1 Exploring DeepSeek-R1's Agentic Capabilities Through Code Actions
Adela Dewitt edited this page 2025-02-10 22:18:17 +01:00


I ran a fast experiment investigating how DeepSeek-R1 carries out on agentic tasks, regardless 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 model not just prepares the actions but likewise 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% outright, from 53.1% to 65.6% correct, tandme.co.uk and other designs by an even larger margin:

The experiment followed model use standards from the DeepSeek-R1 paper and the model card: Don't utilize few-shot examples, prevent including a system timely, and set the temperature level to 0.5 - 0.7 (0.6 was utilized). You can find further here.

Approach

DeepSeek-R1's strong coding capabilities allow it to function as an agent without being explicitly trained for tool use. By enabling the design to create actions as Python code, it can flexibly interact with environments through code execution.

Tools are implemented as Python code that is consisted of straight in the timely. This can be a basic function meaning or a module of a larger plan - any legitimate Python code. The design then creates code actions that call these tools.

Arise from performing these actions feed back to the design as follow-up messages, driving the next steps till a last answer is reached. The agent structure is an easy iterative coding loop that moderates the conversation in between the model and its environment.

Conversations

DeepSeek-R1 is used as chat design in my experiment, where the model autonomously pulls extra context from its environment by utilizing tools e.g. by utilizing an online search engine or fetching information from web pages. This drives the conversation with the environment that continues till a final answer is reached.

On the other hand, o1 models are known to carry out poorly when used as chat designs i.e. they don't attempt to pull context throughout a conversation. According to the linked short article, o1 designs perform best when they have the full context available, with clear directions on what to do with it.

Initially, I also tried a complete context in a single prompt technique at each step (with arise from previous actions consisted of), but this resulted in substantially lower ratings on the GAIA subset. Switching to the conversational method explained above, I was able to reach the reported 65.6% performance.

This raises an interesting concern about the claim that o1 isn't a chat model - perhaps this observation was more appropriate to older o1 models that lacked tool usage capabilities? After all, isn't tool usage support an essential mechanism for allowing models to pull additional context from their environment? This conversational approach certainly seems reliable for DeepSeek-R1, though I still require to perform similar experiments with o1 models.

Generalization

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

Despite its ability to generalize to tool use, DeepSeek-R1 often produces long thinking traces at each action, compared to other models in my experiments, restricting the usefulness of this model in a single-agent setup. Even easier jobs in some cases take a very long time to complete. Further RL on agentic tool use, be it through code actions or not, might be one option to improve effectiveness.

Underthinking

I also observed the underthinking phenomon with DeepSeek-R1. This is when a thinking design regularly changes in between different thinking thoughts without adequately exploring promising paths to reach an appropriate option. 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 models is to utilize them for preparing only, while using other designs for creating code actions. This could be a prospective brand-new function of freeact, if this separation of functions shows beneficial for more complex jobs.

I'm also curious about how reasoning designs that currently support tool use (like o1, o3, ...) carry out in a single-agent setup, with and without generating code actions. Recent advancements like OpenAI's Deep Research or Hugging Face's open-source Deep Research, which also utilizes code actions, look fascinating.