Exploring DeepSeek R1's Agentic Capabilities Through Code Actions
Armand Old 于 6 个月前 修改了此页面


I ran a quick experiment examining how DeepSeek-R1 carries out on agentic jobs, visualchemy.gallery regardless of not supporting tool use natively, and I was rather pleased by initial outcomes. This experiment runs DeepSeek-R1 in a single-agent setup, buysellammo.com where the design not only plans the actions however likewise formulates the actions as code. On a subset1 of the GAIA validation split, DeepSeek-R1 outshines Claude 3.5 Sonnet by 12.5% absolute, from 53.1% to 65.6% proper, and other models by an even bigger margin:

The experiment followed model usage standards from the DeepSeek-R1 paper and the model card: Don’t use few-shot examples, avoid including a system timely, and set the temperature to 0.5 - 0.7 (0.6 was utilized). You can discover more evaluation details here.

Approach

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

Tools are executed as Python code that is included straight in the prompt. This can be a basic function meaning or a module of a larger package - any legitimate Python code. The model then produces code actions that call these tools.

Arise from carrying out these actions feed back to the model as follow-up messages, driving the next steps till a final response is reached. The representative structure is a basic iterative coding loop that moderates the discussion 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 utilizing tools e.g. by utilizing a search engine or fetching information from websites. This drives the conversation with the environment that continues till a final response is reached.

In contrast, o1 designs are known to carry out inadequately when used as chat models i.e. they don’t attempt to pull context throughout a discussion. According to the linked short article, o1 designs carry out best when they have the full context available, with clear instructions on what to do with it.

Initially, I also tried a full context in a single prompt approach at each action (with results from previous steps included), but this resulted in substantially lower ratings on the GAIA subset. Switching to the conversational technique explained above, I had the ability to reach the reported 65.6% efficiency.

This raises an intriguing concern about the claim that o1 isn’t a chat model - possibly this observation was more pertinent to older o1 models that did not have tool use abilities? After all, isn’t tool use support a crucial mechanism for enabling models to pull extra context from their environment? This conversational approach certainly appears reliable for DeepSeek-R1, though I still need to conduct comparable try outs 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 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 use, DeepSeek-R1 frequently produces extremely long reasoning traces at each action, compared to other models in my experiments, limiting the usefulness of this model in a single-agent setup. Even easier tasks often take a long period of time to finish. Further RL on agentic tool usage, be it via code actions or not, might be one choice to enhance performance.

Underthinking

I also observed the underthinking phenomon with DeepSeek-R1. This is when a reasoning design frequently changes between various thinking thoughts without sufficiently exploring appealing courses to reach a correct option. This was a major reason for excessively 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 utilize them for planning only, while using other designs for generating code actions. This could be a potential new function of freeact, if this separation of functions proves useful for more complex jobs.

I’m also curious about how thinking designs that currently support tool usage (like o1, o3, …) perform in a single-agent setup, with and 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 interesting.