S*: Test Time Scaling for Code Generation
Dacheng Li, Shiyi Cao, Chengkun Cao, Xiuyu Li, Shangyin Tan, Kurt, Keutzer, Jiarong Xing, Joseph E. Gonzalez, Ion Stoica

TL;DR
This paper introduces S*, a hybrid test-time scaling framework that significantly enhances code generation accuracy and coverage in large language models by combining sequential scaling with adaptive input generation and execution-grounded comparison.
Contribution
S* is the first hybrid test-time scaling method for code generation, combining parallel and sequential scaling with a novel adaptive selection mechanism to improve model performance.
Findings
S* improves performance across various models, enabling smaller models to outperform larger ones.
S* allows non-reasoning models to surpass reasoning models in code generation.
S* boosts state-of-the-art reasoning models, nearing top benchmark performance.
Abstract
Increasing test-time compute for LLMs shows promise across domains but remains underexplored in code generation, despite extensive study in math. In this paper, we propose S*, the first hybrid test-time scaling framework that substantially improves the coverage and selection accuracy of generated code. S* extends the existing parallel scaling paradigm with sequential scaling to push performance boundaries. It further leverages a novel selection mechanism that adaptively generates distinguishing inputs for pairwise comparison, combined with execution-grounded information to robustly identify correct solutions. We evaluate across 12 Large Language Models and Large Reasoning Model and show: (1) S* consistently improves performance across model families and sizes, enabling a 3B model to outperform GPT-4o-mini; (2) S* enables non-reasoning models to surpass reasoning models - GPT-4o-mini…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Code & Models
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsSoftware Testing and Debugging Techniques · Real-time simulation and control systems · Embedded Systems Design Techniques
