ACC: Compiling Agent Trajectories for Long-Context Training
Summary
Agent Context Compilation (ACC) is a novel method that addresses the costly long-context training data problem for large language models (LLMs) used in agents. ACC converts multi-turn agent trajectories from search, software engineering (SWE), and SQL agents into long-context Question-Answering (QA) pairs. This process compiles the original question with all tool responses and environment observations into a single context, enabling direct supervision of long-context reasoning without additional human annotation. Training Qwen3-30B-A3B with ACC significantly improved performance on long-range dependency modeling benchmarks, achieving 68.3 on MRCR (+18.1) and 77.5 on GraphWalks (+7.6). These results are comparable to the much larger Qwen3-235B-A22B model, while preserving general capabilities on GPQA, MMLU-Pro, AIME, and IFEval. The method leverages 10,802 trajectories with context lengths up to 128K tokens.
Key takeaway
For Machine Learning Engineers developing agent-powered LLMs, ACC offers a scalable and effective approach to enhance long-context reasoning without expensive manual annotation. You should consider integrating ACC into your supervised fine-tuning pipelines, especially when working with multi-turn agent trajectories from search, software engineering, or database querying. This method can significantly boost performance on complex long-range dependency tasks like MRCR and GraphWalks, potentially matching larger models with fewer parameters, while maintaining general capabilities.
Key insights
Agent Context Compilation (ACC) transforms multi-turn agent trajectories into long-context QA pairs, directly supervising long-range reasoning.
Principles
- Masking tool responses creates a supervision blind spot.
- Explicitly compiling scattered evidence improves reasoning.
- Diverse trajectory types offer complementary coverage.
Method
ACC compiles an agent trajectory τ=(q,(r₁,a₁,o₁),…,(rₖ₁,aₖ₁,oₖ₁),(rₖ,y)) into a QA pair (x,y) where x=(q,o₁,…,oₖ₁), training the model to answer y directly from x.
In practice
- Apply ACC to search, SWE, or SQL agent trajectories.
- Combine ACC with existing long-context extension methods.
- Include distractors in compiled contexts for localization.
Topics
- Agent Context Compilation
- Long-Context LLMs
- Supervised Fine-Tuning
- Agent Trajectories
- MRCR Benchmark
- GraphWalks Benchmark
- Qwen3-30B-A3B
Code references
Best for: NLP Engineer, Research Scientist, AI Scientist, Machine Learning Engineer, AI Engineer
Related on AIssential
Editorial summary, takeaway, and curation by AIssential. Original article published by cs.CL updates on arXiv.org.