Agent Behavior as Code: Efficient and Robust LLM Agents with Programmatic Specifications
On the map: LLM agents and tool use → General LLM agent frameworks and benchmarks also fits: Software engineering coding agents
Abstract (arXiv)
AI agents based on foundation models (FMs) have demonstrated strong capabilities to perform complex open-ended tasks. However, they face some common challenges in practice: (a) agent behavior can deviate drastically even for semantically similar tasks, leading to catastrophically propagated errors; (b) high cost and latency due to FM calls, repeated in full whenever a task recurs with different inputs; (c) FMs' limited context and instruction following capability confine how well agents manage the ever-growing execution context and follow complex plans. We introduce Agent Behavior as Code Agent (ABCAgent), which uses a symbolic program (e.g., Python code with potential neural functions) to fully specify the agent's behavior at runtime, with a powerful FM agent editing that program for flexibility. Behavior is thus specified without premature variable binding, and its execution is deterministic. We evaluate ABCAgent on six agent benchmarks, two of which we construct to test how well a derived program generalizes to variants of the task it was written for. ABCAgent matches a model-matched neural agent on GAIA and augmented GAIA, and surpasses it where robustness and long control flows matter: 98.3% against 97.3% on GSM-Symbolic (p = 0.001), 71.9% against 47.4% Pass4 on the telecom domain of τ2-bench (p = 0.0001), and more records written correctly at every loop length on our control-flow-augmented WorkArena benchmark. For more parametric task families, ABCAgent is also significantly superior in efficiency. Without authoring a new program, ABCAgent solves 92.6% of GSM-Symbolic instances and 20.1% of augmented GAIA variants, which yields 5.2× lower latency and 7.0× lower cost on GSM-Symbolic, 19% lower cost on augmented GAIA, and 9.5× lower agent latency on τ2-telecom.
Key facts. No citing papers in the map yet (data through 7 Oct 2026). Placed in General LLM agent frameworks and benchmarks, one of 16 directions in LLM agents and tool use. First posted on arXiv 4 Oct 2026.
Builds on
No reference list yet.
Built on by
Not cited yet.
Similar, not cited
Close in wording, no citation either way
- 2025AI Agentic Programming: A Survey of Techniques, Challenges, and Opportunities
- 2025The FM Agent
- 2023Formally Specifying the High-Level Behavior of LLM-Based Agents
- 2026AgentSPEX: An Agent SPecification and EXecution Language
- 2025Agentic AI Process Observability: Discovering Behavioral Variability
- 2026AgentFactory: A Self-Evolving Framework Through Executable Subagent Accumulation and Reuse
- 2026LLM-as-Code: Agentic Programming for Agent Harness
- 2025CodeAgents: A Token-Efficient Framework for Codified Multi-Agent Reasoning in LLMs