P

Hallucination: Definition and Examples

A hallucination refers to a response generated by an AI model that appears plausible and is stated with confidence, but is factually incorrect, invented, or has no basis in the training data.

Full definition

In artificial intelligence, a hallucination occurs when a language model generates information that does not exist, is factually incorrect, or does not correspond to any reliable source. The term is borrowed from psychiatry, where it denotes a perception without a real object. In the AI context, it describes the tendency of models to 'invent' facts with an appearance of certainty.

Hallucinations arise because language models (LLMs) operate by statistical prediction of the next word. They do not 'know' in the human sense: they generate probable text based on learned patterns. When the model lacks information on a topic or the question is ambiguous, it may produce a response that is linguistically coherent but factually wrong — invented citations, fictitious statistics, events that never occurred.

The main danger of hallucinations lies in their appearance of credibility. Unlike a search engine that displays 'no results,' an LLM will almost always produce a response, even when it should admit ignorance. This can lead to the spread of misinformation, especially when the user does not verify sources.

Several techniques can reduce hallucinations: Retrieval-Augmented Generation (RAG) which anchors responses in verified documents, prompting with source requests, lowering generation temperature, or explicit instructions asking the model to say 'I don't know' rather than invent. Understanding this phenomenon is a central challenge of modern prompt engineering.

Etymology

The term 'hallucination' is borrowed from medical and psychiatric vocabulary, where it refers to a sensory perception without an actual external stimulus (from Latin hallucinari, 'to wander in mind'). Its adoption in AI dates to the early 2020s with the rise of large language models, to describe by analogy the generation of content without grounding in reality.

Concrete examples

Asking for bibliographic references from an LLM

List 3 scientific studies published after 2020 on the impact of sleep on memory. IMPORTANT: only cite real studies with their DOIs. If you are not certain that a reference exists, clearly indicate it.

Verifying historical facts generated by AI

What is the exact date of the signing of the Treaty of Westphalia? Only answer if you are certain of the date. If you have any doubt, say so.

Reducing hallucinations with provided context (RAG)

Based ONLY on the document below, answer the question. If the answer is not found in the document, respond 'Information not available in the provided document.'

[Document: ...]

Question: What is the company's 2024 revenue?

Practical usage

In prompt engineering, combating hallucinations involves explicit instructions: ask the model to cite sources, indicate its level of certainty, or respond 'I don't know' when information is lacking. Providing relevant context directly in the prompt (RAG technique) and lowering the generation temperature are also effective levers for obtaining more reliable responses.

Related concepts

GroundingRetrieval-Augmented Generation (RAG)TemperatureFaithfulness

FAQ

Why do AI models hallucinate?
LLMs operate by statistical prediction: they generate the most likely next word based on the previous one, without true factual understanding. When they lack reliable information on a topic, they fill gaps with plausible but fabricated text because their goal is to produce a fluid response, not necessarily a true one.
How can I detect a hallucination in an AI response?
Warning signs include: very specific details on obscure topics (exact dates, round numbers), citations of studies or books that cannot be found online, and statements made with absolute certainty on controversial subjects. The best practice is to systematically verify key facts against primary sources.
Can hallucinations be completely eliminated?
No, not with current LLM architectures. However, they can be significantly reduced using techniques such as RAG, fine-tuning on verified data, explicit instructions in the prompt, and human validation. Recent models hallucinate less than their predecessors, but zero risk does not yet exist.

See also

How to use this prompt

  1. Copy the prompt with the button above.
  2. Paste it into ChatGPT, Claude or your favorite AI assistant.
  3. Replace the bracketed variables with your details, then refine the result.

About Prompt Guide

Prompt Guide is a free library of 2500+ ready-to-use prompts for ChatGPT, Claude and other AIs, with guides to learn prompting and tools to build and optimize your own prompts.

More definitions

Get new prompts every week

Join our newsletter.