SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2409.19804 · 2024

Does RAG Introduce Unfairness in LLMs? Evaluating Fairness in Retrieval-Augmented Generation Systems

arXiv · PDF · Open in the Atlas

Code that ran

8 of 10 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (0 of them constructed an object rather than computing a result; 0 honoured the contract we drafted, 0 violated it and 0 have no contract verdict; 8 failures of our instrument; 2 no recorded run), measured 2026-11-22; repository links from the Papers with Code archive attributed under CC BY-SA, no affiliation; bodies inline only under a permissive licence as GitHub detects it. Not a reproduction of the paper's results.

"Ran" means the function executed on a synthesized input and returned a value. It is not a reproduction of the paper's results. This record, dated, as JSON: /api/ran/2409.19804.json · badge: /api/ran/2409.19804.svg

Each repository's role is a label: a classifier's output recorded on the link, or, where no role is recorded, what the Papers with Code archive marked. The line under it names its basis. Neither says who wrote the code.

RepositoryRoleRan
elviswxy/rag_fairness canonical (classifier label)
classifier basis: census
8 ran · 2 no recorded run
FunctionStatusWhere it lives
basic_process Ran
ran; our contract draft was wrong, not the code
elviswxy/rag_fairness/preprocess_trec_wiki.py
pointer only (licence: NONE) · get_code("b645135617451850")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, elviswxy/rag_fairness when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

compute_bleu Ran
ran; our contract draft was wrong, not the code
elviswxy/rag_fairness/flashrag/evaluator/_bleu.py
pointer only (licence: NONE) · get_code("2dd8e40379d7bbb9")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, elviswxy/rag_fairness when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

cross_attention_forward Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
elviswxy/rag_fairness/flashrag/generator/fid.py
pointer only (licence: NONE) · get_code("6bef6bdd6eb44070")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, elviswxy/rag_fairness when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

gender_random_all_irrelevant_pairs_by_q_text Ran
ran; our contract draft was wrong, not the code
elviswxy/rag_fairness/prepare_rag_fairness_data.py
pointer only (licence: NONE) · get_code("1c191093e712cd32")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, elviswxy/rag_fairness when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

gender_random_all_relevant_pairs_by_q_text Ran
ran; our contract draft was wrong, not the code
elviswxy/rag_fairness/prepare_rag_fairness_data.py
pointer only (licence: NONE) · get_code("573b1bed7e8e5370")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, elviswxy/rag_fairness when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

gender_random_one_relevant_pairs_by_q_text Ran
ran; our contract draft was wrong, not the code
elviswxy/rag_fairness/prepare_rag_fairness_data.py
pointer only (licence: NONE) · get_code("74ed96cc94ee5e21")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, elviswxy/rag_fairness when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

get_existed_results Ran
ran; our contract draft was wrong, not the code
elviswxy/rag_fairness/offline_evaluation.py
pointer only (licence: NONE) · get_code("a0df218ea7171bde")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, elviswxy/rag_fairness when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

normalize_answer Ran
ran; our contract draft was wrong, not the code
elviswxy/rag_fairness/flashrag/evaluator/utils.py
pointer only (licence: NONE); the stored copy get_code serves, from shmsw25/GraphRetriever, is pointer only (licence: NONE) · get_code("dae7ab386661a4f4")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, elviswxy/rag_fairness when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

create_segments Not yet run
unverified (harvested, no recorded run)
elviswxy/rag_fairness/preprocess_trec_wiki.py
pointer only (licence: NONE) · get_code("71b1ede1102f38f1")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, elviswxy/rag_fairness when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. No invocation recorded.

load_corpus Not yet run
unverified (harvested, no recorded run)
elviswxy/rag_fairness/preprocess_trec_wiki.py
pointer only (licence: NONE) · get_code("7b7eafb43497dd26")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, elviswxy/rag_fairness when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. No invocation recorded.

Also present in other papers' code

Of 10 samples lifted from this paper's linked repositories, 10 carry a function identity and 0 do not. Of the 10 distinct functions with an identity, 3 are also present in other papers whose code we hold (3 with at least one paper dated earlier, 1 the same month, 3 later) and 7 are only here among the 52,977 papers whose code Syntology holds (as of 2026-09-26).

Only here means: among the 52,977 papers whose code Syntology holds (51,887 with lifted samples, 1,090 through their assemblies only), as of 2026-09-26, no other paper's lifted samples or current assembly bricks contain an identical function body after normalisation.

FunctionAlso present inEarliest-datedOthers named
normalize_answer 133 other papers
90 dated earlier, 2 the same month, 40 later, 1 undated · 1 only as an assembly brick
1508.06615 (2015-08)
Character-Aware Neural Language Models
1606.05250 (2016-06)
SQuAD: 100,000+ Questions for Machine Comprehension of Text
1608.07905 (2016-08)
Machine Comprehension Using Match-LSTM and Answer Pointer
and 130 more not named here
compute_bleu 10 other papers
9 dated earlier, 1 later
1909.09436 (2019-09)
CodeSearchNet Challenge: Evaluating the State of Semantic Code Search
aaai_6453 (2020 (year only))
Improving Knowledge-Aware Dialogue Generation via Knowledge Base Question Answering
2206.05239 (2022-06)
StructCoder: Structure-Aware Transformer for Code Generation
and 7 more not named here
cross_attention_forward 10 other papers
9 dated earlier, 1 later · 1 only as an assembly brick
2108.06314 (2021-08)
A Dataset for Answering Time-Sensitive Questions
2112.08688 (2021-12)
Evidentiality-guided Generation for Knowledge-Intensive NLP Tasks
2206.15474 (2022-06)
Forecasting Future World Events with Neural Networks
and 7 more not named here

Presence, not direction: an identical function body in two papers' repositories does not say who wrote it, which came from which, or that either paper's method rests on it. Matching is exact after normalisation, so a renamed or edited function is not matched. Dates are when papers appeared, not when code was written. Only .py files the harvester lifted are covered; notebooks are not read. A new-style arXiv id YYMM.NNNN dates a paper to the month 20YY-MM; otherwise Paper.year dates it to the year; otherwise it is undated. Dates are when the paper appeared, not when the code was written. Read 2026-11-22.

Repositories linked to this paper

Some links come from the archived Papers with Code dataset (CC BY-SA 4.0): attribution and licence.

Abstract

Retrieval-Augmented Generation (RAG) has recently gained significant attention for its enhanced ability to integrate external knowledge sources into open-domain question answering (QA) tasks. However, it remains unclear how these models address fairness concerns, particularly with respect to sensitive attributes such as gender, geographic location, and other demographic factors. First, as language models evolve to prioritize utility, like improving exact match accuracy, fairness considerations may have been largely overlooked. Second, the complex, multi-component architecture of RAG methods poses challenges in identifying and mitigating biases, as each component is optimized for distinct objectives. In this paper, we aim to empirically evaluate fairness in several RAG methods. We propose a fairness evaluation framework tailored to RAG, using scenario-based questions and analyzing disparities across demographic attributes. Our experimental results indicate that, despite recent advances in utility-driven optimization, fairness issues persist in both the retrieval and generation stages. These findings underscore the need for targeted interventions to address fairness concerns throughout the RAG pipeline. The dataset and code used in this study are publicly available at this GitHub Repository https://github.com/elviswxy/RAG_fairness .

For agents

The same record, over MCP at https://syntology.ai/mcp:

get_harvested_code_for_paper("2409.19804")
get_code_for_paper("2409.19804")
have("2409.19804")

The run record, dated, one paper per request, free:

curl https://syntology.ai/api/ran/2409.19804.json

A badge for a README (the split and the date, never a ratio):

[![Syntology run record](https://syntology.ai/api/ran/2409.19804.svg)](https://syntology.ai/paper/2409.19804)

Connect an agent — have() is free.