4.2. | Quality assurance: Dealing with AI hallucinations
What you already know
What you will learn in this module
1. What are AI Hallucinations?
AI hallucinations are content that an AI model generates, but:
- is not true
- is made up or false
- is often presented with excessive confidence
The term „hallucination“ figuratively describes how AI sometimes „sees“ things that don’t exist or „invents“ facts, similar to human hallucinations, but based on statistical patterns instead of perceptual disturbances.
Typical Examples:
- Made-up quotes or sources
- Non-existent statistics or studies
- Incorrect historical events or dates
- Invented products, books, or people
- False biographical details
2. Why Do AI Models Hallucinate?
AI models hallucinate for various technical and conceptual reasons:
- Statistical Training: AIs don’t understand concepts like humans. They recognize patterns and probabilities in vast amounts of data and generate the most likely word sequence, which is not necessarily factually correct.
- Filling Gaps („Confabulation“): When the AI doesn’t find information directly in its training data, it tends to fill gaps with content that seems statistically plausible, even if it’s made up.
- Limited Training Data: AIs can only „know“ what was in their training data. Current events, niche topics, or incorrect information in the data can lead to hallucinations.
- Unclear or Ambiguous Prompts: Vague or poorly formulated instructions give the AI more room for interpretation, increasing the risk of it making assumptions and hallucinating.
- Over-optimization for Fluency: Models are often trained to provide fluent and human-like responses. Sometimes, they prioritize this flow over absolute accuracy.
3. Recognizing and Verifying Hallucinations
A critical eye is essential. Watch for the following signs and use simple methods for verification:
Warning signs for possible hallucinations:
- Answers that sound too good or too perfect
- Unusually specific numbers, dates, or statistics without a source
- Very confident statements on controversial or brand-new topics
- Quotes that cannot be attributed to any known person or publication
- References to non-existent studies, articles, or books
- Inconsistencies within the answer or compared to previous answers
Simple verification methods:
- Cross-checking (Fact-checking): Check critical claims with trustworthy external sources (search engines, professional databases, expert knowledge).
- Plausibility check: Does the information fit with your existing knowledge or common sense? Does something seem „off“?
- Source verification: If sources are cited, check if they actually exist and support the statement.
- Follow-up questions: Ask the AI to elaborate, justify, or provide sources.
- Vary the prompt: Ask the same question in a slightly different way or ask for confirmation. Hallucinations are often inconsistent.
4. Strategies to Minimize Hallucinations
You can reduce the risk of hallucinations through targeted prompting:
Your tools against AI hallucinations in prompting
Be precise and specific
Avoid vague questions. Provide clear context and state exactly what you expect.
Better: „Explain the functioning of a qubit in simple terms for laypeople.“
Request sources
Explicitly ask the AI to cite its sources, especially for facts or figures.
Allow uncertainty
Give the AI the option to say it doesn’t know something, instead of guessing.
Provide context (Grounding)
Give the AI relevant information (e.g., text passages, data) to base its response on.
Limit the scope
Don’t ask for all-encompassing answers; focus on specific aspects instead.
Better: „Draft a SWOT analysis for a fictional café.“
Temperature parameter (if available)
A lower „temperature“ value in some tools leads to more focused, less „creative“ (and often less hallucinatory) responses.
Temperature: 0.2 (for factual answers)
Temperature: 0.8 (for creative writing)
6. Professional Handling of Identified Hallucinations
When you discover a hallucination, there’s no need to panic. Instead, it’s a reason for careful action:
- Don’t trust blindly & correct immediately: Treat every AI output as a draft. Never use hallucinated content unchecked, especially for important decisions or external communication. Correct or remove the false statement immediately.
- Clarify internally (if necessary): If the hallucinated information has already been shared internally, make sure all involved parties are informed of the correction to avoid misunderstandings.
- Adjust prompt & regenerate: Analyze why the hallucination might have occurred (e.g., vague prompt). Adjust your prompt according to the strategies above (be more precise, provide context, allow uncertainty) and try again.
- Provide feedback (if possible): Many AI tools offer a feedback function (thumbs up/down). Use it to inform the model that the answer was wrong. This helps developers improve the models.
- Be transparent when sharing: If you share AI-generated content (even corrected versions), be transparent about its origin and that it has been verified. Phrases like „AI-assisted and reviewed“ build trust.
- Document (for recurring problems): If a particular topic or type of question regularly leads to hallucinations, document it to be extra cautious in the future or to use alternative methods for information gathering.
Your Takeaway
- AI hallucinations are a known limitation of current models – expect them and plan accordingly.
- Always be critical: externally verify important facts, figures, and quotes.
- Minimize the risk with precise prompts, context, and by allowing for uncertainty.
- Request sources whenever possible and sensible.
- The responsibility for the accuracy of the final content always lies with you as the user.
- Use the tools‘ feedback mechanisms to contribute to improving the models.