Exploring DeepSeek-R1's Agentic Capabilities Through Code Actions
I ran a fast experiment examining how DeepSeek-R1 performs on agentic tasks, despite not supporting tool usage natively, and I was quite amazed by preliminary results. This experiment runs DeepSeek-R1 in a single-agent setup, where the model not just prepares the actions but also 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 larger margin:
The experiment followed design usage standards from the DeepSeek-R1 paper and the model card: Don't utilize few-shot examples, prevent adding a system timely, and set the temperature level to 0.5 - 0.7 (0.6 was used). You can discover further examination details here.
Approach
DeepSeek-R1's strong coding capabilities allow it to serve as an agent without being clearly trained for tool usage. By enabling the model to generate actions as Python code, it can flexibly connect with environments through code execution.
Tools are executed as Python code that is included straight in the prompt. This can be a basic function meaning or a module of a larger plan - any legitimate Python code. The model then generates code actions that call these tools.
Arise from performing these actions feed back to the model as follow-up messages, driving the next steps up until a last answer is . The representative structure is a basic iterative coding loop that mediates the conversation in between the design and its environment.
Conversations
DeepSeek-R1 is used as chat model in my experiment, where the design autonomously pulls extra context from its environment by utilizing tools e.g. by utilizing an online search engine or bring data from websites. This drives the conversation with the environment that continues up until a final answer is reached.
In contrast, o1 designs are known to carry out poorly when utilized as chat designs i.e. they don't try to pull context during a conversation. According to the linked short article, o1 designs carry out best when they have the complete context available, with clear directions on what to do with it.
Initially, I also attempted a complete context in a single timely approach at each step (with arise from previous steps consisted of), but this led to significantly lower ratings on the GAIA subset. Switching to the conversational technique explained above, I was able to reach the reported 65.6% efficiency.
This raises an intriguing question about the claim that o1 isn't a chat model - perhaps this observation was more relevant to older o1 models that did not have tool usage abilities? After all, isn't tool usage support a crucial mechanism for allowing designs to pull additional context from their environment? This conversational method certainly appears efficient for DeepSeek-R1, though I still need to carry out similar experiments with o1 designs.
Generalization
Although DeepSeek-R1 was mainly trained with RL on math and coding jobs, it is amazing that generalization to agentic jobs with tool use through code actions works so well. This ability to generalize to agentic tasks advises of current research study by DeepMind that reveals that RL generalizes whereas SFT remembers, although generalization to tool use wasn't investigated because work.
Despite its ability to generalize to tool use, DeepSeek-R1 often produces long reasoning traces at each action, compared to other designs in my experiments, restricting the effectiveness of this model in a single-agent setup. Even simpler jobs in some cases take a long time to finish. Further RL on agentic tool usage, be it through code actions or not, wavedream.wiki could be one choice to improve efficiency.
Underthinking
I likewise observed the underthinking phenomon with DeepSeek-R1. This is when a reasoning design often changes between various reasoning thoughts without adequately checking out promising courses to reach a right solution. This was a significant factor for extremely 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 designs is to use them for planning only, while utilizing other designs for producing code actions. This could be a possible new feature of freeact, if this separation of roles shows helpful for more complex jobs.
I'm also curious about how thinking models that already support tool usage (like o1, o3, ...) perform in a single-agent setup, with and without creating code actions. Recent advancements like OpenAI's Deep Research or Hugging Face's open-source Deep Research, which also uses code actions, look interesting.