Hallucination Detection

Estimates factual confidence and flags fabricated facts, false citations, and invented statistics.

How it works

The Hallucination pillar measures how well a response is supported by evidence. It analyses factual claims, citation validity, and internal consistency, producing a confidence score where a low value means the output is likely fabricated.

Grounded vs ungrounded

Detection is dramatically more accurate when you provide the source material the model was supposed to use. Pass it in context:

Python
r = client.evaluate_sync(
    prompt="What was Q3 revenue?",
    response="Q3 revenue was $4.2M, up 30% YoY.",
    metadata={"context": retrieved_docs},   # ground truth for the check
)
print(r.pillar_scores["hallucination"])
Grounded evaluation reduces hallucination false-positives by 60–80% compared with context-free checking — ideal for RAG pipelines.

Flags

FlagMeaning
uncertain_claimsClaims with low factual confidence (informational).
fabricated_citationA cited source that does not support the claim.
unsupported_statisticA number with no basis in the provided context.

Example

Use the hallucination score to gate RAG answers: below your threshold, fall back to "I don't have enough information" instead of shipping a confident-but-wrong answer.

Was this page helpful?