Exploring DeepSeek-R1's Agentic Capabilities Through Code Actions
I ran a quick experiment investigating how DeepSeek-R1 carries out on agentic jobs, in spite of not supporting tool usage natively, and I was quite satisfied by initial results. This experiment runs DeepSeek-R1 in a single-agent setup, where the model not only prepares the actions however also formulates 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% appropriate, and other designs by an even bigger margin:
The experiment followed design usage guidelines from the DeepSeek-R1 paper and the design card: Don't use few-shot examples, prevent adding a system prompt, and set the temperature level to 0.5 - 0.7 (0.6 was utilized). You can discover additional examination details here.
Approach
DeepSeek-R1's strong coding capabilities enable it to act as an agent without being clearly trained for tool usage. By allowing the design to generate actions as Python code, it can flexibly connect with environments through code execution.
Tools are executed as Python code that is consisted of straight in the timely. This can be a simple function definition or a module of a larger bundle - any valid Python code. The model then creates code actions that call these tools.
Arise from carrying out these actions feed back to the design as follow-up messages, driving the next steps till a last response is reached. The representative framework is a simple iterative coding loop that mediates the conversation in between the model and its environment.
Conversations
DeepSeek-R1 is utilized as chat model in my experiment, where the design autonomously pulls additional context from its environment by using tools e.g. by utilizing a search engine or bring data from websites. This drives the discussion with the environment that continues till a final answer is reached.
In contrast, o1 designs are understood to carry out inadequately when utilized as chat designs i.e. they do not attempt to pull context during a conversation. According to the connected short article, o1 models perform best when they have the complete context available, with clear instructions on what to do with it.
Initially, I likewise tried a complete context in a single prompt method at each action (with arise from previous steps included), however this caused significantly lower ratings on the GAIA subset. Switching to the conversational technique explained above, I had the ability to reach the reported 65.6% performance.
This raises an intriguing concern about the claim that o1 isn't a chat design - possibly this observation was more appropriate to older o1 models that lacked tool usage capabilities? After all, isn't tool usage support an important system for allowing models to pull extra context from their environment? This conversational technique certainly appears reliable for DeepSeek-R1, though I still need to carry out comparable try outs o1 designs.
Generalization
Although DeepSeek-R1 was mainly trained with RL on mathematics and utahsyardsale.com coding tasks, it is amazing that generalization to agentic tasks with tool use by means of code actions works so well. This capability to generalize to agentic tasks advises of recent research by DeepMind that shows that RL generalizes whereas SFT remembers, asteroidsathome.net although generalization to tool usage wasn't examined in that work.
Despite its ability to generalize to tool use, DeepSeek-R1 often produces long reasoning traces at each action, drapia.org compared to other designs in my experiments, restricting the effectiveness of this model in a single-agent setup. Even simpler tasks in some cases take a long time to finish. Further RL on agentic tool usage, be it through code actions or humanlove.stream not, might be one alternative to enhance performance.
Underthinking
I also observed the underthinking phenomon with DeepSeek-R1. This is when a thinking design regularly changes between various thinking thoughts without adequately checking out promising paths to reach an appropriate service. This was a significant reason for extremely long reasoning traces produced by DeepSeek-R1. This can be seen in the taped traces that are available for download.
Future experiments
Another typical application of reasoning designs is to utilize them for planning only, while using other designs for producing code actions. This might be a prospective new of freeact, if this separation of roles shows helpful for more complex jobs.
I'm also curious about how thinking models that currently support tool use (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, forum.pinoo.com.tr which also utilizes code actions, look interesting.