CodeAgents: A Token-Efficient Framework for Codified Multi-Agent Reasoning in LLMs

Bruce Yang, Xinfeng He, Huan Gao, Yifan Cao, Xiaofan Li +1 more
7/4/2025
cs.AI

No confident code implementation found for this paper. 2 possible matches can be shown below.

Abstract

Effective prompt design is essential for improving the planning capabilities of large language model (LLM)-driven agents. However, existing structured prompting strategies are typically limited to single-agent, plan-only settings, and often evaluate performance solely based on task accuracy - overlooking critical factors such as token efficiency, modularity, and scalability in multi-agent environments. To address these limitations, we introduce CodeAgents, a prompting framework that codifies multi-agent reasoning and enables structured, token-efficient planning in multi-agent systems. In CodeAgents, all components of agent interaction - Task, Plan, Feedback, system roles, and external tool invocations - are codified into modular pseudocode enriched with control structures (e.g., loops, conditionals), boolean logic, and typed variables. This design transforms loosely connected agent plans into cohesive, interpretable, and verifiable multi-agent reasoning programs. We evaluate the proposed framework across three diverse benchmarks - GAIA, HotpotQA, and VirtualHome - using a range of representative LLMs. Results show consistent improvements in planning performance, with absolute gains of 3-36 percentage points over natural language prompting baselines. On VirtualHome, our method achieves a new state-of-the-art success rate of 56%. In addition, our approach reduces input and output token usage by 55-87% and 41-70%, respectively, underscoring the importance of token-aware evaluation metrics in the development of scalable multi-agent LLM systems. The code and resources are available at: https://anonymous.4open.science/r/CodifyingAgent-5A86

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. 2 weaker matches are hidden by default — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Similar Papers

Cite this paper

@article{yang2025codeagents,
  title  = {CodeAgents: A Token-Efficient Framework for Codified Multi-Agent Reasoning in LLMs},
  author = {Bruce Yang and Xinfeng He and Huan Gao and Yifan Cao and Xiaofan Li and David Hsu},
  year   = {2025},
  eprint = {2507.03254},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2507.03254v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2507.03254.svg)](https://codeofpaper.com/paper/2507.03254)

Discussion