[Paper Review] Trusting Your Evidence: Hallucinate Less with Context-aware Decoding
This paper introduces Context-aware Decoding (CAD), a no-fine-tuning, inference-time method that enhances language model faithfulness by contrastively adjusting output probabilities to amplify reliance on input context over prior knowledge. CAD achieves a 14.3% improvement in factuality metrics on LLaMA-30B for summarization and up to a 2.9x gain on knowledge conflict QA tasks by effectively overriding hallucinatory model biases.
Language models (LMs) often struggle to pay enough attention to the input context, and generate texts that are unfaithful or contain hallucinations. To mitigate this issue, we present context-aware decoding (CAD), which follows a contrastive output distribution that amplifies the difference between the output probabilities when a model is used with and without context. Our experiments show that CAD, without additional training, significantly improves the faithfulness of different LM families, including OPT, GPT, LLaMA and FLAN-T5 for summarization tasks (e.g., 14.3% gain for LLaMA in factuality metrics). Furthermore, CAD is particularly effective in overriding a model's prior knowledge when it contradicts the provided context, leading to substantial improvements in tasks where resolving the knowledge conflict is essential.
Motivation & Objective
- To address the problem of language models (LMs) failing to attend adequately to input context, especially when it contradicts their prior knowledge.
- To reduce hallucinations in text generation by shifting model behavior toward contextual evidence rather than parametric knowledge.
- To develop a method applicable to off-the-shelf, non-fine-tuned LMs without requiring retraining or architectural changes.
- To improve performance on context-sensitive tasks such as summarization and knowledge conflict resolution.
Proposed method
- CAD modifies the output probability distribution using a contrastive formulation that amplifies the difference between probabilities with and without context.
- It applies a temperature-like scaling via a hyperparameter α to reweight the logits: softmax[(1+α)logit_with_context − α·logit_without_context].
- The method leverages pointwise mutual information (PMI) between the context and next token to identify contextually relevant outputs.
- The adjustment downweights outputs that are highly probable based on prior knowledge alone, favoring those that become more likely only when context is present.
- The approach is applied at inference time and requires no model fine-tuning or architectural changes.
- It is designed to be universally applicable across various LM families, including OPT, GPT, LLaMA, and FLAN-T5.

Experimental results
Research questions
- RQ1Can a decoding method improve language model faithfulness to input context without fine-tuning?
- RQ2How effectively can a contrastive decoding strategy override a model’s prior knowledge when it conflicts with provided context?
- RQ3Does the effectiveness of context-aware decoding scale with model size, particularly in knowledge conflict scenarios?
- RQ4What is the optimal adjustment level α for balancing context attention and generation quality?
- RQ5Can this method generalize across diverse LM architectures and tasks like summarization and QA?
Key findings
- CAD achieved a 14.3% absolute improvement in factuality metrics on LLaMA-30B for the CNN-DM summarization task.
- On the knowledge conflict QA dataset, CAD improved performance by 2.9x compared to standard decoding.
- The performance gain from CAD increased with model size, especially in knowledge conflict tasks, indicating stronger reliance on prior knowledge in larger models.
- Setting α = 0.5 provided consistent improvements across all datasets and model sizes, with higher α yielding further gains in conflict-heavy tasks.
- CAD significantly improved ROUGE-L scores by 21% on CNN-DM when applied to LLaMA-30B, demonstrating better factual and structural alignment.
- The method was effective across diverse LM families, including OPT, GPT, LLaMA, and FLAN-T5, confirming broad applicability.

Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.