mlsanityData to 14 Oct 2026

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

arXiv 2601.16746 ↗First posted 23 Jan 2026cs.SE cs.CLcited by 44

On the map: LLM agents and tool use → Software engineering coding agents

also in 1 more
Abstract (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.

Key facts. Cited by 44 papers in the map (data through 14 Oct 2026). Placed in Software engineering coding agents, one of 16 directions in LLM agents and tool use. Builds on 64 of its 79 references that are in the map. First posted on arXiv 23 Jan 2026.

Builds on

64 of 79 references.

Closest ancestors · 10

Same direction, newest first

  1. 2025Live-SWE-agent: Can Software Engineering Agents Self-Evolve on the Fly?17 Nov
  2. 2025Understanding Code Agent Behaviour: An Empirical Study of Success and Failure Trajectories31 Oct
  3. 2025Reducing Cost of LLM Agents with Trajectory Reduction28 Sep
  4. 2025Trae Agent: An LLM-based Agent for Software Engineering with Test-time Scaling31 Jul
  5. 2025SWE-Debate: Competitive Multi-Agent Debate for Software Issue Resolution31 Jul
  6. 2024Large Language Model-Based Agents for Software Engineering: A Survey4 Sep
  7. 2024OpenHands: An Open Platform for AI Software Developers as Generalist Agents23 Jul
  8. 2024Agentless: Demystifying LLM-based Software Engineering Agents1 Jul
  9. 2024SWE-agent: Agent-Computer Interfaces Enable Automated Software Engineering6 May
  10. 2024RepairAgent: An Autonomous, LLM-Based Agent for Program Repair25 Mar

Other references · 54

  1. 2023GPT-4 Technical Reportcited by 18,396
  2. 2022Chain-of-Thought Prompting Elicits Reasoning in Large Language Modelscited by 12,459
  3. 2020Retrieval-Augmented Generation for Knowledge-Intensive NLP Taskscited by 9,297
  4. 2022ReAct: Synergizing Reasoning and Acting in Language Modelscited by 8,695
  5. 2021Evaluating Large Language Models Trained on Codecited by 8,320
  6. 2023Lost in the Middle: How Language Models Use Long Contextscited by 3,455
  7. 2023SWE-bench: Can Language Models Resolve Real-World GitHub Issues?cited by 3,373
  8. 2023Qwen Technical Reportcited by 3,344
  9. 2024Gemini 1.5: Unlocking multimodal understanding across millions of tokens of contextcited by 3,224
  10. 2023G-Eval: NLG Evaluation using GPT-4 with Better Human Alignmentcited by 2,276
  11. 2025Qwen3 Embedding: Advancing Text Embedding and Reranking Through Foundation Modelscited by 1,261
  12. 2024Qwen2.5-Coder Technical Reportcited by 1,203
38 more
  1. 2023StarCoder: may the source be with you!cited by 799
  2. 2023LongLLMLingua: Accelerating and Enhancing LLMs in Long Context Scenarios via Prompt Compressioncited by 453
  3. 2025LLMs Get Lost In Multi-Turn Conversationcited by 429
  4. 2023Learning to Compress Prompts with Gist Tokenscited by 390
  5. 2023RepoCoder: Repository-Level Code Completion Through Iterative Retrieval and Generationcited by 367
  6. 2022UniXcoder: Unified Cross-Modal Pre-training for Code Representationcited by 361
  7. 2024LLMLingua-2: Data Distillation for Efficient and Faithful Task-Agnostic Prompt Compressioncited by 348
  8. 2023LLMLingua: Compressing Prompts for Accelerated Inference of Large Language Modelscited by 287
  9. 2015Conditional Random Fields as Recurrent Neural Networkscited by 214
  10. 2023LooGLE: Can Long-Context Language Models Understand Long Contexts?cited by 202
  11. 2023Compressing Context to Enhance Inference Efficiency of Large Language Modelscited by 189
  12. 2025Scaling Long-Horizon LLM Agent via Context-Foldingcited by 148
  13. 2025ACON: Optimizing Context Compression for Long-horizon LLM Agentscited by 136
  14. 2024xRAG: Extreme Context Compression for Retrieval-augmented Generation with One Tokencited by 125
  15. 2023LongCoder: A Long-Range Pre-trained Language Model for Code Completioncited by 112
  16. 2025AgentFold: Long-Horizon Web Agents with Proactive Context Managementcited by 103
  17. 2024CodeR: Issue Resolving with Multi-Agent and Task Graphscited by 91
  18. 2025Can LLMs Replace Human Evaluators? An Empirical Study of LLM-as-a-Judge in Software Engineeringcited by 67
  19. 2025SWE-Exp: Experience-Driven Software Issue Resolutioncited by 65
  20. 2025Scaling LLM Multi-turn RL with End-to-end Summarization-based Context Managementcited by 51
  21. 2025Seed-Coder: Let the Code Model Curate Data for Itselfcited by 49
  22. 2025The Complexity Trap: Simple Observation Masking Is as Efficient as LLM Summarization for Agent Context Managementcited by 48
  23. 2024AgentFL: Scaling LLM-based Fault Localization to Project-Level Contextcited by 47
  24. 2024From Code to Correctness: Closing the Last Mile of Code Generation with Hierarchical Debuggingcited by 46
  25. 2025LongCodeZip: Compress Long Context for Code Language Modelscited by 39
  26. 2025SWE-QA: Can Language Models Answer Repository-level Code Questions?cited by 38
  27. 2025LongCodeBench: Evaluating Coding LLMs at 1M Context Windowscited by 37
  28. 2025Pruning the Unsurprising: Efficient LLM Reasoning via First-Token Surprisalcited by 32
  29. 2022Diet Code Is Healthy: Simplifying Programs for Pre-trained Models of Codecited by 24
  30. 2025COMPASS: Enhancing Agent Long-Horizon Reasoning with Evolving Contextcited by 20
  31. 2025AttentionRAG: Attention-Guided Context Pruning in Retrieval-Augmented Generationcited by 19
  32. 2026In Line with Context: Repository-Level Code Generation via Context Inliningcited by 18
  33. 2025From Code to Courtroom: LLMs as the New Software Judgescited by 16
  34. 2025ELABORATION: A Comprehensive Benchmark on Human-LLM Competitive Programmingcited by 16
  35. 2025LastingBench: Defend Benchmarks Against Knowledge Leakagecited by 14
  36. 2026Reasoning in Trees: Improving Retrieval-Augmented Generation for Multi-Hop Question Answeringcited by 14
  37. 2024Hierarchical Context Pruning: Optimizing Real-World Code Completion with Repository-Level Pretrained Code LLMscited by 13
  38. 2024Natural Is The Best: Model-Agnostic Code Simplification for Pre-trained Large Language Modelscited by 10

50 most cited of 54 All 54 (JSON)

Built on by

Cited by year (2026 to 14 Oct)

Citing papers per year: 2026: 44.

44 papers.

Sort:

By area:

  1. 2026Code as Agent Harnesscited by 47
  2. 2026SWE-Master: Unleashing the Potential of Software Engineering Agents via Post-Trainingcited by 22
  3. 2026SWE-Explore: Benchmarking How Coding Agents Explore Repositoriescited by 21
  4. 2026SWE-TRACE: Optimizing Long-Horizon SWE Agents Through Rubric Process Reward Models and Heuristic Test-Time Scalingcited by 16
  5. 2026A Self-Evolving Framework for Efficient Terminal Agents via Observational Context Compressioncited by 15
  6. 2026SWE-MeM: Learning Adaptive Memory Management for Long-Horizon Coding Agentscited by 15
  7. 2026Seeing is Coding: On the Effectiveness of Vision Language Models in Code Understandingcited by 13
  8. 2026Self-GC: Self-Governing Context for Long-Horizon LLM Agentscited by 11
  9. 2026FASA: Frequency-aware Sparse Attentioncited by 8
  10. 2026The Missing Memory Hierarchy: Demand Paging for LLM Context Windowscited by 8
  11. 2026Test vs Mutant: Adversarial LLM Agents for Robust Unit Test Generationcited by 7
  12. 2026SWE-Bench ProMax: Benchmarking Agents on Large-Scale Multilingual Code Refactoringcited by 6
32 more
  1. 2026FastContext: Training Efficient Repository Explorer for Coding Agentscited by 5
  2. 2026Steer, Don't Solve: Training Small Critic Models for Large Code Agentscited by 5
  3. 2026CoACT: Action-Preserving Observation Compression for Coding Agentscited by 4
  4. 2026Turning Interaction History into Execution State: A Runtime Layer for Long-Horizon Coding Agentscited by 4
  5. 2026What Context Does a Coding Agent Actually Need to Act?cited by 3
  6. 2026EarlyEval: Cheaper Agent Evaluation via Early Outcome Predictioncited by 3
  7. 2026SEA-TS: Self-Evolving Agent for Autonomous Code Generation of Time Series Forecasting Algorithmscited by 2
  8. 2026ClassEval-Pro: A Cross-Domain Benchmark for Class-Level Code Generationcited by 2
  9. 2026Context Pruning for Coding Agents via Multi-Rubric Latent Reasoningcited by 2
  10. 2026SWE-Pruner Pro: The Coder LLM Already Knows What to Prunecited by 2
  11. 2026SkillForge: Self-Distilling Agents for Project-Specific Issue Resolutioncited by 2
  12. 2026Deep Agentic Search for Repository-Level Code Question Answering: An Empirical Studycited by 1
  13. 2026Memory Control Signals Emerge Before Action in Long Horizon Agentscited by 1
  14. 2026StateComp: Learning When to Compress History in Long Horizon Agentscited by 1
  15. 2026Beyond Textual Repository Exploration: Dual-Modal Structural Reasoning for Agentic Issue Resolutioncited by 0
  16. 2026Shapley Context Pruning: A Cooperative Game Perspective for Context Reranking and Pruningcited by 0
  17. 2026Do Large Language Models Perform Well on Comprehending Poetic Logic in Modern Chinese Poetry?cited by 0
  18. 2026Read Less, Solve More: Token-Efficient Sparse Reading for AI Agentscited by 0
  19. 2026openJiuwen: Beyond Static Harnesses for Long-Horizon Coding Agentscited by 0
  20. 2026DRSR: Learning Set-Level Deletion Risk for Efficient Long-Horizon Agentscited by 0
  21. 2026Stable Geometry with Divergent Task Evidence for Efficient Long-Horizon Agent Compressioncited by 0
  22. 2026Schr"odinger's Code Repository: Have LLMs Learned SWE-bench or Memorized It?cited by 0
  23. 2026When Can Agents Forget Their Reasoning? ICLR for Long-Horizon Agent Context Compressioncited by 0
  24. 2026Analyzing and Mitigating Cost-Inefficient Behaviors in Coding Agentscited by 0
  25. 2026Compress What You See, Not What You Say: Anchored Context Distillation for Latent-Observation Software Engineering Agentscited by 0
  26. 2026ARSM: Auto-Regressive State Machine for Agentic Reasoning Compressioncited by 0
  27. 2026EfficientAgent: What Makes KV Cache Offloading Work for Concurrent Agents?cited by 0
  28. 2026StateTape: Action-Conditioned Evidence Lifecycle Modeling for Long-Horizon Coding Agentscited by 0
  29. 2026MemTrace: State-Consistent Memory for Long-Horizon Coding Agentscited by 0
  30. 2026ReFold: Training-Free Reversible Inter-Turn Context Folding for Long-Horizon Agentscited by 0
  31. 2026TAP: Efficient Long-Horizon Agent Pruning via Trajectory-Anchored Recoverycited by 0
  32. 2026StateHarness: Maintaining Evolving Project State for Long-Horizon Coding Agentscited by 0

Similar, not cited

Close in wording, no citation either way

  1. 2026SWE Context Bench: A Benchmark for Context Learning in Coding
  2. 2026Squeez: Task-Conditioned Tool-Output Pruning for Coding Agents
  3. 2026SWE-Duel: Towards a Self-Scaling Arena for Coding Agents
  4. 2025Kimi-Dev: Agentless Training as Skill Prior for SWE-Agents
  5. 2026On Problems of Implicit Context Compression for Software Engineering Agents
  6. 2025Training Versatile Coding Agents in Synthetic Environments
  7. 2026Latent Programming Horizons in Coding Agents
  8. 2026SWE-Edit: Rethinking Code Editing for Efficient SWE-Agent