Reproduce “Executable Code Actions Elicit Better LLM Agents” on OpenResearch

Turn your favorite coding agents into research agents that review literature, develop hypotheses, and run experiments.

Universal app for Apple silicon and Intel. Requires macOS 11 or later.

About this paper

Xingyao Wang, Yangyi Chen, Lifan Yuan, Yizhe Zhang, Yunzhu Li, Hao Peng, Heng Ji

CodeAct lets an LLM agent send Python to an interpreter instead of a text or JSON action. The interpreter returns results or errors as observations, allowing the agent to revise code or take another action. Variables, loops, and conditionals support composing tool calls. On M³ToolEval, GPT-4-1106-preview reaches 74.4% success versus 53.7% for text, demonstrating an advantage on this benchmark.

Key insights

  • Executable Python code expands the action space for LLM agents, enabling complex logic with control and data flow, and allowing for dynamic composition of tools within a single action.
  • Integrating code execution with an interpreter enables LLM agents to receive real-time feedback, including error messages, facilitating autonomous self-debugging and multi-turn refinement of actions.
  • LLM agents can directly leverage the vast existing Python software ecosystem, importing and utilizing packages like Pandas or Matplotlib, significantly expanding their capabilities without requiring custom tool development.
  • Instruction tuning with high-quality agent-environment interaction data can bridge the performance gap for open-source LLMs in complex agentic tasks while preserving general LLM capabilities.

Summary by alphaXiv.

Tip: change arxiv.org to autoarxiv.org in any arXiv abstract link to open the paper here.