Private LLMs and RAG
On-Premises RAG Evaluation: Measuring Retrieval Quality at Scale
How to evaluate on-premises RAG: separate retrieval and generation metrics, build a ground-truth set, automate regression tests and use LLM judges with care.
In short
Evaluate a RAG system in two parts. Retrieval metrics, such as recall at K and reciprocal rank, show whether the right passages were found; generation metrics, such as faithfulness and answer relevance, show whether the answer used them correctly. Run both against a ground-truth set on every change, and monitor production for failures the set misses.
Key takeaways
- Measure retrieval and generation separately: a fluent answer built on the wrong passages is a retrieval failure, and a wrong answer from the right passages is a generation failure.
- A ground-truth set written by domain experts, covering simple, multi-document, time-sensitive, unanswerable and permission-restricted questions, is the basis for every other metric.
- LLM judges scale evaluation but show position, verbosity and self-enhancement biases; calibrate them against human labels and run them on-premises when documents are sensitive.
- Set release thresholds from your own baseline rather than generic numbers, and block changes that regress.
- Production monitoring finds what the test set misses: weak retrieval scores, reformulated questions, missing citations and user feedback.
Why does on-premises RAG need systematic evaluation?
Because spot checks cannot detect regressions. A retrieval-augmented generation (RAG) pipeline has many moving parts: the embedding model, chunking rules, retrieval settings, reranking, prompts and the generation model, plus a corpus that changes every day. Any of them can quietly degrade answers, and anecdotal feedback reveals problems only once users complain.
On-premises you control every component, which makes systematic evaluation practical: you can log each stage, rerun the same questions after every change, and keep evaluation data inside your security boundary. For a refresher on the pipeline itself, see our explainer on retrieval-augmented generation.
How do retrieval and generation evaluation differ?
Retrieval evaluation asks whether the system found the right passages; generation evaluation asks whether the answer used them correctly. Evaluating them together hides the root cause, because a wrong answer can come from either stage. The Ragas framework (Es et al., 2023) makes the same split: the ability of the retrieval system to find relevant, focused passages, and the ability of the model to use them faithfully.
Retrieval metrics compare the retrieved passages with the passages that should have been found:
- Recall at K: the share of relevant passages that appear in the top K results. Low recall means answers miss information that exists in the corpus.
- Precision at K: the share of the top K results that are relevant. Low precision fills the context window with noise and adds latency.
- Mean reciprocal rank: how high the first relevant passage appears, averaged over questions. Retrieval can find the right passage and still rank it too low to be used.
Generation metrics judge the answer against the retrieved context and the question:
- Faithfulness: whether the answer’s claims are supported by the retrieved context. Ragas scores it from 0 to 1, as the number of supported claims divided by the total number of claims in the answer.
- Answer relevance: whether the answer addresses the question that was asked.
- Completeness and citations: whether the answer covers what the context supports and cites the passages it used.
Include a keyword baseline when you evaluate retrieval. The BEIR benchmark tested retrieval models across 18 datasets without domain-specific training. It found BM25 keyword search a robust baseline, and found that dense retrieval models, while efficient, often underperformed other approaches. Your own corpus and questions are the test that counts.
How do you build a ground-truth dataset?
A ground-truth set pairs real questions with the passages that answer them and a reference answer. It is the most labour-intensive part of RAG evaluation and the part that makes every metric meaningful. Recall-type metrics depend on it: the Ragas documentation notes that calculating context recall always requires a reference to compare against.
- Have domain experts write the questions. Engineers tend to write questions they know the system handles well, which makes results look better than they are.
- Cover each question type: simple lookups answered by one passage; questions that need several documents; time-sensitive questions that depend on the latest version of a document; questions the corpus cannot answer, where the right response is to say so; and questions the user is not permitted to have answered, where the right response is a refusal.
- Size it by coverage, not by a target number. Give each question type enough examples to show a regression, and grow the set from real production failures.
- Keep it current. Review the set when the corpus or the user base changes, and retire questions whose source documents are gone.
The permission-restricted questions double as tests of your access controls; our post on policy-enforced RAG boundaries explains why they matter.
How do you automate RAG evaluation?
Run the ground-truth set through the full pipeline on every change that can affect answers: a new embedding model, new chunking rules, retrieval or reranking settings, prompt templates, the generation model or a large corpus update. For each question, store the retrieved passage identifiers, the answer and the scores, and compare them with the current production baseline.
Use the cheapest reliable check for each metric:
- Deterministic checks for retrieval. Compare retrieved passage identifiers with the expected ones; Ragas, for example, offers an identifier-based context recall metric.
- Rule-based checks for generation: required citations present, output format valid, length within limits, and refusals where the corpus holds no answer.
- LLM judges for faithfulness, relevance and completeness, scored against a written rubric.
Set thresholds from your own baseline rather than from generic numbers, and fail the release when a change regresses beyond an agreed tolerance. Our posts on automated model evaluation pipelines and testing strategies for on-premises AI cover the release pipeline around these checks.
Can you trust an LLM as a judge?
Partly, and only after calibration. Zheng and colleagues found that strong LLM judges agreed with human preferences more than 80% of the time, about the same level of agreement as between humans. They also documented position bias, verbosity bias, self-enhancement bias and limited reasoning ability.
Practical safeguards follow from those findings:
- Calibrate the judge on a sample that people have labelled, and recheck after changing the judge model or the rubric.
- Use a different model from the one being judged, to limit self-enhancement bias.
- Fix the judge’s version and prompt so that scores stay comparable over time.
- Swap the order of answers in pairwise comparisons to expose position bias.
Run the judge on-premises when documents are sensitive, so that evaluation data stays inside your boundary. DeepEval states that any LLM can act as its judge, including models served locally through Ollama or wrapped as a custom model, but warns that it cannot guarantee evaluations work as expected with custom models. A judge model also needs GPU capacity of its own; size it with the LLM GPU sizing calculator.
What should you monitor in production?
The test set covers known questions; production monitoring finds the rest. Log each interaction with the question, the retrieved passage identifiers and their scores, the answer, its citations, the latency of each stage and any user feedback, such as ratings or an immediate rephrasing of the question. These logs can contain personal data, so agree retention and access with your data protection officer.
Signals worth tracking:
- Retrieval scores over time. A downward trend suggests that questions are drifting away from the indexed content, or that new document types are poorly represented.
- Answers without citations, and cannot-answer responses. A rise can point to gaps in the corpus or to retrieval failures.
- Reformulated questions. A user who rephrases the same question straight away probably did not get a useful first answer.
- Shifts in answer length. A sudden change is worth investigating, because it can accompany retrieval problems.
Review a sample of the weakest interactions on a regular cadence and classify each failure: document not indexed, chunk boundary wrong, embedding model weak on that content, ranking poor, or question ambiguous.
How do evaluation results turn into improvements?
Map each failure pattern to a targeted change, then rerun the evaluation to confirm that it worked.
| Failure pattern | Likely cause | First change to try |
|---|---|---|
| Low recall on one document type | Chunking or the embedding model handles that content poorly | Adjust chunk size or overlap; test another embedding model |
| Good retrieval, low faithfulness | The model adds information that is not in the context | Tighten the prompt to answer only from cited passages; review the model choice |
| Weak multi-document answers | Relevant passages ranked too low | Add a reranker or query decomposition |
| Exact identifiers missed | Dense retrieval alone misses exact terms | Add keyword search and fuse the results |
| Answers the user should not see | Permission filters missing or wrong | Fix the filters and add the case to the test set |
Track the metrics after every change, so that decisions rest on measurements rather than impressions. SysArt includes evaluation in its enterprise RAG implementations, from the ground-truth set to release gates and production monitoring.
Featured image by Markus Winkler on Unsplash.
Frequently asked questions
Which metrics should we use to evaluate RAG?
Use retrieval and generation metrics separately. For retrieval: recall at K (were the relevant passages found?), precision at K (how much of what was retrieved is relevant?) and mean reciprocal rank (how high does the first relevant passage appear?). For generation: faithfulness to the retrieved context, relevance to the question, completeness and correct citations. Frameworks such as Ragas and DeepEval implement many of these.
How large should a RAG ground-truth dataset be?
There is no universal number. Size it to cover each type of question your users ask, including multi-document, time-sensitive, unanswerable and permission-restricted questions, with enough examples per type to show a regression. Have domain experts write it, because engineers tend to write questions they know the system handles. Grow it from production failures and retire questions the corpus no longer supports.
Can an LLM judge RAG answers reliably?
Partly. Zheng and colleagues found that strong LLM judges agreed with human preferences more than 80% of the time, about as often as humans agree with each other, but they also documented position, verbosity and self-enhancement biases and limited reasoning. Calibrate the judge against a human-labelled sample, use a different model from the one being judged, and fix the judge's version.
Do RAG evaluation frameworks work with on-premises models?
They can. Ragas and DeepEval provide metrics such as faithfulness, contextual precision and contextual recall. DeepEval states that any LLM can act as the judge, including models served locally through Ollama or wrapped as a custom model, but warns that it cannot guarantee evaluations work as expected with custom models. Validate the judge on a labelled sample before relying on its scores.
How often should RAG evaluation run?
On every change that can affect answers: the embedding model, chunking, retrieval settings, prompts, the generation model and large corpus updates. Run it in the release pipeline so that regressions block deployment. Add a scheduled run against the current corpus to catch drift from document changes, and review production samples regularly, because users ask questions your test set does not contain.
Sources
- Es et al.: Ragas, Automated Evaluation of Retrieval Augmented Generation (arXiv:2309.15217) · checked 27 October 2026
- Ragas documentation: faithfulness metric · checked 27 October 2026
- Ragas documentation: context recall metric · checked 27 October 2026
- DeepEval documentation: introduction to metrics · checked 27 October 2026
- Zheng et al.: Judging LLM-as-a-Judge with MT-Bench and Chatbot Arena (arXiv:2306.05685) · checked 27 October 2026
- Thakur et al.: BEIR, a heterogeneous benchmark for zero-shot evaluation of information retrieval models (arXiv:2104.08663) · checked 27 October 2026