SFS: Smarter Code Space Search improves LLM Inference Scaling

Publication Date: 4/28/2025

Event: The Thirteenth International Conference on Learning Representations (ICLR 2025)

Reference: pp. 1-37, 2025

Authors: Jonathan Light, Rensselaer Polytechnic Institute; Yue Wu, Princeton University; Yiyou Sun, UC Berkley, NEC Laboratories America, Inc.; Wenchao Yu, NEC Laboratories America, Inc.; Yanchi Liu, NEC Laboratories America, Inc.; Xujiang Zhao, NEC Laboratories America, Inc.; Haifeng Chen, NEC Laboratories America, Inc.; Wei Cheng, NEC Laboratories America, Inc.; Ziniu Hu, XAi

Abstract: We frame code generation as a black-box optimization problem within the code space and demonstrate how optimization-inspired techniques can enhance inference scaling. Based on this perspective, we propose SCATTERED FOREST SEARCH (SFS), a novel approach that improves solution diversity and better exploits feedback during evolutionary search. Our theoretical analysis illustrates how these methods help avoid local optima during optimization, leading to more efficient exploration. Extensive experiments on HumanEval, MBPP, APPS, CodeContests, and Leetcode reveal significant performance gains. For instance, our method achieves a pass@1 rate of 67.1% on HumanEval+ and 87.2% on HumanEval with GPT-3.5, marking improvements of 8.6% and 4.3% over the state-of-the-art, while also halving the iterations needed to find the correct solution. Furthermore, our approach scales more efficiently than existing search techniques, including tree search, line search, and repeated sampling.

Publication Link: https://openreview.net/forum?id=MCHuGOkExF