Scaling Test-Time Compute for Agentic Coding
| Authors | Joongwon Kim et al. |
| Year | 2026 |
| HF Upvotes | 9 |
| arXiv | 2604.16529 |
| Download | |
| HF Page | View on Hugging Face |
Abstract
Test-time scaling has become a powerful way to improve large language models. However, existing methods are best suited to short, bounded outputs that can be directly compared, ranked or refined. Long-horizon coding agents violate this premise: each attempt produces an extended trajectory of actions, observations, errors, and partial progress taken by the agent. In this setting, the main challenge is no longer generating more attempts, but representing prior experience in a form that can be effectively selected from and reused. We propose a test-time scaling framework for agentic coding based on compact representations of rollout trajectories. Our framework converts each rollout into a structured summary that preserves its salient hypotheses, progress, and failure modes while discarding low-signal trace details. This representation enables two complementary forms of inference-time scaling. For parallel scaling, we introduce Recursive Tournament Voting (RTV), which recursively narrows a population of rollout summaries through small-group comparisons. For sequential scaling, we adapt Parallel-Distill-Refine (PDR) to the agentic setting by conditioning new rollouts on summaries distilled from prior attempts. Our method consistently improves the performance of frontier coding agents across SWE-Bench Verified and Terminal-Bench v2.0. For example, by using our method Claude-4.5-Opus improves from 70.9% to 77.6% on SWE-Bench Verified (mini-SWE-agent) and 46.9% to 59.1% on Terminal-Bench v2.0 (Terminus 1). Our results suggest that test-time scaling for long-horizon agents is fundamentally a problem of representation, selection, and reuse.
Engineering Breakdown
Plain English
This paper addresses a fundamental limitation in test-time scaling for AI agents that write code: while existing methods work well for short, isolated outputs, they break down when applied to long-horizon coding tasks where agents execute extended sequences of actions, observations, and error corrections. The authors propose a framework that compresses the full trajectory of each agent rollout (what it tried, what failed, what partially worked) into compact, structured summaries that preserve the most important information while discarding noise. This enables effective reuse and selection from prior attempts during test time, scaling up agent performance without the computational cost of naively generating more complete trajectories. The core insight is that representing prior experience efficiently becomes the bottleneck for agentic systems, not just generating more attempts.
Core Technical Contribution
The key innovation is a structured summarization technique that converts long agent trajectories into compact representations suitable for retrieval and reuse during test-time scaling. Rather than treating each rollout as a monolithic sequence (which makes comparison and ranking intractable for long outputs), the framework extracts salient hypotheses, progress markers, and failure modes into a format that can be efficiently indexed and selected during inference. This moves agentic test-time scaling from a "generate more and rank" paradigm to a "represent, retrieve, and recombine" paradigm. The approach specifically targets the mismatch between test-time scaling methods designed for bounded outputs and the inherently long-horizon, multi-step nature of coding agent behavior.
How It Works
The system takes as input a complete rollout trajectory from a coding agent, which includes the agent's action sequence, environmental observations, errors encountered, and intermediate progress states. The framework processes this trajectory through a summarization module that identifies and extracts key information: which hypotheses (code approaches) the agent explored, what progress was made toward the goal, and what failure modes or dead-ends occurred. These summaries are converted into a structured, compact representation (likely embedding-based or semantic tokens) that preserves distinguishing features while reducing size dramatically. During test-time scaling, instead of running fresh independent attempts, the system retrieves previously summarized trajectories from the experience pool, uses them to condition or guide new attempts, or directly recombines successful components. The framework likely includes a scoring or ranking mechanism to select which prior experiences are most relevant to the current problem, enabling intelligent reuse rather than exhaustive re-exploration.
Production Impact
For teams building coding agents in production, this approach directly addresses the exponential cost of test-time scaling on long-horizon tasks. Instead of expanding compute linearly with trajectory length, you can now scale efficiently by storing and retrieving compact summaries, reducing memory and compute overhead significantly. This would integrate into a production pipeline as a trajectory cache/indexing layer that sits between your agent executor and your inference scheduler—when a new problem arrives, you retrieve similar prior attempts and use them to accelerate or guide the current agent run. The practical benefit is solving harder coding tasks faster: agents can benefit from lessons learned in previous attempts without re-running full expensive rollouts. Trade-offs include the engineering complexity of building the summarization module (requires training or careful prompt engineering), storage for the summary database, and latency for retrieval operations, but these are likely far cheaper than re-running long agent trajectories.
Limitations and When Not to Use This
The paper does not address how to handle domain shift: summaries learned from one codebase or task distribution may not transfer well to different code domains or problem types, and the abstract doesn't discuss retraining or adaptation mechanisms. A critical assumption is that the summarization captures all task-relevant information; if important nuances are lost in compression, the agent may miss crucial prior insights. The approach also assumes you have sufficient prior rollout data to build meaningful summaries—for truly novel problems with no similar prior experience, the framework provides little benefit. Additionally, the paper (based on the abstract) doesn't discuss failure cases where reusing prior trajectory information could mislead the agent down the same wrong path, or how to detect and avoid such mode-locking behavior in practice.
Research Context
This work builds directly on the recent surge in test-time scaling research (chain-of-thought, majority voting, tree search, speculative decoding) but recognizes that these methods assume short, self-contained outputs. It extends test-time compute scaling into the agentic domain, joining recent work on tool-using and code-generating agents (e.g., work on LLM-based software engineering, AutoML agents). The framework likely benchmarks on coding-specific evaluation sets like HumanEval, MBPP, or real-world software engineering tasks. This opens a new research direction: how to efficiently represent and reuse long-horizon agent trajectories, which could extend to robotics, planning, and game-playing agents. The work suggests that the frontier of scaling isn't just more compute or more training data, but smarter representation of experience.
:::tip Subscribe Get weekly breakdowns of papers like this in AI Letters - the newsletter for engineers building production AI systems. :::
