Squeez: Task-Conditioned Tool-Output Pruning for Coding Agents
Organizations: KR Labs
Abstract
Coding agents repeatedly consume long tool observations even though only a small fraction of each observation matters for the next step. We study task-conditioned tool-output pruning: given a focused query and one tool output, return the smallest verbatim evidence block the agent should inspect next. We introduce a benchmark of 11,477 examples built from SWE-bench repository interactions and synthetic multi-ecosystem tool outputs, with a manually curated 618-example test set. We fine-tune Qwen 3.5 2B with LoRA and compare it against larger zero-shot models and heuristic pruning baselines. Our model reaches 0.86 recall and 0.80 F1 while removing 92% of input tokens, outperforming zero-shot Qwen 3.5 35B A3B by 11 recall points and all heuristic baselines by a wide margin.
Figures & tables
| Source | Raw inputs | Released rows |
|---|---|---|
| SWE-derived | 10,713 | 9,205 |
| Synthetic positives | 2,039 | 1,697 |
| Synthetic negatives | — | 575 |
| Total | 12,752 | 11,477 |
| Tool | Rows | Tool | Rows | Tool | Rows |
|---|---|---|---|---|---|
| read_file | 3768 | ls | 347 | build_output | 168 |
| grep | 1330 | type_check | 317 | docker_build | 151 |
| git_log | 720 | git_blame | 291 | make_cmake | 133 |
| python | 698 | npm_build | 230 | kubectl | 123 |
| test_output | 546 | tsc | 229 | cargo_build | 122 |
| curl | 493 | npm_install | 227 | go_build | 120 |
| Tool | Rows | Avg. input | Avg. gold |
|---|---|---|---|
| read_file | 3768 | 1677 | 84 |
| grep | 1330 | 779 | 19 |
| git_log | 720 | 161 | 11 |
| python | 698 | 60 | 28 |
| curl | 493 | 723 | 68 |
| pip_install | 441 | 438 | 79 |
| Model | Prec. | Recall | Strict F 1 | Exact | F 1 | Compression |
|---|---|---|---|---|---|---|
| Squeez-2B | 0.80 | 0.86 | 0.79 | 0.49 | 0.80 | 0.92 |
| Qwen 3.5 35B A3B | 0.74 | 0.75 | 0.70 | 0.39 | 0.73 | 0.92 |
| Kimi K2 | 0.61 | 0.53 | 0.53 | 0.30 | 0.68 | 0.94 |
| Qwen 3.5 2B (base) | 0.42 | 0.53 | 0.41 | 0.19 | 0.55 | 0.82 |
| BM25 (10%) | 0.13 | 0.22 | 0.13 | 0.01 | 0.23 | 0.90 |
| First-N (10%) | 0.07 | 0.14 | 0.08 | 0.02 | 0.16 | 0.91 |
| Pattern | Query / Observation | Squeez-2B | Baseline error |
|---|---|---|---|
| Precise selection in structured output | git_log , 21 lines. Query asks for the commit relevant to the dimension-order change in xr.polyval . | Selects the single correct commit entry. | Qwen 35B chooses a plausible but wrong transpose-related commit; Qwen 2B base over-selects several polyval commits. |
| Failure-block extraction | service log , 176 lines. Query asks for the TLS handshake failure affecting the health-check request. | Returns the correct 5-line health-check failure block. | Qwen 35B selects a later payment-request TLS failure; Kimi K2 keeps only part of the correct block. |
| Correct empty prediction | docker_logs , 316 lines. Query asks for a numpy version conflict that is not present. | Returns empty output. | Qwen 35B generates explanatory text (“No relevant lines found…”); Qwen 2B base returns unrelated database errors. |
| Adjacent over-selection | build_output , 110 lines. Query asks for the Dockerfile syntax error on line 12. | Finds the Dockerfile error but also includes a nearby Python SyntaxError . | Qwen 35B misses the Dockerfile error entirely and selects only the Python block. |
AI Coding Agents
AI coding agents use language models and software tools to plan, edit, test, and maintain code with varying levels of autonomy.
See all 327 papers