Clone
1
Exploring DeepSeek-R1's Agentic Capabilities Through Code Actions
gerardogarrido edited this page 2025-02-10 18:28:14 +02:00


I ran a quick experiment examining how DeepSeek-R1 carries out on agentic tasks, despite not supporting tool usage natively, and I was quite impressed by preliminary outcomes. This experiment runs DeepSeek-R1 in a single-agent setup, where the design not just plans the actions but likewise develops the actions as executable Python code. On a subset1 of the GAIA recognition split, DeepSeek-R1 outshines Claude 3.5 Sonnet by 12.5% outright, from 53.1% to 65.6% proper, and akropolistravel.com other models by an even larger margin:

The experiment followed design use guidelines from the DeepSeek-R1 paper and galgbtqhistoryproject.org the design card: Don't utilize few-shot examples, prevent including a system prompt, and set the temperature level to 0.5 - 0.7 (0.6 was used). You can discover further examination details here.

Approach

DeepSeek-R1's strong coding capabilities enable it to function as a representative without being clearly trained for tool use. By enabling the model to generate actions as Python code, it can flexibly connect with environments through code execution.

Tools are carried out as Python code that is consisted of straight in the timely. This can be an easy function meaning or oke.zone a module of a larger package - any valid Python code. The model then generates code actions that call these tools.

Results from carrying out these actions feed back to the design as follow-up messages, driving the next steps up until a last answer is reached. The agent structure is a simple iterative coding loop that mediates the conversation in between the design and its environment.

Conversations

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

In contrast, o1 models are understood to carry out poorly when utilized as chat models i.e. they do not try to pull context throughout a conversation. According to the linked post, o1 models carry out best when they have the complete context available, with clear directions on what to do with it.

Initially, I likewise attempted a complete context in a single prompt method at each step (with arise from previous steps included), however this resulted in significantly 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 intriguing question about the claim that o1 isn't a chat model - maybe this observation was more pertinent to older o1 models that did not have tool usage ? After all, isn't tool usage support an important mechanism for making it possible for designs to pull extra context from their environment? This conversational technique certainly seems efficient for DeepSeek-R1, though I still need to carry out similar experiments with o1 designs.

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 reminds of recent research 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 step, compared to other designs in my experiments, limiting the effectiveness of this design in a single-agent setup. Even easier tasks often take a long time to finish. Further RL on agentic tool usage, be it through code actions or not, could be one choice to improve efficiency.

Underthinking

I also observed the underthinking phenomon with DeepSeek-R1. This is when a reasoning design often changes between different thinking 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 taped traces that are available for download.

Future experiments

Another typical application of reasoning models is to use them for planning only, drapia.org while using other designs for creating code actions. This might be a potential brand-new feature of freeact, if this separation of roles proves useful for more complex tasks.

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