Similarity is Not All You Need: Endowing Retrieval Augmented Generation with Multi Layered Thoughts

Chunjing Gan, Dan Yang, Binbin Hu, Hanxiao Zhang, Siyuan Li, Ziqi Liu, Yue Shen, Lin Ju, Zhiqiang Zhang, Jinjie Gu, Lei Liang, Jun ZhouarXiv 2024

Abstract

In recent years, large language models (LLMs) have made remarkable achievements in various domains. However, the untimeliness and cost of knowledge updates coupled with hallucination issues of LLMs have curtailed their applications in knowledge-intensive tasks, where retrieval augmented generation (RAG) can be of help. Nevertheless, existing retrieval augmented models typically use similarity as a bridge between queries and documents and follow a retrieve-then-read procedure. In this work, we argue that similarity is not always the panacea and totally relying on similarity would sometimes degrade the performance of retrieval augmented generation. To this end, we propose MetRag, a Multi-layEred Thoughts enhanced Retrieval Augmented Generation framework. To begin with, beyond existing similarity-oriented thought, we embrace a small-scale utility model that draws supervision from an LLM for utility-oriented thought and further come up with a smarter model by comprehensively combining the similarity and utility-oriented thoughts. Furthermore, given the fact that the retrieved document set tends to be huge and using them in isolation makes it difficult to capture the commonalities and characteristics among them, we propose to make an LLM as a task-adaptive summarizer to endow retrieval augmented generation with compactness-oriented thought. Finally, with multi-layered thoughts from the precedent stages, an LLM is called for knowledge-augmented generation. Extensive experiments on knowledge-intensive tasks have demonstrated the superiority of MetRag.

The Limitation of Similarity

Retrieval-Augmented Generation (RAG) has become the standard way to reduce hallucinations in Large Language Models (LLMs) by providing them with external documents. However, most RAG systems rely entirely on semantic similarity—how much the text of a document looks like the query—to choose which information to show the model.

The authors argue that similarity is not a "panacea." A document might be highly similar to a query but provide zero "information gain." For example, if a user asks about George R.R. Martin's books, a document stating "George R.R. Martin is an author" is highly similar but practically useless for answering specific bibliographic questions.

Comparison of Similarity vs. Utility models in document retrieval.

Furthermore, feeding multiple long documents into an LLM often leads to "information overload," where the model gets confused by noise or loses the relevant answer in a sea of text, a phenomenon known as the "lost in the middle" effect.

The METRAG Framework

To address these issues, the authors propose METRAG (Multi-layEred Thoughts enhanced RAG), which processes information through three distinct stages designed to refine raw retrieved data into high-utility knowledge.

The three-stage architecture of the METRAG framework.

1. Utility-Oriented Thought

Instead of just using a standard retriever, METRAG trains a "Utility Model." They use a large "teacher" LLM to score how much a specific document actually helps in answering a query. They then use KL-Divergence to train a smaller retriever to mimic this utility-based selection. This allows for selective retrieval, where the system can choose to retrieve nothing if the LLM already possesses the necessary knowledge, saving computation and avoiding unnecessary noise.

2. Compactness-Oriented Thought

To solve the noise problem, they develop a Task-adaptive Summarizer. This is not a generic summarizer; it is trained to extract only the information relevant to the specific query. This involves two steps:

  • Distillation: Training a Llama-2 model to summarize using GPT-4 outputs as a gold standard.
  • Alignment: Refining this model using a Direct Preference Optimization (DPO) approach, where the "reward" is based on whether the resulting summary actually helps the final LLM reach the correct answer.

3. Knowledge-Augmented Generation

Finally, the LLM generates the answer using the "multi-layered thoughts"—the high-utility, condensed information—derived from the previous stages. This ensures the model receives a "needle" of information rather than a "haystack" of text.

Experimental Results

The researchers evaluated METRAG across four diverse benchmarks: NQ (Natural Questions), TriviaQA, HotpotQA (multi-hop reasoning), and PopQA (long-tail entities).

Key findings include:

  • Superior Performance: METRAG (using Llama-2-13B) outperformed much larger models and competitive RAG baselines. On TriviaQA, it achieved an Exact Match (EM) score of 74.8, beating ChatGPT's 71.4.
  • Conciseness Wins: METRAG showed massive gains in F1 scores. On NQ, it achieved an F1 of 53.9, compared to Llama-2-13B RAG's 21.2.
  • Efficiency: The task-adaptive summarizer reduced the input text to roughly 6.7% - 8.2% of its original length while actually improving accuracy by removing distracting "dross."

Conclusion

METRAG demonstrates that "similarity is not all you need." By prioritizing document utility and task-specific compactness, the framework significantly reduces noise and improves the accuracy of LLMs on knowledge-intensive tasks. While the framework requires multiple training stages, the resulting performance gains and efficiency in context usage suggest a promising path forward for robust retrieval-augmented systems.

Summary updated

BibTeX
@misc{gan2024similarity,
  author = {Chunjing Gan and Dan Yang and Binbin Hu and Hanxiao Zhang and Siyuan Li and Ziqi Liu and Yue Shen and Lin Ju and Zhiqiang Zhang and Jinjie Gu and Lei Liang and Jun Zhou},
  title = {{Similarity is Not All You Need: Endowing Retrieval Augmented Generation with Multi Layered Thoughts}},
  year = {2024},
  eprint = {2405.19893},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2405.19893},
}
Figure