Exploring DeepSeek-R1's Agentic Capabilities Through Code Actions
natejacques010 редактировал эту страницу 4 месяцев назад


I ran a fast experiment investigating how DeepSeek-R1 carries out on agentic tasks, regardless of not supporting tool usage natively, and I was quite impressed by preliminary results. This experiment runs DeepSeek-R1 in a setup, where the model not just plans the actions however likewise formulates the actions as executable Python code. On a subset1 of the GAIA recognition split, DeepSeek-R1 surpasses Claude 3.5 Sonnet by 12.5% absolute, ura.cc 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, prevent adding a system timely, and set the temperature to 0.5 - 0.7 (0.6 was used). You can find more evaluation details here.

Approach

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

Tools are carried out as Python code that is included straight in the prompt. This can be a simple function meaning or a module of a bigger plan - any valid Python code. The model then creates 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 response is reached. The representative framework is a simple iterative coding loop that mediates the discussion in between the model and its environment.

Conversations

DeepSeek-R1 is utilized as chat model 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 web pages. This drives the discussion with the environment that continues up until a final answer is reached.

On the other hand, o1 designs are understood to carry out inadequately when used as chat designs i.e. they do not try to pull context during a conversation. According to the connected short article, o1 models perform best when they have the complete context available, with clear directions on what to do with it.

Initially, I likewise attempted a full context in a single timely approach at each action (with arise from previous steps consisted of), but this caused significantly lower scores on the GAIA subset. Switching to the conversational approach 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 model - maybe this observation was more appropriate to older o1 models that did not have tool usage abilities? After all, isn't tool use support a crucial mechanism for allowing designs to pull extra context from their environment? This conversational approach certainly seems effective for DeepSeek-R1, though I still require to conduct comparable explores o1 designs.

Generalization

Although DeepSeek-R1 was mainly trained with RL on math and coding tasks, it is remarkable that generalization to agentic tasks with tool usage through code actions works so well. This ability 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 capability to generalize to tool usage, DeepSeek-R1 frequently produces extremely long thinking traces at each action, compared to other designs in my experiments, restricting the effectiveness of this design in a single-agent setup. Even easier tasks in some cases take a very long time to complete. Further RL on agentic tool use, be it via code actions or not, might be one option to improve efficiency.

Underthinking

I likewise observed the underthinking phenomon with DeepSeek-R1. This is when a thinking model regularly switches between various thinking thoughts without adequately checking out appealing paths to reach a correct solution. This was a significant 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 thinking models is to use them for preparing only, while using other models for generating code actions. This might be a prospective brand-new function of freeact, if this separation of functions shows useful for more complex tasks.

I'm likewise curious about how reasoning designs that currently support tool use (like o1, o3, ...) carry out 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 fascinating.