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 use natively, and I was rather pleased by preliminary results. This experiment runs DeepSeek-R1 in a single-agent setup, where the model not only plans the actions but also creates the actions as executable Python code. On a subset1 of the GAIA recognition split, DeepSeek-R1 outshines Claude 3.5 Sonnet by 12.5% absolute, from 53.1% to 65.6% proper, and other models by an even bigger margin:
The experiment followed model use standards from the DeepSeek-R1 paper and the model card: Don't utilize few-shot examples, avoid including a system timely, and set the temperature level to 0.5 - 0.7 (0.6 was used). You can find additional examination details here.
Approach
DeepSeek-R1's strong coding abilities enable it to serve as an agent without being explicitly trained for tool use. By permitting the model to generate actions as Python code, it can flexibly connect with environments through code execution.
Tools are carried out as Python code that is consisted of straight in the timely. This can be a basic function meaning or a module of a larger package - any legitimate Python code. The design then produces code actions that call these tools.
Arise from performing these actions feed back to the design as follow-up messages, driving the next actions till a last response is reached. The representative framework is an easy iterative coding loop that mediates the conversation between the design and its environment.
Conversations
DeepSeek-R1 is used as chat design in my experiment, where the model autonomously pulls additional context from its environment by e.g. by utilizing an online search engine or fetching information from websites. This drives the discussion with the environment that continues up until a final response is reached.
In contrast, o1 designs are understood to carry out poorly when utilized as chat models i.e. they do not try to pull context during a discussion. According to the connected post, o1 designs carry out best when they have the full context available, with clear instructions on what to do with it.
Initially, I likewise attempted a full context in a single timely method at each step (with outcomes from previous steps consisted of), however this led to considerably 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 interesting concern about the claim that o1 isn't a chat design - maybe this observation was more appropriate to older o1 designs that lacked tool usage abilities? After all, isn't tool usage support an essential mechanism for enabling models to pull additional context from their environment? This conversational approach certainly appears effective for DeepSeek-R1, though I still require to perform comparable explores o1 designs.
Generalization
Although DeepSeek-R1 was mainly trained with RL on mathematics and coding jobs, it is impressive that generalization to agentic tasks with tool use through 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 usage, DeepSeek-R1 frequently produces long reasoning traces at each action, compared to other designs in my experiments, restricting the usefulness of this model in a single-agent setup. Even easier jobs sometimes take a long period of time to complete. Further RL on agentic tool usage, be it via code actions or not, timeoftheworld.date might be one alternative to enhance effectiveness.
Underthinking
I likewise observed the underthinking phenomon with DeepSeek-R1. This is when a thinking model frequently switches in between different thinking thoughts without adequately checking out promising paths to reach a correct service. This was a major factor for overly 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 utilize them for preparing just, while using other models for creating code actions. This might be a prospective new feature of freeact, if this separation of functions shows useful for more complex tasks.
I'm also curious about how reasoning designs that currently support tool use (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 likewise utilizes code actions, look interesting.