CoRect: Context-Aware Logit Contrast for Hidden State Rectification to Resolve Knowledge Conflicts

Xuhua Ma, Richong Zhang, Zhijie Nie · DOI

TL;DR

CoRect is a novel, training-free framework designed to stop Large Language Models (LLMs) from ignoring retrieved evidence in favor of their own internal, often incorrect, biases. By identifying a "parametric suppression" phenomenon—where deep layers of the model actively overwrite context-driven information with memorized priors—CoRect applies a surgical "rectification" to the model's internal hidden states to ensure the final output remains faithful to the provided context.

What Problem Does This Paper Address?

Retrieval-Augmented Generation (RAG) is the industry standard for reducing hallucinations, but it has a "stubbornness" problem known as knowledge conflict. When retrieved evidence contradicts what a model learned during pre-training (its "parametric knowledge"), the model often ignores the evidence and sticks to its internal bias.

Existing solutions usually fall into two camps:

  1. Decoding-time adjustments: These treat the model as a "black box" and try to fix the final word probabilities. However, by the time the information reaches the output layer, the internal representations may already be too corrupted to fix reliably.
  2. Model Editing: These methods (like ROME) surgically change the model's weights. While powerful, they typically require knowing the "correct" answer in advance to calculate the update, making them useless for real-world, open-ended questions where the answer is unknown.

CoRect bridges this gap by providing a mechanistic, internal fix that doesn't require knowing the ground-truth answer beforehand.

Methods

The authors first used a technique called the Logit Lens to "peek" inside the model's layers. They discovered Parametric Suppression: early layers often correctly identify the answer from the context, but deeper Feed-Forward Network (FFN) layers act as "bullies," overwriting those representations with memorized (and sometimes wrong) facts.

CoRect solves this in two stages:

  • Stage 1: Trustworthy Token Selection. The model performs two forward passes—one with context and one without. By contrasting the results and filtering them through the model’s own attention maps, CoRect identifies a "reliable" target token that the context is trying to promote.
  • Stage 2: Hidden State Rectification. Once the target is identified, CoRect scans the internal layers to find where the FFNs are pushing away from that target. It then applies a mathematical "patch" to those specific layers to neutralize the suppression. This is a "disinhibition" strategy—rather than forcing a new answer in, it simply removes the internal components that are trying to block the correct one.

Datasets

The researchers evaluated CoRect across a diverse set of benchmarks:

  • Question Answering: Natural Questions (NQ), TriviaQA, SQuAD, and HotpotQA.
  • Knowledge Conflict Stress Tests: NQ-Swap, a specialized version of NQ where ground-truth entities are swapped with plausible alternatives to force a conflict with the model's memory.
  • Reasoning: TabMWP (tabular math word problems).
  • Summarization: XSum, CNN-DailyMail, and TofuEval (for factual alignment).

Key Insights and Ideas

  • The "Flip" Phenomenon: In over 56% of error cases, the model actually "knew" the right answer in its middle layers but lost it by the final layer. This suggests models don't lack the information; they just fail to prioritize it.
  • FFNs as Memory Blocks: The paper reinforces the theory that FFN layers act as key-value memories. In knowledge conflicts, these memories are "too loud," drowning out the signals from the attention mechanism that processes the retrieved text.
  • Disinhibition over Injection: Most steering methods try to "inject" a direction. CoRect argues that simply "canceling out" the negative interference from biased layers is more stable and preserves the model's natural linguistic fluency better than forced steering.

Key Results

CoRect consistently outperformed strong baselines like CAD (Context-Aware Decoding) and AdaCAD across multiple model architectures (Qwen2.5, Llama 3, Mistral).

  • NQ-Swap Performance: On the high-conflict NQ-Swap dataset, CoRect achieved significant gains (e.g., a ~10% improvement over greedy decoding on Llama 3-8b), proving it is highly effective at resolving direct contradictions.
  • Summarization: On the TofuEval benchmark, CoRect significantly improved factual alignment scores, indicating that the summaries were much more grounded in the source text than those produced by standard decoding.
  • Efficiency: Because it is training-free and target-agnostic, it can be dropped into existing RAG pipelines without retraining the underlying LLM.

Limitations and Future Work

  • Computational Overhead: CoRect requires multiple forward passes and frequent access to internal residual streams. While the authors suggest reusing KV caches to mitigate this, it is still slower than standard "greedy" decoding.
  • White-Box Requirement: The method requires access to the model's internal hidden states and weights. This means it cannot be used with "closed" API-only models like GPT-4 or Claude; it is currently limited to open-weights models like Llama or Mistral.
  • Future Directions: The authors suggest exploring more efficient ways to localize suppressive layers and investigating if this "rectification" can be applied to other types of model biases beyond just factual knowledge conflicts.

Summary updated

BibTeX
@misc{ma2026corect,
  author = {Xuhua Ma and Richong Zhang and Zhijie Nie},
  title = {{CoRect: Context-Aware Logit Contrast for Hidden State Rectification to Resolve Knowledge Conflicts}},
  year = {2026},
  eprint = {2602.08221},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2602.08221},
}
Figure