NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Text and Patterns: For Effective Chain of Thought It Takes Two to Tango

Aman Madaan, Amir Yazdanbakhsh

TL;DR

Chain-of-Thought (CoT) prompting significantly boosts large language model performance, but why it works has been a mystery. This paper dissects CoT by treating prompts as having three components: symbols, patterns, and text. Through extensive counterfactual experiments, they reveal that the text is crucial for imbuing patterns with commonsense knowledge, guiding the model to the correct answer, rather than the patterns themselves dictating reasoning. This understanding leads to a more efficient CoT variant, CCoT, which prunes unnecessary tokens while maintaining performance.

What Problem Does This Paper Address?

Large language models (LLMs) have achieved remarkable success in few-shot learning, particularly with techniques like Chain-of-Thought (CoT) prompting. CoT involves augmenting prompts with intermediate reasoning steps, leading to significant performance gains on complex tasks. However, the underlying mechanisms behind CoT's effectiveness have remained largely unexplored. This paper aims to demystify CoT by systematically investigating the roles of its constituent components – symbols, patterns, and text – in driving model performance. Understanding these roles is crucial for developing more efficient and interpretable prompting strategies.

Methods

The authors employ a counterfactual prompting approach to systematically probe the influence of different prompt components on LLM performance. They break down a prompt into three key elements:

  • Symbols: The core entities or values within a prompt (e.g., numbers, names, dates).
  • Patterns: The structure of the prompt, including the composition of symbols and operators, or the overall format that guides task understanding.
  • Text: The surrounding language that provides context, meaning, and commonsense knowledge.

They then create counterfactual prompts where only one of these components is altered (e.g., replacing numbers with abstract symbols, removing patterns, or altering the grammatical style of the text). By observing the performance changes across various tasks and models, they infer the contribution of each component. Additionally, they use attention analysis to understand how LLMs process these different prompt components.

Datasets

The experiments were conducted on the following datasets:

  • GSM-8K: A dataset of math word problems designed for middle-school curricula.
  • DATE: A commonsense reasoning dataset focused on date understanding.
  • SPORTS: A commonsense reasoning dataset focused on sports-related knowledge.
  • SORTING: A symbolic reasoning task involving sorting lists of numbers.

Key Insights and Ideas

  • Text is the "conceptual glue": The paper argues that text is not merely descriptive but actively imbues patterns with commonsense knowledge and meaning. This is crucial for guiding the LLM towards the correct answer.
  • Patterns are "beacons," not "reasoning engines": Intermediate steps in CoT are not primarily for teaching the model how to reason, but rather for signaling what symbols to use and how to structure the output to form a factual answer. They act as a channel to "trick" the model into generating correct-looking sentences.
  • Symbiotic relationship between text and patterns: The success of CoT stems from a synergistic interplay where text extracts commonsense knowledge to inform patterns, and patterns enforce task understanding and direct text generation.
  • Factual patterns are less important than their presence: The exact correctness of patterns is often immaterial; their presence and structure are more critical for guiding the model.
  • Symbols are largely interchangeable: The specific values or types of symbols (e.g., numbers vs. abstract placeholders) have a surprisingly small impact on performance, as long as they are present.
  • CCoT: A more efficient CoT: Based on these findings, the authors propose CCoT (Concise Chain of Thought), which prunes prompts by removing less critical tokens while retaining the essential text and pattern components, leading to reduced token usage without sacrificing performance.

Key Results

  • Symbols: Replacing symbols with abstract placeholders or out-of-distribution symbols generally had little to no impact on model performance, except in specific cases like SPORTS where artificial names/activities closed the gap between DIRECT and CoT. Removing symbols entirely, however, significantly degraded performance.
  • Patterns: The absence of patterns catastrophically impacted performance, reducing it to levels similar to DIRECT prompting. However, the model was relatively robust to incorrect patterns, with performance often on par with vanilla CoT, except in SPORTS where wrong patterns led to significant performance drops.
  • Text: Modifying text, especially by using discrepant entities or random thoughts, significantly hampered performance. The performance drop was proportional to the extent of text alteration.
  • CCoT: The proposed CCoT variant achieved comparable or slightly higher task solve rates than standard CoT while reducing token usage by over 20% (1.39x reduction in input tokens and 1.58x in output tokens on average).

Limitations and Future Work

  • Limitations of Counterfactual Prompting: The authors acknowledge that counterfactual explanations can be misleading due to spurious correlations. Their study is limited to a subset of common tasks and datasets, and conclusions may not generalize to all reasoning tasks.
  • Future Work: The paper suggests further investigation into specialized attention heads and their role in understanding semantic parts of inputs. Analyzing attention patterns in detail is highlighted as an interesting future direction. They also propose exploring the impact of "noise" (futile or misleading information) in prompts on model performance.

Summary updated

BibTeX
@misc{madaan2022text,
  author = {Aman Madaan and Amir Yazdanbakhsh},
  title = {{Text and Patterns: For Effective Chain of Thought It Takes Two to Tango}},
  year = {2022},
  eprint = {2209.07686},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2209.07686},
}
Figure