If you’ve ever asked ChatGPT a question only to receive an answer that reads well but is completely wrong, then you’ve witnessed a hallucination. Some hallucinations can be downright funny (i.e. the Wright brothers invented the atomic bomb), others can be a bit disturbing (for example when medical information is messed up).
What makes it a hallucination is the fact that the AI doesn’t know that it is making anything up, it’s confident in its answer and just goes on per normal.
Unlike human hallucinations, it’s not always easy to know when an AI is hallucinating. There are some fundamental things you need to know about AI hallucinations if you’re going to spot them.
What is an AI hallucination: The definition
An AI hallucination is when an AI model produces outputs that are factually incorrect, logically inconsistent or completely made up. These hallucinations are mostly found in generative AI models, specifically Large Language Models (LLMs) like ChatGPT.
Unlike programming bugs in software, AI hallucinations are not the result of a mistake by a programmer but rather come from a model’s learned probabilities. Here’s how to spot the different kinds of hallucinations.
You see facts that are incorrect
Factual hallucinations occur when an AI model produces information that is incorrect or unsubstantiated. An example would be “The Eiffel tower in Paris was built in 1999.” In reality it was built between 1887 and 1889. They come about due to limitations in the model’s training data or ability to check facts.
These hallucinations can be particularly dangerous in the fields of law, education, and healthcare, where factual information is imperative.
You get an answer not related to a question
If an answer deviates too much from a question or breaks the logical flow of a conversation, then the AI is having a contextual hallucination. An example would be a question “How do I make stew?” followed by the answer: “Stew is tasty, and there are nine planets in the solar system.” This produces an output that is linguistically correct, but irrelevant to the topic.
This type of hallucination occurs when the model fails to preserve previous context.
You receive an answer that seems logically invalid
If the logic of an answer is all askew, then the AI is having a logical hallucination. An example of this would be a statement like, “If Barbara has three cats and gets two more, she has 6 cats.” Clearly the logic fails here — the AI has failed at a task that requires simple math and reasoning. This can be a big problem for tasks that require problem solving.
Pexels: Matheus Bertelli
You notice a mismatch across AI modalities
These types of hallucinations known as multimodal hallucinations occur in AI models that interpret multiple types of media. One example would be when a description doesn’t match an image. For example, a prompt to “ask for an image of a monkey wearing sunglasses” produces an image of a monkey without any sunglasses. These are the type you’d see in image generation AI models such as DALL E.
How to test for a potential hallucination
Hallucinations erode trust and can be quite dangerous in some circumstances — for example, when professionals are relying on the AI for correct factual answers.
You can’t always tell if a hallucination is happening, but you can perform some checks to help you find out. Here’s what to do:
Manually fact check
Use search engines and trusted reference materials to check specific claims, names, dates, or numbers provided by the AI. If the AI cites sources, try to look them up. Fabricated or inaccurate source links are a common sign of hallucination.
Use follow-up questions
Ask the AI to elaborate on a specific detail it provided. If it struggles or introduces new, inconsistent facts, the original detail may have been invented.
Ask for justification
Ask the AI, “Can you provide a source for that?” or ask, “How confident are you in this answer?” A good model might point to its training data or search results; a model that’s hallucinating may struggle to back up the claim or invent a plausible-sounding source.
Cross-compare models
Ask a different AI model the exact same question. If the answers are wildly different, it suggests at least one model is incorrect.
Related content
Fake AI images are flooding the Internet. Here’s how to recognize them
Can you spot a poisoned AI chatbot? 4 tips from a Microsoft security expert
I started ‘vibe coding’ my own apps with AI and I’m utterly loving it
Read...