TL;DR
DS-CMS² is a training-free framework that resolves knowledge conflicts in Retrieval-Augmented Generation (RAG) by operating in semantic space. By measuring a model's "semantic entropy," it filters out misleading retrieved documents before inference and adaptively balances internal memory against external evidence during decoding, achieving state-of-the-art performance across multiple LLMs without any additional fine-tuning.
What Problem Does This Paper Address?
Retrieval-Augmented Generation (RAG) is the go-to solution for grounding Large Language Models (LLMs) in up-to-date, external facts. However, RAG introduces two major headaches:
- Inter-context conflict: Multiple retrieved documents provide contradictory information (e.g., one says "A" and another says "B").
- Context-memory conflict: The retrieved document contradicts what the model "learned" during pre-training.
Existing solutions usually require expensive task-specific training or use rigid decoding rules that often fail when the retrieved context is noisy. As shown in Figure 1a, these conflicts inject uncertainty that can lead to hallucinations or incorrect answers.
Methods
The authors propose Dual-Stage Confidence Measurement in Semantic Space (DS-CMS²). The core innovation is moving away from token-level probability (which is noisy due to synonyms) to Semantic Entropy (SE). SE measures uncertainty by clustering semantically equivalent model outputs and calculating entropy over those clusters.
The framework operates in two stages:
- Pre-inference Knowledge Filtering: Before the final answer is generated, the model "probes" each retrieved document. If a document leads to high semantic entropy (meaning the model is confused and generates many different meanings), it is flagged as unreliable or irrelevant and filtered out.
- Post-inference Semantic Contrastive Decoding (SCD): Once reliable sources are identified, the model generates two distributions: an "Expert" (with context) and an "Amateur" (without context). It then uses a dynamic adjustment factor ($\alpha$) based on the expert's semantic confidence to amplify the correct semantic signals. If the model is already confident, it applies a light touch; if it's uncertain, it leans harder on the contrastive signal to align with the context.
Datasets
The authors evaluated DS-CMS² on three open-domain QA benchmarks and one long-form generation task:
- Natural Questions (NQ)
- TriviaQA
- WebQA
- TruthfulQA (specifically for testing long-form hallucinations)
To rigorously test conflict resolution, they used a hybrid strategy: real retrieval results from Wikipedia supplemented with synthetically generated misleading and irrelevant passages.
Key Insights and Ideas
- LLMs "Know" When They're Being Misled: The authors found that when an LLM is exposed to misleading or irrelevant context, its output semantic entropy spikes. This makes SE a powerful, training-free signal for identifying "bad" data.
- Semantic Space > Token Space: Traditional contrastive decoding operates on tokens. DS-CMS² operates on meanings. This prevents the model from being penalized for using different but synonymous words, which is a common failure mode in token-level methods.
- Dynamic Adjustment is Crucial: A fixed contrastive strength often leads to overcorrection. By tying the adjustment factor $\alpha$ directly to the model's uncertainty (SE), the system becomes significantly more robust.
- Truthful Context = Low Entropy: As shown in Figure 1b, truthful context consistently results in the lowest semantic entropy across different models like LLaMA-2, LLaMA-3, and Mistral.
Key Results
DS-CMS² consistently outperformed strong baselines like CAD, AdaCAD, and CRAG.
- Overall Performance: Achieved an average improvement of 5.17% over the strongest baseline across all settings.
- Model Scaling: The benefits were even more pronounced on more capable models. On Mistral-7B, it surpassed the second-best method by 7.8 percentage points.
- Conflict Robustness: In fine-grained evaluations (Figure 3), DS-CMS² showed superior balance. While methods like CRAG are good at handling inter-context conflicts, they often collapse when context contradicts the model's memory. DS-CMS² maintained high accuracy in both scenarios.
Limitations and Future Work
- Computational Cost: The method requires sampling multiple sequences ($M=10$ in the paper) to calculate entropy. While the authors use KV-cache reuse to keep latency manageable (around 3.34s per query), it is still slower than standard RAG.
- The "Confidently Wrong" Problem: If a model is extremely confident in an incorrect internal memory, the semantic entropy will be low, and the system might fail to apply enough contrastive adjustment to fix it. However, the authors note this "failure mode" occurs in less than 6% of cases.
- Clustering Dependency: The system relies on a semantic equivalence judge (like GPT-4o-mini or DeBERTa). While they showed that local models like DeBERTa work well, the choice of judge still impacts the final clustering quality.
Summary updated