BlogRun AI wherever your compliance framework demands. Read blog >
BlogRetrieval accuracy is now a competitive advantage Read blog >

What Are AI Hallucinations?

Try Atlas

AI hallucination occurs when a large language model (LLM) generates a factually incorrect or completely fabricated answer. For example, you may use a generative AI tool (ChatGPT, Claude, Gemini) to ask about a drug interaction and get a warning that doesn't exist. Or, you may ask for a CEO's name and get someone who left years ago. It’s important for every user who interacts with AI tools to understand what hallucinations are and how they present—because the more confident the answer sounds, the easier it is to miss when it’s wrong.

Key takeaways

  • Large language models (LLMs) can only pull from the data they were trained on; when an answer falls outside that dataset, the model may generate a plausible-sounding response rather than acknowledging the gap.
  • AI hallucinations aren't limited to text—image generators can hallucinate, too.
  • Prompt engineering—being specific, setting constraints, and using chain of thought prompting—can reduce hallucinations for individual users.
  • For organizations, the most effective fix is adding retrieval augmented generation (RAG), vector embeddings, and rerankers to create a retrieval layer that feeds the LLMS the most accurate, relevant, and current information before it generates a response.
  • Because AI responses are delivered with the same confidence whether they’re accurate or not, hallucinations can be difficult to detect, which makes verification an important habit for any AI user.

Table of contents

The real-life consequences of AI hallucinations

To understand how easy it is to get misled by generative AI tools, let's follow Greta, a financial analyst reviewing a borrower's risk profile. When Greta read the AI-generated report, she was impressed. It was crisp, confident, well-written, and gave the potential customer a favorable risk score. Unfortunately, she forwarded the file without fact-checking the results and the underwriter flagged it as fraud.

The underwriter may have flagged the file for one of these three possible reasons:

Fabricated compliance: The AI model explicitly stated that the borrower had no outstanding legal actions filed against them when, in fact, a judgment had been filed six months prior.

Inflated assets: The AI model reported the borrower's investment portfolio at $340,000. The actual current value was $180,000—the AI model pulled figures from an 18-month-old statement. This is a classic example of how training cutoff data can produce misleading AI output.

Misclassified employment status: The AI model identified the borrower as a full-time salaried employee, when they had actually transitioned to contract work eight months earlier—a material change that significantly affected their risk profile.

In Greta’s case, the AI was guilty of the first one: the fabricated compliance status. It invented a clean legal record for a borrower who had an active judgment against them. There was no asterisk that said to check the information for accuracy, no “maybe” or “perhaps” qualifying the findings.

AI hallucinations aren't limited to text

Generative AI image generators can hallucinate, too. Extra fingers is the classic example, along with distorted hands and impossible proportions.

An AI-Generated image of a spaceship on a cow
(Source: Sify.com, 2024)

The above image was generated by DALL-E 2 when prompted to create "1960s art of a cow being abducted by a UFO in the Midwest." The AI tools misinterpreted the context and scale of the request. Unlike text hallucinations, image hallucinations are often immediately obvious, which makes them less dangerous than the kind Greta encountered, where nothing looked wrong at all.

Why do AI hallucinations happen? 

If an LLM isn’t set up for search and retrieval from sources outside of its training data, it’s more likely that the LLM will hallucinate information it needs to answer the query. While some models are encouraging “abstinence” when the answer is unclear, it’s still best to fact check important information.

Here are the top reasons why generative AI hallucinates:

What are the different types of AI hallucinations?

AI hallucinations show up in different ways—some are just flat-out wrong, some are confidently made up, and some are so subtly off that they're easy to miss. Below are the most common types.

Factual errors

The AI generates incorrect information. One well-known AI hallucination is when Google’s Bard told the user that the James Webb Space Telescope took the first photos of exoplanets, when that distinction actually belongs to a telescope in Chile. 

Fabricated citations

The AI creates sources, citations, cases, or references that don’t exist, but seem real. In one incident, a lawyer used ChatGPT to research legal precedents for a personal injury case and returned six cases that were completely false, including the case names, courts, and rulings. The lawyer cited them in court and it was publicly sanctioned.

Response misalignment

A user asks an AI to summarize the key financial risks in a specific contract. The AI responds with a general overview of what financial risk is. It’s accurate, but doesn’t answer the question. 

Self-contradiction

The model contradicts itself within a single response. A computer engineering student asked about a specific software library and the AI warned it’s not maintained and has known security exploits, but also recommended it as the foundation for a new application.

Non sequitur

One part of the response has no logical connection to the rest. Asked to summarize the three biggest risks in a merger, the AI lists market consolidation, regulatory scrutiny, and the French Open.

Data lag

The model's training data is outdated, so its answer reflects a reality that no longer exists. This is exactly what happened to Greta in our earlier example when the AI tools didn’t flag the legal action because it happened after the training cutoff date. 

How to spot AI hallucinations

Knowing how to spot AI hallucinations in AI-generated content can protect you from believing fake facts.

Here’s what to watch for:

  • False precision: The more precise the output sounds—exact dates, specific names, detailed statistics, specific citations—the more skeptical you should be. Confident precision is a warning sign, not a reason to trust the output. If it’s authoritative and specific, verify it.

  • Internal contradictions: Be sure to read the full output before assuming it’s true. Generative AI models sometimes contradict themselves from one paragraph to the next—stating one thing early in the answer and something completely different later. 

  • Outdated information: Remember that LLMs have a cutoff date for training data. It may give you information about people, products, or policies that are outdated. Be sure to fact-check the output. This is exactly the trap Greta fell into: nothing in the report signaled that the data was old.

  • Missing sources: If generative AI models make a specific factual claim, ask it for the source and verify it against external sources. If it can't produce one—or provides one that doesn't exist—treat the output with skepticism.

The hard part isn't that hallucinations exist—every technology has weaknesses. The problem is that AI-generated text delivers wrong answers with the same confident, well-written, authoritative tone as accurate outputs—and humans have no way to tell them apart. And while some LLMs are increasingly abstaining from answering when the answer is unclear, hallucinations are always a possibility and must be verified for particularly important information.

How to reduce AI hallucinations with prompt engineering

Prompt engineering won’t eliminate hallucinations entirely, but the way you frame a question can impact the answer. A well-constructed prompt gives the model less room to guess, which is when hallucinations happen. Here are four ways you can tighten your prompts to get more reliable results. 

1. Be specific

Vague prompts invite confusion. To get a solid answer, you need to tell the LLM exactly what you need, how you want the answer delivered, and which constraints to apply. 

"You’re a financial analyst reviewing verified loan documents. Summarize only what’s explicitly stated in the following text."

This narrows the model's context significantly.

2. Tell it what it can and cannot do

Asking the LLM to flag uncertainties narrows the possible outcomes and encourages hedged statements instead of confident fabrications.

"Provide answers using only this document for information” or "If you’re not sure of the answer, say so explicitly." 

3. Use chain of thought prompting

"Show me your reasoning step-by-step before giving your final answer."

This makes errors visible—you can see where the logic breaks down before you accept that the answer is factual.

4. Cross-check high-stakes outputs

Before using the results, verify against a primary source. You can also use one AI tool to fact-check other AI tools. However, if those results are inconsistent, always defer to the primary source.

For individual users, well-crafted queries can make a meaningful difference in the accuracy of the output. Prompt engineering is one of several hallucination mitigation techniques—but highly regulated industries like finance, healthcare, and law need AI systems that retrieve information from verified, up-to-date sources before generating a response. Without that foundation, even well-written prompts can’t prevent AI hallucinations from occurring.

How adding a retrieval layer can mitigate AI hallucinations

As stated previously, LLMs can only access the data they were trained on and need a retrieval layer to pull in real-time content. That retrieval layer is commonly powered by retrieval-augmented generation (RAG), a popular generative AI framework that can mitigate AI hallucinations. 

Instead of relying solely on training data, RAG incorporates relevant, current, and verified factual data during the answer-generation process. That source can be as broad as the internet or as focused as a proprietary knowledge base. 

Companies can create a cost-effective, customized LLM by using an off-the-shelf LLM, adding RAG, and connecting their domain knowledge base—ensuring the model always has sufficient information to generate accurate, grounded responses. Because RAG pulls from real sources, answers are traceable—but quality depends on more than RAG alone. Vector embeddings and rerankers help retrieval augmented generation pull in the right answers.

Vector embeddings

Vector embeddings are what make RAG retrieval smart. Instead of matching keywords, they match meaning, so the right content is found even when the query is worded differently—because embeddings understand intent, not just exact phrasing. 

Rerankers

After RAG retrieves a set of relevant documents using embeddings, not all of them are equally useful. A reranker scores them for relevance, filtering out the weaker ones before the answer is generated. This ensures the LLM only sees the most relevant results, which means it can return more accurate and trustworthy answers, thereby reducing AI hallucination. Research shows that LLMs are not the best tool for reranking their own results, and that a dedicated reranker is significantly better. 

How MongoDB Atlas and Voyage AI mitigate hallucinations

Piecing together separate systems for embeddings, reranking, and retrieval creates a fragmented approach that is complex, costly, and cumbersome for developers. With Voyage AI, MongoDB solves this challenge by making AI-powered search and retrieval native to the database. Developers can generate high-quality embeddings, store vectors, perform semantic search, and refine results—all within MongoDB.

For organizations like Greta's, this changes everything. The fabricated compliance status never makes it into the report—because the model retrieves from verified, current records, not guessing from old data. Even in agentic workflows, where AI agents make sequential decisions autonomously, grounded retrieval prevents one hallucination from cascading through an entire pipeline. 

To learn more about how MongoDB and Voyage AI are powering smarter AI search and retrieval, visit our Voyage AI product page.

Get started with Atlas today

Get started in seconds. Our free clusters come with 512 MB of storage so you can play around with sample data and get oriented with our platform.
Try FreeContact sales
GET STARTED WITH:
  • 125+ regions worldwide
  • Sample data sets
  • Always-on authentication
  • End-to-end encryption
  • Command line tools