Skip to main content
QUICK REVIEW

[论文解读] Parsel: Algorithmic Reasoning with Language Models by Composing Decompositions

Eric Zelikman, Qian Huang|arXiv (Cornell University)|Dec 20, 2022
Topic Modeling被引用 14
一句话总结

Parsel 是一种框架,通过将复杂任务分解为分层的自然语言函数描述,再通过组合测试生成正确实现,从而增强大型语言模型(LLMs)在算法推理方面的能力。它在 HumanEval 上实现了 85% 的 pass@1 率,在 APPS 上的通过率比之前的方法高出 75% 以上,显著提升了 LLM 生成的程序和机器人计划的准确性,实现了模块化、基于测试的组合。

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/parsel

研究动机与目标

  • 解决 LLM 在生成复杂程序时面临的分层、多步骤推理挑战。
  • 使 LLM 能够将高层级的算法任务分解为模块化、可组合的函数描述。
  • 通过自动化测试和约束验证组合实现,提升程序的正确性和效率。
  • 通过支持结构化、分层推理(类似于人类编程),将 LLM 的能力扩展至直接生成之外。

提出的方法

  • Parsel 使用领域特定的中间语言,将算法设计表示为带有输入、输出和约束的自然语言函数描述。
  • 它将任务分解为强连通分量(SCCs),以管理复杂性,并在合成过程中避免组合爆炸。
  • 每个函数由 LLM 独立实现,然后通过约束求解器对输入输出约束进行验证。
  • 通过将依赖关系视为依赖图的一部分,并按拓扑顺序求解 SCC,框架支持递归和高阶函数。
  • 通过使用形式化语法提示,支持 GPT-4 等 LLM 进行零样本和少样本的 Parsel 生成。
  • 它集成了自动化测试生成,以验证实现,减少对手动编写测试用例的依赖。

实验结果

研究问题

  • RQ1LLM 是否能有效将复杂算法任务分解为模块化、可组合的函数描述?
  • RQ2基于测试的分层分解在程序合成基准测试中如何提升 LLM 的性能?
  • RQ3Parsel 相比直接生成,能在多大程度上降低 LLM 生成的机器人计划的失败率?
  • RQ4Parsel 是否能在不增加采样预算的情况下,在 HumanEval 和 APPS 等标准基准上实现最先进性能?
  • RQ5Parsel 的模块化、约束驱动方法在多大程度上缓解了自回归代码生成中常见的错误传播问题?

主要发现

  • Parsel 将 HumanEval 上的 pass@1 性能从 67% 提升至 85%,显著优于 GPT-4 和以往基于 LLM 的方法。
  • 在 APPS 基准上,Parsel 的通过率比 AlphaCode 和 Codex 等直接采样方法高出 75% 以上,即使采样预算更小。
  • 使用 Parsel 生成的 LLM 机器人计划,其准确率是直接由 LLM 生成的两倍以上。
  • 该框架使 GPT-4 能够通过描述格式实现零样本 Parsel 程序生成,从而在 HumanEval 和 APPS 上均获得显著性能提升。
  • Parsel 使用自动生成的测试提高了正确性,减少了对手动编写测试用例的依赖,增强了跨领域的鲁棒性。
  • 基于 SCC 的分解策略有效控制了组合爆炸,实现了复杂、分层程序的可扩展合成。

更好的研究,从现在开始

从阅读论文到最终审阅,大幅缩短您的研究时间。

无需绑定信用卡

本解读由 AI 生成,并经人工编辑审核。