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

Entropy-Based Decoding for Retrieval-Augmented Large Language Models

Zexuan Qiu, Zijing Ou, Bin Wu, Jingjing Li, Aiwei Liu, Irwin King

Introduction

Retrieval-Augmented Large Language Models (RALMs) have emerged as a robust solution to reduce hallucinations by grounding generation in external evidence. However, these models face significant "distractibility" challenges. First, the "lost in the middle" phenomenon describes how LLMs struggle to identify relevant information when it is buried in a long context of retrieved documents. Second, internal knowledge conflict occurs when a model's pre-trained parametric knowledge contradicts the retrieved evidence, leading the model to ignore the correct external facts in favor of its own internal biases.

The CLeHe Framework

To address these issues without the need for expensive fine-tuning, we introduce CLeHe (Contrasting Low-entropy with High-entropy), a training-free decoding strategy. CLeHe operates in two primary stages: Low-entropy Ensemble (LeEns) and Layer-wise Contrastive Decoding.

Overview of the CLeHe decoding strategy, illustrating the parallel document processing and entropy-based layer selection.

1. Low-entropy Ensemble (LeEns)

Instead of concatenating multiple retrieved documents into a single prompt—which often triggers position bias—CLeHe processes each document in parallel. For every generated token, the model calculates the entropy (uncertainty) of the output distribution for each document. The core intuition is that if a document contains the correct answer, the model will exhibit higher certainty (lower entropy) regarding the next token. By weighting documents based on this entropy signal, the ensemble effectively "zooms in" on the most relevant information regardless of its original retrieval rank or position.

2. Layer-wise Contrastive Decoding

To mitigate internal knowledge conflict, CLeHe employs a contrastive mechanism. It compares the distribution derived from the document ensemble against the model's internal knowledge (generated without context). Rather than simply using the final layer, CLeHe dynamically selects the internal layer with the highest entropy. This layer represents the model's most ambiguous state, serving as a baseline to highlight the specific information gain provided by the external documents. This ensures the model only amplifies information that is actually clarified by the external context.

Experimental Results

The framework was evaluated on standard open-domain QA benchmarks, including Natural Questions (NQ), TriviaQA, WebQ, and PopQA. CLeHe demonstrated substantial improvements over "Naive RAG" and "REPLUG," with an average absolute gain of +11.74% on Llama-2-7B. The benefits were most pronounced in smaller models (7B), suggesting that CLeHe is particularly effective at helping smaller models overcome weaker reasoning and context-handling capabilities.

Mitigating Position Bias

A key strength of CLeHe is its ability to solve the "lost in the middle" problem. In synthetic tests where the correct document was placed at various positions among distractors, Naive RAG showed a characteristic U-shaped performance curve, failing when the answer was in the center. In contrast, CLeHe maintained stable, high accuracy across all positions.

Performance comparison across document positions, showing CLeHe's robustness to the 'lost in the middle' phenomenon compared to Naive RAG.

Key Insights and Discussion

  • Uncertainty as a Relevance Signal: The model's own output entropy is a more reliable indicator of document relevance than static retrieval scores (like BM25). This allows the model to dynamically adjust its focus during the generation process.
  • Efficiency: Despite the parallel processing, CLeHe only increases decoding latency by a factor of 1.1x to 1.2x, making it a viable alternative to computationally expensive training-based methods.
  • Limitations: The current study focused on Question Answering and models up to 13B parameters. Future work will explore the application of this method to broader tasks like long-form summarization and its scalability to massive models (70B+).

Conclusion

CLeHe proves that uncertainty, measured via entropy, is a powerful signal for document relevance and layer selection. By bypassing long-sequence position bias through parallel processing and contrasting against internal ambiguity, CLeHe offers a "plug-and-play" solution for making RALMs more robust and reliable.

Summary updated

BibTeX
@inproceedings{qiu2025entropy,
  author = {Zexuan Qiu and Zijing Ou and Bin Wu and Jingjing Li and Aiwei Liu and Irwin King},
  title = {{Entropy-Based Decoding for Retrieval-Augmented Large Language Models}},
  booktitle = {Conference of the North American Chapter of the Association for Computational Linguistics},
  year = {2025},
  doi = {10.18653/v1/2025.naacl-long.236},
}
Figure