大型语言模型中的自动推理链提示
摘要
Large language models (LLMs) can perform complex reasoning by generating intermediate reasoning steps. Providing these steps for prompting demonstrations is called chain-of-thought (CoT) prompting. CoT prompting has two major paradigms. One leverages a simple prompt like “Let’s think step by step” to facilitate step-by-step thinking before answering a question. The other uses a few manual demonstrations one by one, each composed of a question and a reasoning chain that leads to an answer. The superior performance of the second paradigm hinges on the hand-crafting of task-specific demonstrations one by one. We show that such manual efforts may be eliminated by leveraging LLMs with the “Let’s think step by step” prompt to generate reasoning chains for demonstrations one by one, i.e., let’s think not just step by step, but also one by one. However, these generated chains often come with mistakes. To mitigate the effect of such mistakes, we find that diversity matters for automatically constructing demonstrations. We propose an automatic CoT prompting method: Auto-CoT. It samples questions with diversity and generates reasoning chains to construct demonstrations.On ten public benchmark reasoning tasks with GPT-3, Auto-CoT consistently matches or exceeds the performance of the CoT paradigm that requires manual designs of demonstrations. Code is available at https://github.com/amazon-research/auto-cot.
大型语言模型(LLMs)可以通过生成中间推理步骤来执行复杂的推理任务。提供这些步骤作为提示示范被称为推理链(Chain-of-Thought,CoT)提示。CoT提示有两种主要的方式。其一使用简单的提示语,如“让我们一步一步思考”,在回答问题之前帮助模型进行逐步思考。另一种方式是通过手工逐个提供示范,每个示范都包含一个问题和一个推理链,推理链引导模型得出答案。第二种方法的优越性在于需要逐个手工设计任务特定的示范。我们表明,这种手工设计的工作可以通过利用带有“让我们一步一步思考”提示的大型语言模型来自动生成推理链,从而消除手动设计的需要,即不仅仅让模型一步步思考,而是逐个生成推理链。然而,这些生成的推理链往往包含错误。为了减少这些错误的影响,我们发现多样性在自动构建示范时非常重要。我们提出