cs.AIOct 10, 2026

ProgAgent: Learning Tool Orchestration through Programmatic Training

Authors: Hao Li, Keqing He, Longtao Zheng, Junlong Li, Weihao Zeng, Qian Liu, Yuzhen Huang

Organizations: Hong Kong University of Science and Technology · Beijing University of Posts and Telecommunications · Nanyang Technological University

Abstract

Large language models (LLMs) are increasingly expected to orchestrate diverse tools over long-horizon tasks. Existing agents typically use Direct Tool Calling (DTC), where the model invokes tools sequentially, and tool responses accumulate in the model context, which can lead to context rot and orchestration breakdown. In contrast, Programmatic Tool Calling (PTC) invokes tools through executable code and stores intermediate results in runtime variables rather than appending them to the context. Prior work has explored PTC mainly as an inference-time optimization, but its benefits for agentic training remain unclear, and suitable verifiable training tasks are scarce. In this work, we introduce ProgAgent, a full PTC training stack, comprising a pipeline for synthesizing verifiable long-horizon tasks, a lightweight PTC runtime, and a two-stage training recipe. Using only 215 tasks instantiated at four environment scales, ProgAgent yields higher pass rates than the evaluated baselines of comparable size across four benchmarks. On LOCA-bench, ProgAgent-14B achieves a 30.7% pass rate at a 64k-token environment state, where these baselines score zero. Cross-harness experiments show that PTC-trained models outperform DTC-trained models under both evaluation interfaces, suggesting that the benefits of PTC training extend beyond the interface.

Figures & tables

Appendix figures & tables6 assets

Supplementary material from the paper’s appendix.

Appendix

Explore similar work

CardsList
  1. The Bitter Lesson of Tool Calling

    Aug 6, 2026Ishan Patel, Sahil Sen, Elias Lumer +1LLM EvaluationTool-Augmented Language Model Agents

  2. HyperTool: Beyond Step-Wise Tool Calls for Tool-Augmented Agents

    Jun 11, 2026Yaxin Du, Yifan Zhou, Yujie Ge +7Tool-Augmented Language Model AgentsLLM Agent Workflow Optimization

  3. LLM-as-Code: Agentic Programming for Agent Harness

    Jun 14, 2026Junjia Qi, Zichuan Fu, Jingtong Gao +4AI Agent ReliabilityLLM Agent Orchestration