Source-linked AI summary

A Hierarchical Consistency Framework for Auditing Retrieval-Augmented Generation Systems

Ramon Gonzalez, Antonio Diaz

arXiv:2609.07075v1cs.AI

TL;DR

Retrieval similarity measures semantic relevance, not factual agreement, so it cannot by itself diagnose cross-document inconsistency. HCF offers a post-hoc, model-agnostic audit of corpus, retrieval, and answer consistency. Corpus B had the highest mean SSµ (0.8843) but the lowest mean ACS (0.8780).

  • Problem

    Retrieval similarity measures query–passage relevance rather than factual agreement across sources, limiting its use for diagnosing cross-document inconsistency.

    Source: §I · p. 1
  • Method

    HCF provides a post-hoc, model-agnostic audit of corpus, retrieval, and answer consistency as distinct diagnostic levels.

    Source: §I · p. 1
  • Results

    Corpus B had the highest mean SSµ (0.8843) but the lowest mean ACS (0.8780).

    Source: D. Query-Level Answer and Retrieval… · p. 6
  • Takeaways & Limitations

    ACS gives reviewers an explanation of incompatible retrieved evidence, letting them inspect the competing source rather than replace an answer accepted by answer-only review.

    Source: §VI · p. 7

    ACS was not independently validated; assessing its sensitivity, specificity, stability, and calibration requires independently adjudicated answer–context pairs.

    Source: §VIII · p. 9

Abstract

from arXiv · show

Retrieval-augmented generation (RAG) is commonly evaluated by whether the final answer is correct. That test is insufficient: an answer can match its reference while the context that produced it contains a direct contradiction, leaving the contested evidence invisible to answer-only review and retrieval relevance scores. This paper presents the Hierarchical Consistency Framework (HCF), a post-hoc, model-agnostic audit of three distinct levels of a RAG process: the knowledge corpus, the final retrieved context, and the generated answer. HCF represents corpus conflicts as source-linked atomic facts, thereby identifying the documents responsible, and returns each Answer Consistency Score (ACS) with an explanation of supporting and contradictory contextual statements. We evaluate HCF on several controlled corpora spanning five domains and 100 query-corpus instances. A human evaluator compares every generated response with its supplied ground-truth response. The results show that the three diagnostic levels can dissociate: the corpus with the highest mean retrieval similarity has the lowest mean ACS, while a structurally degraded corpus performs worse at corpus level but better at answer level. Most importantly, HCF identifies contradictory retrieved evidence in several cases where the answer still matches the ground truth. HCF does not certify factual truth; it makes the evidence supporting and challenging an answer inspectable and attributable.

I. INTRODUCTION

RAG supplements LLMs’ static parametric knowledge with retrieved external evidence [1], but unreliable outputs can originate in the corpus, retrieval, or generation. HCF audits these stages separately without assuming their consistency levels have a deterministic or monotonic relationship.

I. INTRODUCTION

  • RAG combines an LLM with a dynamic external corpus, retrieving evidence to condition generation and support knowledge-intensive tasks [1], [2].Its production uses include enterprise search and question answering.Source: §I · p. 1
  • Unreliable RAG outputs may arise from degraded or inconsistent corpus documents, ambiguous or contradictory retrieved evidence, or generation that fails to ground its answer in context.Source: §I · p. 1
  • Dense retrieval scores semantic relevance rather than factual agreement, so similarly relevant passages can make retrieval similarity insufficient for diagnosing cross-document conflicts, [4].Source: §I · p. 1
  • HCF provides post-hoc, model-agnostic diagnostics for corpus, retrieval, and answer consistency, using retrieval metrics and ACS to help localize pipeline failures [5].The three levels decompose the audit and were evaluated on a controlled corpus with systematic intra- and inter-document degradation.Source: §I · p. 1

II. RELATED WORK

HCF connects RAG evaluation, corpus-quality assessment, conflict analysis, and explainable AI through diagnostics spanning source-linked corpus conflicts, retrieval discrimination, and answer explanations.

  • RAG combines neural retrieval and generation over external collections [1]; production analyses identify corpus quality as a major failure point [9], motivating corpus-aware diagnostics [33],.Dense passage retrieval, retrieval-augmented pre-training, and fusion-in-decoder established principal modern architectures,,.Source: §II · p. 1
  • HCF operationalizes information-quality dimensions—accuracy, completeness, consistency, and timeliness—and data-centric AI principles as automated document-quality and cross-document-consistency diagnostics [34],,, [31], [11].Source: §II · p. 1
  • Entityswap studies show factual conflicts can increase hallucination while preserving fluency and topical relevance, making them difficult for similarity-based retrieval to distinguish, [4].Models also vary in whether they follow retrieved context or parametric knowledge [13],.Source: §II · pp. 1–2
  • Unlike IndexRAG [15] and instruction-based context validation [28], HCF uses source-linked atomic fact triples to quantify cross-document conflict before retrieval.The related work characterizes context-validation approaches as generally lacking HCF’s source-linked corpus decomposition.Source: §II · p. 2
  • HCF’s post-hoc, model-agnostic explanations localize failures with corpus diagnostics, retrieval-score dispersion, and an answer score with textual justification [5], [16].The work connects SSσ to semantic-uncertainty diagnostics [17] and ACS to process-transparent XAI, addressing calls for deployable explanation methods [5],,.Source: §II · p. 2

III. METHODOLOGY

HCF is an implementation-agnostic framework that separates RAG auditing into linked corpus, retrieval, and answer diagnostics; its metric boxes provide distinct views rather than implying that one score determines another. The framework makes corpus conflicts and answer support inspectable without treating consistency scores as measures of factual truth.

A. Level 1 — Corpus Consistency

  • Corpus Consistency combines document-level structural quality with agreement across documents to diagnose the knowledge base.The two dimensions are assessed separately before being combined into a unified metric.Source: A. Level 1 — Corpus Consistency · p. 2

1) Intra-Document Metrics:

  • Intra-document quality scores structural fitness for retrieval across clarity, internal consistency, completeness, information density, and coherence, not factual truth.The corpus-level intra-document integrity metric averages the normalized document-quality scores.Source: 1) Intra-Document Metrics · p. 2

2) Inter-Document Metrics:

  • Inter-document consistency detects conflicting source-linked atomic facts and identifies the documents responsible, drawing on IndexRAG [15] and FActScore.Facts are grouped by normalized entity–relation pairs; normalization is limited to lowercasing and diacritic removal, so surface variations can be missed.Source: 2) Inter-Document Metrics · pp. 2–3

3) Unified Corpus Consistency Metric:

  • Corpus Consistency linearly combines intra- and inter-document consistency with configurable weights, enabling each dimension’s contribution to remain interpretable.The paper sets both weights to 0.5; lower scores can be attributed to either or both dimensions.Source: 3) Unified Corpus Consistency Metric · p. 3

B. Level 2: Retrieval Consistency

  • Retrieval Consistency uses top and mean query–chunk similarity plus score variance to characterize evidence relevance and dispersion.Variance is dispersion, not consistency by itself: high values indicate heterogeneous relevance, while unusually low values can also flag topically similar contradictions; interpret it with corpus consistency and retrieved text.Source: B. Level 2: Retrieval Consistency · pp. 3–4

C. Level 3: Answer Consistency

  • Answer Consistency evaluates query alignment, evidence support, and contradiction in the generated answer, distinct from retrieval coherence.ACS is neither probabilistic confidence nor factual truthfulness: an answer can be consistent with incorrect retrieved evidence.Source: C. Level 3: Answer Consistency · p. 4

IV. EXPERIMENTAL DESIGN

The experiments use controlled corpora to isolate degradation modes, with paired queries across conditions and human reference-answer assessment separate from ACS. HCF is implemented on a platform that the paper describes as experimental only, not required by the framework.

A. Experimental Platform

  • Mentomy provided the experimental workflows, but HCF’s definitions and operators are platform-agnostic.The platform supported knowledge-base ingestion, retrieval, role-based access control, answer generation, and evaluation.Source: A. Experimental Platform · p. 4

B. Operator and Retrieval Configuration

  • Mistral Small 4 implemented the task-specific operators, while dense retrieval, reranking, and authorization determined each query’s final context.Q assessed document quality without external fact-checking, F extracted source-linked atomic claims, and J returned ACS in [0, 1] with a textual justification. Retrieval selected 15 candidates, reranked them to 10, then applied role-based access control; the authorized set size could vary by query.Source: B. Operator and Retrieval Configuration · p. 4

C. Controlled Corpus Construction

  • The four corpora span clean, conflict-injected, structurally degraded, and combined conditions across five domains.Corpus A has five clean documents; B adds five conflict-injected counterparts with plausible incorrect values; C applies at least three of six structural degradations per document without factual conflicts; D combines these conditions in 20 documents, including five newly constructed documents with both degradation types.Source: C. Controlled Corpus Construction · pp. 4–5, Table I · p. 5

D. Rationale for a Controlled Corpus

  • Controlled corpora provide known conflicts and provenance, while a factorial design isolates factual and structural degradation; Corpus D additionally varies corpus size.The design maintains a complete provenance map and canonical correct values, enabling source-linked conflict inspection. The authors note that organic collections generally lack complete factual ground truth and may confound the two consistency dimensions.Source: D. Rationale for a Controlled Corpus · p. 5

E. Corpus Generation and Review Process

  • Baseline documents were generated with Claude Opus 4.7 and reviewed by GPT-5.5 and Gemini 3.5 Flash before admission to Corpus A.Corrections flagged by either reviewer were applied; the process aimed to reduce factual errors, internal inconsistencies, and structural defects.Source: E. Corpus Generation and Review Process · p. 5

F. Query Set Design

  • The fixed query set yields 100 query–corpus instances and supports within-query paired comparisons across the four conditions.The same 25 queries were issued to each corpus: Q1–Q10 target manipulated values, Q11–Q20 are controls, and Q21–Q25 require multi-part synthesis; retrieval still determines the final context.Source: F. Query Set Design · p. 5

G. Human Reference-Answer Assessment

  • One human evaluator compared all 100 generated responses with supplied ground-truth responses, separately from ACS.Exact matches and semantically equivalent expressions were accepted, while missing or materially different content was retained as such; this assesses benchmark-reference matching, not independent validation of the ACS evaluator.Source: G. Human Reference-Answer Assessment · p. 5

V. RESULTS

HCF’s results show that corpus, retrieval, and answer diagnostics can diverge: relevant retrieved chunks may conflict with an answer, even when the answer matches the ground truth. The evaluation also reports extraction recovery and cross-document correspondence across selected records.

A. Ingestion-Phase Corpus Diagnostics

  • Corpus C combines low integrity (0.23) with no detected cross-document divergences yet has CC 0.615, while D’s intermediate integrity and largest flagged-key count accompany CC 0.720.The passage notes that the number of flags also depends on the number and coverage of extracted keys.Source: A. Ingestion-Phase Corpus Diagnostics · p. 6, Table II · p. 7

B. Evaluation of Atomic Fact Extraction

  • The extractor recovered 34 of 40 selected reference facts (85.0%), with complete recovery in geography and biology and four of six omissions in history.Recovery was judged semantically, accepting equivalent expressions and records that preserved the target fact without reproducing its full wording.Source: B. Evaluation of Atomic Fact Extraction · p. 6, Table III · p. 7

C. Evaluation of ER-Pair Correspondence

  • Of 27 selected clean-side entity–relation records, 24 matched a corresponding record in a modified document, an overall correspondence rate of 88.9%.History and geography had complete correspondence in the selected records; physics, medicine, and biology each had one unmatched record.Source: C. Evaluation of ER-Pair Correspondence · p. 6, Table V · p. 7

D. Query-Level Answer and Retrieval Diagnostics

  • Median ACS is 1.00 in every corpus, but targeted, control, and synthesis question distributions differ, with reductions varying across Corpora B, C, and D.Corpus B’s largest reduction is among targeted questions; C retains ACS 1.00 for targeted and control questions but has lower values on several synthesis questions, while D shows reductions in targeted and synthesis questions.Source: D. Query-Level Answer and Retrieval… · p. 6
  • Corpus B has the highest mean SSµ (0.8843) and lowest mean ACS (0.8780), showing that retrieval relevance and answer consistency are distinct.Across Corpora A–D, mean ACS is 0.9844, 0.8780, 0.9320, and 0.9244, respectively; the three HCF levels provide complementary diagnostics.Source: D. Query-Level Answer and Retrieval… · p. 6
  • Mean SS1 remains high (0.8928–0.9605), mean SSµ varies from 0.8462 to 0.8843, and SSσ requires interpretation with k(q).SS1 measures whether a highly relevant chunk survives retrieval and authorization; SSµ averages relevance across final authorized chunks, while SSσ measures within-query score dispersion and is zero when only one chunk remains.Source: D. Query-Level Answer and Retrieval… · p. 6
  • In four Corpus B cases, answers matched the ground truth but retrieved context contained a conflicting value or date, which ACS identifies and explains.The explanation directs readers to the competing claim, distinguishing answer correctness from whether the authorized context supports the answer without contradiction.Source: D. Query-Level Answer and Retrieval… · p. 6

VI. DISCUSSION

HCF makes evidence that supports or challenges a generated answer inspectable and attributable, while distinguishing corpus, retrieval, and answer diagnostics. Its discussion cautions that relevance is not coherence and that flagged cases require inspection rather than automatic judgments of answer truth.

VI. DISCUSSION

  • High and nearly equal retrieval relevance scores can coexist with conflicting evidence, so relevance statistics should not be treated as semantic coherence.The discussion illustrates this with B–Q1 in Table VIII and notes that retaining one chunk can trivially produce low variance.Source: Figure 3 · p. 8, §VI · p. 9
  • HCF’s staged corpus diagnostics separate estimated structural integrity from indexed divergence and expose whether records are available for comparison.This makes omissions and representation differences visible without attributing every failed comparison to the answer generator.Source: §VI · pp. 8–9
  • HCF distinguishes reference-matching answers from evidential consistency by flagging contradictory retrieved statements and explaining the disagreement for source inspection.The authors frame this as information that reference-only correctness assessment would miss, not merely a lower score under degradation.Source: §VI · pp. 7–8, Table VIII · p. 9
  • A flagged case calls for source inspection, not an automatic declaration that the answer is false; validated decision rules are needed for threshold-based actions.The experiments did not establish false-positive or false-negative rates for an ACS cutoff because no independently labeled calibration set was used.Source: §VI · p. 9

VII. CONCLUSIONS

HCF provides a model-independent, source-linked structure for auditing corpus integrity, retrieved context, and answer consistency. Its controlled experiments show that correct answers can coexist with contradictory retrieved evidence, so HCF complements rather than replaces factual verification.

  • HCF audits corpus integrity and factual divergence, final-context retrieval statistics, and answer-context consistency through model-independent, source-linked records.Source: §VII · p. 9
  • Controlled experiments demonstrated useful extraction coverage and semantic correspondence.Source: §VII · p. 9
  • Correct answers can coexist with contradictory retrieved evidence, and similarity dispersion and corpus-level consistency did not determine answer consistency across four conditions.Source: §VII · p. 9
  • HCF is a complementary diagnostic, not a substitute for factual verification or an independently validated probability of correctness.Source: §VII · p. 9

VIII. LIMITATIONS AND FUTURE RESEARCH

The evidence is bounded by small, constructed collections and evaluation limitations. Further validation requires independent ACS adjudication and broader controlled testing.

VIII. LIMITATIONS AND FUTURE RESEARCH

  • Experiments cover 40 document placements across four configurations, 20 underlying variants, and five domains, with one retained run per question and condition.Controlled modifications facilitate inspection, but the collections cannot establish generalization to organic enterprise knowledge bases; conditions also differ in size and redundancy.Source: §VIII · p. 9
  • A single human evaluator compared all 100 responses with ground truth, supporting benchmark-match assessments but not independently validating ACS.Independent adjudication of answer–context pairs, including compatible paraphrases, unsupported claims, and genuine contradictions, is needed to assess ACS sensitivity, specificity, stability, and calibration; shared generation and evaluation model-family biases may also arise.Source: §VIII · p. 9
  • Algorithm 1’s candidate-divergence counts can be distorted by extraction coverage, key normalization, multilingual equivalents, multivalued relations, and omitted temporal qualifiers.The broader semantic correspondence review is not proof of automated semantic matching.Source: §VIII · pp. 9–10
  • Future validation should vary prompts, score provenance, chunking, and authorization independently, repeat runs, compare reference-free metrics, and test larger corpora across controlled consistency gradients.The current four conditions support decomposition and localization, not the conjecture that upstream degradation statistically propagates to downstream scores.Source: §VIII · p. 10

DATA AND CODE AVAILABILITY

The dataset release includes the documents for Corpora A–D, 25 queries, and their ground-truth responses, but excludes the Mentomy platform.

DATA AND CODE AVAILABILITY

  • The release includes documents for Corpora A–D, 25 queries, and ground-truth responses; the Mentomy platform is excluded.Extracted records and answer excerpts in the main text are translated or summarized for readability.Source: DATA AND CODE AVAILABILITY · p. 10

APPENDIX A DATASET DOCUMENTATION

The appendix documents the public dataset’s contents and limits.

APPENDIX A DATASET DOCUMENTATION

  • The public dataset includes Corpora A–D, 25 questions, and ground-truth responses, but excludes Mentomy’s proprietary platform implementation.Q1–Q10 target manipulated relations, Q11–Q20 are controls, and Q21–Q25 require synthesis; the dataset is available at https://github.com/ramongrobot/mentomy.Source: Appendix A · p. 11

APPENDIX B CORPUS A QUERY RESULTS … APPENDIX E CORPUS D QUERY RESULTS

Appendices B–E present query-level results separately for Corpora A, B, C, and D.

APPENDIX B CORPUS A QUERY RESULTS

APPENDIX C CORPUS B QUERY RESULTS

APPENDIX D CORPUS C QUERY RESULTS

APPENDIX E CORPUS D QUERY RESULTS

Loading 2609.07075v1…