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


I ran a quick experiment examining how DeepSeek-R1 performs on agentic tasks, regardless of not supporting tool use natively, and I was quite impressed by initial results. This experiment runs DeepSeek-R1 in a single-agent setup, where the design not just 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% outright, from 53.1% to 65.6% proper, and other models by an even bigger margin:

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

Approach

DeepSeek-R1's strong coding capabilities allow it to serve as an agent without being clearly trained for tool use. By permitting 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 included straight in the timely. This can be an easy function meaning or a module of a bigger package - any legitimate Python code. The model then creates code actions that call these tools.

Results from carrying out these back to the model as follow-up messages, driving the next actions till a final answer is reached. The agent structure is an easy iterative coding loop that mediates the discussion in between the model and wiki.myamens.com its environment.

Conversations

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

In contrast, o1 designs are understood to carry out poorly when used as chat models i.e. they don't attempt to pull context during a conversation. According to the connected post, o1 designs perform best when they have the full context available, with clear guidelines on what to do with it.

Initially, I likewise attempted a full context in a single prompt approach at each action (with arise from previous actions included), but this resulted in considerably lower scores on the GAIA subset. Switching to the conversational technique explained above, I had the ability to reach the reported 65.6% performance.

This raises an intriguing question 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 abilities? After all, isn't tool use support an important system for making it possible for designs to pull extra context from their environment? This conversational approach certainly appears effective for DeepSeek-R1, though I still require to perform similar explores o1 designs.

Generalization

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

Despite its capability to generalize to tool usage, DeepSeek-R1 often produces long reasoning traces at each action, compared to other models in my experiments, limiting the usefulness of this design in a single-agent setup. Even easier tasks in some cases take a long period of time to complete. Further RL on agentic tool use, be it by means of code actions or not, might be one option to enhance effectiveness.

Underthinking

I also observed the underthinking phenomon with DeepSeek-R1. This is when a thinking model often changes in between different thinking thoughts without sufficiently exploring appealing courses to reach a proper service. This was a major factor for overly long thinking traces produced by DeepSeek-R1. This can be seen in the tape-recorded traces that are available for download.

Future experiments

Another typical application of reasoning designs is to use them for planning just, while utilizing other models for producing code actions. This could be a possible new feature of freeact, if this separation of roles proves useful for more complex jobs.

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