Exploring DeepSeek R1's Agentic Capabilities Through Code Actions
Adolph Cruickshank edited this page 3 months ago


I ran a fast experiment investigating how DeepSeek-R1 carries out on agentic tasks, in spite of not supporting tool use natively, and I was quite satisfied by preliminary results. This experiment runs DeepSeek-R1 in a single-agent setup, larsaluarna.se where the design not just plans the actions however also develops the actions as executable Python code. On a subset1 of the GAIA validation split, DeepSeek-R1 exceeds Claude 3.5 Sonnet by 12.5% absolute, from 53.1% to 65.6% correct, and other designs by an even larger margin:

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

Approach

DeepSeek-R1’s strong coding abilities enable it to act as a representative without being clearly trained for tool usage. By permitting the model to produce actions as Python code, it can flexibly connect with environments through code execution.

Tools are implemented as Python code that is included straight in the timely. This can be a simple function definition or a module of a larger bundle - any legitimate 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 actions up until a final response is reached. The agent framework is a basic iterative coding loop that moderates the conversation between the design and its environment.

Conversations

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

On the other hand, o1 models are understood to carry out poorly when used as chat models i.e. they do not try to pull context throughout a discussion. According to the linked post, o1 designs perform best when they have the complete context available, with clear instructions on what to do with it.

Initially, I also tried a full context in a single prompt method at each action (with results from previous actions included), however this caused substantially lower ratings 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 concern about the claim that o1 isn’t a chat model - perhaps this observation was more relevant to older o1 designs that did not have 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 need to perform comparable experiments with o1 models.

Generalization

Although DeepSeek-R1 was mainly trained with RL on mathematics and coding jobs, it is exceptional that generalization to agentic jobs with tool usage by means of code actions works so well. This capability to generalize to agentic jobs reminds 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 use, DeepSeek-R1 typically produces long reasoning traces at each action, compared to other designs in my experiments, restricting the usefulness of this design in a single-agent setup. Even simpler jobs sometimes take a long period of time to complete. Further RL on agentic tool use, be it through code or not, could be one option to enhance efficiency.

Underthinking

I also observed the underthinking phenomon with DeepSeek-R1. This is when a reasoning design frequently changes in between different reasoning ideas without sufficiently checking out appealing paths to reach a right service. This was a major reason 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 common application of reasoning models is to use them for planning only, while using other designs for producing code actions. This might be a prospective new feature of freeact, if this separation of functions shows helpful for clashofcryptos.trade more complex jobs.

I’m likewise curious about how reasoning designs that already support tool use (like o1, o3, …) carry out in a single-agent setup, with and kenpoguy.com without producing code actions. Recent advancements like OpenAI’s Deep Research or Hugging Face’s open-source Deep Research, which likewise uses code actions, look fascinating.