paper-with-me

홈 › Papers

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

2026-01-23 · Yuhang Wang, Yuling Shi, Mo Yang, Rongrui Zhang, Shilin He, Heng Lian, Yuting Chen, Siyu Ye, Kai Cai, Xiaodong Gu arxiv

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 while even improving success rates, and up to 14.84x compression on single-turn tasks like LongCodeQA with minimal performance impact.

📄 PDF Abstract BibTeX arXiv:2601.16746

Code (0)

등록된 구현이 없습니다.

Similar Papers 제목 키워드 기반

SWE-Pruner Pro: The Coder LLM Already Knows What to Prune

2026-07-20 · Yuhang Wang, Yuling Shi, Shaoqiu Zhang, Jialiang Liang 외 hf

Pruning long context for coding agents has been a vital technology for efficient context management. While existing context pruning methods such as SWE-Pruner realize this by attaching a separate code classifier, we find…

Adapt-Pruner: Adaptive Structural Pruning for Efficient Small Language Model Training

2025-02-05 · Boyao Wang, Rui Pan, Shizhe Diao, Xingyuan Pan 외

Small language models (SLMs) have attracted considerable attention from both academia and industry due to their broad range of applications in edge devices. To obtain SLMs with strong performance, conventional approaches…

Language ModelingLanguage ModellingMMLUSmall Language Model

Sample-aware Adaptive Structured Pruning for Large Language Models

2025-03-08 · Jun Kong, Xinge Ma, Jin Wang, Xuejie Zhang

Large language models (LLMs) have achieved outstanding performance in natural language processing, but enormous model sizes and high computational costs limit their practical deployment. Structured pruning can effectivel…

Bayesian Optimization

Not All Data Matters: An End-to-End Adaptive Dataset Pruning Framework for Enhancing Model Performance and Efficiency

2023-12-09 · Suorong Yang, Hongchao Yang, Suhan Guo, Furao Shen 외

While deep neural networks have demonstrated remarkable performance across various tasks, they typically require massive training data. Due to the presence of redundancies and biases in real-world datasets, not all data …

All

TextPruner: A Model Pruning Toolkit for Pre-Trained Language Models

2022-03-30 · ACL 2022 5 · Ziqing Yang, Yiming Cui, Zhigang Chen

Pre-trained language models have been prevailed in natural language processing and become the backbones of many NLP tasks, but the demands for computational resources have limited their applications. In this paper, we in…

Model Compression