AI for everyone
AI Hallucinations: Why They Happen and How to Spot Them
An AI hallucination is an answer that sounds confident and fluent but is false or invented, such as a book that does not exist or a wrong date. It happens because a language model writes the most plausible next words rather than looking facts up, so you reduce the risk by supplying source material, asking it to admit uncertainty, and checking anything that matters.
By CodingMarble · Published · 4 min read

What a hallucination actually is
In everyday AI use, a hallucination is output that is presented as fact but is not true. The tool might name a court case that was never heard, quote a sentence from a report that contains no such sentence, or give a tidy formula that quietly produces the wrong number. The word is borrowed from human experience, but the machine is not seeing things. It is producing text, and some of that text happens to be wrong.
What makes this hard is the tone. A wrong answer from a person often comes with hesitation. A wrong answer from a language model usually arrives in the same smooth, assured style as a right one. Nothing in the wording tells you which is which, so the habit of trusting confident writing, which works reasonably well with human experts, works badly here.
Why language models produce false but plausible text
A language model is trained on a very large amount of text to predict what words are likely to come next. When you ask a question, it builds an answer one piece at a time, choosing continuations that fit the pattern of the conversation. The goal it was shaped around is plausible text, and plausible and true overlap a lot, but they are not the same thing.
Three gaps follow from this. First, training data has holes: some subjects are thinly covered, some are out of date, and some contain errors that the model absorbed along with everything else. Second, the model does not hold a tidy database of facts it can look up. Knowledge is spread across numbers learned during training, so recall can blur details, merging two similar people or two similar studies into one. Third, there is no built-in fact-checking step. Unless the tool you use is connected to search or to your own documents, nothing compares the draft answer with reality before it reaches you.
Models are also pushed, by how they are trained and tuned, toward being helpful and giving an answer. Saying "I do not know" is a less natural continuation than producing something that looks like an answer, so a gap in knowledge often gets filled rather than flagged.
Questions that invite hallucinations
Some request types are reliably riskier than others. Knowing them lets you aim your attention where it is needed.
- Obscure facts: a small town's history, a minor public figure, a niche product. Thin training coverage means more guessing.
- Citations and references: titles, authors, page numbers, links and case numbers are exactly the kind of detail that looks right when invented. Never accept a reference you have not opened yourself.
- Numbers and calculations: figures, dates, totals and unit conversions can be wrong while reading perfectly well.
- Recent events: anything after the model's training period may be missing, and a tool without live search cannot know it.
- Leading questions: if you ask "why is X true?" about something false, a model may build an explanation instead of questioning your premise.
- Very long or multi-part answers: the more claims in one reply, the more chances for one to be wrong, and the harder each is to spot.
How to reduce hallucinations in your own use
You cannot remove hallucinations, but you can shift the odds. The most effective move is to stop asking the model to remember and start asking it to read. Paste in the text you want it to work from, and tell it to answer only from that text. Questions about a document you supplied are far more dependable than questions about the wider world.
Use only the text between the triple quotes below.
If the answer is not in the text, reply exactly: "Not stated in the text."
For each answer, include the sentence from the text that supports it.
"""
[paste the policy, article or notes here]
"""
Question: What is the notice period for cancelling the membership?Asking for the supporting quote gives you something concrete to check: you can search for that sentence in your original. Asking the model to say when it is unsure also helps a little, though it is not reliable, because a model can be wrong about its own certainty. Treat "I am not sure" as a useful signal when it appears and never treat its absence as proof of accuracy.
Practical tip: when an answer contains a quote, a name or a number you plan to use, search for that exact item in a trusted source before using it. If you cannot find it in two minutes, assume it may be invented.
Verification habits that work
Good checking is mostly a routine, not a talent. Start by sorting claims into those that would cause trouble if wrong and those that would not. A suggested title for a birthday speech needs no checking. A dosage, a deadline, a legal rule, a price or a claim about a named person does.
- Pick out the checkable claims: names, dates, numbers, quotes, references.
- Look each one up in a primary or official source, such as the original document, the organisation's own website or a textbook.
- Ask the same question a second time, in different words. Answers that change between attempts are a warning sign.
- For calculations, redo them yourself or in a spreadsheet instead of trusting the written result.
- Ask the model to list what in its answer is least certain, then check those parts first.
Checking can feel like it cancels the time saved, but it rarely does when you check selectively. Reading a draft and verifying five key facts is usually still faster than writing from nothing.
Where hallucinations matter most
The cost of an error depends on what happens next. In brainstorming, a wrong idea is simply discarded. In health, law, finance, safety and anything involving decisions about other people, a confident falsehood can cause real harm, and those areas call for a qualified professional rather than a chatbot. The same applies to work you will publish or sign your name to: a fabricated citation in a school essay or a report damages your credibility, not the tool's.
A sensible rule is to match your checking effort to the stakes. Low stakes, light glance. Medium stakes, verify the key facts. High stakes, use the AI only to draft or organise, and let verified sources and qualified people supply the substance.
Keep reading
- AI for everyoneHow Large Language Models Work, Explained SimplyA large language model is a program trained on huge amounts of text to predict what piece of text comes next, and it writes answers by repeating that prediction one small step at a time. Because it is built to produce likely, fluent text rather than to look up verified facts, it can sound sure and still be wrong.
- AI for everyoneWhat Is Generative AI? A Plain-Language ExplanationGenerative AI is software that produces new text, images, audio or code in response to a request, based on patterns it learned from large amounts of example material. It is useful for drafting, summarising and brainstorming, but it can state wrong things confidently, so anything that matters must be checked.
- AI for everyonePrompt Writing Basics for Beginners: A Simple RecipeA good prompt states your goal, gives the context, names the task, and says what format and limits you want, with an example if you have one. Start simple, read the answer critically, and refine it in follow-up messages instead of expecting one perfect reply.
- AI for everyoneAI Privacy: What Not to Share With ChatbotsAnything you type into an AI service leaves your device, and the service may store it, have people review it or use it to improve its systems, depending on its policy and your settings. Keep passwords, financial and identity details, health records, confidential work files and other people's private data out of prompts, and anonymise text before you paste it.
Need this built properly for your business?
CodingMarble is a remote studio in India that builds websites, apps and games on fixed packages with the scope written down before payment. Try the free tools we run, or start a project when you are ready.
- On CodingMarble
- Free browser tools
- Frequently asked questions
- All guides