Abstract
Rapidly increasing model scales coupled with steering methods such as chain-of-thought prompting have led to drastic improvements in language model reasoning. At the same time, models struggle with compositional generalization and are far from human performance on many reasoning-based benchmarks. Leveraging the success of chain-of-thought prompting, and also taking inspiration from context-aware decoding (CAD), we explore input-based contrasting methods to further encourage the type of reasoning induced by chain-of-thought prompting. While work remains to stabilize these results across datasets and models, the improvements we find warrant further investigation into input-based steering methods for context-aware reasoning.
Introduction
While Large Language Models (LLMs) have shown remarkable "emergent" reasoning abilities through Chain-of-Thought (CoT) prompting, they are far from perfect. They often struggle with compositional generalization and can be "lazy," skipping crucial logical steps or falling back on pre-trained biases rather than the provided context.
Existing techniques like Context-Aware Decoding (CAD) help models prioritize provided information over internal weights, but they haven't been fully synthesized with the step-by-step nature of CoT. This research introduces Contrastive Chain-of-Thought (CCoT), a decoding strategy that enhances LLM reasoning by contrasting the output probabilities of a full CoT prompt against "amateur" prompts that lack context or reasoning steps. By mathematically upweighting the reasoning-rich path, the authors achieve notable performance gains in common-sense and mathematical multiple-choice tasks.
Methodology: Logit Contrast
The core of this research is Logit Contrast. Instead of simply sampling the most likely next token from a standard CoT prompt, the authors adjust the probability distribution (the logits) at each step.
The Contrastive Formula
A new distribution $y_t$ is defined based on an "Expert" prompt ($c$) and an "Amateur" prompt ($amt$): $$y_t \propto \frac{p_\theta(y_t | c, x, y_{<t})^{\alpha+1}}{p_\theta(y_t | amt, x, y_{<t})^\alpha}$$ Here, $\alpha$ is a "contrastive strength" hyperparameter. By increasing $\alpha$, the model penalizes tokens that are likely in the amateur (low-context) setting and rewards tokens that are uniquely likely in the expert (high-context) setting.
Prompting Strategies
The authors experimented with three types of amateur prompts to see which provided the best contrast against the Expert prompt.
The "Amateurs" included:
- Amateur 1: Minimal context (just a bare "A:" prompt).
- Amateur 2: Provides 8-shot CoT examples but omits the questions, forcing the model to rely on the reasoning chain.
- Amateur 3: Provides 8-shot questions and answers but removes the intermediate reasoning steps (non-CoT).
Experimental Results
The method was evaluated on three standard reasoning benchmarks: GSM8K (math), AQuA (algebra), and CommonSenseQA. The models tested included Phi-1.5 (1.3B parameters) and Mistral 7B.
Key Insights
- Reasoning as a "Delta": Reasoning isn't just a static prompt; it's a direction. By contrasting the expert and amateur paths, the model is effectively told: "Don't just give me an answer; give me the answer that requires this specific logic."
- Amateur 2 is the MVP: Interestingly, Amateur 2 (CoT answers without questions) was highly effective. This suggests that forcing the model to distinguish between "reasoning that fits the context" and "generic reasoning" significantly improves faithfulness to the specific query.
- Performance Boosts: On AQuA, Phi-1.5’s accuracy improved from a baseline of 19.3% to 25.6% using CCoT. On CommonSenseQA, Mistral 7B saw an improvement from 47.1% to 52.0%.
Limitations and Future Work
While logit contrast is cheaper than fine-tuning, it still requires running two forward passes at every decoding step, doubling the inference cost. Furthermore, the optimal value for $\alpha$ is not universal and varies by task. The authors also noted that potential test-set leakage in base models for datasets like GSM8K likely skewed results, as models may have memorized answers rather than reasoning through them. Future work will investigate adaptive $\alpha$ selection and testing on larger, non-instruction-tuned models.
Summary updated