Study guide
4.1 Hallucinations: detection & mitigation
ISTQB Certified Tester — Testing with Generative AI CT-GenAI
Track your progress as you read
Finished sections get a check mark.
1 GenAI Foundations for Testers
1.1 Transformers, tokenization, embeddings & context window 1.2 Foundation models, temperature/sampling & prompting basics 1.3 RAG & agent architectures testers must understand
2 Quality Attributes for GenAI
2.1 Faithfulness, factuality, relevance, coherence & fluency 2.2 Safety, toxicity & bias 2.3 Robustness, privacy, latency & cost
3 Test Design for Non-Determinism
3.1 Controlling non-determinism (seeds, temperature, golden datasets) 3.2 Perturbation & metamorphic testing 3.3 Adversarial prompts & red-teaming
4 GenAI Risks & Mitigation
4.1 Hallucinations: detection & mitigation 4.2 Prompt injection, jailbreaks & training-data extraction 4.3 Governance frameworks (NIST AI RMF, EU AI Act, model cards)
5 Test Infrastructure & Tooling
5.1 Evaluation frameworks (Promptfoo, LangSmith, OpenAI Evals, RAGAS) 5.2 Automated metrics (BLEU/ROUGE/METEOR, embedding similarity, LLM-as-judge) 5.3 Guardrails & safety tooling (Llama Guard, NeMo Guardrails)
6 Organizational Adoption
6.1 Responsible AI governance & regression testing for GenAI 6.2 Continuous evaluation, synthetic test data & cost monitoring
4.1 Hallucinations: detection & mitigation
Key Takeaways Explain This Topic AI
A hallucination is fluent, confident output that is false or not grounded in a reliable source or the provided context.
LLMs hallucinate because they predict the next token for plausibility, not truth, and hold no internal ground-truth database.
Types include factual, faithfulness/context-conflicting, intrinsic (contradicts the input) and extrinsic (unverifiable additions).
Detection is verification: grounding checks, fact verification, self-consistency, retrieval overlap, and NLI/LLM-as-judge entailment.
Mitigation is layered: RAG grounding, citations, lower temperature, guardrails, and human-in-the-loop; the rate is measured, not eliminated.
Last updated: July 2026
What a hallucination is
In the CT-GenAI syllabus a hallucination is output from a generative AI model that is fluent, confident, and well-formed, yet is factually false, unsupported, or not grounded in a reliable source or in the context that was provided. Because a large language model (LLM) predicts the next token from statistical patterns rather than looking a fact up, it will happily produce plausible-sounding text even when it has no basis for the claim. For a tester the real danger is this very fluency: a hallucinated answer reads as authoritatively as a correct one, so it can never be caught by tone, grammar, or the model's own confidence alone — it has to be verified against evidence . A classic example is an LLM that cites a court case, an academic paper, or a software API method that does not exist, complete with a convincing but entirely invented reference.
Why LLMs hallucinate
An LLM is trained to maximise the probability of the next token given the preceding sequence; it therefore optimises for plausibility, not truth . Several factors drive hallucination:
The model holds no internal ground-truth database — only learned statistical correlations between tokens.
Training data contains gaps, errors, and bias, and the model's knowledge is stale after the training cut-off date.
Ambiguous, under-specified, or leading prompts push the model to "fill in" the missing detail.
Decoding settings such as a high temperature reward creative, less-constrained, and less-grounded output.
- The model is biased toward always producing an answer and rarely replies "I don't know."
- Types of hallucination
The syllabus classifies hallucinations by what the output conflicts with :
- Type Conflicts with Example
- Factual Real-world facts Invents a non-existent ruling or a wrong statistic
Faithfulness / context-conflicting The supplied source or context A summary asserts something the source document never said
- Intrinsic The input itself The output contradicts a fact stated in the same prompt
- Extrinsic Anything verifiable Adds detail that cannot be confirmed from the input or source
A faithfulness (or context-conflicting) hallucination matters most for Retrieval-Augmented Generation (RAG) and summarisation, where the model is meant to stay strictly inside the supplied text but drifts beyond it. Separating an intrinsic hallucination (which contradicts the given input) from an extrinsic one (an unverifiable addition) is a distinction the exam frequently probes.