Exploring DeepSeek-R1's Agentic Capabilities Through Code Actions
I ran a quick experiment examining how DeepSeek-R1 carries out on agentic tasks, in spite of not supporting tool usage 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 however also develops the actions as executable Python code. On a subset1 of the GAIA recognition split, DeepSeek-R1 exceeds Claude 3.5 Sonnet by 12.5% outright, from 53.1% to 65.6% correct, and garagesale.es other designs by an even bigger margin:
The experiment followed design use guidelines from the DeepSeek-R1 paper and the model card: Don't use few-shot examples, prevent including a system timely, and set the temperature level to 0.5 - 0.7 (0.6 was used). You can find further assessment details here.
Approach
DeepSeek-R1's strong coding abilities allow it to function as a representative without being clearly trained for tool usage. By allowing the design to generate 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 timely. This can be an easy function definition or a module of a bigger bundle - any legitimate Python code. The model then generates code actions that call these tools.
Results from performing these actions feed back to the model as follow-up messages, driving the next actions till a last answer is reached. The representative structure is a simple iterative coding loop that mediates the conversation between the model and bytes-the-dust.com its environment.
Conversations
DeepSeek-R1 is utilized as chat design in my experiment, where the model autonomously pulls extra context from its environment by utilizing tools e.g. by utilizing a search engine or bring information from web pages. This drives the conversation with the environment that continues up until a last answer is reached.
On the other hand, o1 designs are understood to perform poorly when used as chat models i.e. they don't attempt to pull context throughout a discussion. According to the linked article, o1 designs carry out best when they have the full context available, with clear instructions on what to do with it.
Initially, I also attempted a complete context in a single timely approach at each action (with results from previous actions consisted of), bio.rogstecnologia.com.br however this led to substantially lower ratings on the GAIA subset. Switching to the conversational approach explained above, I was able to reach the reported 65.6% efficiency.
This raises a fascinating question about the claim that o1 isn't a chat model - maybe this observation was more relevant to older o1 designs that did not have capabilities? After all, isn't tool usage support an essential mechanism for making it possible for models to pull additional context from their environment? This conversational approach certainly seems efficient for DeepSeek-R1, though I still need to perform similar explores o1 models.
Generalization
Although DeepSeek-R1 was mainly trained with RL on math and coding tasks, it is amazing that generalization to agentic jobs with tool use by means of code actions works so well. This ability to generalize to agentic jobs advises of current research 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 very long thinking traces at each action, compared to other designs in my experiments, limiting the usefulness of this model in a single-agent setup. Even easier jobs in some cases take a very long time to complete. Further RL on agentic tool use, be it via code actions or not, could be one alternative to improve efficiency.
Underthinking
I also observed the underthinking phenomon with DeepSeek-R1. This is when a thinking model frequently changes between different thinking thoughts without sufficiently checking out promising paths to reach a correct option. This was a major factor for extremely long reasoning traces produced by DeepSeek-R1. This can be seen in the tape-recorded traces that are available for download.
Future experiments
Another typical application of reasoning designs is to utilize them for planning just, while utilizing other models for generating code actions. This might be a potential new feature of freeact, if this separation of functions proves useful for more complex jobs.
I'm also curious about how thinking models that currently support tool usage (like o1, o3, ...) carry out 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 utilizes code actions, look intriguing.