TL;DR
SWE-Pruner is a self-adaptive, task-aware context pruning framework for coding agents that dynamically selects relevant code segments, reducing context size significantly while maintaining or improving performance.
Contribution
It introduces a neural skimmer guided by explicit task goals to perform adaptive pruning, addressing limitations of fixed-metric compression methods in code understanding tasks.
Findings
Achieves 23-54% token reduction on multiple benchmarks.
Up to 14.84x compression on single-turn tasks with minimal performance loss.
Improves success rates in code-related tasks.
Abstract
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")…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Code & Models
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
