S*: Test Time Scaling for Code Generation

Dacheng Li, Shiyi Cao, Chengkun Cao, Xiuyu Li, Shangyin Tan +4 more
2/20/2025
133 citations
cs.LGcs.AI

Official code: NovaSky-AI/SkyThought (3,401 stars, Python, Apache-2.0, last commit 2025-07-12).

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.

Show full abstract

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 with S* outperforms o1-preview by 3.7% on LiveCodeBench; (3) S* further boosts state-of-the-art reasoning models - DeepSeek-R1-Distill-Qwen-32B with S* achieves 85.7% on LiveCodeBench, approaching o1 (high) at 88.5%. Code will be available under https://github.com/NovaSky-AI/SkyThought.

View on arXivView PDF

Code Implementations(1)

Apache-2.0

Sky-T1: Train your own O1 preview model within $450

3,401347Python, ShellJan 9, 20251 years agoApache-2.0

Similar Papers

Cite this paper

@article{li2025test,
  title  = {S*: Test Time Scaling for Code Generation},
  author = {Dacheng Li and Shiyi Cao and Chengkun Cao and Xiuyu Li and Shangyin Tan and Kurt Keutzer and Jiarong Xing and Joseph E. Gonzalez and Ion Stoica},
  year   = {2025},
  eprint = {2502.14382},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2502.14382v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2502.14382.svg)](https://codeofpaper.com/paper/2502.14382)

Discussion