Exploring DeepSeek-R1's Agentic Capabilities Through Code Actions
Albert Ali edited this page 4 months ago


I ran a fast experiment examining how DeepSeek-R1 carries out on agentic tasks, regardless of not supporting tool use natively, and I was quite pleased by preliminary outcomes. This experiment runs DeepSeek-R1 in a single-agent setup, where the model not just prepares the actions however likewise creates the actions as executable Python code. On a subset1 of the GAIA recognition split, DeepSeek-R1 outshines Claude 3.5 Sonnet by 12.5% absolute, from 53.1% to 65.6% correct, and other designs by an even bigger margin:

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

Approach

DeepSeek-R1's strong coding abilities allow it to act as a representative without being clearly trained for tool usage. By the model to produce actions as Python code, it can flexibly connect with environments through code execution.

Tools are executed as Python code that is consisted of straight in the timely. This can be an easy function meaning or a module of a bigger bundle - any valid Python code. The design then generates code actions that call these tools.

Results from performing these actions feed back to the model as follow-up messages, driving the next actions until a last answer is reached. The representative framework is a simple iterative coding loop that moderates the conversation in between the model and its environment.

Conversations

DeepSeek-R1 is used as chat design in my experiment, where the design autonomously pulls extra context from its environment by utilizing tools e.g. by utilizing an online search engine or bring information from web pages. This drives the conversation with the environment that continues until a final answer is reached.

On the other hand, o1 models are understood to perform inadequately when utilized as chat designs i.e. they don't attempt to pull context throughout a conversation. According to the connected short article, 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 full context in a single prompt approach at each action (with arise from previous steps consisted of), but this resulted in considerably lower ratings on the GAIA subset. Switching to the conversational method explained above, I had the ability to reach the reported 65.6% performance.

This raises a fascinating concern about the claim that o1 isn't a chat model - possibly this observation was more appropriate to older o1 designs that did not have tool use abilities? After all, isn't tool use support an essential system for making it possible for models to pull additional context from their environment? This conversational method certainly appears reliable for king-wifi.win DeepSeek-R1, though I still require to conduct comparable try outs o1 designs.

Generalization

Although DeepSeek-R1 was mainly trained with RL on mathematics and coding jobs, it is impressive that generalization to agentic tasks with tool use by means of code actions works so well. This capability to generalize to agentic jobs advises of recent research by DeepMind that shows that RL generalizes whereas SFT memorizes, although generalization to tool usage wasn't investigated because work.

Despite its ability to generalize to tool usage, DeepSeek-R1 often produces very long thinking traces at each step, compared to other models in my experiments, limiting the usefulness of this model in a single-agent setup. Even simpler jobs often take a very long time to finish. Further RL on agentic tool use, be it through code actions or not, might be one option to improve performance.

Underthinking

I likewise observed the underthinking phenomon with DeepSeek-R1. This is when a reasoning design frequently changes between different reasoning ideas without adequately exploring promising paths to reach a correct service. This was a significant reason for extremely long reasoning traces produced by DeepSeek-R1. This can be seen in the tape-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 models for creating code actions. This might be a potential brand-new feature of freeact, if this separation of roles shows beneficial for more complex jobs.

I'm likewise curious about how thinking 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 also utilizes code actions, look fascinating.