使用语言模型进行认证推理
Certified Reasoning with Language Models
June 6, 2023
作者: Gabriel Poesia, Kanishk Gandhi, Eric Zelikman, Noah D. Goodman
cs.AI
摘要
语言模型在复杂任务中逐步推理时通常能够获得更高的准确性。然而,它们的推理可能不可靠、不一致或依赖不良的先验假设。为了解决这些问题,我们引入了一类针对语言模型的工具,称为“指南”,它们利用状态和增量约束来引导生成。模型可以调用指南来约束自身的生成,使其仅生成由工具给出的一组有效语句。反过来,模型的选择可以改变指南的状态。我们展示了一个用于逻辑推理的通用系统可以作为指南使用,我们称之为LogicGuide。对于自然语言中的推理问题,模型可以为LogicGuide形式化其假设,从而保证其推理步骤是可靠的。在PrOntoQA和ProofWriter推理数据集的实验中,LogicGuide显著改善了GPT-3、GPT-3.5 Turbo和LLaMA的性能(准确率提高达35%)。LogicGuide还大大减少了内容效应:即先前和当前假设的干扰,这是人类和语言模型都已经表现出受到影响的。最后,我们探讨了通过自身推理引导LLaMA 13B的启动过程,并发现LogicGuide至关重要:仅通过在经过认证的自我生成推理上进行训练,LLaMA可以自我改进,避免从自身幻觉中学习。
English
Language models often achieve higher accuracy when reasoning step-by-step in
complex tasks. However, their reasoning can be unsound, inconsistent, or rely
on undesirable prior assumptions. To tackle these issues, we introduce a class
of tools for language models called guides that use state and incremental
constraints to guide generation. A guide can be invoked by the model to
constrain its own generation to a set of valid statements given by the tool. In
turn, the model's choices can change the guide's state. We show how a general
system for logical reasoning can be used as a guide, which we call LogicGuide.
Given a reasoning problem in natural language, a model can formalize its
assumptions for LogicGuide and then guarantee that its reasoning steps are
sound. In experiments with the PrOntoQA and ProofWriter reasoning datasets,
LogicGuide significantly improves the performance of GPT-3, GPT-3.5 Turbo and
LLaMA (accuracy gains up to 35%). LogicGuide also drastically reduces content
effects: the interference of prior and current assumptions that both humans and
language models have been shown to suffer from. Finally, we explore
bootstrapping LLaMA 13B from its own reasoning and find that LogicGuide is
critical: by training only on certified self-generated reasoning, LLaMA can
self-improve, avoiding learning from its own hallucinations.