Papers
Topics
Authors
Recent
Gemini 2.5 Flash
Gemini 2.5 Flash
80 tokens/sec
GPT-4o
59 tokens/sec
Gemini 2.5 Pro Pro
43 tokens/sec
o3 Pro
7 tokens/sec
GPT-4.1 Pro
50 tokens/sec
DeepSeek R1 via Azure Pro
28 tokens/sec
2000 character limit reached

Contrastive Decoding Improves Reasoning in Large Language Models (2309.09117v2)

Published 17 Sep 2023 in cs.CL and cs.AI

Abstract: We demonstrate that Contrastive Decoding -- a simple, computationally light, and training-free text generation method proposed by Li et al 2022 -- achieves large out-of-the-box improvements over greedy decoding on a variety of reasoning tasks. Originally shown to improve the perceived quality of long-form text generation, Contrastive Decoding searches for strings that maximize a weighted difference in likelihood between strong and weak models. We show that Contrastive Decoding leads LLaMA-65B to outperform LLaMA 2, GPT-3.5 and PaLM 2-L on the HellaSwag commonsense reasoning benchmark, and to outperform LLaMA 2, GPT-3.5 and PaLM-540B on the GSM8K math word reasoning benchmark, in addition to improvements on a collection of other tasks. Analysis suggests that Contrastive Decoding improves over existing methods by preventing some abstract reasoning errors, as well as by avoiding simpler modes such as copying sections of the input during chain-of-thought. Overall, Contrastive Decoding outperforms nucleus sampling for long-form generation and greedy decoding for reasoning tasks, making it a powerful general purpose method for generating text from LLMs.

An Overview of Contrastive Decoding in LLMs

The paper "Contrastive Decoding Improves Reasoning in LLMs" presents an empirical investigation into using Contrastive Decoding (CD) as a method to enhance reasoning tasks in LLMs. Historically, text generation from LLMs has required distinct approaches depending on the nature of the task: truncated sampling for open-ended tasks and greedy decoding for reasoning-focused tasks. This paper highlights that these divisions might be unnecessary with the introduction of a unified generation method called Contrastive Decoding.

Methodology and Results

Contrastive Decoding, first introduced by Li et al. (2022), operates by balancing the probabilities from a stronger 'expert' model and a weaker 'amateur' model. Specifically, CD generates text that maximizes the difference in likelihoods between outputs proposed by both models, thus efficiently mitigating common pitfalls such as repetitive or generic outputs. Despite its training-free nature, the CD method has demonstrated significant enhancements in reasoning capabilities over traditional greedy decoding strategies.

This paper empirically validates the application of CD on a variety of reasoning benchmarks. Notably, LLaMA (with 65 billion parameters) using CD outperforms several premier models—such as LLaMA 2, GPT-3.5, and PaLM-2 L on the HellaSwag commonsense reasoning benchmark, and GSM8K mathematical word reasoning. These results augment prior findings, establishing CD's superiority over both nucleus sampling for long-form text generation and greedy decoding for reasoning tasks.

Experimental Design and Analysis

The researchers methodically examined the parameter sensitivities of CD, using the LLaMA model variants combined with controlled experimental setups to ensure robust evaluation. Across tasks like algebraic problem-solving and commonsense reasoning, CD consistently yielded improvements, though its efficacy was contingent upon certain task-specific factors. Importantly, CD was shown to diminish surface-level text copying from prompts while ensuring fewer reasoning step omissions during inference, leading to improved reasoning and accuracy.

To further understand the distinct benefits of CD, an analysis revealed CD models performed fewer semantic misunderstandings and omitted fewer reasoning steps compared to baseline models, even though arithmetic errors persisted. A broader application of CD on factual recall tasks, such as OpenBookQA and TriviaQA, suggested slight performance degradations, implying that these tasks may benefit less from the nuanced balance of probabilities that CD encourages.

Implications and Future Directions

The strategy not only unifies disparate generation methods into a versatile approach but also offers a computational cost-effective solution, adding minimal overhead compared to other reasoning-enhancement techniques such as self-consistency. This characteristic posits CD as particularly advantageous when intelligence augmentation for reasoning is desired without proportional scaling of computational resources.

Looking forward, the paper presents several avenues for further research and model refinement. The exploration of different model architectures, particularly those outside the LLaMA family, remains open for future work. Additional studies could investigate intersectional gains from combining CD with advancements in embedding augmentations or adversarial training approaches to further reinforce the robustness of LLMs under diverse operational conditions.

In conclusion, the paper underscores CD's potential to transcend traditional limitations of text generation methodologies, propelling reasoning capabilities of LLMs to new heights. It provides a compelling foundation upon which further explorations into adaptive decoding strategies can build, paving the way for more intelligent, contextually aware natural language generation systems.

Definition Search Book Streamline Icon: https://streamlinehq.com
References (36)
  1. Palm 2 technical report, 2023.
  2. Piqa: Reasoning about physical commonsense in natural language, 2019.
  3. Dola: Decoding by contrasting layers improves factuality in large language models, 2023.
  4. Scaling instruction-finetuned language models, 2022.
  5. Boolq: Exploring the surprising difficulty of natural yes/no questions, 2019.
  6. Think you have solved question answering? try arc, the ai2 reasoning challenge, 2018.
  7. Training verifiers to solve math word problems, 2021.
  8. Hierarchical neural story generation, 2018.
  9. Chain-of-thought hub: A continuous effort to measure large language models’ reasoning performance, 2023.
  10. Did aristotle use a laptop? a question answering benchmark with implicit reasoning strategies, 2021.
  11. Roscoe: A suite of metrics for scoring step-by-step reasoning, 2022.
  12. Measuring massive multitask language understanding, 2021a.
  13. Measuring mathematical problem solving with the math dataset, 2021b.
  14. The curious case of neural text degeneration, 2020.
  15. Triviaqa: A large scale distantly supervised challenge dataset for reading comprehension, 2017.
  16. Scaling laws for neural language models, 2020.
  17. Discriminator-guided multi-step reasoning with language models, 2023.
  18. Contrastive decoding: Open-ended text generation as optimization, 2022.
  19. Program induction by rationale generation: Learning to solve and explain algebraic word problems. In Proceedings of the 55th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pp.  158–167, Vancouver, Canada, July 2017. Association for Computational Linguistics. doi: 10.18653/v1/P17-1015.
  20. Dexperts: Decoding-time controlled text generation with experts and anti-experts, 2021.
  21. Locally typical sampling, 2023.
  22. A diverse corpus for evaluating and developing english math word problem solvers, 2021.
  23. Can a suit of armor conduct electricity? a new dataset for open book question answering, 2018.
  24. OpenAI. Gpt-4 technical report, 2023.
  25. Are nlp models really able to solve simple math word problems?, 2021.
  26. Reasoning with language model prompting: A survey, 2023.
  27. Winogrande: An adversarial winograd schema challenge at scale, 2019.
  28. Socialiqa: Commonsense reasoning about social interactions, 2019.
  29. Commonsenseqa: A question answering challenge targeting commonsense knowledge, 2019.
  30. Llama: Open and efficient foundation language models, 2023.
  31. Towards understanding chain-of-thought prompting: An empirical study of what matters, 2023a.
  32. Self-consistency improves chain of thought reasoning in language models, 2023b.
  33. Chain-of-thought prompting elicits reasoning in large language models, 2023.
  34. FUDGE: Controlled text generation with future discriminators. In Proceedings of the 2021 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies. Association for Computational Linguistics, 2021. doi: 10.18653/v1/2021.naacl-main.276.
  35. Surfacing biases in large language models using contrastive input decoding, 2023.
  36. Hellaswag: Can a machine really finish your sentence?, 2019.
User Edit Pencil Streamline Icon: https://streamlinehq.com
Authors (2)
  1. Sean O'Brien (29 papers)
  2. Mike Lewis (78 papers)
Citations (25)
Youtube Logo Streamline Icon: https://streamlinehq.com