The Power of Noise: Redefining Retrieval for RAG Systems

Florin Cuconasu, Giovanni Trappolini, Federico Siciliano, Simone Filice, Cesare Campagnano, Yoelle Maarek, Nicola Tonellotto, Fabrizio Silvestri · DOI · OpenReview

Abstract

Retrieval-Augmented Generation (RAG) systems represent a significant advancement over traditional Large Language Models (LLMs). RAG systems enhance their generation ability by incorporating external data retrieved through an Information Retrieval (IR) phase, overcoming the limitations of standard LLMs, which are restricted to their pre-trained knowledge and limited context window. Most research in this area has predominantly concentrated on the generative aspect of LLMs within RAG systems. Our study fills this gap by thoroughly and critically analyzing the influence of IR components on RAG systems. This paper analyzes which characteristics a retriever should possess for an effective RAG's prompt formulation, focusing on the type of documents that should be retrieved. We evaluate various elements, such as the relevance of the documents to the prompt, their position, and the number included in the context. Our findings reveal, among other insights, that including irrelevant documents can unexpectedly enhance performance by more than 30% in accuracy, contradicting our initial assumption of diminished quality. These results underscore the need for developing specialized strategies to integrate retrieval with language generation models, thereby laying the groundwork for future research in this field.

Introduction

Retrieval-Augmented Generation (RAG) has become the industry standard for grounding Large Language Models (LLMs) in external, up-to-date knowledge. By retrieving relevant documents and feeding them into the LLM's prompt, RAG helps mitigate hallucinations and extends the model's knowledge base beyond its training data. However, the relationship between the Information Retrieval (IR) component and the generator (the LLM) is often treated as a "black box."

Conventional wisdom suggests that the more semantically similar a retrieved document is to a query, the more helpful it will be for the LLM. This paper challenges that assumption, investigating how the type, number, and position of retrieved documents influence model accuracy. The findings suggest that our current approach to retrieval may be fundamentally misaligned with how LLMs process information.

Experimental Methodology

To understand the dynamics of RAG, the researchers conducted a large-scale systematic study of prompt construction. They categorized the context provided to the LLM into four distinct document types:

  • Gold (⋆): The specific passage containing the correct answer.
  • Relevant: Other passages that contain the answer but are not the primary source.
  • Distracting: Passages that are semantically similar to the query but do not contain the answer (often called "hard negatives").
  • Random: Completely unrelated passages (noise) sourced from out-of-domain corpora.

The study evaluated four popular LLMs—Llama2-7B, Falcon-7B, Phi-2, and MPT-7B—across various retrieval setups. They utilized both dense retrievers (Contriever, ADORE) and sparse retrievers (BM25) to see how different retrieval methods affected the final generation. The experiments specifically manipulated the position of the "Gold" document (Far, Mid, or Near the query) and the ratio of distracting versus random documents.

Datasets

The evaluation utilized the Natural Questions (NQ-open) dataset, consisting of real-world Google searches. The primary corpus for retrieval was Wikipedia, segmented into 100-word passages. To test the impact of out-of-domain noise, the researchers also incorporated data from Reddit (Webis-TLDR-17).

The Toxicity of "Hard Negatives"

In traditional Information Retrieval, "hard negatives" (distracting documents) are considered valuable for training models to distinguish between subtle differences. However, for RAG systems, these documents act as poison. The study found that adding just one distracting document can drop LLM accuracy by 25%. In the most extreme cases, performance plummeted by as much as 67%.

This suggests that when a retriever is "too good" at finding semantically similar but ultimately irrelevant content, it actively sabotages the LLM's ability to extract the correct answer. Interestingly, the "old school" BM25 retriever often led to better RAG performance than modern dense retrievers like Contriever. This is because BM25 is less likely to surface the specific type of "hard negatives" that confuse the attention mechanisms of transformers.

The "Lost in the Middle" Effect

The research confirms the existence of the "Lost in the Middle" phenomenon. LLMs struggle to identify and utilize information when it is buried in the center of a long prompt. Performance is consistently highest when the "Gold" document is placed in a "strong" position—specifically, immediately before the query. As the relevant information moves further away from the query, the model's ability to retrieve the correct answer from its context diminishes.

The Power of Noise: A Counter-Intuitive Discovery

The most significant finding of the study is the beneficial role of random noise. While distracting documents (semantically similar but wrong) degrade performance, adding completely random, irrelevant documents to the prompt actually improved accuracy by up to 35% (most notably in the MPT model).

Why Does Noise Help?

The authors propose the concept of "entropy collapse." When a prompt contains only a few highly similar documents, the LLM's attention mechanism can become too narrow, fixating on the wrong information among the distractors. By introducing random noise, the "attention entropy" is increased. This acts as a form of regularization, preventing the model from over-focusing on misleading distractors and allowing it to remain "open-minded" enough to identify the correct answer in the Gold document.

This benefit held true even when the noise was nonsensical (random words) or from a completely different domain (Reddit), suggesting that the effect is structural to the transformer architecture rather than dependent on the content of the noise itself.

Conclusion and Future Directions

This research highlights a critical need for "RAG-aware" retrievers. Current IR systems are optimized for human relevance or semantic similarity, but these metrics do not necessarily align with what an LLM needs to generate an accurate response.

While the study focused on short-answer extraction, the implications are clear: the goal of retrieval for RAG should not just be similarity, but the optimization of the generator's attention. Future work must explore whether these findings hold for complex reasoning and long-form synthesis, and how we can design retrievers that provide the ideal balance of relevance and "helpful noise" to maximize LLM performance.

Summary updated

BibTeX
@inproceedings{cuconasu2024power,
  author = {Florin Cuconasu and Giovanni Trappolini and Federico Siciliano and Simone Filice and Cesare Campagnano and Yoelle Maarek and Nicola Tonellotto and Fabrizio Silvestri},
  title = {{The Power of Noise: Redefining Retrieval for RAG Systems}},
  booktitle = {International ACM SIGIR Conference on Research and Development in Information Retrieval},
  year = {2024},
  doi = {10.1145/3626772.3657834},
}
Figure