Manuscript Offprint

arXiv:2609.07075

A Hierarchical Consistency Framework for Auditing Retrieval-Augmented Generation Systems

Ramon Gonzalez, Antonio Diaz

Ramón González and Antonio Díaz

Mentomy AI

ramon@mentomy.com

Abstract—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.

Index Terms—Retrieval-augmented generation, consistency auditing, corpus quality, conflicting evidence, retrieval diagnostics, answer grounding, explainable artificial intelligence.

I. INTRODUCTION

Large language models (LLMs) encode vast world knowledge in their parameters, yet this knowledge is static, opaque, and prone to factual errors on facts outside the training distribution [1]. Retrieval-Augmented Generation (RAG) was designed to address these limitations by augmenting a parametric generator with a dynamic, non-parametric memory component: at inference time, a retriever selects relevant evidence from an external corpus and conditions generation on that evidence [1]. This architecture has become the dominant production paradigm for knowledge-intensive tasks, including enterprise search and question answering [2]. It extends a long line of retrieval-based question-answering systems, from domain-specific symbolic systems to modern open-domain neural architectures [29], [35], [36].

Despite this success, diagnosing unreliable RAG outputs remains challenging because the cause may originate at any of three levels: the corpus may contain structurally degraded or factually inconsistent documents; the retriever may surface ambiguous or contradictory evidence; or the generator may fail to ground its answer in the retrieved context. Dense retrieval

scores quantify query–passage semantic relevance rather than factual agreement across sources. Consequently, topically similar passages containing conflicting claims may receive comparable scores, making retrieval similarity insufficient on its own for diagnosing cross-document inconsistency [3], [4].

This paper formalizes consistency diagnostics through a Hierarchical Consistency Framework (HCF) for RAG systems, organized across three levels: Corpus Consistency (CC), Retrieval Consistency, and Answer Consistency. The three levels decompose the audit and localize distinct failure modes; they are not assumed to have a deterministic or monotonic relationship. The framework provides a measurable, post-hoc, model-agnostic diagnostic at each level and is evaluated on a controlled corpus in which intra- and inter-document degradation are varied systematically. The retrieval-level metrics (SS1,SSμ,and SSσ)(SS_1, SS_\mu, \text{and } SS_\sigma) and the Answer Consistency Score (ACS) also form an explainability layer that helps localize failures across the RAG pipeline, directly contributing to the agenda of Explainable AI (XAI) [5].

References (41)