Parsel: Algorithmic Reasoning with Language Models by Composing Decompositions
Preprint
Abstract
Despite recent success in large language model (LLM) reasoning, LLMs struggle with hierarchical multi-step reasoning tasks like generating complex programs. For these tasks, humans often start with a high-level algorithmic design and implement each part gradually. We introduce Parsel, a framework enabling automatic implementation and validation of complex algorithms with code LLMs. With Parsel, we automatically decompose algorithmic tasks into hierarchical natural language function descriptions and then search over combinations of possible function implementations using tests. We show that Parsel can be used across domains requiring hierarchical reasoning, including program synthesis and robotic planning. We find that, using Parsel, LLMs solve more competition-level problems in the APPS dataset, resulting in pass rates over 75\% higher than prior results from directly sampling AlphaCode and Codex, while often using a smaller sample budget. Moreover, with automatically generated tests, we find that Parsel can improve the state-of-the-art pass@1 performance on HumanEval from 67\% to 85\%. We also find that LLM-generated robotic plans using Parsel are more than twice as likely to be considered accurate than directly generated plans. Lastly, we explore how Parsel addresses LLM limitations and discuss how Parsel may be useful for human programmers. We release our code at https://github.com/ezelikman/parselKeywords
All Related Versions
This publication has 14 references indexed in Scilit:
- Prompting Is Programming: A Query Language for Large Language ModelsProceedings of the ACM on Programming Languages, 2023
- ProgPrompt: Generating Situated Robot Task Plans using Large Language Models2023
- Conversing with Copilot: Exploring Prompt Engineering for Solving CS1 Problems Using Natural Language2023
- Top-Down Synthesis for Library LearningProceedings of the ACM on Programming Languages, 2023
- Successive Prompting for Decomposing Complex Questions2022
- Provable Limitations of Acquiring Meaning from Ungrounded Form: What Will Future Language Models Understand?Transactions of the Association for Computational Linguistics, 2021
- Unsupervised Commonsense Question Answering with Self-Talk2020
- Prolific.ac—A subject pool for online experimentsJournal of Behavioral and Experimental Finance, 2018
- An algorithm for reduction of operator strengthCommunications of the ACM, 1977
- Human problem solving: The state of the theory in 1970.American Psychologist, 1971