ChatPaper.aiChatPaper

SWE-Pruner: コーディングエージェントのための自己適応型コンテキスト刈り込み

SWE-Pruner: Self-Adaptive Context Pruning for Coding Agents

January 23, 2026
著者: Yuhang Wang, Yuling Shi, Mo Yang, Rongrui Zhang, Shilin He, Heng Lian, Yuting Chen, Siyu Ye, Kai Cai, Xiaodong Gu
cs.AI

要旨

LLMエージェントはソフトウェア開発において顕著な能力を発揮していますが、長い対話コンテキストによって性能が阻害され、高いAPIコストと遅延が生じています。この課題に対処するためLongLLMLinguaなどの様々なコンテキスト圧縮手法が登場していますが、それらは一般にPPLのような固定指標に依存し、コード理解のタスク固有性を無視しています。その結果、構文や論理構造が頻繁に破壊され、重要な実装詳細が保持されないことがあります。本論文では、コーディングエージェント向けに調整された自己適応型コンテキスト剪定フレームワークであるSWE-Prunerを提案します。人間のプログラマが開発やデバッグ中にソースコードを「選択的に流し読み」する方法に着想を得て、SWE-Prunerは長いコンテキストに対してタスク認識型の適応的剪定を実行します。現在のタスクが与えられると、エージェントは剪定対象を導くヒントとして明示的な目標(例:「エラー処理に焦点を当てる」)を策定します。軽量なニューラルスキマー(0.6Bパラメータ)が、目標を考慮して周辺コンテキストから関連行を動的に選択するように訓練されます。4つのベンチマークと複数モデルによる評価により、SWE-Bench Verifiedのようなエージェントタスクでは23-54%のトークン削減を、LongCodeQAのような単一ターンタスクでは性能影響を最小限に抑えつつ最大14.84倍の圧縮を達成するなど、様々なシナリオにおけるSWE-Prunerの有効性が実証されました。
English
LLM agents have demonstrated remarkable capabilities in software development, but their performance is hampered by long interaction contexts, which incur high API costs and latency. While various context compression approaches such as LongLLMLingua have emerged to tackle this challenge, they typically rely on fixed metrics such as PPL, ignoring the task-specific nature of code understanding. As a result, they frequently disrupt syntactic and logical structure and fail to retain critical implementation details. In this paper, we propose SWE-Pruner, a self-adaptive context pruning framework tailored for coding agents. Drawing inspiration from how human programmers "selectively skim" source code during development and debugging, SWE-Pruner performs task-aware adaptive pruning for long contexts. Given the current task, the agent formulates an explicit goal (e.g., "focus on error handling") as a hint to guide the pruning targets. A lightweight neural skimmer (0.6B parameters) is trained to dynamically select relevant lines from the surrounding context given the goal. Evaluations across four benchmarks and multiple models validate SWE-Pruner's effectiveness in various scenarios, achieving 23-54% token reduction on agent tasks like SWE-Bench Verified and up to 14.84x compression on single-turn tasks like LongCodeQA with minimal performance impact.
PDF713January 27, 2026