LLM-as-Judge and Faithfulness: RAGAS as a Family of Estimators
The evaluation track measured retrieval against fixed relevance labels. Generation has no label, so we hire an LLM to judge — and the judge is a noisy instrument with its own sensitivity, specificity, bias, and variance. We rebuild every RAGAS metric as an estimator you must correct for the instrument: debias the verdict with known error rates, agree on the protocol with chance-corrected reliability, calibrate the confidence, price the irreducible judge-variance floor, and recover the error rates with no gold labels at all.
The label we no longer have
The evaluation layer was built on a fixed answer key. Set metrics, NDCG, and significance testing all measured a retrieval system against a qrel — a relevance label fixed in advance — and treated the resulting number as the sample mean of a per-query score, with a standard error, a confidence interval, and a paired test. Generation breaks that contract. A generated answer has no answer key: there is no fixed label that says whether “Q3 revenue rose 12% to $4.2B” is grounded in the retrieved filing. The production response, formalized by RAGAS, is to hire a large language model as a judge and let its verdicts stand in for the missing labels.
The judge, however, is not an oracle. It is a measurement instrument: it answers “is this claim supported?” with imperfect sensitivity and specificity, it carries systematic biases toward longer or earlier-shown candidates, and it adds its own noise on top of the noise we already had from sampling queries. Reading a RAGAS number honestly means treating it as an estimate produced by that instrument, and correcting for the instrument before believing it.
We introduce the notation once. A generated answer is decomposed into atomic claims ; each claim has a latent truth (is it genuinely supported by the context?) with prevalence , and the judge returns a verdict . The judge’s sensitivity is and its specificity is . RAGAS faithfulness is the sample mean of the verdicts, , with observed positive rate .
An LLM judge is a measurement instrument with its own bias and variance; every RAGAS metric is an estimator built from its verdicts, and reading it correctly means correcting for the instrument — debiasing the verdict, agreeing on the protocol, calibrating the confidence, and pricing the noise floor.
Raw faithfulness ranks A > B (0.80 vs 0.74); the judge's low specificity on A's documents inflates it. Rogan–Gladen restores the truth: B > A (0.79 vs 0.70), matching the oracle.
Faithfulness is the mean of the judge's per-claim verdicts, so an imperfect judge makes it a biased estimate of the true grounded fraction π. Rogan–Gladen inverts the error model to recover π, but its variance is inflated by 1/J² — as the judge approaches a coin flip (J → 0) the correction is amplified to uselessness, and below the Youden line it is undefined. On the corpus the same lenient judge inflates dense faithfulness to 0.703 over a true 0.647; the audited correction recovers it.
120 synthetic finance documents, 40 queries, top-10 retrieved claims; the judge is a synthetic Bernoulli rater of the MaxSim oracle (5-judge panel in Panels D–E). Numbers mirror llm_as_judge_ragas.py; the lab recomputes the Rogan–Gladen estimate and its variance, κ/AC1 from the reconstructed table, ECE/MCE from the baked reliability bins, and the SE decomposition in closed form, and bakes the corpus-derived rates, reliability bins, variance components, paradox tables, and EM recoveries.
The lab above is the topic in five panels. The arc: watch a biased verdict get debiased and a ranking get reversed; ask whether two judges agree once chance is removed; calibrate the judge’s stated confidence; price the irreducible judge noise; and finally recover the judge’s error rates with no answer key at all.
The judge as a noisy instrument
Faithfulness inherits everything the prerequisite said about a metric — it is a mean of per-item scores — with one change: the scores are now noisy verdicts rather than fixed labels.
Definition 1 (Faithfulness as a sample mean of judge verdicts).
For an answer decomposed into claims with judge verdicts , the RAGAS faithfulness is the sample mean
an estimate of the latent grounding prevalence — the fraction of claims that are truly supported.
Because the judge is imperfect, that mean does not estimate ; it estimates something shifted away from it.
Proposition 1 (Faithfulness is a biased estimator of prevalence).
The expected verdict relates to the latent prevalence through the judge’s error rates,
so unless , with bias .
Proof. Condition a single verdict on the latent truth: , the law of total probability. Linearity of expectation over the claims gives ; subtracting and collecting terms gives the bias.
A lenient judge — one that over-endorses, with high sensitivity but mediocre specificity — inflates faithfulness. On the corpus, such a judge reports faithfulness for the dense leg whose true grounded fraction is . The fix is to invert the error model.
Definition 2 (The Rogan–Gladen corrected estimator).
Solving the prevalence identity for gives the Rogan–Gladen estimator
defined when the Youden index — when the judge is better than random.
Theorem 1 (Rogan–Gladen unbiasedness and its variance).
With known and , for a judge whose error rates are constant across claims: (a) — the estimator is unbiased; and (b) since is a mean of Bernoulli verdicts,
inflated relative to the raw verdict variance by , which diverges as : a useless judge cannot be debiased.
Proof. The estimator is an affine function of , namely with . By linearity, , and the numerator simplifies to , giving exactly — no approximation, because is affine. For the variance, , so ; substituting the binomial variance completes it.
On the dense leg, the audited correction recovers — exactly the oracle prevalence — at the cost of a variance inflated . Panel A drives this with sensitivity and specificity sliders: the truth , the inflated observation , and the corrected sit on one axis, and the curve climbs without bound as the sliders approach a coin flip.
The consequence is a decision, not just a number. Two answer-generation systems judged by the same lenient judge can be ranked in the wrong order by raw faithfulness: a system whose documents the judge over-endorses (low effective specificity) is inflated above a genuinely better one. Panel A’s lower chart shows the constructed case — raw faithfulness favors system A ( over ), but Rogan–Gladen with each system’s audited rates restores the truth, favoring system B ( over ), matching the oracle. The instrument was masking the ranking; correcting for it flips the verdict back.
Agreement is not accuracy: chance-corrected reliability and the variance floor
Before trusting a judge against the truth, we ask a weaker question we can actually check in production: does the judge agree with a second rater — another model, or a human auditor on a sample? Raw agreement is the wrong summary, because two raters agree by chance even when they share no signal.
Definition 3 (Observed agreement, chance agreement, and Cohen's kappa).
For two raters on items forming a table, the observed agreement is the fraction of items on which they agree, and the chance agreement is the sum over categories of the product of the two raters’ marginals. Cohen’s kappa is
Theorem 2 (Kappa is the fraction of beyond-chance agreement achieved).
iff (perfect agreement); iff (agreement at chance); iff the raters agree less than chance.
Proof. The map is the unique affine map sending the chance level to and perfect agreement to , so it rescales from the achievable-beyond-chance interval onto . At numerator and denominator both equal ; at the numerator vanishes; for the numerator is negative while the denominator stays positive.
The trouble is that depends on the marginals, and in a setting where almost every claim is supported, the marginals are extreme and swells toward .
Proposition 2 (The kappa paradox (Feinstein–Cicchetti)).
At a fixed observed agreement , as the prevalence of one category approaches or the chance agreement and an indeterminate form that collapses toward . Two tables with the same can therefore carry very different .
Proof by example (RUN in the notebook). Two tables each have observed agreement . The balanced table has and ; the skewed table has and . Identical agreement, kappa differing by — one “substantial,” one “fair.”
The remedy is a chance term that does not balloon with skew.
Definition 4 (Prevalence-robust coefficients: Gwet's AC1 and Krippendorff's alpha).
Gwet’s AC1 replaces the chance term with , where is the overall propensity of the positive category (the binary special case of ), giving , which is stable as the marginals skew. Krippendorff’s alpha , the ratio of observed to expected disagreement, generalizes the same chance-correction to any number of raters, missing data, and any measurement level.
On the same two tables, Gwet’s AC1 reads and — it does not collapse where kappa does. Panel B sweeps the prevalence at fixed agreement and overlays the two curves: kappa plunges toward zero at the extremes while AC1 stays high. The lesson is not that AC1 is “correct” — none of the three is canonical — but that kappa must never be read without its marginals.
Agreement also exposes a second, structural fact: the judge is a source of variance that more queries cannot average away. Model each per-query faithfulness as with a query effect , a judge effect , and residual noise.
Theorem 3 (The variance decomposition and the judge-variance floor).
The total variance splits into independent components, , and the intraclass correlation is the fraction of variance explained by true between-query differences. The standard error of a faithfulness averaged over queries and judges is
As at fixed , — a positive floor that only more judges, never more queries, can lower.
Proof. Write . By independence of the effects, ; the first and third terms vanish as , leaving . The ICC identity follows from .
On the five-judge panel the components are , , , giving . Panel D plots the total standard error descending toward the judge floor as queries grow, and prices the lever: at a fixed budget of judge-calls, five judges over forty queries () beat one judge over two hundred queries (). You cannot buy confidence in a faithfulness score with queries alone — the judge noise is structural.
Judge bias, calibration, and learning the error rates
Two threads remain. First, the systematic biases the judge brings — and which of them we can remove. Second, the judge’s stated confidence: is it a probability?
Definition 5 (The paired swap test for position bias).
Present each claim to the judge once in the first slot and once in the last slot, holding its content fixed, and form the paired difference of the judge’s confidence, . Under no position bias, presentation order is exchangeable and ; the position-bias estimate is , tested by the prerequisite’s paired and permutation tests.
Proposition 3 (A symmetric position effect is removable; self-preference is not).
If the judge’s verdict carries a slot effect symmetric across the two orders, then averaging the two presentations cancels and recovers an unbiased preference. A self-preference effect that correlates with a candidate’s provenance rather than its slot survives order-averaging and is unidentifiable without external ground truth.
Proof. For the removable part, adds and in the two slots, which cancel, leaving the content term plus mean noise. The provenance term is constant across slots, so it does not cancel under order-averaging.
On the corpus the lenient judge’s swap test returns a bias of at — a real, removable position effect — while a bias-free control judge returns bias at . The swap test detects and removes the slot effect; it cannot touch self-preference.
The judge does not only vote; it states a confidence. We feed those confidences straight into the prerequisite’s calibration suite.
Definition 6 (Judge-confidence calibration).
Pooling the judge’s stated confidence and the binary truth across all pairs, the reliability diagram plots empirical relevance against confidence per bin (the diagonal is perfect calibration), the expected calibration error is the area off the diagonal, and Platt scaling and isotonic regression recalibrate it.
Theorem 4 (Monotone recalibration preserves ranking (reused)).
A strictly increasing recalibration map leaves every order-based decision of the judge unchanged, so the AUC and every ranking metric are invariant under it; only the probability reading changes. This is exactly the monotone-recalibration theorem of the calibration prerequisite, applied to judge confidence — the proof is there.
The judge confidence ranks claims almost perfectly (AUC for the lenient judge) yet is wildly over-confident as a probability (ECE ): Panel C shows the raw dots bowed far off the diagonal. Platt scaling pulls the ECE to and isotonic to , both leaving the AUC untouched at — calibration is orthogonal to ranking, the same reason rank fusion fuses ranks rather than scores. A pipeline that thresholds or averages a judge’s raw confidences inherits the miscalibration; one that ranks by them does not.
Learning the error rates with no gold set
The Rogan–Gladen correction needed the judge’s sensitivity and specificity. In production there is often no gold label to estimate them from — only the judges’ verdicts. The latent-class model recovers them anyway.
Definition 7 (The Dawid–Skene latent-class model).
With latent class per item, class prior , and each judge ‘s confusion matrix , the EM algorithm alternates an E-step — the posterior — with a closed-form M-step re-estimating and each . It recovers each judge’s sensitivity and specificity from the agreement structure alone.
Panel E runs it: with no gold labels, EM recovers every planted per-judge sensitivity and specificity within and labels items more accurately than majority vote ( versus ). This closes the loop — the error rates the instrument correction assumed are exactly what EM supplies. The result is identifiable only up to a label permutation (we anchor to the majority vote), and the likelihood is non-convex, so EM finds a local optimum from a sensible start; correlated judges, who violate the conditional-independence assumption, break the guarantee. It is a powerful tool, not a free lunch.
The thread that ran through the evaluation layer — a metric is an estimator — now reaches the generation layer with a second source of noise stacked on the first. Faithfulness and groundedness will give that support a semantic definition, and conformal factuality will turn a calibrated, debiased judge confidence into a distribution-free correctness guarantee. Both begin from the instrument this topic learned to read.
Connections
- the direct prerequisite and the instrument this topic reuses wholesale: its calibration panel — the reliability diagram, expected calibration error, Brier score, Platt and isotonic recalibration, and the monotone-recalibration theorem — is applied here to the JUDGE's stated confidence rather than a retrieval score, and its permutation and paired tests become the swap test that detects judge position bias; that topic framed a metric as an estimator with a standard error, and this topic deepens that estimator with a second, nested noise source, the judge itself significance-testing-calibration
- the root of the evaluation layer that defined every retrieval metric as a sample mean of per-query scores against FIXED relevance labels; generation has no such labels, so this topic replaces the gold qrel with an LLM judge and inherits the metric-as-estimator machinery — the sample mean, the standard error, the precision@k that the perfect-judge faithfulness collapses onto exactly — now applied to noisy judge verdicts instead of human relevance grades set-metrics-precision-recall-map-mrr
- that topic measured graded relevance against a fixed ideal ranking; faithfulness here is the analogous graded quantity for generation, but with the grader itself uncertain — the per-claim support verdict plays the role NDCG's relevance grade played, except that where NDCG's grades were a fixed oracle, the judge's grades carry a sensitivity and specificity that must be corrected for before the mean can be read ndcg-discount-geometry
- that topic fused rankings by reciprocal RANK rather than by score because raw retrieval scores are miscalibrated and incomparable; the calibration pillar here makes the same point about a judge's stated confidence — it ranks claims almost perfectly yet is wildly over-confident as a probability, so any pipeline that thresholds or averages judge confidences directly, rather than ranking by them, inherits that miscalibration rank-fusion-rrf
References & Further Reading
- paper RAGAS: Automated Evaluation of Retrieval Augmented Generation — Es, James, Espinosa-Anke & Schockaert (2024) The source of the faithfulness, answer-relevance, and context-precision metrics this topic rebuilds as estimators; defines faithfulness as the ratio of LLM-judged supported claims to total decomposed claims; EACL 2024 System Demonstrations (arXiv:2309.15217)
- paper Judging LLM-as-a-Judge with MT-Bench and Chatbot Arena — Zheng, Chiang, Sheng, Zhuang, Wu, Zhuang, Lin, Li, Li, Xing, Zhang, Gonzalez & Stoica (2023) The foundational study of LLMs as evaluators, documenting position bias, verbosity bias, and self-enhancement (self-preference) bias — the systematic judge biases the swap test detects; NeurIPS 2023 Datasets and Benchmarks Track
- paper G-Eval: NLG Evaluation using GPT-4 with Better Human Alignment — Liu, Iter, Xu, Wang, Xu & Zhu (2023) Chain-of-thought, form-filling LLM evaluation with probability-weighted scoring — a concrete judge whose stated confidence is the quantity the calibration pillar recalibrates; EMNLP 2023
- paper A Coefficient of Agreement for Nominal Scales — Cohen (1960) The original chance-corrected agreement coefficient kappa = (p_o − p_e)/(1 − p_e); Educational and Psychological Measurement 20(1):37–46
- paper High Agreement but Low Kappa: I. The Problems of Two Paradoxes — Feinstein & Cicchetti (1990) The kappa paradox: under skewed marginals two raters can agree on most items yet score kappa near zero — the reason this topic reads Gwet's AC1 alongside kappa; Journal of Clinical Epidemiology 43(6):543–549
- paper Estimating Prevalence from the Results of a Screening Test — Rogan & Gladen (1978) The correction that recovers true prevalence from an imperfect test's observed positive rate, pi-hat = (p_obs + sp − 1)/(se + sp − 1) — the debiasing of faithfulness; American Journal of Epidemiology 107(1):71–76
- paper Maximum Likelihood Estimation of Observer Error-Rates Using the EM Algorithm — Dawid & Skene (1979) Recovers each rater's error rates with no gold labels via latent-class EM — the no-gold-set estimation of judge sensitivity and specificity that closes the loop with the Rogan–Gladen correction; Journal of the Royal Statistical Society Series C 28(1):20–28
- paper Intraclass Correlations: Uses in Assessing Rater Reliability — Shrout & Fleiss (1979) The intraclass-correlation reliability coefficients and the variance decomposition behind the judge-variance floor; ICC(2,1) is the two-way random-effects, absolute-agreement form; Psychological Bulletin 86(2):420–428
- paper Computing Inter-Rater Reliability and Its Variance in the Presence of High Agreement — Gwet (2008) Gwet's AC1, the prevalence-robust agreement coefficient stable under the skewed marginals that break kappa; British Journal of Mathematical and Statistical Psychology 61(1):29–48
- paper Answering the Call for a Standard Reliability Measure for Coding Data — Hayes & Krippendorff (2007) Krippendorff's alpha, the general-purpose reliability coefficient handling any number of raters, missing data, and any measurement level; Communication Methods and Measures 1(1):77–89