菜单

关于 🐙 GitHub
arXiv 提交日期: 2026-01-23
📄 Abstract - SWE-Pruner: Self-Adaptive Context Pruning for Coding Agents

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.

顶级标签: llm agents systems
详细标签: context pruning coding agents software engineering efficiency long context 或 搜索:

SWE-Pruner:面向编程智能体的自适应上下文剪枝框架 / SWE-Pruner: Self-Adaptive Context Pruning for Coding Agents


1️⃣ 一句话总结

这篇论文提出了一种名为SWE-Pruner的智能剪枝框架,它通过模仿程序员‘选择性浏览’代码的习惯,能根据当前编程任务的目标(如‘关注错误处理’)动态压缩冗长的代码上下文,从而在显著减少计算开销和延迟的同时,有效保留关键代码逻辑和细节。

源自 arXiv: 2601.16746