AI Workflow Agency
AI5 min read

Faithfulness in RAG: What It Means and How to Measure It

What faithfulness means in retrieval-augmented generation, how to measure it with RAGAS and TruLens, and how to fix hallucinations in production RAG

By AI Advisory team

Faithfulness is the property that a RAG system's generated answer is fully supported by the retrieved context. If the model states something the retrieved documents do not say, or contradicts them, the answer is unfaithful - regardless of whether the claim is true in the wider world.

This distinction matters because most people conflate faithfulness with accuracy. They are different. An answer can be accurate and unfaithful (the model knew the fact from pre-training, but the retrieved passages did not support it). An answer can be faithful and inaccurate (the retrieved passages were wrong, and the model repeated them). For regulated use cases - legal, financial, medical, HR - faithfulness is often the metric that matters, because it is the only one that keeps the system honest about its own sources.

What faithfulness actually means

The clearest working definition comes from the RAGAS framework: an answer is faithful if every claim it makes can be inferred from the retrieved context. RAGAS operationalises this by decomposing the generated answer into atomic claims, then checking each claim against the context using an LLM judge. The faithfulness score is the ratio of supported claims to total claims.

Two things follow from this definition. First, faithfulness is claim-level, not answer-level. A five-sentence response with four supported claims and one hallucinated one scores 0.8, not zero. Second, faithfulness says nothing about whether the retrieved context was the right context. That is a separate metric (context precision or context recall). A RAG system can achieve perfect faithfulness by retrieving irrelevant documents and refusing to answer - which is why faithfulness is always evaluated alongside answer relevance and retrieval quality.

The Stanford HELM benchmark and the original RAG paper from Lewis et al. (2020) both treated faithfulness (sometimes called groundedness or attribution) as one of the core signals for judging retrieval-augmented systems. The terminology has drifted since - Google calls it groundedness in Vertex AI, Anthropic tends to call it grounding, and academic papers use faithfulness and attribution somewhat interchangeably - but the underlying concept is stable.

Why faithfulness fails in production

Most RAG systems ship with reasonable faithfulness on a demo dataset and degrade in production. The failure modes are predictable.

Retrieval-generation mismatch. The retriever returns documents that are topically relevant but do not contain the specific answer. The generator, trained to be helpful, fills the gap from parametric knowledge. This is the single most common source of unfaithful answers in production RAG. It gets worse when you tune the retriever for recall (larger k, lower similarity threshold) because you feed the model more noisy context to synthesise from.

Long context dilution. When you stuff 20 chunks into a prompt, models struggle to distinguish which chunks support which claims. Research on the lost-in-the-middle effect (Liu et al., 2023) shows accuracy drops sharply for information placed in the middle of long contexts. Faithfulness follows the same pattern: models paraphrase and merge information across chunks, and the merged claim often does not appear in any single chunk.

Aggressive summarisation. Instructions like "summarise concisely" or "give a one-sentence answer" push the model to compress. Compression is where hallucinations creep in, because the model interpolates connective tissue between facts.

Multi-hop questions. Questions that require combining two or three pieces of information from different documents are the hardest case. Each retrieval step introduces error, and the generator has to reason across chunks that were not written to be combined.

Weak refusal behaviour. Base models are trained to be helpful. Without explicit prompting or fine-tuning to refuse when context is insufficient, they will attempt an answer regardless. This is the fix that most teams underinvest in.

How to measure faithfulness

You need automated evaluation. Human review does not scale past a few hundred examples, and you need to be able to run evaluation on every prompt change, retrieval change, and model swap.

The three mature open-source options are:

RAGAS. Python library, LLM-as-judge, decomposes answers into claims and checks each against the context. Straightforward to integrate. The faithfulness score correlates reasonably well with human judgement in published benchmarks, though it inherits biases from whichever judge model you use. Use a stronger model as the judge than as the generator - GPT-4-class judging a Claude Haiku or GPT-4o-mini generator, for example.

TruLens. Broader observability framework with a groundedness metric that works similarly to RAGAS faithfulness. Better if you want continuous production monitoring rather than batch evaluation.

DeepEval. Pytest-style testing for LLM applications. Faithfulness metric is comparable to RAGAS. Good if your team is already comfortable with unit test patterns.

All three are LLM-judge based, which means the score is a proxy. Calibrate it. Take 200 examples, have two humans score them independently, resolve disagreements, then compare against the automated metric. You will typically see 75-85% agreement, and the disagreements tell you where the automated metric is unreliable for your domain.

Beyond LLM judges, there are natural language inference (NLI) approaches that treat faithfulness as an entailment problem: does the context entail the generated claim? Models like DeBERTa-v3 fine-tuned on MNLI can classify claim-context pairs faster and cheaper than an LLM judge, at the cost of some accuracy on complex claims. This is worth exploring if evaluation cost is becoming a bottleneck.

Whatever you pick, hold three things constant when tracking faithfulness over time: the evaluation dataset, the judge model, and the scoring prompt. If any of those change, your trend line is meaningless.

How to improve faithfulness in a live system

Interventions ordered by effort and typical impact:

1. Tighten the system prompt. Explicit instructions matter. Something like: "Answer only using the information in the provided context. If the context does not contain the answer, respond with 'I don't have enough information to answer that.' Do not use prior knowledge." This alone lifts faithfulness by 10-20 percentage points in most systems we have measured. It is free.

2. Add citation requirements. Require the model to cite the chunk ID for every claim. This forces the model to attend to specific passages rather than blending them. Citation output also gives you a cheap post-hoc faithfulness check: parse the citations and verify each claim appears in the cited chunk.

3. Improve retrieval precision. Faithfulness problems are often retrieval problems in disguise. Add a reranker (Cohere Rerank, BGE reranker, or a cross-encoder). Reduce k after reranking. Move from pure dense retrieval to hybrid (dense + BM25) - most production RAG systems see meaningful gains from hybrid retrieval, as documented in the Pinecone hybrid search overview and similar work from Weaviate and Elastic.

4. Chunk deliberately. Small chunks (200-400 tokens) reduce dilution but fragment context. Large chunks (1000+ tokens) preserve context but make retrieval noisier. For most use cases, 400-600 tokens with 10-15% overlap is a sensible default, but the right size depends on your document structure. Test it empirically on your faithfulness metric.

5. Post-generation verification. Run a second LLM pass that takes the generated answer and the retrieved context, and flags unsupported claims. This is expensive but works. For high-stakes applications (legal, medical, financial advice), the cost is usually justified. You can also gate on the verification score and route low-confidence answers to a fallback: a refusal, a human handoff, or a request for more information.

6. Fine-tune for faithfulness. The heaviest option. Collect examples of faithful and unfaithful answers on your domain, fine-tune the generator with preference data or supervised examples. Rarely the right first move - the earlier interventions usually get you to acceptable faithfulness without training - but for narrow domains with strict grounding requirements, it works.

What faithfulness does not solve

Faithfulness is a necessary but not sufficient condition for a useful RAG system. A perfectly faithful system that retrieves the wrong documents will confidently give the wrong answer, cited correctly, and score well on faithfulness. The ICO's guidance on AI is worth reading here: for any system making decisions that affect individuals, you need to document not just that the answer is grounded, but that the sources themselves are appropriate, up to date, and lawfully obtained.

The four metrics you need to track together are:

  • Faithfulness / groundedness - is the answer supported by the context?
  • Answer relevance - does the answer address the question?
  • Context precision - are the retrieved chunks relevant to the question?
  • Context recall - did retrieval find all the relevant chunks?

Optimising one at the expense of the others gets you nowhere. A production RAG system needs a balanced scorecard, tracked over time, with regression tests on every change.

A pragmatic evaluation setup

For a mid-market RAG deployment, a workable evaluation setup looks like this:

Build a golden dataset of 200-500 question-answer pairs from real user queries or expert-authored questions. Each entry should have the question, the expected answer, and the source documents that contain the answer. This is annoying to build and worth every hour spent on it.

Run RAGAS or equivalent on the golden set nightly, or on every deploy to staging. Track faithfulness, answer relevance, context precision, and context recall as four separate lines on one dashboard.

Log every production query with the retrieved context and generated answer. Sample 1-2% for manual review and score them yourself. This catches distribution shift that your golden set misses.

Set a faithfulness threshold below which changes cannot ship. For most applications, 0.85 is a reasonable target; for high-stakes applications, 0.95 or higher. The number matters less than having one and holding the line on it.

Faithfulness is one of the small number of RAG metrics that maps directly to user trust. Users forgive systems that admit they do not know. They stop using systems that make things up. Measuring and improving faithfulness is the difference between a demo and something people rely on.

Frequently asked questions

Is faithfulness the same as accuracy in RAG?

No, and conflating them causes real problems. Accuracy asks whether an answer is factually correct in the wider world. Faithfulness asks whether the answer is supported by the specific documents the system retrieved. An answer can be accurate but unfaithful if the model used pre-training knowledge rather than the retrieved context, and it can be faithful but inaccurate if the source documents were wrong. For most enterprise RAG applications, faithfulness is the primary metric because it ensures the system is honest about its sources and can be audited. Accuracy is then a function of your source quality.

What faithfulness score should I aim for?

It depends on the application. For internal knowledge assistants where users can verify answers themselves, 0.80-0.85 on the RAGAS faithfulness metric is usually acceptable. For customer-facing chatbots, 0.90 is a reasonable minimum. For regulated use cases - legal research, medical information, financial advice - you should be targeting 0.95 or higher, and gating unfaithful answers behind refusal patterns. The absolute number is less important than the trend line: any change that drops faithfulness should be investigated before it ships, and the threshold should be a hard gate in your CI pipeline.

How does faithfulness relate to hallucination?

Hallucination is the failure mode; faithfulness is the metric that catches it. When a RAG system hallucinates, it generates content that is not supported by the retrieved context - which by definition is a faithfulness failure. All hallucinations in RAG show up as low faithfulness scores. However, not every faithfulness failure looks like a stereotypical hallucination: some are subtle inferences that go slightly beyond what the context supports, or paraphrases that shift meaning. Measuring faithfulness gives you a numeric handle on hallucination rate and lets you track it as a regression metric rather than treating it as an anecdotal problem.

Can I improve faithfulness without retraining the model?

Yes, and you should try everything else first. In our experience, prompt engineering (explicit grounding instructions plus refusal patterns), retrieval improvements (reranking, hybrid search, better chunking), and post-generation verification together get most systems to acceptable faithfulness without any fine-tuning. Fine-tuning for faithfulness is expensive, requires labelled data specific to your domain, and locks you into a specific base model. Reserve it for cases where the earlier interventions plateau below your required threshold, or where you have very narrow domain requirements that off-the-shelf models cannot meet.

Which tools should I use to measure faithfulness?

The three mature options are RAGAS, TruLens, and DeepEval - all open source, all Python, all LLM-judge based. RAGAS is the most widely adopted and has the cleanest faithfulness implementation. TruLens is better for continuous production monitoring. DeepEval fits well if your team wants pytest-style testing. For higher throughput or lower cost, consider NLI-based approaches using DeBERTa or similar entailment models, though these are less accurate on complex claims. Whichever you pick, use a stronger model as the judge than as the generator, and calibrate the automated score against human judgement on a few hundred examples before trusting it.

Does using a bigger model automatically improve faithfulness?

Not reliably. Larger models often produce more fluent unfaithful answers because they are better at making plausible-sounding inferences beyond the provided context. GPT-4-class models tend to have better faithfulness than smaller models when instructed clearly, but the gap is smaller than people expect, and it disappears entirely if the prompt does not explicitly require grounding. What consistently improves faithfulness across model sizes is prompt design (grounding instructions, refusal patterns, citation requirements) and retrieval quality. Model choice matters at the margin; prompt and retrieval matter at the core.

How often should we re-evaluate faithfulness?

Continuously in some form, and comprehensively at least weekly. Every change to prompts, retrieval configuration, chunking strategy, or model version should trigger a run against your golden evaluation set - ideally automated in CI. Beyond that, sample production traffic (1-2% of queries) for ongoing monitoring, because your golden set will not capture distribution shift as user behaviour evolves. Once a quarter, expand or refresh the golden set based on real query logs. Faithfulness scores that were fine three months ago can drift as your documentation changes, users ask new question types, or upstream models get silently updated by providers.

What is the difference between faithfulness and groundedness?

In practice, none. Google and some other vendors use groundedness; academic papers and open-source evaluation tools tend to use faithfulness; Anthropic uses grounding. All three describe the same property: the generated answer is supported by the retrieved or provided source material. The choice of term usually reflects which ecosystem you are working in rather than any substantive difference. When comparing benchmark numbers across tools or vendors, check the exact scoring method rather than assuming the words are interchangeable - some implementations score at the claim level, some at the sentence level, some at the whole-answer level, and the numbers are not directly comparable.

Closing

Faithfulness is the metric that separates RAG systems people trust from RAG systems people quietly stop using. Get the evaluation setup right, hold a threshold, and treat faithfulness regressions as blockers rather than nice-to-fixes. If you want help designing an evaluation harness or diagnosing faithfulness problems in an existing RAG deployment, AI Advisory builds and operates these systems for UK mid-market teams.

Ready to put this into production? book a discovery call.

Get started

Ready to automate your operations?

Walk away with a prioritised list of automation and AI wins, costed, sequenced, and yours. The call is 30 minutes, free, and binds you to nothing. The shortest path to knowing whether AI Workflow Agency is the right fit.