Executable Code Actions Elicit Better LLM Agents
Executable Code Actions Elicit Better LLM Agents
Summary
CodeAct has agents act by writing executable Python code instead of JSON or a fixed text format. A Python interpreter runs the code, and the agent revises its next action based on what comes back. Across 17 LLMs, CodeAct had up to 20% higher success rates than the usual alternatives. The authors also release CodeActInstruct, a set of 7k interactions, and CodeActAgent.
Draft. License: CC BY 4.0 (this summary). Sources: [S1] arXiv, "Executable Code Actions Elicit Better LLM Agents" (CC BY 4.0).
When to apply
- Agents that need loops, conditionals or tool composition in one step.
Paper
- Title: Executable Code Actions Elicit Better LLM Agents
- Authors: Xingyao Wang, Yangyi Chen, Lifan Yuan, Yizhe Zhang, Yunzhu Li, Hao Peng, Heng Ji
- arXiv: https://arxiv.org/abs/2402.01030 (first posted 2024-02-01)
- License: CC BY 4.0 (checked on the arXiv abstract page 2026-11-02)
- Read for this note: arXiv abstract page; figures restate the abstract.
Related
- 2305.15334 Gorilla
Facts
- id: F1 claim: CodeAct uses executable Python code as a unified action space for LLM agents, instead of JSON or text in a fixed format. confidence: medium date: 2026-11-02 sources: [S1] license: CC BY 4.0 checked_on: 2026-11-02
- id: F2 claim: JSON/text actions are limited by a constrained action space and cannot easily compose multiple tools. confidence: medium date: 2026-11-02 sources: [S1] license: CC BY 4.0 checked_on: 2026-11-02
- id: F3 claim: Integrated with a Python interpreter, the agent can revise prior actions or issue new ones based on observations over multiple turns. confidence: medium date: 2026-11-02 sources: [S1] license: CC BY 4.0 checked_on: 2026-11-02
- id: F4 claim: Across 17 LLMs on API-Bank and a new benchmark, CodeAct achieved up to 20% higher success rates than alternatives (author-reported). confidence: medium date: 2026-11-02 sources: [S1] license: CC BY 4.0 checked_on: 2026-11-02
- id: F5 claim: The authors released CodeActInstruct (7k multi-turn interactions) and CodeActAgent, fine-tuned from Llama2 and Mistral. confidence: medium date: 2026-11-02 sources: [S1] license: CC BY 4.0 checked_on: 2026-11-02
Caveats
- Running model-written code requires a sandbox; never execute it with broad credentials.
Pointers
- id: P1 answers: Full method, experiments and appendices where: https://arxiv.org/abs/2402.01030 access: free, public web page
Source: https://arxiv.org/abs/2402.01030 · License: CC-BY-4.0 · Summary by iinventedlight (AI-assisted), condensed and paraphrased; sources: Xingyao Wang, Yangyi Chen, Lifan Yuan, Yizhe Zhang, Yunzhu Li, Hao Peng, Heng Ji, \"Executable Code Actions Elicit Better LLM Agents\", arXiv:2402.01030 (CC BY 4.0)
Cite this
iinventedlight Library. 2026. "Executable Code Actions Elicit Better LLM Agents." iinventedlight Library, iil:note:avkd90nn, version of 2026-11-02. https://iinventedlight.com/library/reference/arxiv/2402-01030-codeact/. License: CC-BY-4.0. Summary of https://arxiv.org/abs/2402.01030.
@misc{iil_note_avkd90nn,
author = {{iinventedlight Library}},
title = {{Executable Code Actions Elicit Better LLM Agents}},
howpublished = {iinventedlight Library},
year = {2026},
date = {2026-11-02},
url = {https://iinventedlight.com/library/reference/arxiv/2402-01030-codeact/},
note = {Permanent ID iil:note:avkd90nn. License: CC-BY-4.0. Summary of https://arxiv.org/abs/2402.01030.},
}
For language models and agents: start at /llms.txt. This page in Markdown: /library/reference/arxiv/2402-01030-codeact.md.