Exploring DeepSeek-R1's Agentic Capabilities Through Code Actions
I ran a quick experiment examining how DeepSeek-R1 performs on agentic tasks, despite not supporting tool usage natively, and I was rather amazed by preliminary outcomes. This experiment runs DeepSeek-R1 in a single-agent setup, where the design not only prepares the actions but likewise formulates the actions as executable Python code. On a subset1 of the GAIA validation split, DeepSeek-R1 surpasses Claude 3.5 Sonnet by 12.5% absolute, from 53.1% to 65.6% right, and other models by an even bigger margin:
The experiment followed design use standards from the DeepSeek-R1 paper and the model card: Don't utilize few-shot examples, prevent including a system prompt, and set the temperature to 0.5 - 0.7 (0.6 was used). You can find additional evaluation details here.
Approach
DeepSeek-R1's strong coding capabilities allow it to serve as a representative without being explicitly trained for tool usage. By allowing the model to produce actions as Python code, it can flexibly communicate with environments through code execution.
Tools are carried out as Python code that is consisted of straight in the prompt. This can be a simple function meaning or a module of a bigger package - any legitimate Python code. The design then creates code actions that call these tools.
Arise from performing these actions feed back to the design as follow-up messages, driving the next actions up until a final response is reached. The agent framework is an easy iterative coding loop that mediates the conversation between the design and its environment.
Conversations
DeepSeek-R1 is utilized as chat model in my experiment, where the design autonomously pulls additional context from its environment by using tools e.g. by using an online search engine or fetching information from websites. This drives the conversation with the environment that continues up until a last answer is reached.
In contrast, o1 models are known to perform improperly when utilized as chat models i.e. they don't try to pull context throughout a conversation. According to the linked short article, o1 designs perform best when they have the complete context available, with clear guidelines on what to do with it.
Initially, I likewise tried a complete context in a single prompt approach at each step (with outcomes from previous actions included), but this caused substantially lower ratings on the GAIA subset. Switching to the conversational technique explained above, I had the ability to reach the reported 65.6% performance.
This raises an intriguing concern about the claim that o1 isn't a chat model - possibly this observation was more appropriate to older o1 designs that lacked tool use capabilities? After all, isn't tool usage support a crucial mechanism for allowing models to pull additional context from their environment? This conversational approach certainly seems reliable for DeepSeek-R1, though I still need to carry out similar explores o1 models.
Generalization
Although DeepSeek-R1 was mainly trained with RL on mathematics and coding tasks, it is amazing that generalization to agentic tasks with tool usage through code actions works so well. This capability to generalize to agentic jobs advises of recent research study by DeepMind that shows that RL generalizes whereas SFT remembers, although generalization to tool use wasn't examined because work.
Despite its capability to generalize to tool usage, DeepSeek-R1 often produces extremely long reasoning traces at each action, compared to other models in my experiments, restricting the usefulness of this model in a single-agent setup. Even easier jobs often take a long time to complete. Further RL on agentic tool usage, be it through code actions or not, might be one option to improve performance.
Underthinking
I also observed the underthinking phenomon with DeepSeek-R1. This is when a thinking model regularly switches between various thinking ideas without adequately exploring promising courses to reach a proper service. This was a major factor for excessively long thinking traces produced by DeepSeek-R1. This can be seen in the recorded traces that are available for download.
Future experiments
Another typical application of reasoning models is to utilize them for preparing only, while utilizing other models for creating code actions. This might be a possible brand-new function of freeact, if this separation of useful for more complex tasks.
I'm likewise curious about how reasoning designs that currently support tool usage (like o1, o3, ...) carry out in a single-agent setup, with and without generating code actions. Recent advancements like OpenAI's Deep Research or Hugging Face's open-source Deep Research, demo.qkseo.in which likewise uses code actions, look interesting.