Exploring DeepSeek R1's Agentic Capabilities Through Code Actions
cyrusmeudell91 laboja lapu pirms 11 mēnešiem


I ran a quick experiment examining how DeepSeek-R1 carries out on agentic jobs, regardless of not supporting tool use natively, and I was quite pleased by initial outcomes. This experiment runs DeepSeek-R1 in a single-agent setup, where the design not just prepares the actions however likewise creates the actions as executable Python code. On a subset1 of the GAIA validation split, DeepSeek-R1 outperforms Claude 3.5 Sonnet by 12.5% absolute, from 53.1% to 65.6% correct, and other models by an even larger margin:

The experiment followed design usage guidelines from the DeepSeek-R1 paper and the model card: Don’t utilize few-shot examples, avoid adding a system timely, and set the temperature to 0.5 - 0.7 (0.6 was utilized). You can discover more examination details here.

Approach

DeepSeek-R1’s strong coding abilities allow it to act as a representative without being clearly trained for tool usage. By enabling the design to create actions as Python code, it can flexibly interact with environments through code execution.

Tools are executed as Python code that is consisted of straight in the prompt. This can be a simple function definition or a module of a larger package - any valid Python code. The design then actions that call these tools.

Arise from executing these actions feed back to the model as follow-up messages, driving the next actions till a final response is reached. The representative structure is a basic iterative coding loop that mediates the discussion in between the design and yewiki.org its environment.

Conversations

DeepSeek-R1 is used as chat model in my experiment, where the model autonomously pulls extra context from its environment by utilizing tools e.g. by using a search engine or bring data from web pages. This drives the discussion with the environment that continues until a last answer is reached.

On the other hand, o1 designs are understood to carry out inadequately when utilized as chat models i.e. they don’t try to pull context during a discussion. According to the linked post, o1 designs carry out best when they have the complete context available, with clear instructions on what to do with it.

Initially, I also tried a complete context in a single timely approach at each action (with outcomes from previous actions included), however this resulted in 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 interesting concern about the claim that o1 isn’t a chat model - possibly this observation was more relevant to older o1 models that lacked tool usage abilities? After all, isn’t tool usage support an essential system for enabling designs to pull extra context from their environment? This conversational technique certainly seems reliable for DeepSeek-R1, though I still require to perform similar try outs o1 models.

Generalization

Although DeepSeek-R1 was mainly trained with RL on math and coding jobs, it is amazing that generalization to agentic jobs with tool use through code actions works so well. This capability to generalize to agentic tasks advises of current research study by DeepMind that reveals that RL generalizes whereas SFT memorizes, although generalization to tool use wasn’t examined in that work.

Despite its ability to generalize to tool usage, DeepSeek-R1 frequently produces really long reasoning traces at each action, compared to other models in my experiments, restricting the usefulness of this model in a single-agent setup. Even easier tasks often take a long period of time to finish. Further RL on agentic tool usage, be it through code actions or not, might be one option to enhance efficiency.

Underthinking

I also observed the underthinking phenomon with DeepSeek-R1. This is when a thinking design regularly switches between different reasoning thoughts without sufficiently checking out promising courses to reach a proper service. This was a major reason for extremely 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 thinking designs is to use them for preparing just, while utilizing other models for producing code actions. This might be a potential brand-new feature of freeact, if this separation of functions shows helpful for more complex tasks.

I’m also curious about how reasoning designs that already support tool usage (like o1, o3, …) perform in a single-agent setup, with and without generating code actions. Recent developments like OpenAI’s Deep Research or Hugging Face’s open-source Deep Research, which likewise utilizes code actions, look interesting.