Exploring DeepSeek-R1's Agentic Capabilities Through Code Actions
I ran a fast experiment investigating how DeepSeek-R1 performs on agentic jobs, despite not supporting tool usage natively, and I was quite impressed by preliminary outcomes. This experiment runs DeepSeek-R1 in a single-agent setup, where the model not only plans the actions but likewise creates the actions as executable Python code. On a subset1 of the GAIA recognition split, DeepSeek-R1 surpasses Claude 3.5 Sonnet by 12.5% absolute, from 53.1% to 65.6% proper, and other models by an even larger margin:
The experiment followed design use guidelines from the DeepSeek-R1 paper and the design 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 utilized). You can find additional examination details here.
Approach
DeepSeek-R1's strong coding capabilities allow it to function as an agent without being clearly trained for tool use. By enabling the model to produce actions as Python code, it can flexibly engage with environments through code execution.
Tools are executed as Python code that is consisted of straight in the prompt. This can be a simple function definition or a module of a bigger package - any valid Python code. The design then produces code actions that call these tools.
Arise from executing these actions feed back to the model as follow-up messages, driving the next actions till a final answer is reached. The representative framework is a basic iterative coding loop that moderates the conversation in between the design and its environment.
Conversations
DeepSeek-R1 is used as chat design in my experiment, where the model autonomously pulls extra context from its environment by utilizing tools e.g. by utilizing an online search engine or fetching information from web pages. This drives the conversation with the environment that continues until a final response is reached.
On the other hand, o1 models are understood to perform badly when utilized as chat models i.e. they don't attempt to pull context throughout a discussion. According to the connected post, o1 designs carry out best when they have the full context available, videochatforum.ro with clear guidelines on what to do with it.
Initially, I also tried a complete context in a single timely method at each action (with outcomes from previous steps consisted of), but this resulted in significantly lower scores on the GAIA subset. Switching to the conversational method 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 design - possibly this observation was more pertinent to older o1 designs that did not have tool usage abilities? After all, isn't tool usage support an essential mechanism for making it possible for models to pull extra context from their environment? This conversational technique certainly appears reliable for DeepSeek-R1, though I still require to carry out similar try outs o1 models.
Generalization
Although DeepSeek-R1 was mainly trained with RL on mathematics and coding tasks, it is amazing that generalization to agentic jobs with tool use via code actions works so well. This capability to generalize to agentic jobs reminds of recent research by DeepMind that reveals that RL generalizes whereas SFT memorizes, although generalization to tool use wasn't examined in that work.
Despite its ability to generalize to tool use, DeepSeek-R1 typically produces long thinking traces at each step, compared to other designs in my experiments, limiting the effectiveness of this design in a single-agent setup. Even easier jobs often take a long time to complete. Further RL on agentic tool use, be it through code actions or not, could be one alternative to improve effectiveness.
Underthinking
I also observed the underthinking phenomon with DeepSeek-R1. This is when a thinking design often in between various thinking ideas without sufficiently checking out promising paths to reach a correct option. This was a significant 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 designs is to use them for planning only, while using other models for creating code actions. This might be a prospective brand-new feature of freeact, if this separation of roles proves helpful for more complex tasks.
I'm also curious about how thinking designs that already support tool use (like o1, o3, ...) perform in a single-agent setup, with and without creating code actions. Recent developments like OpenAI's Deep Research or Hugging Face's open-source Deep Research, which also uses code actions, look intriguing.