Mitigating Knowledge Conflicts in Retrieval-Augmented Generation via Inference-Time Representation Editing

Dahyun Jung, Jaehyung Seo, Heuiseok LimNeurIPS 2026

TL;DR

When you feed external documents to a Large Language Model (LLM) using Retrieval-Augmented Generation (RAG), the model sometimes gets confused: what if the retrieved text contradicts what it already memorized during pretraining, or is buried under irrelevant search results? Instead of retraining the entire LLM or endlessly tweaking prompts, this paper introduces CARE—a lightweight, plug-and-play method that peeks inside the model's neural activations at inference time and nudges them away from "confused" states toward accurate, evidence-grounded answers.

What Problem Does This Paper Address?

LLMs freeze their worldview the moment pretraining ends. To keep them current and factual, we use RAG—fetching relevant external documents and pasting them into the prompt like an open-book exam.

Unfortunately, RAG introduces two major headaches:

  1. Knowledge Conflict: The open-book notes contradict what the model memorized during pretraining (its parametric knowledge). Faced with two competing truths, the model often hallucinates or stubbornly clings to outdated facts.
  2. Retrieval Noise: Search engines aren't perfect. Alongside the golden answer, a retriever often pulls in tangentially related junk. This noise distracts the model and makes resolving conflicts between internal memory and external text even harder.

Existing fixes usually filter the search results before the model reads them, or tweak token probabilities at the very end of generation. Neither approach steps into the middle layers of the neural network, where internal memory and external evidence actually collide.

Methods

The authors propose CARE (Conflict-Aware Representation Editing). It relies on a fascinating quirk of LLM geometry: high-level concepts—like "I am experiencing a knowledge conflict"—tend to organize themselves along neat, linear directions inside the model's hidden layers.

Figure 1: The overall pipeline of CARE. Retrieved context and the question are fed into an LLM to form an internal representation, and an autoencoder encodes it into a latent vector. The model is trained to distinguish latent representations associated with correct versus incorrect answers. At inference time, the learned direction vector is applied to the latent representation of a new input to edit the representation, and the modified vector is then injected back into the LLM to steer it toward a more accurate final output.

Here is how CARE works without changing a single parameter of the base LLM:

  • Generating Conflict Examples: Using a standard QA dataset, the authors collect hidden-state activations for positive cases (ground-truth answers) and negative cases. Crucially, the negatives are split evenly between Parametric Errors (wrong answers given without retrieval) and Noise Errors (wrong answers given despite having the right document, due to distracting noise).
  • Autoencoder Training: For each layer of the LLM, they train a tiny, external 2-layer MLP autoencoder. It compresses the LLM's hidden states into a compact latent space using two goals: a reconstruction loss (don't lose what the LLM was thinking about) and a supervised contrastive loss (pull evidence-aligned states together, push conflict-ridden states apart).
  • Inference-Time Steering: The authors pick the top 5 LLM layers where positive and negative clusters separate most cleanly. They compute a steering vector ($\delta$) pointing from the center of the negative cluster to the positive cluster. During live generation, incoming hidden states are encoded, nudged along $+\delta$, decoded back, and added into the LLM's residual stream to keep it on track.

Datasets

  • Training: CARE is trained exclusively on the training split of Natural Questions (NQ).
  • Evaluation: To test out-of-domain generalization, the authors evaluate on NQ's test set plus four single-hop QA benchmarks (TriviaQA, PopQA, SQuAD, NQ-SWAP) and two multi-hop reasoning benchmarks (HotpotQA, 2WikiMultiHopQA).
  • New Stress-Test: Building on NQ-SWAP (which swaps entities in documents to deliberately contradict an LLM's memory), the authors introduce NOISY-NQ-SWAP, injecting four distracting retrieved passages alongside the gold conflicting passage to simulate messy, real-world search.

Key Insights and Ideas

  • Conflict has a distinct neural signature: CARE isn't just a generic "be smarter" button. When the authors compared conflict-induced errors against ordinary non-conflict mistakes, the latent space separated them with an AUC of 0.96. Training a steering vector on generic mistakes barely helped on conflict benchmarks, proving CARE specifically targets the tug-of-war between memory and context.
  • Targeted nudges beat brute force: Steering just the top 5 most separable layers works best. Editing every layer or cranking up the steering strength ($\lambda$) too high derails the model's text generation. Similarly, injecting a random vector destroys coherence far worse than injecting the exact opposite vector ($-\delta$), because $-\delta$ still stays within the model's valid knowledge subspace.
  • First, do no harm: In transition analyses, CARE achieved the highest Resolution rate (fixing initially wrong parametric answers using context) while maintaining the lowest Corruption rate (refusing to let noisy search results ruin an already-correct answer).
Figure 3: 2D projection of rep- resentations for positive (blue) and negative (red) samples.

Key Results

Evaluated across four backbones (LLaMA-2-7B/13B-Chat, LLaMA-3.1-8B-Instruct, and Qwen-2.5-7B-Instruct) against 13 baselines, CARE achieved the highest overall average performance across every model family—despite only ever seeing NQ during training:

  • Consistent QA Gains: On LLaMA-2-7B-Chat, CARE boosted average Exact Match/F1 across six benchmarks from 26.75 (standard RAG) to 33.93, outperforming specialized methods like Self-RAG (30.85) and TruthX (28.05). On Qwen-2.5-7B-Instruct, it lifted the average from 42.05 to 44.27.
  • Explicit Conflict & Noise: On LLaMA-3.1-8B-Instruct under explicit conflict (NQ-SWAP), CARE jumped Exact Match from 22.00 (standard RAG) to 39.83, beating conflict-mitigation baselines like CAD and IRCAN across the board—a lead it maintained under heavy noise in NOISY-NQ-SWAP.
Figure 2: Performance under explicit knowledge conflict. We compare CARE with conflict-mitigation baselines (CAD, IRCAN) and With Retrieval on NQ-SWAP and NOISY-NQ-SWAP.

Limitations and Future Work

Not discussed in the paper. (While the main text notes that hyperparameter $\lambda$ must be tuned per model to avoid over-intervention and mentions modest inference overhead, explicit dedicated sections on limitations and future directions are omitted or deferred beyond the 10-page main text.)

Summary updated

Abstract

Retrieval-Augmented Generation (RAG) has been widely adopted to enable Large Language Models (LLMs) to ground their responses in external knowledge sources. Nonetheless, recent studies show that conflicts between the retrieved external knowledge and the model’s parametric knowledge can lead to hallucinatory outputs, and this problem is exacerbated when the retrieved documents contain noise. In this work, we propose Conflict-Aware Representation Editing (CARE), an inference-time representation editing method for improving LLM robustness under noisy knowledge conflict settings. CARE learns a latent editing direction from intermediate representations associated with evidence-aligned and conflict-associated erroneous generations, and uses this direction to mitigate conflict-associated activation patterns during inference. We evaluate CARE across Question Answering (QA) benchmarks and LLMs, showing improvements over retrieval-based and conflict-mitigation baselines, especially under noisy retrieval conditions.
BibTeX
@inproceedings{jung2026mitigating,
  author = {Dahyun Jung and Jaehyung Seo and Heuiseok Lim},
  title = {{Mitigating Knowledge Conflicts in Retrieval-Augmented Generation via Inference-Time Representation Editing}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2026},
  url = {https://openreview.net/forum?id=zbapcKkECb},
}
Figure