Fairness-Aware Retrieval Optimization for Retrieval-Augmented Generation

Yingqi Zhao, Vasilis Efthymiou, Jyrki Nummenmaa, Kostas StefanidisarXiv 2026

TL;DR

Retrieval-Augmented Generation (RAG) improves LLM reliability but can inadvertently propagate and amplify biases found in retrieved documents. This paper introduces a three-stage framework and a scalable optimization algorithm called FARO to model position-dependent bias propagation in top-$k$ retrieval. The approach successfully mitigates downstream generation bias while preserving document relevance without requiring costly embedding model fine-tuning.

What Problem Does This Paper Address?

While RAG systems excel at reducing hallucinations by injecting external knowledge, they introduce a subtle vulnerability: the selection and ordering of retrieved documents can heavily bias the LLM's final output.

Prior work established that a linear relationship exists between embedding bias and output bias in simple top-1 retrieval settings. However, real-world RAG systems rely on top-$k$ retrieval, where multiple documents are fed into the prompt simultaneously. Because LLMs exhibit position-dependent attention patterns, documents at different ranks interact in complex, non-linear ways to influence the output. Furthermore, traditional fairness-aware ranking methods only focus on ensuring equitable exposure for item providers, completely ignoring how those ranking decisions impact downstream text generation.

The authors tackle this gap by asking: How can we precisely model how bias propagates through multi-document RAG contexts, and how can we optimize retrieval to guarantee fair outputs without destroying prompt relevance?

Methods

The authors propose an end-to-end, three-stage framework:

  1. Controlled Bias Injection via Reranking: Instead of fine-tuning the underlying embedding model (which is computationally expensive), the authors partition the knowledge base into group-specific subsets (e.g., liberal vs. conservative viewpoints). For any given query, they independently retrieve candidates from each group and use a probabilistic reranker to systematically alter the group distribution at specific ranks.
  2. Bias Propagation Modeling: By treating the LLM as a black box and applying controlled perturbations to the position-wise embedding bias ($E_b^p$), they fit a linear regression model to map how input bias at each rank contributes to the final output bias ($R_b$).
  3. Fairness-Aware Retrieval Optimization (FARO): The retrieval task is formulated as a constrained optimization problem maximizing relevance while keeping output bias below a strict threshold. To solve the scalability issues of standard Linear Programming (LP)—which couples all questions globally—the authors introduce FARO (Quadratic Fairness via Dual Hyperplane Approximation). Using Fenchel-Legendre dual representation, FARO decomposes the massive global problem into independent, per-question subproblems that can be solved efficiently in parallel using the Hungarian algorithm.

Datasets

The framework was evaluated on two distinct bias dimensions:

  • Political Bias: Constructed using statements from the TwinViews-13k dataset. The authors sampled 200 topic instances (paired left- and right-leaning statements) and generated 200 neutral evaluation questions using Copilot. A second, separate question set from prior work was used to test cross-dataset generalization.
  • Gender Bias: Built using a dataset of Wikipedia biographical profiles of historical figures. The authors generated an occupation-gender QA dataset using 4 neutral templates applied across 55 occupations, forcing the model to select between male and female candidate answers.

Key Insights and Ideas

  • Bias Propagation is Highly Model-Specific: Different LLMs allocate attention uniquely. For political bias, Llama and Gemma heavily favor documents at the beginning of the context, whereas Mistral distributes attention across both early and late positions.
  • The "Counter-Bias" Phenomenon: In top-5 gender bias experiments, some models exhibited negative positional weights for later ranks. This implies that documents placed at certain positions can actually counteract bias signals introduced earlier in the prompt.
  • RAG Weakens Safety Safeguards: Models like Gemma and Mistral showed high refusal rates (indicating strong alignment safeguards) when evaluated on sensitive questions without retrieval. However, as soon as RAG context was introduced, refusal rates plummeted, showing that external context can inadvertently bypass safety filters.
  • The Intrinsic Bias Bottleneck: Retrieval optimization is highly effective if the underlying LLM is relatively balanced. However, if a model possesses a massive intrinsic bias (like Qwen on political questions), retrieval manipulation alone cannot fully correct the output shift.

Key Results

  • Effective Mitigation: FARO successfully brought output bias within the target threshold ($|R_b| \le 0.1$) for models like Llama and Gemma while maintaining near-perfect normalized relevance scores (~0.99).
  • Scalability Win: While standard Linear Programming (LP) suffers from cubic-time complexity and fails to scale as the dataset grows, FARO breaks the problem down per question. As $k$ increases, FARO demonstrates a massive computational efficiency advantage over LP.
  • Pareto Frontier Exploration: Unlike LP, which yields a single hard constraint solution, FARO allows engineers to sweep a surrogate parameter ($\mu$) to map out the entire relevance-fairness trade-off curve dynamically.

Limitations and Future Work

The authors acknowledge several limitations in their current framework:

  1. Linearity Assumption: The bias propagation model assumes that document contributions are additive and independent, which ignores higher-order semantic interactions between documents inside an LLM prompt.
  2. Binary Constraints Only: The current formulation is strictly limited to binary group fairness (e.g., male vs. female, liberal vs. conservative) and does not naturally extend to multi-group scenarios (like nationality or race).
  3. Dependence on Base Models: The system cannot entirely overcome severe intrinsic LLM biases.

Future research directions include developing non-linear or interaction-aware bias models, extending the optimization framework to multi-group fairness definitions, and exploring adaptive, question-specific retrieval strategies.

Summary updated

BibTeX
@misc{zhao2026fairness,
  author = {Yingqi Zhao and Vasilis Efthymiou and Jyrki Nummenmaa and Kostas Stefanidis},
  title = {{Fairness-Aware Retrieval Optimization for Retrieval-Augmented Generation}},
  year = {2026},
  eprint = {2605.15790},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2605.15790},
}
Figure