Skip to main content
QUICK REVIEW

[Paper Review] Contrastive Chain-of-Thought Prompting

Yew Ken Chia, Guizhen Chen|arXiv (Cornell University)|Nov 15, 2023
Topic ModelingComputer Science5 citations
TL;DR

This paper proposes contrastive chain-of-thought (CoT) prompting, a method that enhances large language model reasoning by providing both valid and invalid reasoning demonstrations. By automatically generating contrastive rationales from existing correct chains, it improves reasoning accuracy and reduces errors, achieving 9.8 and 16.0 absolute gains on GSM-8K and Bamboogle Press benchmarks using GPT-3.5-Turbo.

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.

Motivation & Objective

  • To investigate whether invalid reasoning demonstrations can enhance language model reasoning, challenging the assumption that only valid chains are beneficial.
  • To address the lack of understanding in how chain-of-thought prompting truly works, especially given that invalid demonstrations often yield similar performance to valid ones.
  • To reduce reasoning errors by explicitly teaching models what not to do, improving robustness and trustworthiness.
  • To develop an automatic method for generating contrastive demonstrations without additional annotation cost, enabling generalization across tasks.
  • To position contrastive CoT as a general-purpose enhancement of conventional chain-of-thought prompting, compatible with existing decoding strategies like self-consistency.

Proposed method

  • The method introduces contrastive chain-of-thought prompting, which provides both correct and incorrect reasoning demonstrations in the few-shot prompt context.
  • It automatically generates invalid reasoning chains by perturbing existing valid rationales through logical or factual inconsistencies, such as incorrect arithmetic or flawed reasoning steps.
  • The perturbation strategy is designed to preserve task relevance while introducing plausible but incorrect reasoning paths, enabling models to learn from counterexamples.
  • The approach is task-agnostic and compatible with existing CoT decoding strategies, such as self-consistency, which further amplifies performance gains.
  • The method leverages the model’s ability to distinguish between correct and incorrect reasoning paths, similar to contrastive learning, to improve reasoning generalization.
  • The construction of contrastive demonstrations requires no new annotations, as they are derived from existing correct rationales, minimizing cost.
Figure 1: Example of contrastive chain-of-thought which leverages both positive and negative demonstrations to enhance language model reasoning.
Figure 1: Example of contrastive chain-of-thought which leverages both positive and negative demonstrations to enhance language model reasoning.

Experimental results

Research questions

  • RQ1Can invalid reasoning demonstrations improve language model reasoning performance, despite prior findings showing minimal impact of invalid chains?
  • RQ2What types of reasoning errors are most effective to include as negative examples in contrastive prompting?
  • RQ3Can contrastive demonstrations be automatically generated from existing correct rationales without manual annotation?
  • RQ4Does contrastive CoT generalize across diverse reasoning tasks and improve robustness against common reasoning errors?
  • RQ5How does contrastive CoT interact with existing decoding strategies like self-consistency, and does it amplify their benefits?

Key findings

  • Contrastive chain-of-thought achieves a 9.8-point absolute improvement on the GSM-8K benchmark and a 16.0-point improvement on the Bamboogle Press benchmark when using GPT-3.5-Turbo.
  • The method significantly reduces the number of reasoning errors in generated chains, as validated through manual analysis of model outputs.
  • When combined with self-consistency, contrastive CoT yields an additional 14.2% performance gain on the AQuA dataset, demonstrating synergistic benefits.
  • The automatic generation of contrastive demonstrations preserves the same annotation cost as conventional CoT, making it scalable and practical.
  • The approach outperforms conventional CoT across multiple reasoning benchmarks, confirming its effectiveness as a general enhancement.
  • The results suggest that learning from both positive and negative examples is crucial for improving reasoning robustness and model trustworthiness.
Figure 2: Categorization of invalid chain-of-thought examples, following Wang et al. ( 2023 ) .
Figure 2: Categorization of invalid chain-of-thought examples, following Wang et al. ( 2023 ) .

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.