Contrastive Chain-of-Thought Prompting
Yew Ken Chia 1, Guizhen Chen 1, 2 Luu Anh Tuan2 Soujanya Poria Lidong Bing 1 1DAMO Academy, Alibaba Group, Singapore Singapore University of Technology and Design 2Nanyang Technological University, Singapore {yewken_chia, {guizhen001, {yewken.chia, guizhen.chen, Equal contribution. Yew Ken and Guizhen are students under the Joint PhD Program between Alibaba and their corresponding university. Corresponding author.
Abstract
Despite the success of chain of thought in enhancing language model reasoning, the underlying process remains less well understood. Although logically sound reasoning appears inherently crucial for chain of thought, prior studies surprisingly reveal minimal impact when using invalid demonstrations instead. Furthermore, the conventional chain of thought does not inform language models on what mistakes to avoid, which potentially leads to more errors. Hence, inspired by how humans can learn from both positive and negative examples, we propose contrastive chain of thought to enhance language model reasoning. Compared to the conventional chain of thought, our approach provides both valid and invalid reasoning demonstrations, to guide the model to reason step-by-step while reducing reasoning mistakes. To improve generalization, we introduce an automatic method to construct contrastive demonstrations. Our experiments on reasoning benchmarks demonstrate that contrastive chain of thought can serve as a general enhancement of chain-of-thought prompting.111Our code implementation will be released at https://github.com/DAMO-NLP-SG/contrastive-cot
中文速览
大型语言模型在推理任务上虽借助"思维链"(chain-of-thought, CoT)提示取得了显著进步,但仅展示正确推理步骤的传统做法无法告知模型应当避免哪些错误,而且研究发现即便使用逻辑错误的示例,效果也与正确示例相差无几,说明我们对模型如何从思维链中学习推理仍缺乏深入理解。受人类同时从正反案例中学习的方式启发,本文提出"对比思维链"(contrastive chain-of-thought)提示方法,在每个示例中同时提供正确与错误的推理链,让模型在学习正确推理步骤的同时明确知道哪些错误需要规避。为降低人工标注成本并提升泛化能力,作者设计了一种自动构造错误示范的方法——利用实体识别模型提取推理链中的关键对象(如数字、人名),随机打乱其位置以生成逻辑不连贯的负样本。在算术推理和事实问答多个基准测试上的实验表明,对比思维链相比传统思维链平均提升显著,在GSM-8K和Bamboogle上分别提高了9.8和16.0个百分点,与自洽解码(self-consistency)结合后收益进一步放大,证明该方法可作为思维链提示的通用增强手段。
原文 arXiv:2311.09277;中英对照 + 大白话阅读 https://aha.fim.ai/paper/2311.09277v1