Evaluating RAG Source Attribution: Metrics and Governance for LLM Q&A Systems
This article breaks down how large language model Q&A systems select and cite sources, using a 20-question home renovation sample set. It models the answer pipeline as a two-stage funnel—candidate retrieval followed by source adoption—and examines three key issues: an overall adoption rate that runs high, a highly concentrated adoption distribution, and hidden sources that appear in the answer text but are missing from the candidate list. You will find practical metric definitions, a reproducible evaluation script skeleton, and engineering governance recommendations for building an auditable retrieval-augmented Q&A pipeline on top of common capabilities such as object storage, message queues, container platforms, log services, and monitoring alerts.
Evaluating a large language model (LLM) Q&A system on answer correctness alone is not enough. What really determines trustworthiness is which sources it uses—and which sources it admits to using. Starting from a home renovation Q&A sample set of 20 questions, this article abstracts the answering process into two stages: candidate pool retrieval and in-text source adoption. It discusses three key phenomena: an overall adoption rate that is too high, a highly concentrated adoption distribution, and a hidden source problem where sources are cited in the answer text but missing from the candidate list. The article provides actionable metric definitions, an evaluation script skeleton, and engineering governance recommendations. These help developers build a reproducible, auditable retrieval-augmented Q&A pipeline on top of common capabilities such as object storage, message queues, container platforms, log services, and monitoring alerts on Baidu AI Cloud.
1. The Problem: Why Sources Matter More Than Answers
In a retrieval-augmented generation (RAG) pipeline, a single answer typically goes through three stages: retrieve, rerank/filter, and generate. What developers can usually see is only the final answer, while the intermediate steps—which sources entered the candidate pool and which ones actually shaped the wording—remain a black box. Without this layer of observability, three typical failures emerge:
- The answer looks well-grounded but is actually produced from the model’s internal parametric memory, with retrieval results serving only as decoration.
- The citation list does not match the body text, so users find unrelated content when they click the links.
- High-quality long-tail content never makes it into the candidate pool, and the system’s coverage is monopolized by top-tier sites.
The evaluation criteria therefore need to be upgraded from a single “answer accuracy” metric to an auditable two-stage metric system covering “candidates” and “adoption.”
2. Mechanism: A Two-Stage Funnel and Three Key Metrics
Model a single Q&A interaction as a funnel:
Full searchable corpus└─(retrieve)→ Candidate pool C (self-reported by the system)└─(rerank/filter/generate)→ Adopted set A (written into the answer)└─(citation rendering)→ Explicit citations E (visible in the list)
This yields three metrics:
- Overall adoption rate
ρ = |A| / |C|, which measures how efficiently candidate resources are used; - Concentration
HHI = Σ (a_i / |A|)², which measures whether adoption is monopolized by a few sources; - Hidden adoption gap
Δ = |A \ E|, the number of sources used in the body text but not listed, which directly reflects the auditability gap.
Reference observation: In one 20-question home renovation Q&A run, there were 118 candidates and 104 adopted sources, giving ρ ≈ 88%; a single source accounted for 20 candidates and 18 adoptions, contributing nearly half of all adoptions; 30 sources entered the candidate pool with zero adoption; and another 24 sources were adopted in the body text without appearing in the candidate list. These numbers show that a high ρ does not equal high quality—it may simply mean “the candidates were few and well-chosen,” at the cost of long-tail coverage and citation transparency.
3. Why “High Adoption Rate + Missing Long Tail” Happens
- Objective function bias: If the ranking stage relies mainly on features such as click-through rate and site authority, top content has a natural advantage, and long-tail content cannot break into the top K even when relevant.
- Deduplication and quota policies: To keep answers from becoming too long, the system sets quotas per single source, further compressing diversity.
- “Free citation” on the generation side: The model can directly use parametric memory during generation, bypassing the candidate list and forming
Δ. - Lack of negative samples in evaluation: Only “what was used” is counted, not “what should have been used but wasn’t,” which keeps long-tail gaps invisible.
4. A Reproducible Evaluation Approach
Fix the question set, the time window, and the retrieval parameters, then persist three pieces of data per question: the candidate list, the final answer, and the rendered citation list. A sample evaluation skeleton:
def evaluate(items):for q in items:cand = retrieve(q, top_k=50) # Candidate poolans, cited = generate(q, cand) # Answer and rendered citationsA = extract_sources(ans) # Sources actually adopted in the body textrho = len(A) / max(len(cand), 1)hhi = sum((c.count(s)/max(len(A),1))**2 for s in set(A))delta = len(set(A) - set(cited))log(q.id, rho, hhi, delta, cand, ans)
On the engineering side, send logs to a message queue, archive them in object storage, use a log service for search, and set thresholds on monitoring alerts for sudden changes in ρ and Δ. Together these form a closed loop.
5. Governance Recommendations for Developers
- Candidate diversity constraints: Set layered quotas by source type to ensure long-tail content enters the top K.
- Citation consistency checks: Enforce
A ⊆ E, and allow publishing only whenΔis 0. - Dual-metric dashboard: Show
ρandHHIon the same screen to prevent a high adoption rate from masking monopoly. - Traceable attribution: Tag every conclusion with its candidate id and support one-click replay.
- On Baidu AI Cloud, run evaluation tasks on the container platform, store samples in object storage, and rely on log services and monitoring alerts for observability—all assembled from common capabilities, with no dependency on any proprietary interface.
6. Conclusion
Source evaluation is essentially transparency engineering. A high adoption rate accompanied by high concentration and hidden citations actually lowers system trustworthiness. Only by bringing all three stages—candidates, adoption, and explicit citations—into metrics and alerts can retrieval-augmented Q&A move from “looking grounded” to “verifiably grounded.”
