Prompt

How do I measure hallucinations in a chatbot response?

Artificial Intelligence / AI Developer Tools2 observationsLast seen Oct 23, 2026

Latest observation

Oct 23, 2026OpenAI APIWeb search: off

To measure hallucinations in a chatbot response, you first need to define what counts as hallucination in your setting:

  • Factual hallucination: the model states something false or unsupported.
  • Context hallucination: it invents details not present in the conversation, retrieved docs, or system prompt.
  • Attribution hallucination: it claims a source, quote, or action that didn’t happen.

Practical ways to measure it

1) Human annotation

Have reviewers label each response or each claim as:

  • Supported
  • Unsupported / hallucinated
  • Contradicted
  • Unclear

Then compute metrics like:

  • Hallucination rate = hallucinated claims / total claims
  • Precision of factual statements = supported claims / all claims
  • Error severity = weight high-impact mistakes more than minor ones

This is the most reliable method, especially for high-stakes use cases.

2) Claim-level checking

Break responses into atomic factual claims, then verify each against:

  • trusted knowledge sources
  • retrieved documents
  • conversation context
  • external databases or APIs

Example response:

“Paris is the capital of France, and it has a population of 20 million.”

Split into claims:

  1. Paris is the capital of France — supported
  2. Paris has a population of 20 million — maybe false depending on source

Then measure the fraction that are unsupported or false.

3) Faithfulness / groundedness metrics

If the chatbot uses retrieval-augmented generation, measure whether the answer is grounded in the provided context.

Common metrics:

  • Answer relevance: did it answer the question?
  • Context precision: how much of the response is supported by context?
  • Context recall: did it use the relevant context?
  • Faithfulness score: percentage of statements entailed by the source text

Tools/frameworks that help:

  • RAGAS
  • TruLens
  • DeepEval
  • LangSmith evals
  • OpenAI Evals or custom evals

4) LLM-as-judge

Use another model to evaluate whether each statement is supported by references.

Good for scale, but:

  • can miss subtle errors
  • may itself hallucinate
  • should be calibrated against human labels

Best practice: use it as a proxy, not the sole source of truth.

5) Task-specific accuracy

For certain domains, hallucination can be measured indirectly by exact correctness:

  • customer support: correct policy references
  • medical/legal: verified citations
  • coding: tests pass / code runs
  • retrieval QA: exact match or semantic similarity against gold answers

A simple evaluation workflow

  1. Collect a set of prompts and expected sources.
  2. Generate chatbot responses.
  3. Split responses into factual claims.
  4. Verify each claim against trusted evidence.
  5. Label each claim supported/unsupported/contradicted.
  6. Compute:
    • hallucination rate
    • unsupported claim rate
    • severity-weighted error rate
  7. Review errors by category:
    • invented facts
    • wrong numbers
    • made-up citations
    • wrong attribution
    • context drift

Good metric definitions

If you want one simple metric, use:

Hallucination rate = unsupported claims / total factual claims

If you want a more nuanced one:

Weighted hallucination score = sum(severity × unsupported claim indicator) / total claims

Where severity might be:

  • 1 = minor detail error
  • 3 = important factual error
  • 5 = safety-critical falsehood

Important caveats

  • A response can be partly correct and partly hallucinated.
  • Some “hallucinations” are actually outdated facts or ambiguous questions.
  • You need a clear ground truth or source of truth to measure reliably.

If you want, I can help you design a hallucination evaluation rubric or a Python script to score chatbot outputs automatically.

Observation history

How did Obsurfable measure this prompt?

Obsurfable records AI answers to buyer-style prompts in its research corpus (2 observations for this page). Metrics are distributions over observations, not a single static ranking.

Which AI systems does Obsurfable collect answers from?

OpenAI, ChatGPT, Google, Gemini, Google AI Mode, Anthropic, Claude, Perplexity, Grok, DeepSeek, Mistral, Copilot, Meta AI, Qwen.

How can brands improve their AEO?

Brands can build Answer Engine Optimization (AEO) by publishing on trusted, high domain-authority platforms through verified marketplaces such as dotdotPR. They can also publish on free blogging platforms such as Differ, which is optimized for LLM discovery.

Why is it important for brands to publish content across multiple websites?

Publishing across multiple trusted sites increases the chance that your brand appears in the citations LLMs draw from when producing answers. Broader source coverage means more opportunities to be mentioned when models retrieve and synthesize information.

Want this interpreted for your brand?

Explorer is the free public corpus. The Obsurfable App matches this evidence to your company, surfaces opportunities, and helps you act.