Sometimes AI confidently states things that simply are not true. That is called a hallucination. Knowing why it happens — and which prompts make it less likely — is essential before you trust AI with anything important.
An AI hallucination is when the model generates text that sounds right but isn't right. It might invent a citation, get a date wrong, fabricate a quote, or describe a feature that does not exist in some software. The result reads beautifully and looks confident — that is exactly what makes hallucinations dangerous.
To understand hallucinations, remember what the model is actually doing: predicting the next likely token based on patterns it has seen. It is not "looking up" facts in a database. It is composing a plausible continuation.
Most of the time, "plausible" and "true" overlap. But when the AI is asked about something it does not really know — a niche topic, a recent event, a specific person, an unusual edge case — it still produces plausible text, because that is what it was trained to do. The result looks correct because the structure is correct. Only the content is fabricated.
One-line definition: A hallucination is fluent, confident-sounding output that has no factual basis.
Prone to hallucination
Give me three academic papers that prove
the benefits of intermittent fasting.
Without access to a real research database, the AI may invent paper titles, authors, journals, and years that look completely real but don't exist.
Hallucination-resistant
Based ONLY on the abstracts I paste below,
summarise the main findings on intermittent
fasting. If a question is not answered in
these abstracts, say "Not covered in source".
Abstracts:
"""
… paste real abstracts here …
"""
By restricting the AI to the text you provide and telling it to admit when it doesn't know, you collapse the room for invention.
The single most powerful technique. Don't ask the AI to recall facts — give it the facts and ask it to work on them. "Based only on the text below…" is the safest prompt phrasing for factual tasks.
If you are not certain, reply with
"I don't have reliable information for that."
Do not guess.
This gives the AI explicit permission to refuse — most hallucinations happen because the model feels it must give some answer.
For every claim, quote the exact sentence
from the source text that supports it.
If the AI cannot find a supporting quote, it is forced to admit the claim has no basis.
Asking the AI to walk through its reasoning step by step exposes weak links — you can see where it guessed.
If your AI tool lets you set temperature (covered in the next topic), use 0 to 0.3 for factual tasks. Higher creativity is great for brainstorming but invites invention.
Ask any AI tool:
Recommend three books written before 2010 about prompt engineering, with author and publisher.
Spot the invention. (Prompt engineering as a named field came later.)
Paste a short news article and ask:
Summarise this article in 5 bullets. For each bullet, quote the sentence from the article that supports it.
Notice how the AI's tone shifts when forced to cite.
Take a topic you know well and ask the AI a deliberately niche question about it. Check the answer carefully and note any subtle invention. This trains your eye.
Sign in to join the discussion and post comments.
Sign inPrompt Engineering Projects & Real-World Applications
Twelve hands-on projects that turn prompt engineering theory into a portfolio. Build chatbots, content generators, RAG systems, and more.
Advanced Prompt Engineering Techniques
Master the powerful techniques AI experts use every day. Chain-of-thought, RAG, agents, function calling, prompt evaluation, and much more — 20 deep-dive tutorials.
Prompt Engineering for Image Generation
Turn words into stunning visuals. Master AI image generation tools like Midjourney, DALL·E 3, and Stable Diffusion with 18 focused tutorials — from first prompt to full brand identity.
Prompt Engineering for Business & Productivity
Use AI to work smarter — automate tasks, make better decisions, and communicate professionally. 12 practical business prompt tutorials for professionals.
Prompt Engineering for Developers
Use AI as your coding co-pilot. 18 tutorials on writing prompts to generate clean code, debug faster, write tests, build APIs, and ship better software.
Prompt Engineering for Data Science & Analytics
Supercharge your data workflows with AI. 15 practical tutorials on using prompt engineering for data cleaning, EDA, machine learning, SQL, visualisation, and more.