Scaling Test-Time Compute for Coding Agents: It's All About Representation
Scaling Test-Time Compute for Agentic Coding
The paper introduces a test-time scaling framework for agentic coding that enables Large Language Models to improve performance through increased inference compute. By converting long, noisy rollout trajectories into compact "Structured Summaries," the authors implement two scaling mechanisms: Recursive Tournament Voting (RTV) for parallel selection and an agentic version of Parallel-Distill-Refine (PDR) for sequential improvement.
In the quest for "Superintelligence," the industry has shifted its gaze from pre-training larger models to test-time scaling—allowing models to "think longer" during inference. While this has worked wonders for math (e.g., OpenAI o1), agentic coding presents a unique nightmare. Unlike a math proof, an agent's attempt to fix a bug involves hundreds of steps, terminal outputs, and file edits.
A recent paper from researchers at Meta, CMU, and others argues that the bottleneck isn't just "more compute"—it's how we represent the agent's messy history.
The Problem: The "Long-Horizon" Noise
In standard Best-of-N sampling, we pick the best answer from candidates. But in coding, each "answer" is an entire trajectory. If an agent tries to solve a bug 16 times, comparing 16 different 50-step logs is cognitively overwhelming for even the best LLMs. The signal (the fix) is buried under the noise (repeated ls commands and error logs).
The Solution: Structured Summaries
The authors propose that agents should communicate with themselves via Structured Summaries. Every rollout is compressed into an artifact capturing:
- Key Hypotheses: What did the agent think was wrong?
- Decisions: Which files were edited?
- Failure Modes: Why did certain attempts fail?
This compression turns a multi-thousand-token log into a manageable "reusable representation."
Figure: The unified PDR + RTV pipeline. Summaries act as the bridge between parallel selection and sequential refinement.
Methodology: Two Axes of Scaling
1. Parallel Selection: Recursive Tournament Voting (RTV)
Instead of asking a model to rank all 16 attempts at once, RTV uses a "Tournament" format.
- Groups of 2 summaries are compared.
- The winner moves to the next round.
- Insight: Small-group comparisons (G=2) yield much higher accuracy than flat rankings because the model can focus on the nuances of just two paths.
2. Sequential Reuse: Parallel-Distill-Refine (PDR)
Iteration 1 doesn't start from scratch. It is conditioned on summaries from Iteration 0. The agent sees what worked and what didn't in previous attempts, allowing it to bypass exploration (like reading the directory structure) and go straight to the surgical fix.
Figure: The RTV process. Pairwise voting aggregates signal while filtering out low-quality trajectories.
Critical Results: Better and Faster
The results across SWE-Bench Verified and Terminal-Bench v2.0 are impressive. Across the board, frontier models (Claude 4.5, Gemini 3.1) saw absolute gains of 5% to 16%.
| Model | Baseline (Iter 0) | RTV + PDR (Final) | Gain |
|---|---|---|---|
| Claude 4.5 Opus | 70.9% | 77.6% | +6.7 |
| Gemini 3.1 Pro | 72.3% | 76.6% | +4.3 |
Efficiency Gain: Interestingly, the "refined" rollouts (Iteration 1) were significantly shorter. Claude 4.5 Opus went from an average of 41 steps down to 14 steps. By learning from its previous summaries, the agent stopped wandering and started solving.
Figure: Performance across SWE-Bench and Terminal-Bench.
Senior Editor's Perspective: Why This Matters
This paper marks a shift in agent design. We have moved from Stateless Agents (one-shot prompts) to Stateful Agents (conditioning on their own history).
The real magic here is Recursive Tournament Voting. It acknowledges that LLMs are fallible judges. By breaking a large decision into binary choices (A vs B), we maximize the "Self-Certainty" of the model.
Limitations: The framework still relies on textual summaries. A truly persistent agent would likely need more than text—perhaps a "frozen" environment state (Docker snapshot) or a persistent knowledge graph of the codebase.
Conclusion
"Scaling" isn't just about throwing more H100s at the problem; it's about structuring the data produced during those extra seconds of thought. By treating trajectory representation as a first-class citizen, this research provides a blueprint for the next generation of autonomous developers.
