Squeez: Task-Conditioned Tool-Output Pruning for Coding Agents
The paper introduces "Squeez," a task-conditioned tool-output pruning method that uses a fine-tuned Qwen 3.5 2B model to identify and retain only the most relevant evidence from long tool observations, achieving high recall and F1 scores while removing 92% of input tokens and significantly outperforming larger zero-shot models and heuristic baselines.
Original paper licensed under CC BY 4.0 (http://creativecommons.org/licenses/by/4.0/). This is an AI-generated explanation of the paper below. It is not written or endorsed by the authors. For technical accuracy, refer to the original paper. Read full disclaimer
Imagine you are a detective trying to solve a complex crime, but instead of getting a neat summary of the evidence, you are handed a giant, chaotic warehouse filled with millions of documents, audio tapes, and video clips. Every time you ask a question, you have to read everything in the warehouse before you can make your next move. It's slow, exhausting, and you often miss the one crucial clue buried under a mountain of irrelevant paperwork.
This is exactly the problem coding agents (AI programmers) face today. When they try to fix a bug, they get flooded with massive logs, error messages, and code files. Most of this data is "noise," but the AI has to process it all, which is incredibly inefficient.
Enter Squeez: The "Smart Shredder" for AI.
The Core Idea: Finding the Needle in the Haystack
The authors of this paper realized that AI doesn't need to read the whole haystack to find the needle. They created a system called Squeez that acts like a super-smart filter.
Here is how it works in simple terms:
- The Input: You give the AI a specific question (e.g., "Why did the login fail?") and a massive wall of text (the tool output, like a 500-line error log).
- The Magic: Instead of reading the whole thing, Squeez instantly scans the text and cuts out only the tiny, specific lines that actually answer the question.
- The Output: It hands the AI just those few lines, throwing away 92% of the junk.
The "Chef" Analogy
Think of a coding agent as a chef trying to make a soup.
- The Old Way: The chef is given a truckload of groceries (the tool output). To find the salt, the chef has to open every single bag, taste every vegetable, and read every label before they can start cooking. It takes forever.
- The Squeez Way: A sous-chef (Squeez) stands by the truck. The head chef asks, "Where is the salt?" The sous-chef instantly grabs only the salt shaker and hands it over, leaving the truck full of carrots and potatoes behind. The head chef can now cook immediately.
How They Built It
To teach their AI this skill, the researchers didn't just guess. They built a massive training gym with over 11,000 practice scenarios.
- They used real-world coding problems (from a famous dataset called SWE-bench) and created fake ones for different programming languages.
- They taught a small, efficient AI model (a 2-billion parameter version of Qwen) to look at a question and a messy log, then highlight the exact lines of code or error messages that matter.
- They tested it against "big brain" models (like a 35-billion parameter AI) and simple rules (like "just read the first 10 lines").
The Results: Small is Beautiful
The results were surprising and impressive:
- The Small Model Won: The tiny, specialized AI (Squeez) was much better at finding the right clues than the massive, expensive 35-billion parameter AI.
- Speed and Efficiency: Squeez removed 92% of the unnecessary text. It found the right evidence 86% of the time (Recall), beating the giant models by a wide margin.
- Why the Big Models Failed: The big, "zero-shot" models (models not specifically trained for this) were too chatty. They often tried to summarize or rewrite the text, or they got distracted by similar-looking but wrong information. Squeez, however, learned to be a strict "extractor"—it just grabs the exact lines needed, verbatim, without rewriting them.
Why This Matters
In the world of AI coding, attention is a limited resource. If an AI spends too much time reading irrelevant logs, it gets slower, costs more money to run, and might even get confused.
Squeez is like a laser-guided spotlight. It shines only on the part of the story that matters, letting the AI agent move faster and smarter. It proves that you don't need a "super-genius" AI to filter data; you just need a small, well-trained specialist who knows exactly what to look for.
In a nutshell: Squeez is the ultimate "Ctrl+F" for AI agents, but instead of just finding a word, it understands the context, cuts out the garbage, and hands the agent the exact evidence it needs to solve the problem next.
Drowning in papers in your field?
Get daily digests of the most novel papers matching your research keywords — with technical summaries, in your language.