TL;DR
When you give an LLM a document that contradicts its pre-trained memory, it stubbornly clings to what it memorized; existing decoding fixes force it to listen, but accidentally break its accuracy on normal, agreeable documents. By splitting the prompt into separate parts—the instruction to use the text and the evidence text itself—and amplifying their influences independently during token generation, the authors achieve the best of both worlds: models that stay faithful to surprising new context without losing their grip on reality.
What Problem Does This Paper Address?
Imagine handing a brilliant colleague a memo stating that Michelangelo wrote the funk classic "Papa's Got a Brand New Bag," and asking who wrote the song. If they blurt out "James Brown," they are relying on memory rather than reading the memo. Large Language Models (LLMs) do this constantly in Retrieval-Augmented Generation (RAG) setups when a prompt's text updates or contradicts pre-trained facts.
A popular training-free fix is Contrastive Decoding (specifically Context-Aware Decoding, or CAD). It runs the model twice—once with the full prompt, and once with just the question—and subtracts the second prediction from the first to amplify tokens favored by the passage.
Here is the catch: when the passage agrees with the model's memory (an "ordinary" passage), subtracting the question-only prediction actively penalizes the right answer! Why? Because the model already knew "Dmitri Mendeleev" invented the periodic table without the passage, so CAD suppresses "Mendeleev" and outputs nonsense like "No one."
Methods
The authors realize that stripping a prompt down to "just the question" actually changes two things at once: it removes the passage (evidence) and deletes the instruction telling the model to use it (directive).
Instead of lumping them together, they propose Factorized Contrastive Decoding (FCD). They break a standard QA prompt into four factors: Directive, Format, Evidence, and Question. Alongside the full prompt, FCD feeds the LLM two "matched views," each surgical enough to alter only one factor while keeping the rest intact:
- The Directive View: Keeps the passage, format, and question, but flips the directive to its opposite ("Answer using your own knowledge and ignore the passage").
- The Evidence View: Keeps the original directive, format, and question, but swaps the passage with a random, unrelated passage from another example.
At every decoding step, FCD calculates the next-token log-probabilities for all three streams ($\ell$, $\ell_D$, and $\ell_E$). It then boosts the full prompt's predictions by adding the differences from both views, each weighted by its own hyperparameter knob ($\gamma_D = 1.0$ for directive, $\gamma_E = 0.5$ for evidence):
$$s(y) = \ell(y) + \gamma_D(\ell(y) - \ell_D(y)) + \gamma_E(\ell(y) - \ell_E(y))$$
No training or internal model surgery is required, and this single pair of weights works across all tested models and passage benchmarks.
Datasets
Because FCD is a decoding-time method, no training datasets are used. Evaluation spans seven existing benchmarks (no new datasets are introduced):
- Counterfactual passages (contradict memory): NQ-Swap (Natural Questions with swapped answer entities), FaithEval (multiple-choice backing false options), and held-out ConFiQA.
- Ordinary passages (align with memory): NQ-Original (pre-swap passages), SQuAD, and HotpotQA (with distractors).
- Instruction conflict: MemoTrap, which asks models to finish famous quotes with an unexpected word rather than the memorized ending.
Key Insights and Ideas
- Evidence is a sledgehammer; the directive is a scalpel: Measuring token probability drops reveals that swapping out the passage shifts predictions 22 times more (median across models) than flipping the directive. Because standard CAD removes both at once, that massive evidence shift completely drowns out the subtle directive signal.
- The directive contrast naturally turns itself off when not needed: When a passage agrees with the model's memory, telling the model to "use its own knowledge" produces roughly the same answer as telling it to "use the passage." Thus, the directive contrast shrinks by 59% on ordinary passages! This means you can crank up the directive weight ($\gamma_D$) to resolve conflicts without breaking answers on ordinary text—something you cannot do with the evidence weight ($\gamma_E$).
Key Results
Evaluated across six instruction-tuned models (Qwen3 1.7B–14B, Llama-3.1-8B, Mistral-7B) and scaled up to Qwen3-32B:
- No more trade-off: FCD improves counterfactual accuracy by +7.2 points over standard sampling while increasing ordinary passage scores by +0.8 points (the only method with statistically significant gains on both). Standard CAD gets +7.8 on counterfactuals, but drops −2.1 points on ordinary text—breaking 7.1% of right answers compared to FCD's 3.7%.
- Superior Pareto curve: Across a wide sweep of guidance strengths, FCD dominates single-view baselines (CAD, AdaCAD, Random-passage CD, Instructive Decoding) and single-strength variants on both passage types.
- Generalizes beyond RAG: On held-out ConFiQA, FCD leads all methods (+7.1 points over sampling). On MemoTrap, using a matched view (swapping in another example's requested ending) boosts quote-ending obedience by +6.0 points, nearly doubling the gain of simply deleting the instruction (+3.1).
Limitations and Future Work
- 3x compute overhead: Running three prompts in parallel requires ~3.1x the forward tokens and generation time of standard sampling, and requires access to output token probabilities (ruling out closed APIs that hide log-probs).
- Prompt structure: FCD assumes prompts cleanly separate the directive from the evidence; multi-turn chats or system-embedded contexts will need tailored view designs.
- Blind obedience: FCD forces faithfulness even when context is false—so RAG pipelines using untrusted sources must vet retrieved text first. Future work includes testing long-form generation, handling irrelevant passages, and adapting $\gamma_D$ and $\gamma_E$ dynamically per example.
Summary updated