Stable-RAG: Fixing the "Order Obsession" that Causes RAG Hallucinations

Stable-RAG: Mitigating Retrieval-Permutation-Induced Hallucinations in Retrieval-Augmented Generation

2026-01-01
Qianchi Zhang, Hainan Zhang, Liang Pang, Hongwei Zheng, Zhiming Zheng
Summary
Problem
Method
Results
Takeaways
Abstract

Stable-RAG is a novel framework designed to mitigate "Permutation-Induced Hallucinations" in Retrieval-Augmented Generation (RAG). It utilizes spectral clustering of internal hidden states to estimate reasoning stability and employs Direct Preference Optimization (DPO) to align divergent reasoning paths, achieving state-of-the-art accuracy and consistency across multiple QA benchmarks.

TL;DR

Even when the correct answer is right in front of them, LLMs can be "tricked" into hallucinating simply by changing the order of retrieved documents. Stable-RAG is a new framework that tackles this "Permutation-Induced Hallucination" by analyzing the model's internal reasoning clusters and using Direct Preference Optimization (DPO) to force the model to stay consistent, regardless of how you shuffle the input.

Background: The Butterfly Effect of Document Order

In Retrieval-Augmented Generation (RAG), we assume that if the "Gold Document" is in the context, the model will find it. However, the authors of Stable-RAG discovered a disturbing vulnerability: LLM answers vary wildly across different permutations of the same Top-5 documents.

This isn't just a "long context" problem (the so-called "lost-in-the-middle" effect). Even in short contexts under 1,000 tokens, moving a document can cause the model's internal reasoning to "branch" into entirely different—and often wrong—directions.

Why Does Shuffling Cause Hallucinations?

The authors performed a deep dive into the LLM's "brain" (hidden states). Their insight is that permutation sensitivity stems from structural instability in internal reasoning dynamics. As the signal passes through deeper layers, the document order causes the reasoning trajectories to diverge.

Layer-wise Visualization Figure: Visualizing how reasoning trajectories (colors represent different answers) stay mixed in shallow layers but diverge into distinct "islands" in deeper layers based on document order.

Methodology: Clustering the "Reasoning Modes"

Stable-RAG doesn't just ask the model for an answer once. It maps out the model's potential confusion and then trains it to be stable.

  1. Hidden State Clustering: For a given query, the system generates multiple permutations of the documents. It extracts the hidden states of the last token in the final layer.
  2. Spectral Clustering: It uses spectral clustering to group these hidden states. Each group represents a "reasoning mode." Instead of decoding 120 permutations (which is expensive), it only decodes the "centroid" of each cluster.
  3. DPO Alignment: It identifies which clusters lead to the correct answer and which lead to hallucinations. Using Direct Preference Optimization (DPO), it trains the model to prefer the "Stable and Correct" path and to say "I don't know" when the evidence is genuinely missing.

Stable-RAG Overall Framework

Experiments & SOTA Results

Stable-RAG was tested on NQ, TriviaQA, and HotpotQA using LLaMA3-8B and Qwen3-8B.

  • Accuracy Boost: It significantly outperformed standard RAG and other robust methods (like RetRobust and ATM).
  • Position Robustness: The "Perturbation Success Rate" (the chance an attacker could cause a hallucination by reordering docs) dropped significantly.
  • Generalization: A model trained on one retriever (DPR) worked remarkably well on another (Contriever), proving the method fixes the generator's logic, not just the retriever's bias.

Main Results Table

Critical Insight: The Future of Robust RAG

The takeaway from Stable-RAG is that RAG robustness isn't just about better retrievers or position-aware encodings. It’s about Internal Reasoning Stability.

While the current method is computationally heavier than standard inference (due to the clustering stage during training/data prep), it proves that we can "debug" an LLM's reasoning by looking at its hidden state manifold. The limitation remains that it primary optimizes the final layer; future work could extend this "stability constraint" to every layer of the Transformer block.

Conclusion

Stable-RAG represents a shift from "black-box" prompting to "white-box" alignment for RAG. By forcing the model to reach the same conclusion through different document "doors," we create a system that is not only more accurate but significantly more trustworthy in production environments.

Find Similar Papers

Try Our Examples

  • Search for recent studies investigating the structural instability of LLM reasoning trajectories across different layers or internal hidden states.
  • Who first identified the 'lost-in-the-middle' phenomenon in RAG systems, and how does the concept of 'Permutation-Induced Hallucination' in this paper expand upon that theory?
  • Explore whether the clustering of hidden states and DPO alignment can be applied to improve consistency in multimodal retrieval-augmented tasks like Video-QA or Image-Instruction following.
Contents
Stable-RAG: Fixing the "Order Obsession" that Causes RAG Hallucinations
1. TL;DR
2. Background: The Butterfly Effect of Document Order
3. Why Does Shuffling Cause Hallucinations?
4. Methodology: Clustering the "Reasoning Modes"
5. Experiments & SOTA Results
6. Critical Insight: The Future of Robust RAG
7. Conclusion