An agent can know which tools to call yet struggle to combine their outputs. The central insight is to make action composition part of the language itself: variables, loops, and conditionals carry work that would otherwise require repeated model turns. Interpreter feedback then makes failed actions repairable.
Key Findings
- Across 17 models, code actions are competitive on atomic API calls; the larger benefit appears when tasks require multiple tools and dependent steps.
- On the 82-task M³ToolEval benchmark, the authors report gains of up to about 20 percentage points and up to 30% fewer actions, linking composability to fewer interactions.
- About 7,000 CodeActInstruct trajectories teach interaction and self-debugging. Fine-tuned Llama-2 and Mistral agents improve agent tasks without sacrificing the general capabilities measured in the paper.
Who Should Read It
Great fit if you are choosing an action interface for tool-using agents or collecting interactive training data. Look elsewhere if you need proof that code always beats structured calls: results vary by model, the main benchmark has 82 tasks, and executing generated code requires careful sandboxing.