{
  "id": "contrastive-decoding",
  "code": "PTL-0250",
  "term": "Contrastive Decoding",
  "aliases": [
    "CD"
  ],
  "category": "foundations",
  "definition": "Contrastive decoding is a text-generation method that chooses tokens by maximizing the difference in log-likelihood between a large \"expert\" language model and a smaller \"amateur\" model, restricted to tokens the expert itself finds plausible.",
  "description": "The idea is that failures such as repetition and incoherence are even more likely under a small model, so subtracting its preferences filters them out while keeping what the larger model does better. It needs no extra training. Li et al. reported that it produced higher-quality text than decoding from the larger model alone and outperformed nucleus and top-k sampling in automatic and human evaluations on Wikipedia, news and story text.",
  "example": null,
  "broader": [],
  "narrower": [],
  "related": [
    "top-p-sampling",
    "top-k-sampling",
    "greedy-decoding",
    "text-degeneration",
    "speculative-decoding"
  ],
  "introduced": 2022,
  "added": "2026-11-15",
  "sources": [
    {
      "title": "Contrastive Decoding: Open-ended Text Generation as Optimization",
      "authors": "Li et al.",
      "year": 2022,
      "url": "https://arxiv.org/abs/2210.15097"
    }
  ],
  "url": "https://protologue.com/t/contrastive-decoding/",
  "citation": "Protologue. (2026). Contrastive Decoding. In Protologue: A Taxonomy of Prompting and LLM Techniques (v1.7.0, PTL-0250). https://protologue.com/t/contrastive-decoding/"
}