ProtForge ← protforge.com

Cheap hallucination checks catch most errors, and half of your good answers too

ProtForge research · 29 October 2026 · code and data below

Most teams with a RAG product reach for a cheap automatic check before they reach for a human review: does the answer use words the sources don't contain, does a small entailment model agree with it, do the numbers match. We measured how far those checks get on real model output, using 900 answers that people had already labelled sentence by sentence.

  1. A word-overlap check beat a neural entailment model. Counting content words that never appear in the sources reached an AUROC of 0.78; a DeBERTa NLI cross-encoder reached 0.72.
  2. At useful recall, every cheap detector is noisy. Tuned to catch about 85% of hallucinated answers, the best one also flags about half of the correct ones. Roughly one alarm in two is false.
  3. What works depends on the task and the model. On data-to-text the NLI model is at chance (0.50). On the weakest generator it was the best detector; on GPT-4 it was the worst.

Setup

RAGTruth (Niu et al., ACL 2024, MIT licence) contains about 18,000 answers from six LLMs to retrieval-grounded prompts in three tasks: question answering, summarisation and data-to-text writing, with human-annotated hallucination spans. We call an answer hallucinated if it has at least one annotated span.

We tested three detectors that run on a CPU with no API calls:

Plus a logistic-regression ensemble of the three. Thresholds and ensemble weights were fit on 300 training answers and frozen; results are on 900 test answers stratified by task and model (150 per model, 300 per task). The lexical and numeric detectors were also run on the full 2,700-answer test split, with the same result (lexical AUROC 0.785).

Results

AUROC: probability that a random hallucinated answer scores higher than a random clean one. 0.5 is chance (dashed line), 1.0 is perfect.

DetectorAUROC (95% CI)PrecisionRecallF1
Lexical0.78 (0.75–0.81)0.480.860.61
Ensemble0.77 (0.74–0.80)0.450.930.61
NLI0.72 (0.68–0.75)0.480.840.61
Numeric0.54 (0.50–0.57)0.351.000.52

n = 900 test answers, 35% hallucinated. Precision, recall and F1 at the threshold tuned on the training sample. The numeric detector's best threshold flags everything, so its recall of 1.00 means nothing.

By task

TaskHallucinatedLexicalNLIEnsemble
Question answering20%0.710.710.74
Summarisation20%0.620.630.58
Data-to-text66%0.660.500.66

AUROC within each task (300 answers each). Pooled AUROC is higher than any single task's because the detectors partly pick up the task itself, and tasks differ a lot in how often models hallucinate.

By generating model

ModelHallucinatedLexicalNLI
GPT-4 (0613)10%0.810.69
GPT-3.5 Turbo (0613)15%0.770.74
Llama 2 70B chat36%0.800.70
Llama 2 13B chat46%0.850.73
Llama 2 7B chat49%0.730.66
Mistral 7B instruct56%0.690.81

150 answers per model. The confidence intervals here are wide; read the pattern, not the second decimal.

What each detector misses

“…the implant holds promise for treating a broad range of peritoneal cancers. The first clinical trial focusing on recurrent ovarian cancer is currently underway.”
Summary, Mistral 7B. Annotated as a conflict with the source. Almost every word is in the source, so the lexical score is low (0.10); NLI flags it (0.9997).
“The two-kilometer run down the Las Vegas Strip will make it the longest F1 circuit ever built.”
Summary, Mistral 7B. Unsupported claim. Lexical misses it (0.18); NLI flags it.
“The lease agreement outlines the terms and conditions of the arrangement, including the duration of the lease, payment amounts, and any responsibilities and obligations of both parties.”
QA, Llama 2 70B. Plausible boilerplate the sources never say. NLI finds it vaguely entailed and lets it through; the new vocabulary trips the lexical check (0.44).

What this means if you ship a RAG product

A cheap detector is a useful triage signal, not a quality gate. If you block or rewrite every flagged answer, you will degrade about half of your correct ones. If you only log the flags, they are a reasonable way to decide which answers a person should look at first.

The detectors also disagree in ways that depend on your task and your model, and the ranking flips between them. Neither the public leaderboard nor this page tells you which check works on your traffic. The only reliable way to know is to label a few hundred of your own answers and measure, which is a week of work, not a quarter.

Two things we did not test, deliberately: LLM-as-judge detectors (more accurate, but they cost per call and have their own failure modes; the code includes the interface) and fine-tuned detectors trained on RAGTruth itself, which would flatter the numbers on this benchmark.

Code and reproduction

groundcheck-0.1.0.zip (MIT): the detectors, a CLI that scores one answer against its sources sentence by sentence, the benchmark, per-answer test scores and all metrics.

pip install -e .
groundcheck score --source source.txt --response answer.txt --detector nli
groundcheck bench   # downloads RAGTruth, reproduces this page

The full run took 2.5 hours on a laptop CPU. Limitations: English only; RAGTruth's domains and 2023-era models; answer-level labels (we ignore span positions); a 900-answer test sample for the NLI rows.

Citation

Niu et al. (2024). RAGTruth: A Hallucination Corpus for Developing Trustworthy Retrieval-Augmented Language Models. ACL 2024. arXiv:2401.00396.

Want your own number? We run this measurement on your product in one week, for a fixed $1,500. You share 100–200 real queries with the documents behind them. You get back your hallucination rate by query type, the ten worst failures with their causes, and the evaluation harness in your repository so it keeps running in CI.

guillermollopis@protforge.com