Sign inGet started
All insights
Education & Learning

How to Use AI Hallucination Examples: A Practical Walkthrough

By SkillzBench · October 17, 2026

Learn to use AI hallucination examples for training and testing. This practical walkthrough shows how to detect, benchmark, and mitigate LLM errors effe...


Key Facts

Why Hallucinations Are Hard to Catch — and Why Real Examples Are Your Best Teaching Tool

AI hallucinations are not hypothetical failure modes — they have cost real people real money. A lawyer and his firm were fined $5,000 for submitting ChatGPT-invented legal precedents to a court. Google lost roughly $100 billion in stock value after Bard's demo error, and NIH-cited research found that up to 47% of ChatGPT references are inaccurate.

The stakes extend into technical work too. In one documented case, a developer asked an LLM to generate payment API documentation, and the model confidently invented endpoints, parameters, and responses for an API that did not exist.

The core problem is that hallucinations are visually indistinguishable from correct answers. As Shittu Olumide of MachineLearningMastery puts it, "a correct answer and a completely fabricated one can look identical in tone and confidence." One of the more dangerous traits of LLMs is not that they get things wrong, but that they do so without hesitation.

  • Invented citations with plausible titles and author names that simply don't exist
  • Fabricated financial figures, like the FinanceBench answer "$2850.00" for Kraft Heinz net working capital
  • Nonexistent API endpoints and parameters presented as authoritative documentation
  • A major airline losing a court case after its RAG system hallucinated refund policy details

Because hallucinations look and sound correct, teams cannot rely on intuition alone. Curated hallucination examples are the best teaching tool available — they train eyes to spot fabrication patterns and provide concrete material for building automated tests.

Risk also varies dramatically by model, which means it must be measured rather than assumed. Vectara's hallucination leaderboard shows rates ranging from 1.8% to 24.2% on a standardized summarization benchmark — a spread of more than 13x between the best and worst performers. Choosing a model without checking its hallucination rate is guessing.

This measurement mindset extends beyond model outputs to the entire AI stack. Published research found that roughly 26% of agent skills carry at least one vulnerability, which is why SkillzBench is building a free directory and MCP connector that will let users verify and benchmark agent skills in a sandbox before deploying them. Whether you are testing model outputs or the skills those models rely on, the principle is the same: real examples, measured, beat assumptions every time.

Sort Every Example Into One of Three Failure Types Before You Test Anything

A hallucination isn't one kind of failure — it's three. Before you test anything, sort every example in your catalogue into one of three buckets, because the check that catches one type will silently miss the others.

Braintrust's evaluation framework makes the critical distinction: an answer can be factually wrong, unsupported by retrieved context, or inconsistent with conversation history — and these require separate checks. As their evaluation guide puts it, "a single model answer can pass a groundedness check while failing factuality or consistency checks." A RAG answer can even be perfectly grounded and still wrong if retrieval supplied the wrong document.

Sorting the catalogued examples

Take the fake legal citations from the Mata v. Avianca case — ChatGPT-invented precedents that cost a lawyer a $5,000 court fine, part of a broader pattern where NIH-cited research found up to 47% of ChatGPT references are inaccurate. Those are pure factuality failures: the claims are false against the real world, regardless of context.

The Kraft Heinz example from FinanceBench is different. When asked for FY2015 net working capital, a RAG system answered "$2850.00" — a number with no support in the retrieved Consolidated Balance Sheets. Per Cleanlab's benchmark analysis, that's a groundedness failure: the response isn't traceable to the source documents. A factuality check alone won't catch it, because the model's arithmetic might be fine — the problem is what it invented rather than retrieved.

Matching metrics to your task type

Once your examples are sorted, assign each failure type the right metric for the job:

  • RAG question answering → groundedness plus faithfulness, checking the answer against retrieved context
  • Summarization → faithfulness, since summaries must stay true to the source document
  • Free-form generation → consistency checks across multiple generations of the same prompt

This matters because a peer-reviewed survey concludes no single detection approach works in all circumstances — effective mitigation combines complementary techniques. The same logic applies when you're evaluating AI agents more broadly: published research found roughly 26% of agent skills carry at least one vulnerability, which is why SkillzBench is building a free directory and MCP connector to verify and benchmark skills in a sandbox before deployment. Sorting failures by type is the first step toward testing what actually breaks — not what's easy to measure.

Build a Test Set: The [Query, Context, Response] Scoring Pattern That Works

Before you trust any hallucination detector, you need a test set it can't cheat on. That's harder than it sounds — even widely used benchmark datasets have been found unreliable.

The cleanest published methodology comes from Cleanlab's RAG hallucination benchmark. Each detection method receives a triple — user query, retrieved context, and LLM response — and returns a hallucination likelihood score between 0 and 1. Those scores are then evaluated via AUROC against ground-truth annotations held in reserve, so the labels used for judging are never the labels used for building.

The reserve step matters more than most teams realize. When Cleanlab audited popular hallucination datasets, it excluded HaluEval and RAGTruth entirely due to significant errors in their ground truth annotations. If your example set contains mislabeled cases, every detector score you compute against it is noise. Validate a sample of your examples by hand before benchmarking anything against them.

For teams starting cheap, three building blocks are already public:

  • Vectara's summarization prompt template is published in full, so you can replicate its evaluation setup rather than inventing your own.
  • The open-source HHEM-2.1-Open detector is available on Hugging Face and Kaggle, giving you a working scorer without licensing costs.
  • Running your model at temperature 0 makes results reproducible — essential when you're comparing detectors across runs.

One caveat belongs on every benchmark you build: vendor bias. Vectara promotes its own HHEM detector, and Cleanlab's benchmark crowns Cleanlab's own tool. Treat any single-vendor result as a starting hypothesis, not a verdict.

The deeper finding is that no detector suffices alone. In the same benchmark, RAGAS Answer Relevancy proved mostly ineffective for detecting hallucinations — modern LLM hallucinations tend to answer the question plausibly, just inaccurately, so relevancy scoring misses them. An academic survey reaches the same conclusion from the mitigation side: no single approach completely mitigates hallucination, and combinations of complementary techniques work best.

The same discipline applies beyond model outputs. Published research found roughly 26% of agent skills carry at least one vulnerability, which is why SkillzBench is building free sandbox benchmarking for agent skills — test components the same way you test responses, with results you can reproduce.

Build the triple-pattern test set, validate your labels, score with multiple detectors, and your hallucination examples stop being anecdotes and start being measurement.

Turn Failures Into Regression Tests and Add Friction Between Generation and Delivery

Every hallucination that slips into production is a free lesson — if you capture it. The teams that catch hallucinations reliably are the ones that turn each failure into a permanent test case rather than a one-off fix.

Start by closing the loop on evaluation itself. An expert evaluation workflow recommends a specific sequence: run built-in and custom scorers, calibrate them against human review, then promote flagged outputs into regression test cases. The calibration step matters most, because "the judge is still a language model, so it can return the wrong verdict" — you cannot trust an LLM judge as a release signal until you have verified it against human labels.

From there, the operational loop looks like this:

  • Convert every production failure into a regression test case with the original query, retrieved context, and the hallucinated response.
  • Add CI checks on pull requests so prompt or retrieval changes that reintroduce a known failure block the merge.
  • Score sampled live traffic continuously, since offline test sets cannot cover every way users stress your system.
  • Re-calibrate judges against human labels periodically, not just once.

This is where friction between generation and delivery becomes a design principle rather than a slowdown. As practical guidance puts it, "do not rely on a single pass" — a verification layer, a confidence threshold, or a human checkpoint between the model and the user catches what prompting alone cannot. The same guidance is clear that RAG reduces but does not eliminate hallucinations, so a retrieval system still needs this loop running behind it.

The stakes justify the overhead. A published RAG benchmark documents a major airline losing a court case after its system hallucinated refund policy details — a failure that a groundedness check on sampled traffic might have caught. On the finance benchmark in the same study, one hallucinated answer cited a precise "$2850.00" figure for a question the retrieved balance sheet could not actually answer.

Hallucination-style risks extend beyond model output to agent skills too. Published research found roughly 26% of agent skills carry at least one vulnerability, and a hallucinating skill can inject bad instructions into your agent just as confidently as a hallucinating model injects bad facts. SkillzBench (skillzbench.com) is building a free directory, security scanning, and a free MCP connector so you can discover, verify, and sandbox-benchmark agent skills before they ever reach production — the same regression-test mindset, applied one layer earlier in the stack.

Frequently Asked Questions

How can I tell if an AI answer is a hallucination if it sounds confident?
You often can't by feel — as one researcher puts it, "a correct answer and a completely fabricated one can look identical in tone and confidence." That's why curated real hallucination examples are the best training tool: they teach you to recognize fabrication patterns like invented citations, fake financial figures, and nonexistent API endpoints.
What are some real examples of AI hallucinations that caused actual harm?
A lawyer and his firm were fined $5,000 for submitting ChatGPT-invented legal precedents to a court, and Google lost roughly $100 billion in stock value after Bard's demo contained a factual error. Research also found that up to 47% of ChatGPT references are inaccurate, and one airline lost a court case after its RAG system hallucinated refund policy details.
Do I need different tests for different kinds of hallucinations?
Yes — hallucinations come in three failure types: factually wrong, unsupported by retrieved context, and inconsistent with conversation history, and each requires a separate check. A single answer can pass a groundedness check while failing factuality, so match the metric to your task: groundedness for RAG, faithfulness for summarization, consistency checks for free-form generation.
How do I build a test set to measure hallucinations in my own system?
Use the [query, context, response] pattern: each detection method receives the user query, retrieved context, and LLM response, and returns a 0–1 hallucination likelihood score evaluated against ground-truth annotations held in reserve. One caution — validate your examples by hand first, since Cleanlab excluded HaluEval and RAGTruth entirely due to significant errors in their ground-truth annotations.
Is one hallucination detector enough, or should I use several?
Use several — a peer-reviewed survey concludes that no single approach works in all circumstances and that combinations of complementary techniques work best. For example, RAGAS Answer Relevancy proved mostly ineffective at detecting hallucinations because modern LLMs answer questions plausibly, just inaccurately.
Does RAG stop hallucinations, or do I still need verification layers?
RAG significantly reduces hallucinations but doesn't eliminate them — a grounded answer can still be wrong if retrieval supplies the wrong document. Practical guidance is to "not rely on a single pass" and add friction between generation and delivery, such as a verification layer, confidence threshold, or human checkpoint, and to convert every production failure into a regression test.

From Anecdotes to Evidence: Make Your Hallucination Examples Work for You

Hallucinations are dangerous precisely because they sound right — invented citations, fabricated figures like the "$2850.00" Kraft Heinz answer, and nonexistent API endpoints all arrive with the same confident tone as correct answers. That is why real, documented examples are your best teaching tool: they train your team's eyes and give you concrete material to build tests around. The walkthrough above gives you a repeatable path: sort each example into factuality, groundedness, or consistency failures; build a [query, context, response] test set with reserved ground-truth labels; score with multiple complementary detectors; and convert every production failure into a regression test with friction between generation and delivery. The payoff is measurable risk reduction, not guesswork — especially when hallucination rates vary so widely across models, from 1.8% to 24.2% on a standardized benchmark. Start with one real failure from your own system this week, and if you're extending that testing mindset to AI agents, SkillzBench is building a free directory and MCP connector to help you discover, verify, and sandbox-benchmark agent skills before they reach production — join the waitlist to follow along.

AI Hallucination Examples: Practical Walkthrough · SkillzBench