ACC:用于长上下文训练的代理轨迹编译
ACC: Compiling Agent Trajectories for Long-Context Training
AI总结:
本文提出ACC,一种将代理轨迹编译为长上下文问答对的方法,通过整合多轮交互中的工具响应和环境观察,提升大语言模型的长上下文推理能力。
摘要:
近期代理的发展重新激发了对LLM长上下文推理能力的需求。然而,训练LLM具备这种能力需要耗费成本的长文档整理或启发式上下文合成。我们发现,当代理解决问题时,会产生大量轨迹,涉及调用工具和接收环境观察,这些证据分散在多个回合中,需要整合远距离上下文片段。然而,标准代理SFT会屏蔽工具响应,仅训练回合级工具选择,导致监督盲区,使这些分散的信号无法被利用。我们提出Agent Context Compilation (ACC),将搜索、软件工程和数据库查询代理的轨迹转换为长上下文QA对,结合原始问题与多回合收集的工具响应和环境观察,训练模型直接回答而不使用工具。这使问题与证据之间的依赖关系显式化,使模型能够直接监督长上下文推理,无需额外标注。ACC是一种简单但有效的做法,可与任何现有的长上下文扩展或训练方法结合,提供可扩展的监督微调数据。我们通过MRCR和GraphWalks长距离依赖建模任务验证了ACC,挑战需要跨回合核心ference解析和图遍历的基准测试。训练Qwen3-30B-A3B使用ACC在MRCR上达到68.3(+18.1),在GraphWalks上达到77.5(+7.6),结果与Qwen3-235B-A22B相当,同时在GPQA、MMLU-Pro、AIME和IFEval上保持通用能力。进一步的机制分析表明,ACC训练的模型表现出任务自适应的注意力重构和专家专业化。
英文摘要:
Recent development of agents has renewed demand for long-context reasoning capacity of LLMs. However, training LLMs for this capacity requires costly long-document curation or heuristic context synthesis. We observe that agents produce massive trajectories when solving problems, invoking tools and receiving environment observations across many turns. The evidence needed to answer the original question is thus scattered throughout these turns, requiring integration of distant context segments. Nevertheless, standard agent SFT masks tool responses and only trains turn-level tool selection, creating a supervision blind spot where these scattered signals go unused. We propose Agent Context Compilation (ACC), which converts trajectories from search, software engineering, and database querying agents into long-context QA pairs that combine the original question with tool responses and environment observations gathered across multiple turns, training the model to answer directly without tool use. This makes the dependencies between the question and the evidence explicit, enabling direct supervision of long-context reasoning over distant segments without additional annotation. ACC is a simple but effective approach that can be combined with any existing long-context extension or training method, providing scalable supervised fine-tuning data. We validate ACC on long-range dependency modeling tasks through MRCR and GraphWalks, challenging benchmarks requiring cross-turn coreference resolution and graph traversal over extended contexts. Training Qwen3-30B-A3B with ACC achieves 68.3 on MRCR (+18.1) and 77.5 on GraphWalks (+7.6), results comparable to Qwen3-235B-A22B, while preserving general capabilities on GPQA, MMLU-Pro, AIME, and IFEval. Further mechanism analysis reveals that the ACC-trained model exhibits task-adaptive attention restructuring and expert specialization.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。