1 Exploring DeepSeek-R1's Agentic Capabilities Through Code Actions
magdanorthmore edited this page 2025-02-11 03:47:49 +01:00


I ran a fast experiment examining how DeepSeek-R1 performs on agentic jobs, in spite of not supporting tool use natively, and I was quite impressed by preliminary results. This experiment runs DeepSeek-R1 in a single-agent setup, where the design not only prepares the actions however also formulates the actions as executable Python code. On a subset1 of the GAIA validation split, DeepSeek-R1 outperforms Claude 3.5 Sonnet by 12.5% absolute, from 53.1% to 65.6% correct, and other models by an even larger margin:

The experiment followed design usage standards from the DeepSeek-R1 paper and the model card: Don't utilize few-shot examples, avoid including a system prompt, and set the temperature level to 0.5 - 0.7 (0.6 was utilized). You can find more assessment details here.

Approach

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

Tools are carried out as Python code that is consisted of straight in the prompt. This can be an easy function definition or a module of a larger package - any legitimate Python code. The design then produces code actions that call these tools.

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

Conversations

DeepSeek-R1 is utilized 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 bring data from web pages. This drives the discussion with the environment that continues until a last response is reached.

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

Initially, I also attempted a complete context in a single prompt approach at each action (with arise from previous steps included), however this led to significantly lower scores on the GAIA subset. Switching to the conversational method explained above, I was able to reach the reported 65.6% efficiency.

This raises an interesting concern about the claim that o1 isn't a chat design - possibly this observation was more pertinent to older o1 designs that lacked tool use abilities? After all, isn't tool use support an essential system for making it possible for models to pull extra context from their environment? This conversational approach certainly seems efficient for DeepSeek-R1, though I still require to carry out comparable experiments with o1 designs.

Generalization

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

Despite its capability to generalize to tool use, DeepSeek-R1 frequently produces long reasoning traces at each step, compared to other designs in my experiments, restricting the effectiveness of this model in a single-agent setup. Even easier jobs sometimes take a long period of time to finish. Further RL on agentic tool usage, be it by means of code actions or wiki.whenparked.com not, might be one alternative to enhance efficiency.

Underthinking

I likewise observed the underthinking phenomon with DeepSeek-R1. This is when a reasoning model regularly switches between various reasoning ideas without out promising paths to reach a proper solution. This was a major reason for excessively long thinking 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 utilizing other designs for generating code actions. This could be a possible new function of freeact, if this separation of roles proves helpful for more complex tasks.

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