NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Mitigating Context-Memory Conflicts in LLMs through Dynamic Cognitive Reconciliation Decoding

Yigeng Zhou, Wu Li, Yifan Lu, Yequan Wang, Xuebo Liu, Wenya Wang, Jun Yu, Min Zhang, Jing LiarXiv 2026

TL;DR

When external context contradicts an LLM's internal memory, standard decoding methods often over-correct, degrading performance on normal, conflict-free tasks. This paper introduces Dynamic Cognitive Reconciliation Decoding (DCRD), a two-stage method that uses internal attention maps to predict knowledge conflicts and dynamically routes inputs to either standard greedy decoding or an adaptive contrastive decoding path. The result is a framework that successfully mitigates context-memory conflicts without sacrificing accuracy or inference speed in conflict-free scenarios.

What Problem Does This Paper Address?

Retrieval-Augmented Generation (RAG) is widely used to supply Large Language Models (LLMs) with up-to-date external knowledge. However, a major challenge arises when retrieved information conflicts with the model's pre-trained parametric memory (e.g., an outdated fact vs. a recent update).

Existing solutions like Context-Aware Decoding (CAD) force the model to prioritize external context by amplifying the difference between output distributions generated with and without context. While effective when a conflict actually exists, this static intervention causes "over-intervention" in conflict-free scenarios, introducing bias and degrading the model's standard generation capabilities.

Illustration of correct intervention vs. over-intervention in conflict scenarios.

The authors address this by asking: Can we achieve "cognitive reconciliation"—dynamically determining when to trust external context and when to rely on internal memory?

Methods

DCRD splits the decoding process into two distinct stages:

  1. Conflict Prediction via Attention Maps: Instead of using heavy external classifiers, DCRD leverages the LLM's own internal states. During the prompt processing phase, it extracts attention weights across all layers and heads to calculate a contextual fidelity score. This score measures how much the model naturally relies on the context versus its own generated tokens. A lightweight, single-layer Multi-Layer Perceptron (MLP) uses these scores to predict whether a context-memory conflict exists.
  2. Cognitive Reconciliation Decoding (CRD): Based on the prediction, the input is dynamically routed:
  3. Path A (Conflict Detected): The model uses Dynamic Contrastive Decoding. Instead of using a fixed hyperparameter to balance context weight, DCRD adaptively adjusts the contrast intensity token-by-token based on the contextual fidelity score.
  4. Path B (No Conflict): The model bypasses contrastive decoding entirely and defaults to standard, fast Greedy Decoding, preserving original generation quality and saving compute.
Fig. 2. Overview of DCRD, a two-stage dynamic decoding method designed to mitigate context-memory conflicts, including Conflict Prediction Based on Attention Maps and Cognitive Reconciliation Decoding. We employ a dynamic routing approach, where conflict-free inputs are directed to the greedy decoding path (B), while conflicting inputs are routed to the dynamic contrastive decoding path (A) based on conflict prediction results.

Datasets

The authors evaluated DCRD across three distinct types of datasets:

  • Standard General QA (Low Conflict): Natural Questions (NQ), TriviaQA, and SQuAD.
  • Knowledge Conflict QA (High Conflict): Counterfacts and NQ-Swap (where entities are synthetically swapped to force context reliance).
  • ConflictKG (New Benchmark): To better simulate real-world knowledge updates, the authors built ConflictKG, a dataset containing 4,466 instances of both conflicting and non-conflicting knowledge pairs derived from Wikidata, complete with strict quality control filtering via GPT-4o.

Key Insights and Ideas

  • Attention Maps as Conflict Signals: The model's attention maps inherently reveal its "cognitive dissonance." When an LLM is forced to generate text that contradicts its parametric memory, its internal attention patterns shift predictably, allowing a simple single-layer MLP to achieve high classification accuracy (84.7% on Llama2-7B).
  • Avoiding Over-Intervention: Forcing context-awareness on everything is harmful. In standard datasets like SQuAD, traditional CAD drops Llama3-8B's accuracy from 87.2% down to 72.6%. DCRD avoids this pitfall entirely by routing clean data away from the contrastive path.
  • Efficiency Gains through Routing: Dynamic routing means the computationally expensive contrastive distribution calculations are only performed when strictly necessary.

Key Results

DCRD was evaluated against standard baselines (Greedy, CAD, COIECD, ADACAD) across four mainstream LLMs: Llama2-7B, Llama2-13B, Llama3-8B, and Mistral-7B.

  • Superior Conflict Resolution: On the high-conflict NQ-Swap dataset, DCRD outperformed standard greedy decoding by 17.7% to 29.1% across the models, and beat the strongest contrastive baseline (CAD) by up to 11.6%.
  • Maintained General Performance: On general QA datasets where other context-aware methods failed drastically, DCRD consistently matched or exceeded greedy decoding baseline performance (e.g., scoring 73.4% on NQ for Llama3-8B compared to CAD's 51.0%).
  • Robustness to Noise: When 30% noisy/irrelevant context was injected into the benchmark, DCRD's performance remained virtually unchanged (-0.1% drop), while alternative methods like COIECD dropped by 2.6%.
Fig. 3. We experiment on ConflictKG by varying the conflict data proportion. DCRD consistently outperforms other baselines, with smaller fluctuations in performance as the conflict ratio changes.

Limitations and Future Work

The authors note a few limitations in their current work:

  • Model Scale: Due to compute constraints, evaluations were limited to 7B and 13B parameter models. Testing on larger architectures (e.g., 70B+) remains future work.
  • Base vs. Chat Models: The experiments focused strictly on base models. The behavior of DCRD on instruction-tuned or RLHF-aligned chat models (which already have altered context-following behaviors) is still unexplored.
  • Classifier Exploration: While the single-layer MLP proved highly efficient, exploring other encoder-based classifiers (like BERT) or SVMs could potentially yield even more accurate routing.

Summary updated

BibTeX
@misc{zhou2026mitigating,
  author = {Yigeng Zhou and Wu Li and Yifan Lu and Yequan Wang and Xuebo Liu and Wenya Wang and Jun Yu and Min Zhang and Jing Li},
  title = {{Mitigating Context-Memory Conflicts in LLMs through Dynamic Cognitive Reconciliation Decoding}},
  year = {2026},
  eprint = {2605.12185},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2605.12185},
}
Figure