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


I ran a quick experiment examining how DeepSeek-R1 performs on agentic jobs, regardless of not supporting tool usage natively, and I was quite amazed by initial outcomes. This experiment runs DeepSeek-R1 in a single-agent setup, where the model not just plans the actions however likewise develops the actions as executable Python code. On a subset1 of the GAIA validation split, DeepSeek-R1 surpasses Claude 3.5 Sonnet by 12.5% outright, from 53.1% to 65.6% correct, and other designs by an even larger margin:

The experiment followed model usage guidelines from the DeepSeek-R1 paper and the model card: Don't utilize few-shot examples, avoid including a system timely, and set the temperature level to 0.5 - 0.7 (0.6 was used). You can find additional examination details here.

Approach

DeepSeek-R1's strong coding capabilities allow it to serve as a representative without being explicitly trained for tool usage. By enabling the design to create actions as Python code, it can flexibly communicate with environments through code execution.

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

Arise from carrying out these actions feed back to the model as follow-up messages, driving the next actions until a last response is reached. The agent framework is a simple iterative coding loop that mediates the conversation between the model and its environment.

Conversations

DeepSeek-R1 is utilized as chat design in my experiment, where the design autonomously pulls additional context from its environment by utilizing tools e.g. by using a search engine or fetching information from web pages. This drives the discussion with the environment that continues till a last answer is reached.

In contrast, o1 models are known to carry out improperly when utilized as chat models i.e. they do not attempt to pull context during a conversation. According to the linked post, o1 designs carry out best when they have the full context available, with clear directions on what to do with it.

Initially, I likewise attempted a complete context in a single timely approach at each action (with outcomes from previous actions included), but this led to scores on the GAIA subset. Switching to the conversational method explained above, I was able to reach the reported 65.6% efficiency.

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

Generalization

Although DeepSeek-R1 was mainly trained with RL on math and coding tasks, it is impressive that generalization to agentic jobs with tool usage through 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 remembers, although generalization to tool usage wasn't investigated in that work.

Despite its ability to generalize to tool usage, DeepSeek-R1 often produces extremely 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 simpler tasks in some cases take a long period of time to complete. Further RL on agentic tool use, 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 reasoning design regularly switches between various reasoning thoughts without sufficiently exploring appealing paths to reach a correct service. This was a significant factor for overly 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 models is to use them for preparing just, while utilizing other models for creating code actions. This might be a potential brand-new feature 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 usage (like o1, o3, ...) perform in a single-agent setup, with and setiathome.berkeley.edu 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 interesting.