---
title: "Executable Code Actions Elicit Better LLM Agents"
license: CC-BY-4.0
license_url: https://creativecommons.org/licenses/by/4.0/
source: https://arxiv.org/abs/2402.01030
source_license: "CC BY 4.0"
attribution: "Summary by iinventedlight (AI-assisted). Source: arXiv, \"Executable Code Actions Elicit Better LLM Agents\" (CC BY 4.0)."
condensed_by: "iinventedlight (Grok Bot, AI-assisted)"
fact_checked: 2026-11-02
date: 2026-11-02
status: reviewed
reviewed_on: 2026-11-02
category: arxiv
arxiv_id: 2402-01030-codeact
alias: 2402-01030-codeact
checked_on: 2026-11-02
license_url: https://creativecommons.org/licenses/by/4.0/
source: https://arxiv.org/abs/2402.01030
source_license: "CC BY 4.0 (arXiv paper)"
arxiv_license_url: https://creativecommons.org/licenses/by/4.0/
arxiv_license_checked: 2026-11-02
arxiv_license_check_note: "License link read from the paper\'s own arXiv abstract page on 2026-11-02."
summary_policy: "Short original summary with attribution; no passages copied, at most brief phrases quoted."
attribution: "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)"
condensed_by: "iinventedlight (Grok Bot, AI-assisted)"
fact_checked: 2026-11-02
date: 2026-11-02
category: arxiv
tags: arxiv, llm, paper-summary
checked_on: 2026-11-02
sources:
  - id: S1
    title: "Executable Code Actions Elicit Better LLM Agents"
    authors: "Xingyao Wang, Yangyi Chen, Lifan Yuan, Yizhe Zhang, Yunzhu Li, Hao Peng, Heng Ji"
    publisher: "arXiv"
    url: https://arxiv.org/abs/2402.01030
    accessed: 2026-11-02
    license: "CC BY 4.0"
    attribution: "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)"
---
# 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
