Few-shot prompting is a surprisingly powerful way to use Large Language Models (LLMs) to solve various tasks. However, this approach struggles as the task complexity increases or when the individual reasoning steps of the task themselves are hard to learn, especially when embedded in more complex tasks. To address this, we propose Decomposed Prompting, a new approach to solve complex tasks by decomposing them (via prompting) into simpler sub-tasks that can be delegated to a library of prompting-based LLMs dedicated to these sub-tasks. This modular structure allows each prompt to be optimized for its specific sub-task, further decomposed if necessary, and even easily replaced with more effective prompts, trained models, or symbolic functions if desired. We show that the flexibility and modularity of Decomposed Prompting allows it to outperform prior work on few-shot prompting using GPT3. On symbolic reasoning tasks, we can further decompose sub-tasks that are hard for LLMs into even simpler solvable sub-tasks. When the complexity comes from the input length, we can recursively decompose the task into the same task but with smaller inputs. We also evaluate our approach on textual multi-step reasoning tasks: on long-context multi-hop QA task, we can more effectively teach the sub-tasks via our separate sub-tasks prompts; and on open-domain multi-hop QA, we can incorporate a symbolic information retrieval within our decomposition framework, leading to improved performance on both tasks. Datasets, Code and Prompts available at https://github.com/allenai/DecomP.
翻译:少样本提示是一种利用大型语言模型解决各类任务的惊人有效方法。然而,随着任务复杂度增加或任务中单个推理步骤本身难以学习(尤其是在嵌入更复杂任务时),该方法面临挑战。为此,我们提出分解式提示,这是一种通过将复杂任务分解(通过提示)为更简单的子任务来解决复杂任务的新方法,这些子任务可委托给专门针对这些子任务的基于提示的LLM库。这种模块化结构允许每个提示针对其特定子任务进行优化,必要时可进一步分解,甚至可轻松替换为更有效的提示、训练模型或符号函数(如需)。我们证明,分解式提示的灵活性和模块化性使其在基于GPT3的少样本提示中优于先前工作。在符号推理任务中,我们可进一步将LLM难以处理的子任务分解为更简单、可解决的子任务。当复杂度源于输入长度时,我们可将任务递归分解为相同但输入更小的任务。我们还评估了该方法在文本多步推理任务上的表现:在长上下文多跳问答任务中,我们可通过独立的子任务提示更有效地教授子任务;在开放域多跳问答中,我们可在分解框架中融入符号信息检索,从而在两项任务上均取得性能提升。数据集、代码和提示见https://github.com/allenai/DecomP。