Skip to main content
QUICK REVIEW

[Paper Review] Contrastive Decoding Improves Reasoning in Large Language Models

Sean O’Brien|arXiv (Cornell University)|Sep 17, 2023
Natural Language Processing TechniquesComputer Science6 references5 citations
TL;DR

This paper demonstrates that Contrastive Decoding—a training-free, computationally lightweight method that maximizes the likelihood difference between a strong expert model and a weaker amateur model—significantly improves reasoning performance in large language models. It achieves state-of-the-art results on GSM8K and HellaSwag benchmarks, outperforming larger models like LLaMA 2 and GPT-3.5 without fine-tuning.

ABSTRACT

This record contains the camera-ready paper “LLM Inference in Normal Form: A TRoT-Based Unification.”We show that many inference-time methods for large language models (LLMs)—e.g., MBR/eMBR decoding, Conformal prediction gates, Verifier/Judge ensembles, Self-RAG, Chain/Tree/Graph-of-Thought, and Verifier-Sandwich (VS)—admit a single normal form derived from the Theory of Relativity of Theories (TRoT). Our formulation uses enriched category theory over the Lawvere cost quantale (tropical (min,+) semiring): left/right Kan extensions \Lan/\Ran\Lan/\Ran\Lan/\Ran, residuation (elementwise residuals), masking and nuclei (1-Lipschitz projectors). In this normal form, generation/lifts (K3), safety consolidation (K4), and auditing (K6–K10 RAVE) become GraphBLAS-style sparse operators with explicit stability and auditability contracts. Provable guarantees Implementation equivalence (normal form): common decoding “tricks” map to \Lan\Lan\Lan → Obs → \Ran\Ran\Ran with the same outputs under masking/nucleus conditions. Stability: \Lan\Lan\Lan and the residual are 1-Lipschitz in ℓ∞\ell_\inftyℓ∞. Approximation bounds: geometric truncation error q\*k+11−q\*\frac{q_\*^{k+1}}{1-q_\*}1−q\*q\*k+1; soft-min (log-sum-exp) gap k log⁡dmax⁡λcost\frac{k\,\log d_{\max}}{\lambda_{ ext{cost}}}λcostklogdmax (with join ≡ numeric infimum in Cost polarity). Auditing: a deterministic spending schedule ∑tαt≤αglobal\sum_t\alpha_t\le\alpha_{ ext{global}}∑tαt≤αglobal with test-(super)martingale e-processes gives time-uniform FWER control; LR/mixture-LR constructions yield valid e-values. Implementation blueprint (GPU/GraphBLAS-ready) \Lan\Lan\Lan: sparse SpMV/SpGEMM on (min,+); \Ran\Ran\Ran: elementwise residual → max-reduce; Numerics: log-domain + row-wise max-shift; masks send forbidden entries to +∞+\infty+∞. Reproducibility log (minimum fields): seed; model/revision; tokenizer; prompts; forward map JJJ; transport KKK; masks; λcost\lambda_{ ext{cost}}λcost; kkk; effective dmax⁡d_{\max}dmax; \Lan/\Ran\Lan/\Ran\Lan/\Ran kernel + build flags; hardware/BLAS; e-process updates (et,Mt)(e_t,M_t)(et,Mt); Conformal calibration snapshots.

Motivation & Objective

  • To evaluate whether Contrastive Decoding can improve reasoning capabilities in large language models without fine-tuning.
  • To investigate the effectiveness of Contrastive Decoding on standard reasoning benchmarks such as GSM8K and HellaSwag.
  • To analyze whether the method reduces common reasoning errors like input copying and step omission during chain-of-thought generation.
  • To explore the impact of different amateur model architectures and training stages on the performance of Contrastive Decoding.
  • To assess the compatibility of Contrastive Decoding with chain-of-thought prompting and self-consistency decoding strategies.

Proposed method

  • Contrastive Decoding uses a weighted difference in logit scores between a strong expert model and a weaker amateur model to guide generation.
  • It applies an α-mask to filter out low-probability tokens from the expert model, ensuring only high-confidence predictions are considered.
  • The final logits are computed as $ s_{CD}^{(i)} = (1+eta)s_e^{(i)} - eta s_a^{(i)} $ for valid tokens, with invalid tokens masked to $- ty$.
  • The hyperparameter $\beta$ controls the strength of the contrastive penalty, with $\beta \to 0$ reducing to greedy decoding and $\beta \to \infty$ converging to argmax of the ratio $p_e^{(i)}/p_a^{(i)}$.
  • The method operates in logit space, enabling efficient inference with minimal computational overhead.
  • It is applied post-prompting, particularly with chain-of-thought prompting, to improve reasoning trace quality.
Figure 1: Contrastive decoding improves reasoning across model scales and reasoning tasks.
Figure 1: Contrastive decoding improves reasoning across model scales and reasoning tasks.

Experimental results

Research questions

  • RQ1Can Contrastive Decoding improve reasoning performance in large language models on standard benchmarks like GSM8K and HellaSwag?
  • RQ2How does the choice of amateur model (size, training stage) affect the performance of Contrastive Decoding?
  • RQ3Does Contrastive Decoding reduce surface-level copying from the input prompt and improve logical step completeness during chain-of-thought reasoning?
  • RQ4How does Contrastive Decoding compare to greedy decoding and nucleus sampling in terms of reasoning accuracy and generation quality?
  • RQ5Can Contrastive Decoding be effectively combined with self-consistency or negative prompting to further improve reasoning outcomes?

Key findings

  • Contrastive Decoding improves the performance of LLaMA-65B on GSM8K by up to 8 absolute percentage points, surpassing LLaMA 2, GPT-3.5, and PaLM 2-L.
  • On the HellaSwag commonsense reasoning benchmark, LLaMA-65B with Contrastive Decoding outperforms LLaMA 2, GPT-3.5, and PaLM 2-L, achieving performance close to GPT-4.
  • The method reduces input copying and step omission in chain-of-thought reasoning, suggesting it mitigates common abstract reasoning errors.
  • Using a 7B model as an amateur harms performance on GSM8K, but early-training checkpoints (e.g., 130B steps) of a 7B model improve results, indicating that model stage matters.
  • Negative prompting combined with Contrastive Decoding degrades performance, suggesting trade-offs in combining multiple steering techniques.
  • Contrastive Decoding outperforms both greedy decoding and nucleus sampling in long-form reasoning generation, establishing it as a general-purpose method for improving LLM outputs.
Figure 3: CD accentuates what the expert model has learned that the amateur model has not. Results are taken from greedy decoding with a 65B parameter expert, using $\alpha=0.1$ , $\beta=0.5$ for CD.
Figure 3: CD accentuates what the expert model has learned that the amateur model has not. Results are taken from greedy decoding with a 65B parameter expert, using $\alpha=0.1$ , $\beta=0.5$ for CD.

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.