mlsanityData to 7 Oct 2026

Scattered Forest Search: Smarter Code Space Exploration with LLMs

arXiv 2411.05010 ↗First posted 22 Oct 2024cs.SE cs.AI cs.LGcited by 10

On the map: LLM reasoning → Reasoning for agents, planning and code

Abstract (arXiv)

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.

Key facts. Cited by 10 papers in the map (data through 7 Oct 2026). Placed in Reasoning for agents, planning and code, one of 17 directions in LLM reasoning. Builds on 53 of its 63 references that are in the map. First posted on arXiv 22 Oct 2024.

Builds on

53 of 63 references.

Closest ancestors · 5

Same direction, newest first

  1. 2024MapCoder: Multi-Agent Code Generation for Competitive Problem Solving18 May
  2. 2023Language Agent Tree Search Unifies Reasoning Acting and Planning in Language Models6 Oct
  3. 2023Reasoning with Language Model is Planning with World Model24 May
  4. 2023Teaching Large Language Models to Self-Debug11 Apr
  5. 2022Competition-Level Code Generation with AlphaCode8 Feb

Other references · 48

  1. 2022Training language models to follow instructions with human feedbackcited by 15,712
  2. 2022Chain-of-Thought Prompting Elicits Reasoning in Large Language Modelscited by 12,302
  3. 2021Training Verifiers to Solve Math Word Problemscited by 9,743
  4. 2022ReAct: Synergizing Reasoning and Acting in Language Modelscited by 8,355
  5. 2021Evaluating Large Language Models Trained on Codecited by 8,053
  6. 2023Direct Preference Optimization: Your Language Model is Secretly a Reward Modelcited by 7,916
  7. 2023Reflexion: Language Agents with Verbal Reinforcement Learningcited by 4,064
  8. 2023Let's Verify Step by Stepcited by 3,598
  9. 2021Program Synthesis with Large Language Modelscited by 3,509
  10. 2023Self-Refine: Iterative Refinement with Self-Feedbackcited by 3,317
  11. 2023Tree of Thoughts: Deliberate Problem Solving with Large Language Modelscited by 3,155
  12. 2022Constitutional AI: Harmlessness from AI Feedbackcited by 2,950
36 more
  1. 2023Code Llama: Open Foundation Models for Codecited by 2,105
  2. 2024Scaling LLM Test-Time Compute Optimally can be More Effective than Scaling Model Parameterscited by 1,928
  3. 2023MetaGPT: Meta Programming for A Multi-Agent Collaborative Frameworkcited by 1,761
  4. 2023Is Your Code Generated by ChatGPT Really Correct? Rigorous Evaluation of Large Language Models for Code Generationcited by 1,332
  5. 2020CodeBERT: A Pre-Trained Model for Programming and Natural Languagescited by 1,286
  6. 2024DeepSeek-Coder: When the Large Language Model Meets Programming -- The Rise of Code Intelligencecited by 1,154
  7. 2024Large Language Monkeys: Scaling Inference Compute with Repeated Samplingcited by 946
  8. 2021Measuring Coding Challenge Competence With APPScited by 879
  9. 2023Graph of Thoughts: Solving Elaborate Problems with Large Language Modelscited by 873
  10. 2022Solving math word problems with process- and outcome-based feedbackcited by 871
  11. 2023Large Language Models as Optimizerscited by 830
  12. 2017Mastering Chess and Shogi by Self-Play with a General Reinforcement Learning Algorithmcited by 723
  13. 2022CodeT: Code Generation with Generated Testscited by 369
  14. 2023Alphazero-like Tree-Search can Guide Large Language Model Decoding and Trainingcited by 291
  15. 2024Inference Scaling Laws: An Empirical Analysis of Compute-Optimal Inference for Problem-Solving with Language Modelscited by 282
  16. 2024CodeAgent: Enhancing Code Generation with Tool-Integrated Agent Systems for Real-World Repo-level Coding Challengescited by 278
  17. 2024TextGrad: Automatic "Differentiation" via Textcited by 250
  18. 2023Is Self-Repair a Silver Bullet for Code Generation?cited by 191
  19. 2023Planning with Large Language Models for Code Generationcited by 179
  20. 2024AlphaMath Almost Zero: Process Supervision without Processcited by 160
  21. 2023Beyond Chinchilla-Optimal: Accounting for Inference in Language Model Scaling Lawscited by 155
  22. 2024Stream of Search (SoS): Learning to Search in Languagecited by 141
  23. 2023CodePlan: Repository-level Coding using LLMs and Planningcited by 139
  24. 2024MAGIS: LLM-Based Multi-Agent Framework for GitHub Issue Resolutioncited by 132
  25. 2024Toward Self-Improvement of LLMs via Imagination, Searching, and Criticizingcited by 123
  26. 2023Large Language Models as Evolutionary Optimizerscited by 122
  27. 2023Self-planning Code Generation with Large Language Modelscited by 121
  28. 2024Planning In Natural Language Improves LLM Search For Code Generationcited by 79
  29. 2023Using Large Language Models for Hyperparameter Optimizationcited by 71
  30. 2023CodeChain: Towards Modular Code Generation Through Chain of Self-revisions with Representative Sub-modulescited by 58
  31. 2024Large Language Models As Evolution Strategiescited by 57
  32. 2024Code Repair with LLMs gives an Exploration-Exploitation Tradeoffcited by 50
  33. 2024When is Tree Search Useful for LLM Planning? It Depends on the Discriminatorcited by 46
  34. 2023ALGO: Synthesizing Algorithmic Programs with LLM-Generated Oracle Verifierscited by 41
  35. 2023Language Models as Black-Box Optimizers for Vision-Language Modelscited by 36
  36. 2023LLM-Assisted Code Cleaning For Training Accurate Code Generatorscited by 27

Built on by

Cited by year (2026 to 7 Oct)

Citing papers per year: 2024: 1; 2025: 7; 2026: 2.

10 papers.

Similar, not cited

Close in wording, no citation either way

  1. 2026GraphAHA: Graph-Based Adaptive Search with Heterogeneous Actions for Test-Time Code Generation
  2. 2025Let's Revise Step-by-Step: A Unified Local Search Framework for Code Generation with LLMs
  3. 2024Thinking Before Running! Efficient Code Generation with Thorough Exploration and Optimal Refinement
  4. 2026Simple Baselines are Competitive with Code Evolution
  5. 2024Seed-CTS: Unleashing the Power of Tree Search for Superior Performance in Competitive Coding Tasks
  6. 2026Idea Search: Guiding Tree Search with Ideas to Explore Diverse Scientific Methods
  7. 2024Search-Based LLMs for Code Optimization
  8. 2026Code Generation by Differential Test Time Scaling