Towards Fair RAG: On the Impact of Fair Ranking in Retrieval-Augmented Generation

To Eun Kim, Fernando Diaz

TL;DR

Retrieval-Augmented Generation (RAG) systems traditionally rely on deterministic top-$k$ retrieval, which systematically excludes equally relevant documents from being seen by the language model. This paper introduces fairness-aware stochastic retrieval to RAG, demonstrating that injecting controlled randomness can achieve fairer source exposure and more balanced attribution without sacrificing—and sometimes even improving—downstream generation quality.

What Problem Does This Paper Address?

When a RAG system answers a user query, it retrieves a ranked list of documents and truncates them to fit the Large Language Model's (LLM) limited context window. Standard systems do this deterministically, always selecting the absolute top-scoring items.

However, as shown in Figure 1, if multiple documents (e.g., from different companies or content creators) are equally relevant, a deterministic system will repeatedly favor the same top few items across multiple identical or similar user requests. This creates severe item-side unfairness, starving lower-ranked but highly useful documents of exposure. In real-world applications, this can lead to downstream representational harms, biased answers, or unfair financial/reputational impacts for content providers who rely on citations or traffic.

Figure 1: Fairness concerns in RAG. A simplified example of how RAG models can ignore equally relevant items (𝑑3 and 𝑑4) and always consume the fixed top-scoring items (𝑑1 and 𝑑2) with the same order of ranking over the multiple user requests. This is due to the deterministic nature of the retrieval process and a short context-length of a language model that necessitates the top-𝑘truncation of a ranked list.

Methods

The authors bridge the gap between traditional fair ranking and RAG by introducing a systematic evaluation framework based on two key components:

  1. Utility-Based Labeling: Instead of using human relevance judgments, the authors define an item's worthiness by its utility-gain—the marginal improvement it provides to the LLM's task performance when included in the prompt compared to a vanilla baseline prompt.
  2. Fairness-Aware Stochastic Retriever: To mitigate the rigidity of deterministic ranking, they convert standard retrievers into stochastic ones using Plackett-Luce sampling. By introducing a fairness control parameter ($\alpha$), they can smoothly adjust the system from completely random ($\alpha=0$) to fully deterministic ($\alpha \to \infty$).

The complete evaluation pipeline measures how retrieval fairness propagates through the LLM to impact generation quality and final source attribution (Figure 2).

Overview of the experimental design evaluating fairness, utility, and attribution.

Datasets

The experiments were conducted using the LaMP benchmark (Language Model Personalization), which evaluates LLMs on personalization tasks using users' interaction histories. The authors specifically highlighted tasks like LaMP-1 (academic citation classification) and LaMP-4 (news article text generation). They constructed a specialized test collection from the first 1,000 entries of the development set, filtering out queries that did not feature multiple useful documents.

Key Insights and Ideas

  • The Fairness-Utility Tradeoff is Not Strict: The most surprising finding is that introducing fairness via stochastic ranking does not inherently degrade RAG performance. In fact, mild randomization often improves downstream generation quality.
  • Why Randomization Helps: LLMs are notoriously sensitive to document ordering (e.g., "lost in the middle" phenomena) and can be easily derailed by distracting text within high-scoring documents. Perturbing the ranking acts as a form of regularization, occasionally surfacing overlooked high-utility items or rearranging documents into a structure the LLM handles better.
  • Retrieval Fairness Drives Attribution Fairness: Ensuring equitable exposure at the retrieval stage successfully translates to more balanced citation and usage patterns in the final text generated by the LLM.

Key Results

  • Performance Gains: In many configurations, RAG systems operating within a high-fairness interval (e.g., Expected Exposure Disparity $\text{EE-D} \in [0.8, 1.0)$) outperformed the deterministic baseline. For instance, this range beat the baseline for all evaluated models in the LaMP-4 dataset.
  • Controlled Disparity: The parameter $\alpha$ successfully regulated ranking disparity. Setting $\alpha=4$ consistently yielded well-distributed, fairer document exposure compared to the baseline ($\alpha=8$).
  • Attribution Correlation: The generator proved significantly more likely to cite and utilize multiple items if the stochastic retriever maintained high ranking quality, confirming that fair retrieval directly supports fair consumption.

Limitations and Future Work

  • Computational Cost: Evaluating stochastic RAG requires repeated sampling ($N=100$ in this study) and multiple LLM inference steps, which can be computationally expensive during evaluation (though less problematic in production where only a single fair permutation needs to be sampled).
  • Independent Utility Assumption: The utility labeling framework annotates documents individually, failing to account for synergistic or redundant interactions when multiple documents are presented together in a single prompt.
  • Scope of Exposure: The current method focuses primarily on the fairness of the attributed sources rather than tracking exposure across the entire underlying corpus.

Future work aims to extend this framework to handle graded or missing utility judgments and explore broader definitions of group and consumer-side fairness within generative AI pipelines.

Summary updated

BibTeX
@misc{kim2024towards,
  author = {To Eun Kim and Fernando Diaz},
  title = {{Towards Fair RAG: On the Impact of Fair Ranking in Retrieval-Augmented Generation}},
  year = {2024},
  eprint = {2409.11598},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2409.11598},
}
Figure