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.
Pruner-Zero: Evolving Symbolic Pruning Metric from scratch for Large Language Models
The Hong Kong University of Science and Technology (Guangzhou)(香港科技大学(广州));The Hong Kong University of Science and Technology(香港科技大学);Hong Kong Baptist Univeristy(香港浸会大学);Harbin Institude of Technology, Shenzhen(哈尔滨工业大学(深圳))
Z-Pruner: Post-Training Pruning of Large Language Models for Efficiency without Retraining
Department of Electrical and Computer Engineering, North South University, Dhaka, 1229, Bangladesh(电气与计算机工程系,北南大学,达卡,孟加拉国);Data Science and AI, University of Doha for Science and Technology, Doha, Qatar(数据科学与人工智能,多哈科学技术大学,多哈,卡塔尔)
O1-Pruner: Length-Harmonizing Fine-Tuning for O1-Like Reasoning Pruning
China Agriculture University(中国农业大学);Tsinghua University(清华大学);University of Oxford(牛津大学);Didichuxing Co. Ltd(滴滴出行有限公司);Shenzhen Campus of Sun Yat-sen University(中山大学深圳校区);Nanyang Technological University(南洋理工大学)
Persona-Pruner: Sculpting Lightweight Models for Role-Playing
Department of Artificial Intelligence, Korea University, Seoul, South Korea(韩国大学人工智能系);Korea Advanced Institute of Science and Technology (KAIST)(韩国科学技术院)
Unifying Depth and Width Pruning for LLMs via Binary Knapsack Optimization
Yardi School of Artificial Intelligence, Indian Institute of Technology Delhi(德里印度理工学院亚迪人工智能学院);Indian Institute of Technology Delhi(德里印度理工学院);Microsoft Research (MSR) India(微软研究院印度分部)
Fluctuation-based Adaptive Structured Pruning for Large Language Models
Institute of Automation, Chinese Academy of Sciences(中国科学院自动化研究所);University of Chinese Academy of Sciences(中国科学院大学);Wuhan AI Research(武汉人工智能研究院);Objecteye Inc.(Objecteye公司)
The Fragility and Dynamics of LLM Pruning-Recovery Steps
Institute of Information Science, Academia Sinica(中央研究院资讯科学研究所);National Taiwan University of Science and Technology(台湾科技大学);AI Research Center, Hon Hai Research Institute(鸿海研究院人工智能研究中心)
Less is More: Towards Green Code Large Language Models via Unified Structural Pruning
Nanjing University of Aeronautics and Astronautics(南京航空航天大学);Singapore Management University(新加坡国立管理学院);National University of Defense Technology(国防科技大学);Nantong University(南通大学);Monash University and CSIRO’s Data61(莫纳什大学和CSIRO Data61);Birkbeck, University of London(伦敦大学伯贝克学院)
When Compression Helps and When It Hurts: Condition-Aware Analysis of Chain-of-Thought Distillation
Ningbo Institute of Digital Twin, Eastern Institute of Technology, Ningbo(宁波数字孪生研究院,东方理工高等研究院,宁波);Viterbi School of Engineering, University of Southern California(南加州大学维特比工程学院);The Hong Kong Polytechnic University(香港理工大学);LMU Munich(慕尼黑大学);Saarland University(萨尔大学)