Exploring DeepSeek-R1's Agentic Capabilities Through Code Actions
I ran a fast experiment investigating how DeepSeek-R1 performs on agentic jobs, in spite of not supporting tool use natively, and I was rather impressed by preliminary results. This experiment runs DeepSeek-R1 in a single-agent setup, where the design not only plans the actions but likewise formulates the actions as executable Python code. On a subset1 of the GAIA validation split, DeepSeek-R1 exceeds Claude 3.5 Sonnet by 12.5% outright, from 53.1% to 65.6% appropriate, and other models by an even bigger margin:
The experiment followed model usage 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 discover more evaluation details here.
Approach
DeepSeek-R1's strong coding capabilities enable 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 connect with environments through code execution.
Tools are executed 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 design then produces code actions that call these tools.
Results from executing these actions feed back to the model as follow-up messages, driving the next steps until a final answer is reached. The agent structure is a simple 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 utilizing tools e.g. by utilizing a search engine or fetching data from websites. This drives the discussion with the environment that continues up until a final response is reached.
In contrast, o1 designs are known to carry out inadequately when utilized as chat models i.e. they don't try to pull context during a conversation. According to the linked post, o1 designs perform best when they have the full context available, with clear instructions on what to do with it.
Initially, utahsyardsale.com I likewise attempted a full context in a single prompt approach at each action (with arise from previous actions included), but this resulted in substantially lower scores on the GAIA subset. Switching to the conversational approach 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 - maybe this observation was more appropriate to older o1 designs that lacked tool usage capabilities? After all, isn't tool use support an essential system for enabling models to pull extra context from their environment? This conversational technique certainly seems effective for DeepSeek-R1, though I still require to conduct comparable explores o1 designs.
Generalization
Although DeepSeek-R1 was mainly trained with RL on mathematics and coding jobs, it is amazing that generalization to agentic tasks with tool usage by means of code actions works so well. This capability to generalize to agentic jobs advises of current research study by DeepMind that reveals that RL generalizes whereas SFT memorizes, although generalization to tool usage wasn't examined in that work.
Despite its ability to generalize to tool usage, ura.cc DeepSeek-R1 typically produces long thinking traces at each step, compared to other models in my experiments, restricting the effectiveness of this model in a single-agent setup. Even simpler tasks often take a very long time to complete. Further RL on agentic tool usage, be it via code actions or wiki.snooze-hotelsoftware.de not, could be one alternative to improve efficiency.
Underthinking
I likewise observed the underthinking phenomon with DeepSeek-R1. This is when a reasoning design regularly changes in between different reasoning thoughts without sufficiently checking out appealing courses to reach a correct solution. This was a major factor for extremely long reasoning traces produced by DeepSeek-R1. This can be seen in the recorded traces that are available for download.
Future experiments
Another common application of reasoning designs is to use them for planning just, while utilizing other models for creating code actions. This might be a prospective brand-new function of freeact, if this separation of roles proves beneficial for more complex tasks.
I'm also curious about how reasoning models that currently support tool usage (like o1, o3, ...) perform in a single-agent setup, with and without creating code actions. Recent advancements like OpenAI's Deep Research or Hugging Face's open-source Deep Research, which also uses code actions, look fascinating.