Exploring DeepSeek-R1's Agentic Capabilities Through Code Actions
Open
Exploring DeepSeek-R1's Agentic Capabilities Through Code Actions
I ran a quick experiment investigating how DeepSeek-R1 carries out on agentic tasks, despite not supporting tool use natively, and I was quite impressed by preliminary results. This experiment runs DeepSeek-R1 in a single-agent setup, where the model not just plans the actions but likewise develops the actions as executable Python code. On a subset1 of the GAIA validation split, DeepSeek-R1 exceeds Claude 3.5 Sonnet by 12.5% outright, from 53.1% to 65.6% correct, and other models by an even larger margin:
The experiment followed design use guidelines from the DeepSeek-R1 paper and the model card: Don't use few-shot examples, avoid including a system prompt, and asystechnik.com set the temperature to 0.5 - 0.7 (0.6 was used). You can find more assessment details here.
Approach
DeepSeek-R1's strong coding abilities allow it to act as a representative without being clearly trained for tool usage. By permitting the design to generate actions as Python code, it can flexibly connect with environments through code execution.
Tools are implemented as Python code that is included straight in the prompt. This can be an easy function meaning or akropolistravel.com a module of a bigger package - any legitimate Python code. The model then produces code that call these tools.
Results from executing these actions feed back to the model as follow-up messages, driving the next steps until a last answer is reached. The representative structure is a simple iterative coding loop that mediates the discussion in between the model and its environment.
Conversations
DeepSeek-R1 is used as chat model in my experiment, where the design autonomously pulls additional context from its environment by utilizing tools e.g. by utilizing a search engine or fetching information from web pages. This drives the conversation with the environment that continues till a last response is reached.
In contrast, o1 designs are understood to carry out improperly when utilized as chat models i.e. they do not try to pull context during a conversation. According to the linked post, o1 models perform best when they have the complete context available, with clear directions on what to do with it.
Initially, I likewise tried a full context in a single timely approach at each step (with arise from previous actions included), but this led to substantially lower ratings on the GAIA subset. Switching to the conversational technique explained above, I was able to reach the reported 65.6% performance.
This raises an intriguing question about the claim that o1 isn't a chat model - perhaps this observation was more appropriate to older o1 models that did not have tool use abilities? After all, isn't tool usage support an important mechanism for enabling models to pull extra context from their environment? This conversational technique certainly seems reliable for DeepSeek-R1, though I still require to perform similar experiments with o1 designs.
Generalization
Although DeepSeek-R1 was mainly trained with RL on math and coding tasks, it is exceptional that generalization to agentic jobs with tool usage via code actions works so well. This ability to generalize to agentic tasks advises of recent research by DeepMind that reveals that RL generalizes whereas SFT memorizes, although generalization to tool usage wasn't investigated because work.
Despite its ability to generalize to tool usage, DeepSeek-R1 typically 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 very long time to finish. Further RL on agentic tool use, be it through code actions or addsub.wiki not, might be one choice to enhance effectiveness.
Underthinking
I likewise observed the underthinking phenomon with DeepSeek-R1. This is when a thinking design frequently switches between different reasoning ideas without sufficiently checking out promising courses to reach a correct solution. This was a major factor for excessively long reasoning traces produced by DeepSeek-R1. This can be seen in the recorded traces that are available for download.
Future experiments
Another typical application of thinking models is to utilize them for preparing only, while utilizing other models for generating code actions. This might be a possible brand-new feature of freeact, if this separation of roles proves beneficial for more complex tasks.
I'm also curious about how reasoning designs that currently support tool usage (like o1, o3, ...) perform in a single-agent setup, with and without producing code actions. Recent advancements like OpenAI's Deep Research or Hugging Face's open-source Deep Research, which also uses code actions, look interesting.