arXiv:2409.12452cs.CL2024-09ICLR被引 30

通过代码化规划提升大模型多步推理能力,无需特定数据集即可自动构建推理路径。

Unlocking Reasoning Potential in Large Langauge Models by Scaling Code-form Planning

  • 用伪代码形式生成结构化推理计划,提升逻辑清晰度与可执行性。
  • 在13个复杂推理任务上平均提升25.1%准确率,复杂任务效果更显著。
  • 可从海量文本中自动提取规划,适合需要强推理的通用场景。

尽管大型语言模型在传统自然语言处理任务上表现优异,其规划能力仍是解决复杂多步推理任务的关键瓶颈。现有方法主要依赖提示或任务特定微调,常面临鲁棒性差和跨任务泛化能力弱的问题。为此,我们提出CodePlan——一种可扩展框架,使大模型能生成并遵循‘代码形式的计划’(即伪代码),以结构化方式呈现高层次推理过程。借助代码的结构化与多功能性,CodePlan有效捕捉复杂推理任务中的丰富语义与控制流。更重要的是,它能从大规模、多样化的文本语料库中自动提取代码形式的计划,无需依赖人工标注的任务特定数据集,从而实现高效扩展,并在多种场景下提升大模型的推理能力。为训练CodePlan,我们构建了一个包含200万样本的大规模数据集,将代码形式计划与现有语料中的标准提示-响应对相结合。在训练与推理阶段计算开销极低,相比直接生成回答,平均在13个具有挑战性的多步推理基准上取得25.1%的相对性能提升,涵盖数学推理、符号推理、指令遵循、多跳问答与决策任务。进一步分析表明,CodePlan在更复杂的推理任务中表现提升更明显,且得益于其良好的泛化能力,展现出显著的数据效率。

原文摘要 · Abstract (English)

Despite the remarkable success of large language models (LLMs) on traditional natural language processing tasks, their planning ability remains a critical bottleneck in tackling complex multi-step reasoning tasks. Existing approaches mainly rely on prompting or task-specific fine-tuning, often suffering from poor robustness and cross-task generalization. To address the limitation, we introduce CodePlan, a scalable framework that empowers LLMs to generate and follow \textit{code-form plans} -- pseudocode that outlines high-level, structured reasoning processes. By leveraging the structured and versatile nature of code, CodePlan effectively captures the rich semantics and control flows inherent to sophisticated reasoning tasks. Importantly, CodePlan allows automatic extraction of code-form plans from massive, wide-ranging text corpora without the need for curated, task-specific datasets. This enables it to scale up efficiently and improve LLM's reasoning capabilities across diverse scenarios. To train CodePlan, we construct a large-scale dataset of 2M examples that integrate code-form plans with standard prompt-response pairs from existing corpora. With minimal computation overhead during both training and inference, CodePlan achieves a 25.1\% relative improvement compared with directly generating responses, averaged across 13 challenging multi-step reasoning benchmarks, spanning mathematical reasoning, symbolic reasoning, instruction-following, multi-hop QA, and decision-making tasks. Further analysis reveals CodePlan's increasing performance gains on more complex reasoning tasks, as well as significant data efficiency thanks to its generalization ability.

大模型推理代码规划多步推理可扩展性

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。