Large language models often answer from knowledge learned during training, even when a provided passage contradicts that knowledge. To address this problem, contrastive decoding contrasts the predictions under the full and a modified prompt at every token, but it also alters correct answers that the passage supports. We show that checking answers against the passage removes this trade-off. Based on this observation, we propose Accept-or-Repair (AoR), a training-free procedure. AoR keeps a sampled answer if the passage supports it. Otherwise, it tries up to two replacements with contrastive decoding, returning one as soon as it passes this check. It rejects replacements that repeat the answer generated without the passage when the passage favors another answer. Our experiments show that AoR raises the score over sampling by 12.5 points on counterfactual passages and 2.3 on ordinary ones, surpassing eight contrastive and prompting baselines on both, including when each receives the same rejection rule. Replacing only initial answers that the passage does not support improves the average score of every decoder. These results suggest that models can follow passages that contradict their knowledge while preserving accuracy on passages that agree with it. Code will be released at https://github.com/js-lee-AI/AoR.
Figures & tables
Figure 1: Gain over plain sampling on counterfactual and ordinary passages, at the setting that each method chose on the development split. Test split, averaged over six models.
Figure 2: Two test questions. (a) CAD contrasts every answer. (b) AoR accepts supported answers (Supp). When the passage favors another answer, the memory veto rejects repairs that repeat m , generated without the passage. Gray steps are skipped.
Counterfactual
Ordinary
Method
NQ-Swap
FaithEval
Avg.
NQ-Orig.
SQuAD
HotpotQA
Avg.
Mean
Cost
Sampling
56.9
63.6
60.3
76.0
84.5
63.5
74.7
67.5
1.00
CAD ( Shi et al., 2024 )
62.4
73.7
68.1 (+7.8)
72.5
84.6
60.8
72.6 ( − 2.1)
70.3
1.18
AdaCAD ( Wang et al., 2025a )
61.4
65.5
63.4 (+3.2)
75.6
85.5
63.2
74.8 (+0.1)
69.1
1.18
COIECD ( Yuan et al., 2024 )
62.2
73.7
68.0 (+7.7)
72.7
84.5
61.1
72.8 ( − 1.9)
70.4
1.18
NWCAD ( Tao and Agrawal, 2026 )
57.3
63.8
60.6 (+0.3)
76.0
84.5
63.7
74.8 (+0.1)
67.7
1.18
Table 1: Test scores averaged over six models: F1 for free-form tasks, accuracy for FaithEval. Mean averages both groups. Parentheses show differences from sampling, colored when their 95% intervals exclude zero. Cost is the token count relative to sampling.
Figure 3: (a) How AoR ends on each task over six models: the plain answer is accepted, a repair is supported, or no draw is supported. (b) Mean on Qwen3 models of five sizes.
Counterfactual
Ordinary
Repaired part
Method
S
¬S
Fixed (%)
S
¬S
Broken (%)
Lowered (%)
CF
Ord.
Sampling
–
–
–
–
–
–
–
37.2
35.5
CAD
− 0.2
+8.0
22.0
− 3.4
+1.3
12.2
12.9
52.7
43.7
AdaCAD
+0.3
+2.9
9.4
− 0.9
+0.9
3.9
5.3
44.7
41.1
COIECD
− 0.2
+7.9
21.6
− 3.3
+1.4
11.9
12.6
52.5
43.9
NWCAD
− 0.1
+0.4
1.2
− 0.1
+0.2
0.9
1.4
38.2
36.6
Table 2: Where the gains come from. S , ¬S : share-weighted difference to sampling on supported and unsupported plain answers; Fixed, Broken: wrong plain answers made right, correct ones made wrong; Lowered: F1 below the plain answer; Repaired part: scores where AoR repairs.
Wrapped decoder
CF
Ord.
Mean
CAD
68.3
76.0 (+3.4)
72.2 (+1.8)
AdaCAD
63.2
75.6 (+0.9)
69.4 (+0.3)
COIECD
68.2
76.1 (+3.3)
72.1 (+1.7)
NWCAD
60.7
74.9 (+0.1)
67.8 (+0.1)
RPCD
66.8
76.5 (+2.1)
71.6 (+1.4)
ID
66.2
76.7 (+2.1)
71.5 (+1.1)
Table 3: Each decoder D wrapped by AoR as its only repair, without the veto. On ordinary passages and in Mean, parentheses give the difference to D alone, colored when its 95% interval excludes zero.
Figure 4: F1 change on the supported plain answers of the ordinary tasks, binned by the probability that the model gives the same answer without the passage.
Figure 5: Counterfactual and ordinary averages of CAD, ID and RPCD at four strengths, alone and wrapped by AoR as the only repair. Dotted lines mark sampling.
Variant
CF
Ord.
Mean
Cost
AoR
72.8
77.0
74.9
1.71
Components
Repair every answer
+0.7
− 1.3
− 0.3
2.71
No memory veto
− 3.2
0.0
− 1.6
1.63
Any occurring option supported
− 0.9
0.0
− 0.5
1.65
Repairs
Table 4: Variants of AoR and majority votes. Score differences are relative to AoR; color indicates a 95% interval excluding zero. Cost is the token count relative to sampling.
Gate
NQ-Swap
Ord.
Mean
CAD on every answer
+5.5
− 2.1
+1.7
Same as closed-book answer
+1.5
− 0.8
+0.3
Answer probability
+4.2
+0.2
+2.2
Probability gain from passage
+4.8
− 0.8
+2.0
Self-check
+3.0
− 0.3
+1.4
Entailment model
+3.7
− 0.2
+1.7
Table 5: Gain over sampling when CAD replaces selected answers on free-form tasks. Four ranked gates match the support test’s selection count. Mean averages NQ-Swap and Ord. Color indicates 95% intervals excluding zero.
Main tasks
Held-out data
Further models
Other settings
LLM judge
Method
No FaithEval
With veto
CF
Ord.
OLMo
Yi
32B
70B
Greedy
Distractors
Qwen
Gemma
Sampling
65.8
70.2
63.1
83.7
68.6
67.9
72.3
68.9
66.6
63.3
–
–
CAD
67.5
71.7
66.6
81.9
60.1
64.2
74.4
68.9
67.3
63.6
− 1.5
+1.1
AdaCAD
68.1
71.6
65.7
83.7
68.5
67.5
74.0
71.6
67.6
64.9
+0.6
+1.6
COIECD
67.5
71.8
66.7
82.0
60.0
64.6
74.3
69.6
66.5
63.5
− 1.2
+1.3
NWCAD
66.0
68.6
63.4
83.7
68.7
67.8
72.3
69.1
66.6
63.5
0.0
+0.1
Table 6: Beyond the main setting: Mean, or group average for held-out data. No FaithEval: NQ-Swap, ordinary average; With veto: veto for all; Greedy: four models, retuned, first row greedy; Distractors: passages of four other questions; Judge: free-form Mean gain over sampling.
Task, model
Passage, excerpt
Question
Sampling
CAD
AoR
NQ-Orig. Qwen3-8B
UConn owns the two longest winning streaks …The longest streak, 111 straight wins, started …
how many games in a row have the uconn women’s basketball team won
111 ✓
two ✗
111 ✓ accepted
NQ-Swap Qwen3-8B
In 1971, after the Irish War of Independence …most of Ireland seceded from the United Kingdom …
when did ireland gain its independence from england
1922 ✗
1971 ✓
1971 ✓ CAD repair
NQ-Swap Llama-3.1-8B
Neal Dahlen as Hiccup Horrendous Haddock III, the son of the Viking chief Stoick the Vast and Valka.
who voices hiccup in how to train your dragon 2
Jay Baruchel ✗
Jay Baruchel ✗
Neal Dahlen ✓ ID repair
FaithEval Qwen3-14B
…recent studies have shown that minerals hold a pivotal role in the fossilization process. …
Which of the following would most likely form a fossil? A. a rock, B. a crystal, C. a mineral, D. a bone
D ✗
D ✗
C ✓ D vetoed
Table 7: Test answers from three models, with passage excerpts, illustrating acceptance, CAD and ID repairs, and the memory veto. A check marks a correct answer; labels below AoR’s answers indicate the action taken.
Appendix figures & tables16 assets
Supplementary material from the paper’s appendix.
Appendix
Prompt
Text
Used by
Standard
Answer the question using the passage. Reply with only the answer, a few words at most. + passage + question
sampling, AoR, every contrastive decoder except Strict CAD
Closed-book
Answer the question. Reply with only the answer, a few words at most. + question
the memory veto of AoR, contrast of CAD, AdaCAD, COIECD, NWCAD and Strict CAD
Other passage
standard instruction + passage of another example + question
contrast of RPCD
Opposite directive
Answer the question using your own knowledge and ignore the passage. Reply with only the answer, a few words at most. + passage + question
contrast of ID
Strict
Answer the question using only the passage, even if the passage contradicts what you know. Reply with only the answer, a few words at most. + passage + question
Strict prompt, Strict CAD
Copy
Answer the question using the passage. Reply with only the answer, copied from the passage in as few words as possible. + passage + question
copy prompt, alone and with CAD
Appendix
Table 8: Prompts of the free-form tasks. A plus sign joins the parts of a prompt. Shading marks the two prompts that AoR samples from. Its repairs use the prompts of CAD and ID.
Task
Metric
Dev.
Test
Used
Counterfactual passages
NQ-Swap
F1
200
800
724
FaithEval
accuracy
200
800
800
Ordinary passages
NQ-Original
F1
200
800
724
SQuAD
F1
200
800
724
Appendix
Table 9: Counts of development and test examples. Used excludes test examples whose question, or for SQuAD whose passage, occurs in the development split. ConFiQA rows represent each subset.
Model
Temperature
Top- p
Top- k
Qwen3 (all sizes)
0.7
0.8
20
Llama-3.1 (8B, 70B)
0.6
0.9
off
Mistral-7B
0.7
0.9
off
OLMo-2-13B
0.7
0.9
off
Yi-1.5-9B
0.7
0.9
off
Appendix
Table 10: Sampling settings of every model, shared by all methods.
Table 11: Settings tried on the development split and their scores in the same order. Scores average the counterfactual and ordinary gains over sampling, in points. Bold marks the chosen setting.
Table 12: Gain over sampling at each setting of Table 11 , on the counterfactual and the ordinary average of the test split. Bold marks the chosen setting.
Closed-book probability p(a∣q)
<0.01
0.01 – 0.1
0.1 – 0.5
≥0.5
Share (%)
72.7
8.8
7.2
11.3
Plain F1
80.5
85.1
86.3
89.3
F1 change
CAD
− 3.0
− 5.4
− 7.1
− 7.4
AdaCAD
− 1.0
− 1.3
− 1.2
− 0.7
Appendix
Table 13: Supported plain answers on ordinary tasks, grouped by their closed-book probability p(a∣q) . Rows give the share, plain F1 and decoder F1 changes. Test split, six models.
Variant
NQ-Swap
FaithEval
NQ-Orig.
SQuAD
HotpotQA
CF
Ord.
Mean
Sampling
56.9
63.6
76.0
84.5
63.5
60.3
74.7
67.5
AoR
65.2
80.4
78.2
87.5
65.2
72.8
77.0
74.9
Repair every answer
66.6
80.4
76.5
86.8
63.8
73.5
75.7
74.6
No memory veto
65.2
74.0
78.2
87.5
65.2
69.6
77.0
73.3
CAD only
62.8
79.5
76.9
86.7
64.5
71.2
76.0
73.6
ID only
64.2
76.5
78.1
86.9
65.2
70.4
76.8
73.6
Appendix
Table 14: Variants of AoR on each task, test split, six models. The plain answer as fallback returns the plain answer, instead of the first answer not rejected by the veto, when no draw is supported.
Decoder
Without veto
With veto
Veto score as a solver
61.4
–
Sampling
63.6
74.5
ID
67.8
76.1
CAD
73.7
79.2
AoR
74.0
80.4
Appendix
Table 15: FaithEval accuracy of each decoder without and with the memory veto, which masks the letter of a vetoed closed-book answer. The first row picks the option with the highest veto score. Test split, six models.
Method
CF
Ord.
Mean
Sampling + veto
65.7
74.7
70.2
CAD + veto
70.8
72.6
71.7
AdaCAD + veto
68.4
74.8
71.6
COIECD + veto
70.8
72.8
71.8
NWCAD + veto
62.4
74.8
68.6
RPCD + veto
69.9
74.4
72.2
Appendix
Table 16: Each baseline with the memory veto of AoR, which on FaithEval masks the letter of a vetoed closed-book answer. Test split, six models.
Method
NQ-Swap
Ord.
Mean
Cost
Sampling
56.9
74.7
65.8
1.00
Span decoding
61.4
76.3
68.8
1.00
Copy prompt
59.6
73.4
66.5
1.02
Copy prompt, CAD
59.7
66.2
63.0
1.20
AoR with one repair
Feedback
58.5
74.9
66.7
1.28
Appendix
Table 17: Span and copy methods and AoR variants on free-form tasks. Ord. averages NQ-Original, SQuAD and HotpotQA, and Mean averages NQ-Swap and Ord. Cost counts processed tokens relative to sampling. Test split, six models.
Method
NQ-Swap
NQ-Orig.
Mean
Sampling
53.8
72.7
63.3
CAD
58.8
68.5
63.6
AdaCAD
57.9
71.9
64.9
COIECD
58.4
68.6
63.5
NWCAD
54.3
72.7
63.5
RPCD
59.1
72.6
65.8
Appendix
Table 18: NQ-Swap and NQ-Original with the passage of each question placed among four passages of other questions, at a random position. Test split, six models.
Method
CF
Ord.
Mean
Sampling
64.2
76.6
70.4
CAD
72.8
75.5
74.1
AdaCAD
67.4
76.8
72.1
COIECD
72.7
75.6
74.1
NWCAD
64.6
76.6
70.6
RPCD
70.7
76.5
73.6
Appendix
Table 19: Scores when a free-form answer counts as correct if it contains a gold answer as whole words, which does not penalize longer answers. FaithEval keeps accuracy. Test split, six models.
Method
NQ-Orig.
SQuAD
HotpotQA
Ord.
NQ-Swap
CAD
− 4.6
− 1.8
− 4.9
− 3.8
+0.9
AdaCAD
− 0.6
0.0
− 1.2
− 0.6
+1.8
COIECD
− 4.2
− 1.8
− 4.5
− 3.5
+1.0
NWCAD
− 0.1
− 0.2
0.0
− 0.1
0.0
RPCD
− 2.3
− 1.7
− 3.0
− 2.3
+0.8
ID
− 3.4
− 1.0
− 1.0
− 1.8
+2.8
Appendix
Table 20: Accuracy differences from sampling on free-form answers, judged by Qwen2.5-32B-Instruct. Test split, six models.
Method
NQ-Swap
NQ-Orig.
SQuAD
Ord.
Mean
Sampling
64.9
86.3
90.9
88.6
76.7
AoR (ours)
73.3
86.7
91.9
89.3
81.3
Difference
+8.4 ∗
+0.4
+1.0
+0.7 ∗
+4.6 ∗
Appendix
Table 21: Answers given as one sentence, correct when they contain a gold answer. Ord. averages NQ-Original and SQuAD, and Mean averages NQ-Swap and Ord. ∗ : the 95% interval of the difference excludes zero. Test split, six models.
Mean
Method
CF
Ord.
Mean
Llama
Mistral
OLMo
Yi
Greedy
58.4
74.8
66.6
70.2
58.0
69.4
68.8
CAD
63.3
71.4
67.3
74.1
62.1
67.7
65.4
AdaCAD
61.7
73.5
67.6
72.3
61.1
69.0
68.1
COIECD
60.8
72.2
66.5
72.5
60.5
67.8
65.3
NWCAD
58.5
74.7
66.6
70.5
58.1
69.3
68.3
Appendix
Table 22: Greedy decoding of every method on Llama-3.1-8B, Mistral-7B, OLMo-2-13B and Yi-1.5-9B, test split, with every setting chosen again under greedy decoding on the development split. The memory veto of AoR uses the sampled closed-book answer of the main runs.
Method
Qwen3-1.7B
Qwen3-4B
Qwen3-8B
Qwen3-14B
Llama-3.1-8B
Mistral-7B
Sampling
65.1
68.1
72.2
72.2
69.5
57.7
CAD
65.3
70.6
76.2
75.5
72.3
62.3
AdaCAD
65.9
69.4
73.3
73.2
71.9
60.9
COIECD
65.5
70.6
76.1
75.5
72.4
62.2
NWCAD
65.4
68.3
72.3
72.2
69.8
57.9
RPCD
65.8
70.4
74.3
74.6
71.2
65.1
Appendix
Table 23: Mean of the counterfactual and ordinary averages for each model in the main comparison. Test split.
Language models increasingly answer questions by consulting retrieved documents rather than memory alone, a design now common in search assistants and enterprise knowledge tools. Grounding a model in retrieved text reduces unsupported statements but does not eliminate them, and a reader cannot tell a grounded sentence from an invented one. Most research on this problem stops at detection, yet flagging a faulty answer changes nothing for the person reading it, and little is known about which action should follow. Using RAGTruth, a benchmark whose unsupported passages are annotated by hand, we split each flagged answer into individual factual claims, check each against the retrieved source, and compare leaving the answer untouched with three repair strategies of increasing richness: deleting an unsupported claim, replacing it with source text, and rewriting it. Three language models from different families judge the 916 repaired answers. Every strategy reduces the proportion of answers judged to contain unsupported content, and all three judges agree on the ordering. Deletion achieves the largest reduction while retaining least of the original answer, at 64.3% of the text, whereas rewriting retains 80.1% and reduces least. Repair is not confined to faulty answers: 83.5% of answers annotated clean are edited too. The strategies occupy different points on a grounding preservation trade-off rather than forming a quality ranking, and choosing between them needs evidence about answer usefulness that automatic metrics cannot supply.
Sai Krishna Reddy Mulakkayala, Niki van Stein, Aske Plaat
When a user supplies a document and wants the answer drawn from it, a language model is expected to follow it even when it contradicts its parametric knowledge. Prior work has focused on making the model rely on context by steering activations, contrasting logits during decoding, or instructing it in plain language. We ask whether the document alone, with no instruction written into it and no access to the model at inference time, is enough. We optimize a document suffix by discrete token search, starting from the answer to a single question and extending the objective to a set of passages, to multi-hop questions that follow from the planted fact, and to later turns of a conversation. On counterfactual passages that contradict parametric knowledge of the model, the suffix flips nearly all items the model resists across three instruction-tuned model families, in most settings outperforms the decoding baseline and the strongest instruction we could write, and matches activation steering. Controls show that the suffix largely acts through the passage rather than injecting the answer, and a single suffix per model transfers to unseen passages. Each extended objective carries the effect to its target, so the objective, not only the document, sets how far the effect reaches.
While Chain-of-Thought (CoT) prompting improves the reasoning performance of large language models (LLMs), recent studies have shown that final answers do not always depend on the generated rationales. In particular, LLMs may rely on query-specific shortcuts rather than the information provided by their reasoning steps. In this paper, we investigate whether context-aware decoding (CAD), an existing contrastive decoding method, can mitigate such shortcut behavior when applied to CoT reasoning. We study this application as Rationale Contrastive Decoding (RCD), which contrasts the next-token distributions conditioned on the query with and without its rationale, amplifying tokens whose likelihood increases due to the rationale. We provide a theoretical interpretation of this decoding rule via a KL-regularized reward-maximization objective. Experiments across five reasoning benchmarks demonstrate that RCD improves answer accuracy over standard CoT. Furthermore, intervention analyses using ground-truth and random rationales reveal that RCD increases the behavioral dependence of final answers on the rationale content. Our findings suggest that contrastive decoding offers a simple, training-free approach to mitigating query shortcuts.