ACC: Compiling Agent Trajectories for Long-Context Training
Qisheng Su, Zhen Fang, Shiting Huang, Yu Zeng, Yiming Zhao, Kou Shi, Ziao Zhang, Lin Chen, Zehui Chen, Lijun Wu, Feng Zhao
arXiv:2605.21850 · 2026-05-22 공개 · arXiv · PDF
long-context qwen3 software-engineering supervised-finetuning agent-trajectories tool-responses qa-pairs mrcr
Abstract
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.
한국어 요약
한 줄 요약
**[Long-Context Training / Agent Trajectory]** ACC가 search·SWE·DB query agent의 trajectory를 long-context QA로 변환해 SFT, Qwen3-30B-A3B를 MRCR 68.3(+18.1)·GraphWalks 77.5(+7.6)로 235B급에 근접·일반능력 보존.
핵심 기여도
- 에이전트 발전이 LLM의 long-context reasoning 수요를 재차 증대시키지만, 학습은 비싼 long-document 큐레이션·heuristic context 합성을 요구함을 지적.
- 에이전트가 문제 해결 시 tool 호출·환경 관측의 massive trajectory를 생성, 원 질문 답에 필요한 evidence가 turn 전반에 분산되어 distant context segment 통합이 필요함 관찰.
- 표준 agent SFT가 tool response를 masking하고 turn-level tool selection만 학습 — 분산된 signal이 supervision blind spot에 빠짐.
- ACC(Agent Context Compilation) 제안 — search·software engineering·database query agent의 trajectory를 long-context QA로 변환, 원 질문 + multi-turn tool response·환경 관측을 결합해 tool 사용 없이 직접 답하도록 학습.
핵심 아이디어
Agent trajectory에는 long-context reasoning supervision이 이미 풍부하게 내재하지만 표준 SFT는 이를 masking으로 폐기한다 — trajectory를 long-context QA로 재구성해 question-evidence dependency를 명시화하면 추가 annotation 없이 scalable한 distant-segment reasoning supervision을 얻는다.
기술적 접근법
- **방법론**: ACC — Agent Context Compilation.
- **핵심 기법**: (1) Search·SWE·DB query agent의 trajectory 수집, (2) 원 질문 + tool response + 환경 관측을 결합해 long-context QA pair 생성, (3) Tool 사용 없이 직접 답하도록 학습해 multi-turn evidence 통합 supervision, (4) 기존 long-context 확장·학습 방법과 결합 가능, (5) MRCR·GraphWalks 등 cross-turn coreference·graph traversal 벤치로 검증.
주요 결과
- Qwen3-30B-A3B 학습: MRCR 68.3(+18.1), GraphWalks 77.5(+7.6).
- Qwen3-235B-A22B에 comparable한 성능을 30B-A3B로 달성.
- GPQA·MMLU-Pro·AIME·IFEval에서 일반 능력 보존.
- Mechanism 분석: task-adaptive attention restructuring·expert specialization 발생.
의의 및 한계
**의의**: long-context 학습의 데이터 수급 문제를 agent trajectory로 해결, supervision blind spot 노출·해소, 30B로 235B급 성능에 도달하는 효율, 다른 long-context 방법과 결합 가능한 plug-and-play. **한계**: agent trajectory 수집 의존(원 task 환경 구축 비용), QA 변환 품질이 학습 효과 결정, 매우 긴 context(>>1M token)으로의 확장은 추가 검증.
실용적 활용
- LLM의 long-context 능력 학습 데이터 합성.
- Agent 환경 활용한 SFT 데이터 augmentation.
- Cross-turn evidence integration training.