[Paper Review] SWE-Replay: Efficient Test-Time Scaling for Software Engineering Agents
SWE-Replay reuses archived trajectories to enable efficient test-time scaling for modern SWE agents, reducing sampling costs while maintaining or improving solution quality across multiple benchmarks and backends.
Test-time scaling has been widely adopted to enhance the capabilities of Large Language Model (LLM) agents in software engineering (SWE) tasks. However, the standard approach of repeatedly sampling trajectories from scratch is computationally expensive. While recent methods have attempted to mitigate costs using specialized value agents, they can suffer from model miscalibration and fail to generalize to modern agents that synthesize custom bash scripts as tools. In this paper, we introduce SWE-Replay, the first efficient and generalizable test-time scaling technique for modern agents without reliance on potentially noisy value estimates. SWE-Replay optimizes the scaling process by recycling trajectories from prior trials, dynamically choosing to either explore from scratch or exploit archived experience by branching at critical intermediate steps. This selection of intermediate steps is driven by the potential and reasoning significance of repository exploration, rather than external LLM-based quality estimates. Our evaluation shows that, on SWE-Bench Verified, SWE-Replay consistently outperforms naive scaling, reducing costs by up to 17.4% while maintaining or even improving performance by up to 3.8%. Further evaluation on SWE-Bench Pro and Multilingual validates the generalizability of SWE-Replay, establishing it as a robust foundation for efficient test-time scaling of software engineering agents.
Motivation & Objective
- Motivate the need for efficient test-time scaling in modern SWE agents and repositories.
- Introduce SWE-Replay as a generalizable trajectory-reuse method that does not rely on LLM-based quality estimates.
- Demonstrate cost and performance gains across SWE-Bench Verified, Pro, and Multilingual.
- Analyze the components of SWE-Replay (selection, grouping, filtering) and their contributions to performance.
- Provide empirical and theoretical intuition on why replay-based exploration improves efficiency.
Proposed method
- Maintain an archive of sampled trajectories and iteratively decide to explore from scratch or exploit archived trajectories by branching at a critical intermediate step.
- Represent steps by abstract repository states (set of files explored before the step) and sample states with a rarity-based softmax to encourage exploration of less-visited areas.
- Prioritize reasoning-intensive steps using the number of reasoning paragraphs as a proxy for reasoning intensity to guide branching.
- Restore the environment state before a selected step by applying stored diffs when possible, or replaying actions if needed, to minimize overhead.
- Branch at a selected critical step by replacing it with a newly sampled step and continue exploration to form a new trajectory added to the archive.
- Compare SWE-Replay against naive scaling and against an LLM-as-a-Judge baseline to assess efficiency and performance.
- Provide an ablation study to validate the roles of trajectory filtering, state abstraction, and reasoning-based step selection.
Experimental results
Research questions
- RQ1Can SWE-Replay consistently reduce trajectory sampling costs compared with naive scaling across multiple SWE benchmarks and backends?
- RQ2Does SWE-Replay generalize to different agent scaffolds and languages (e.g., SWE-Bench Verified, Pro, Multilingual)?
- RQ3What is the impact of each component (trajectory filtering, state abstraction, reasoning-based step selection) on performance and efficiency?
- RQ4How does the diversity of explored repository files change under SWE-Replay compared with naive scaling?
Key findings
- SWE-Replay reduces the cost of naive test-time scaling by up to 17.4% on SWE-Bench Verified while maintaining or improving performance by up to 3.8%.
- On SWE-Bench Pro and Multilingual, SWE-Replay achieves up to 22.6% performance gain with up to 9.0% cost reduction, demonstrating generalizability to diverse SWE problems.
- SWE-Replay shifts exploration toward long-tail repository files, increasing diversity of explored files compared with naive scaling.
- A theoretical intuition shows that, under reasonable assumptions, SWE-Replay’s replay strategy achieves at least as good a success probability as random selection, justifying its efficiency gains.
- Ablation studies show that removing components (trajectory filtering, state grouping, or reasoning-based step selection) degrades both performance and efficiency, confirming the necessity of the full pipeline.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.