Planning In Natural Language Improves LLM Search For Code Generation

Fuente: arXiv
Saved in:
Bibliographic Details
Main Authors: Wang, Evan, Cassano, Federico, Wu, Catherine, Bai, Yunfeng, Song, Will, Nath, Vaskar, Han, Ziwen, Hendryx, Sean, Yue, Summer, Zhang, Hugh
Format: Preprint
Published: 2024
Subjects:
Online Access:
Tags: Add Tag
No Tags, Be the first to tag this record!
_version_ 1866910657045069824
author Wang, Evan
Cassano, Federico
Wu, Catherine
Bai, Yunfeng
Song, Will
Nath, Vaskar
Han, Ziwen
Hendryx, Sean
Yue, Summer
Zhang, Hugh
author_facet Wang, Evan
Cassano, Federico
Wu, Catherine
Bai, Yunfeng
Song, Will
Nath, Vaskar
Han, Ziwen
Hendryx, Sean
Yue, Summer
Zhang, Hugh
contents While scaling training compute has led to remarkable improvements in large language models (LLMs), scaling inference compute has not yet yielded analogous gains. We hypothesize that a core missing component is a lack of diverse LLM outputs, leading to inefficient search due to models repeatedly sampling highly similar, yet incorrect generations. We empirically demonstrate that this lack of diversity can be mitigated by searching over candidate plans for solving a problem in natural language. Based on this insight, we propose PlanSearch, a novel search algorithm which shows strong results across HumanEval+, MBPP+, and LiveCodeBench (a contamination-free benchmark for competitive coding). PlanSearch generates a diverse set of observations about the problem and then uses these observations to construct plans for solving the problem. By searching over plans in natural language rather than directly over code solutions, PlanSearch explores a significantly more diverse range of potential solutions compared to baseline search methods. Using PlanSearch on top of Claude 3.5 Sonnet achieves a state-of-the-art pass@200 of 77.0% on LiveCodeBench, outperforming both the best score achieved without search (pass@1 = 41.4%) and using standard repeated sampling (pass@200 = 60.6%). Finally, we show that, across all models, search algorithms, and benchmarks analyzed, we can accurately predict performance gains due to search as a direct function of the diversity over generated ideas. Code can be found at https://github.com/scaleapi/plansearch.
format Preprint
id arxiv_https___arxiv_org_abs_2409_03733
institution arXiv
publishDate 2024
record_format arxiv
spellingShingle Planning In Natural Language Improves LLM Search For Code Generation
Wang, Evan
Cassano, Federico
Wu, Catherine
Bai, Yunfeng
Song, Will
Nath, Vaskar
Han, Ziwen
Hendryx, Sean
Yue, Summer
Zhang, Hugh
Machine Learning
Artificial Intelligence
Computation and Language
While scaling training compute has led to remarkable improvements in large language models (LLMs), scaling inference compute has not yet yielded analogous gains. We hypothesize that a core missing component is a lack of diverse LLM outputs, leading to inefficient search due to models repeatedly sampling highly similar, yet incorrect generations. We empirically demonstrate that this lack of diversity can be mitigated by searching over candidate plans for solving a problem in natural language. Based on this insight, we propose PlanSearch, a novel search algorithm which shows strong results across HumanEval+, MBPP+, and LiveCodeBench (a contamination-free benchmark for competitive coding). PlanSearch generates a diverse set of observations about the problem and then uses these observations to construct plans for solving the problem. By searching over plans in natural language rather than directly over code solutions, PlanSearch explores a significantly more diverse range of potential solutions compared to baseline search methods. Using PlanSearch on top of Claude 3.5 Sonnet achieves a state-of-the-art pass@200 of 77.0% on LiveCodeBench, outperforming both the best score achieved without search (pass@1 = 41.4%) and using standard repeated sampling (pass@200 = 60.6%). Finally, we show that, across all models, search algorithms, and benchmarks analyzed, we can accurately predict performance gains due to search as a direct function of the diversity over generated ideas. Code can be found at https://github.com/scaleapi/plansearch.
title Planning In Natural Language Improves LLM Search For Code Generation
topic Machine Learning
Artificial Intelligence
Computation and Language
url https://arxiv.org/abs/2409.03733