Source-linked AI summary

Contrastive Chain-of-Thought Prompting

Yew Ken Chia, Guizhen Chen, Luu Anh Tuan, Soujanya Poria, Lidong Bing

arXiv:2311.09277v1cs.CL

TL;DR

Chain-of-thought reasoning remains poorly understood, and conventional demonstrations do not show models what mistakes to avoid. This paper introduces contrastive CoT with valid and invalid demonstrations and automatic construction, reporting consistent improvements over conventional CoT across reasoning benchmarks.

  • Problem

    How language models learn effective reasoning from CoT demonstrations remains unclear, while mistakes in intermediate steps can affect answer accuracy and trustworthiness.

    Source: §1 · pp. 1–2
  • Method

    Contrastive CoT gives demonstrations with both correct and incorrect reasoning steps and automatically constructs contrastive examples from existing rationales.

    Source: §1 · p. 2, §3 · p. 5
  • Results

    Contrastive CoT consistently outperforms conventional CoT across arithmetic and factual reasoning benchmarks, including a 9.8-point improvement on GSM-8K with GPT-3.5-Turbo.

    Source: §1 · p. 2, §4.2 · p. 5
  • Takeaways & Limitations

    Automatically constructing contrastive demonstrations from existing rationales has the same annotation cost as conventional CoT, supporting its use as a general enhancement.

    Source: §4.2 · pp. 5–6

Abstract

from arXiv · show

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.

1 Introduction

The introduction highlights gaps in understanding how language models learn reasoning from CoT demonstrations and the risk of errors in intermediate steps. It proposes contrastive CoT, which combines valid and invalid demonstrations.

1 Introduction

  • Prior findings showed little performance difference between valid and invalid CoT demonstrations, leaving how models learn effective reasoning unclear.Errors in intermediate reasoning can affect final-answer accuracy and model trustworthiness.Source: §1 · pp. 1–2
  • Contrastive CoT provides both positive and negative reasoning demonstrations to guide step-by-step reasoning and help models avoid faults.The approach is inspired by learning from positive and negative examples.Source: §1 · p. 2
  • The authors propose automatically constructing contrastive demonstrations from existing valid reasoning chains and report improvements across multiple reasoning benchmarks.They describe the method as task-agnostic and compatible with self-consistency.Source: §1 · p. 2
  • GPT-3.5-Turbo gains 9.8 points on GSM-8K and 16.0 points on Bamboogle over conventional CoT.The paper also reports reduced errors in generated reasoning chains.Source: §1 · p. 2

2 Preliminary Study: Effect of Different Types of Contrastive Demonstrations

The preliminary study asks whether valid and invalid rationales together can improve chain-of-thought prompting, and finds gains across invalid-rationale categories.

2 Preliminary Study: Effect of Different Types of Contrastive Demonstrations

  • The study tests whether including both valid and invalid rationales in demonstrations can enhance chain-of-thought prompting.The question is motivated by prior findings that invalid demonstrations had little effect despite the apparent importance of sound reasoning.Source: §2 · p. 2

2.1 Components of Chain of Thought

  • CoT rationales contain bridging objects, such as numbers or entities, and language templates that guide their derivation and contextualization.Source: §2.1 · p. 2

2.2 What is Invalid Chain of Thought?

  • Invalid rationales are classified by coherence and relevance, with logical mistakes included as a further category; Figure 2 presents five main categories.Coherence concerns step ordering, while relevance concerns whether the rationale corresponds to question information.Source: §2.2 · pp. 2–3, Figure 2 · p. 3

2.3 Experimental Setup

  • The preliminary experiments use GPT-3.5-Turbo (0301), four-shot prompts, and GSM8K and Bamboogle, with demonstrations manually constructed by prior work.The two datasets represent arithmetic and factual reasoning, respectively.Source: §2.3 · p. 3

2.4 Preliminary Results

  • All tested invalid-rationale categories improve over conventional CoT, with incoherent-object demonstrations yielding the highest average performance on GSM8K and Bamboogle.The results are reported in the preliminary-results table.Source: §2.4 · pp. 3–4, §2.2 · p. 3, Table 1 · p. 4

3 Contrastive Chain of Thought

The paper proposes contrastive chain of thought to address uncertainty about how demonstrations teach reasoning and the limits of manually constructed invalid rationales. It combines valid and invalid reasoning demonstrations and automatically constructs contrastive examples.

3 Contrastive Chain of Thought

  • The approach responds to limited understanding of chain-of-thought learning, including prior findings that invalid demonstrations can yield performance similar to valid ones.The paper also notes that conventional chain of thought does not identify faults to avoid, which could contribute to error propagation.Source: §3 · pp. 4–5
  • The paper introduces automatic construction to address concerns that manually created invalid rationales may not generalize well to new tasks.Prior analysis found that providing both valid and invalid demonstrations improved reasoning performance.Source: §3 · p. 4
  • Contrastive chain of thought pairs correct and incorrect reasoning steps in demonstrations, while test-time prompts provide the question and demonstrations for the model to generate its own reasoning and answer.The demonstration format includes the question, reasoning steps, and answer for both the positive and negative examples.Source: §3 · p. 5
  • The method automatically constructs incorrect rationales by extracting object spans from correct rationales and randomly shuffling their positions to create incoherent bridges.The extracted spans can include numbers, equations, or persons.Source: §3 · p. 5

4 Experiments

The experiments evaluate arithmetic reasoning and factual question answering across seven datasets, using at most 500 test samples per dataset. Contrastive CoT consistently improves over conventional CoT, and self-consistency further enhances its performance.

4.1 Experimental Setup

  • The evaluation covered five arithmetic datasets and two factual-QA datasets, sampling up to 500 test examples per dataset or using all examples when fewer were available.The experiments focused on arithmetic reasoning and factual question answering.Source: §4.1 · p. 5

4.2 Main Results

  • Contrastive CoT consistently outperformed conventional CoT, with gains of more than 10 points on GSM-Hard, SVAMP, ASDIV, Bamboogle, and StrategyQA.The authors describe these results as evidence of the method’s general effectiveness.Source: §4.2 · pp. 5–6
  • Self-consistency further enhanced contrastive CoT, particularly on AQuA, where the standalone gain was 4.0% and self-consistency added 14.2%.The passage describes the 14.2% as an additional improvement.Source: §4.2 · p. 6

5 Related Work

Related work situates the paper within research on language-model reasoning, chain-of-thought prompting, and learning from negative examples. The authors frame contrastive chain of thought as a way to learn from both valid and invalid reasoning demonstrations.

Large Language Models; Chain of Thought

  • The discussion describes language models’ prompt-based generalization while noting that scaling alone has not ensured strong performance on challenging arithmetic and factual reasoning tasks.It also reviews chain-of-thought work on automatic demonstrations, zero-shot prompting, problem decomposition, and executable programs.Source: §5 · p. 6

Related Work

  • The paper positions contrastive chain-of-thought prompting as a response to limited understanding of its underlying mechanism and as a reason to rethink the process using valid and invalid demonstrations.The related-work discussion connects this proposal to earlier chain-of-thought research (Turpin et al., 2023; Feng et al., 2023).Source: §5 · p. 6

Learning from Negative Examples

  • Prior work on contrastive learning and reinforcement learning from human feedback also uses positive and negative examples, motivating the paper’s approach to reasoning demonstrations.The passage cites contrastive learning and RLHF (Ouyang et al., 2022; Christiano et al., 2017).Source: §5 · p. 6

6 Conclusions

The authors report that contrastive demonstrations improve language-model reasoning and introduce an automatic way to construct them from existing rationales; across several reasoning tasks, the method generally enhances chain-of-thought prompting.

  • Contrastive chain of thought is reported as a general enhancement of chain-of-thought prompting across several reasoning tasks.Source: §6 · p. 6
  • A preliminary study found that providing valid and invalid reasoning demonstrations contrastively greatly improves language-model reasoning.Source: §6 · p. 6
  • The method automatically constructs contrastive demonstrations from existing rationales to avoid manually annotating invalid rationales.Source: §6 · p. 6
Loading 2311.09277v1…