Abstract
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 the agent itself encodes internal representations indicating the relevance of code context when reading tool output. Based on this finding, we propose SWE-Pruner Pro, which prunes tool outputs directly inside the agent. Concretely, a small head turns the agent's own internal representations into a keep-or-prune label for each line, with a length-aware embedding keyed to each tool output's line count. Across two open-weight backbones and four multi-turn benchmarks, SWE-Pruner Pro saves up to 39% of prompt and completion tokens while preserving task quality, with bounded inference overhead. Notably, on MiMo-V2-Flash SWE-Pruner Pro additionally raises the SWE-Bench Verified resolve rate by +3.8% and the long-context Oolong accuracy by +2.2 points.
Community
Prunes tool outputs in coding agents using internal representations for efficient context management without external classifiers.
This is an automated message from the Librarian Bot. I found the following papers similar to this paper.
The following papers were recommended by the Semantic Scholar API
- FastContext: Training Efficient Repository Explorer for Coding Agents (2026)
- SHERLOC: Structured Diagnostic Localization for Code Repair Agents (2026)
- Stop Early, Spend Less: Hidden-State Probes as a Practical Recipe for Streaming Moderation of LLM Outputs (2026)
- Still: Amortized KV Cache Compaction in a Single Forward Pass (2026)
- Cross-Lingual Token Arbitrage: Optimizing Code Agent Context Windows via Local LLM Preprocessing (2026)
- Send a SCOUT First: Pre-hoc Reasoning for Adaptive Detector Allocation in Prompt-Injection Defense (2026)
- MemDecay: Region-Aware KV Cache Eviction for Efficient LLM Agent Inference (2026)
Please give a thumbs up to this comment if you found it helpful!
If you want recommendations for any Paper on Hugging Face checkout this Space
You can directly ask Librarian Bot for paper recommendations by tagging it in a comment: @librarian-bot recommend
Get this paper in your agent:
hf papers read 2607.18213 Don't have the latest CLI?
curl -LsSf https://hf.co/cli/install.sh | bash Models citing this paper 2
ayanami-kitasan/swe-pruner-pro-mimo-v2-flash-head
Datasets citing this paper 1
ayanami-kitasan/swe-pruner-pro-training-corpus
Spaces citing this paper 0
No Space linking this paper