1 Exploring DeepSeek R1's Agentic Capabilities Through Code Actions
Abbie Santo edited this page 2 months ago


I ran a fast experiment examining how DeepSeek-R1 carries out on agentic jobs, in spite of not supporting tool usage natively, and I was rather pleased by preliminary outcomes. This experiment runs DeepSeek-R1 in a single-agent setup, where the model not only plans the actions however likewise creates the actions as executable Python code. On a subset1 of the GAIA recognition split, DeepSeek-R1 outperforms Claude 3.5 Sonnet by 12.5% outright, from 53.1% to 65.6% appropriate, and other designs by an even larger margin:

The experiment followed design use standards from the DeepSeek-R1 paper and the design card: botdb.win Don't utilize few-shot examples, avoid adding a system timely, and set the temperature level to 0.5 - 0.7 (0.6 was utilized). You can find additional 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 generate actions as Python code, it can flexibly engage 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 plan - any valid Python code. The model then generates code actions that call these tools.

Results from performing these actions feed back to the model as follow-up messages, driving the next steps until a last response is reached. The agent structure is an easy iterative coding loop that moderates the discussion between the model 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 an online search engine or bring data from web pages. This drives the conversation with the environment that continues till a last response is reached.

In contrast, o1 designs are known to carry out poorly when used as chat models i.e. they don't attempt to pull context during a discussion. According to the linked post, o1 models carry out best when they have the complete context available, with clear instructions on what to do with it.

Initially, I also attempted a full context in a single prompt method at each step (with arise from previous actions included), 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% .

This raises an intriguing concern about the claim that o1 isn't a chat design - maybe this observation was more appropriate to older o1 designs that did not have tool usage capabilities? After all, isn't tool usage support an important mechanism for enabling models to pull additional context from their environment? This conversational approach certainly seems efficient for DeepSeek-R1, though I still require to conduct comparable try outs o1 models.

Generalization

Although DeepSeek-R1 was mainly trained with RL on mathematics and coding tasks, it is amazing that generalization to agentic jobs with tool use by means of code actions works so well. This ability to generalize to agentic jobs advises of recent research by DeepMind that reveals that RL generalizes whereas SFT remembers, although generalization to tool usage wasn't investigated in that work.

Despite its capability to generalize to tool usage, DeepSeek-R1 frequently produces long reasoning traces at each action, compared to other models in my experiments, restricting the usefulness of this design in a single-agent setup. Even easier tasks in some cases take a very long time to complete. Further RL on agentic tool usage, be it via code actions or not, could be one option to improve performance.

Underthinking

I also observed the underthinking phenomon with DeepSeek-R1. This is when a reasoning model regularly switches between different reasoning thoughts without adequately checking out appealing paths to reach an appropriate solution. This was a major reason for excessively long reasoning traces produced by DeepSeek-R1. This can be seen in the taped traces that are available for download.

Future experiments

Another common application of thinking designs is to utilize them for planning only, while utilizing other designs for creating code actions. This could be a prospective new feature of freeact, if this separation of functions shows useful for more complex jobs.

I'm also curious about how reasoning 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, prawattasao.awardspace.info which likewise utilizes code actions, look intriguing.