Exploring DeepSeek-R1's Agentic Capabilities Through Code Actions
I ran a fast experiment examining how DeepSeek-R1 carries out on agentic tasks, in spite of not supporting tool use natively, securityholes.science and I was quite amazed by initial results. This experiment runs DeepSeek-R1 in a single-agent setup, where the model not just plans the actions however likewise creates the actions as executable Python code. On a subset1 of the GAIA recognition split, asteroidsathome.net DeepSeek-R1 outperforms Claude 3.5 Sonnet by 12.5% absolute, from 53.1% to 65.6% correct, asystechnik.com and engel-und-waisen.de other designs by an even bigger margin:
The experiment followed design use standards from the DeepSeek-R1 paper and the design card: Don't use few-shot examples, prevent including a system prompt, and set the temperature to 0.5 - 0.7 (0.6 was used). You can find more evaluation details here.
Approach
DeepSeek-R1's strong coding capabilities enable it to act as a representative without being clearly trained for tool usage. By permitting the model to generate actions as Python code, it can flexibly engage with environments through code execution.
Tools are carried out as Python code that is consisted of straight in the prompt. This can be an easy function meaning or a module of a larger package - any valid Python code. The model then generates code actions that call these tools.
Results from executing these actions feed back to the model as follow-up messages, driving the next actions up until a final response is reached. The agent structure is a simple iterative coding loop that moderates the conversation between the design and its environment.
Conversations
DeepSeek-R1 is utilized as chat model in my experiment, where the pulls additional context from its environment by using tools e.g. by utilizing a search engine or bring information from web pages. This drives the conversation with the environment that continues till a last answer is reached.
In contrast, o1 designs are known to perform improperly when used as chat designs i.e. they do not attempt to pull context throughout a discussion. According to the linked post, o1 designs carry out best when they have the full context available, with clear directions on what to do with it.
Initially, I also tried a complete context in a single timely approach at each step (with arise from previous steps included), however this resulted in considerably lower scores on the GAIA subset. Switching to the conversational method 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 - possibly this observation was more pertinent to older o1 designs that did not have tool use abilities? After all, isn't tool usage support an essential mechanism for making it possible for designs to pull additional context from their environment? This conversational approach certainly seems reliable for DeepSeek-R1, though I still need to conduct comparable explores o1 models.
Generalization
Although DeepSeek-R1 was mainly trained with RL on math and coding jobs, it is remarkable that generalization to agentic tasks with tool use via code actions works so well. This ability to generalize to agentic tasks advises of current research by DeepMind that reveals that RL generalizes whereas SFT memorizes, although generalization to tool usage wasn't examined because work.
Despite its ability to generalize to tool use, gdprhub.eu DeepSeek-R1 often produces long reasoning traces at each action, compared to other models in my experiments, limiting the effectiveness of this model in a single-agent setup. Even easier jobs sometimes take a long period of time to finish. Further RL on agentic tool usage, be it through code actions or not, might be one alternative to enhance effectiveness.
Underthinking
I also observed the underthinking phenomon with DeepSeek-R1. This is when a thinking design regularly switches in between various thinking thoughts without sufficiently checking out promising paths to reach a right solution. This was a major factor for excessively long thinking 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 thinking designs is to utilize them for preparing only, while using other models for generating code actions. This might be a potential new function of freeact, if this separation of roles proves useful for more complex tasks.
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 developments like OpenAI's Deep Research or Hugging Face's open-source Deep Research, which also uses code actions, look interesting.