Faithfulness-QA: A Counterfactual Entity Substitution Dataset for Training Context-Faithful RAG Models

arXiv cs.CL / 4/29/2026

📰 NewsTools & Practical UsageModels & Research

Key Points

  • The paper targets an important RAG failure mode where models answer from parametric memory instead of the retrieved context, breaking the promise of retrieval grounding.
  • It introduces Faithfulness-QA, a dataset with 99,094 counterfactually generated QA samples meant to force the model to prefer the provided context over internal knowledge.
  • The dataset is built by counterfactual entity substitution: named entities in SQuAD and TriviaQA contexts are replaced with type-consistent alternatives from a curated bank of 76,953 entities, creating controlled conflicts.
  • The authors apply rigorous quality filtering, reporting 100% pass rates across four automated checks on random audit samples, and release the dataset, pipeline, and typed entity bank for training and evaluation.
  • Faithfulness-QA is intended both as training data for context-faithfulness objectives (e.g., attention-based) and as a benchmark to measure context-grounding behavior in RAG systems.

Abstract

Retrieval-Augmented Generation (RAG) models frequently produce answers grounded in parametric memory rather than the retrieved context, undermining the core promise of retrieval augmentation. A fundamental obstacle to fixing this unfaithfulness is the lack of training data that explicitly requires models to prefer context over internal knowledge. We introduce Faithfulness-QA, a large-scale dataset of 99,094 samples constructed through counterfactual entity substitution. Starting from two established extractive QA benchmarks--SQuAD and TriviaQA--we automatically identify answer-bearing named entities in each context, replace them with type-consistent alternatives drawn from a curated bank of 76,953 entities, and thereby manufacture controlled knowledge conflicts between context and parametric memory. Rigorous quality filtering ensures 100% pass rates across four automated checks on random 200-sample audits. We release the full dataset, the construction pipeline, and a typed entity bank covering eight named entity categories. Faithfulness-QA is designed as a training resource for attention-based faithfulness objectives and as an evaluation benchmark for measuring context-grounding behavior in RAG systems. Data and code are available at https://github.com/qzhangFDU/faithfulness-qa-dataset.