Scattered Forest Search (SFS) makes code generation smarter by exploring multiple solution paths simultaneously
It turns code generation into a treasure hunt with multiple search parties.
https://arxiv.org/abs/2411.05010
π― Original Problem:
Code generation using LLMs often gets stuck in local optima due to similar solutions being generated repeatedly, leading to inefficient exploration of the solution space.
-----
π Solution in this Paper:
β Introduces Scattered Forest Search (SFS) which frames code generation as a black-box optimization problem
β Uses Scattering to generate diverse solution directions by dynamically varying input prompts
β Implements Foresting to create multiple seed solutions and perform tree search from each one
β Employs Scouting to share feedback across search branches, enhancing exploration efficiency
β Utilizes Monte Carlo Tree Search (MCTS) with UCT formula to balance exploration and exploitation
-----
π‘ Key Insights:
β Traditional methods like tree search and line search produce highly similar solutions
β Diverse initialization seeds significantly improve exploration of solution space
β Knowledge sharing across search branches enhances solution quality
β Higher conductance in Markov chain theory explains why SFS escapes local optima better
-----
π Results:
β Achieves 67.1% pass@1 on HumanEval+ (8.6% improvement over SOTA)
β 87.2% pass@1 on HumanEval (4.3% improvement over SOTA)
β Halves iterations needed to find correct solutions
β Shows better scaling efficiency than tree search, line search and repeated sampling










