AI Pulse
📄 论文解读

让 AI 把工具调用写成代码,长任务不再中途失忆

现在的 AI 智能体用工具,是一步步把结果堆进对话里,任务一长,上下文就烂掉,它开始忘事、乱套。这篇换了个思路:让 AI 把工具调用写成可执行代码,中间结果存进变量,而不是塞回对话。研究者用 215 个任务训练出的 14B 模型,在 64k token 的复杂环境里通过率 30.7%,而传统方法直接归零。它不是你明天能用上的,但指向一个趋势:AI 处理长任务的正确姿势,可能不是更长的上下文,而是更像程序员写脚本。

📄 原文摘要(英文)

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.

arXiv 原文

订阅 AI Pulse

每天 08:00 · 12:30 · 18:30 · 23:50 更新