• AI

AI Hallucination: AI Bluffs with Confidence

By Tejas Shahi ·

AI Hallucination: AI Bluffs with Confidence


Ever wondered, AI has answer to everything, whatever you throw to it response with perfect answer. But do you think is it actually perfect or they just looks perfect but is actually fabricated.

Well in this world nothing is 100% perfect than how can AI be? its actually not it sometimes generates output which is deviated from the facts or made up to look perfect but is actually fake and it is called Hallucination.

In terms of human, Hallucination refers to perceiving something that does not actually exists. But in the world of AI hallucination refers to the behaviour of Large Language Models where they generate output which is fluent, has perfect grammar, and looks so perfect but are actually fabricated, incorrect, or irrelevant to the context.

The trickiest part while dealing with AI Hallucination is that it delivers with such confidence its merely noticeable because it is trained with human patterns unless it is trained with strict guardrails. It merely says "I don't know" as it guesses with straight face that we might not even notice.

Various Kinds of AI Hallucination

The amount of hallucination is never fix. It can range all the way from minor inconsistencies to completely broken, fabricated, and contradictory statements. Some of its core kinds are:

  1. Sentence Hallucination: This occurs when AI generates sentences which contradicts with each other within a same response or same conversation. For example, it may state a fact in first paragraph and deny that on second one.

  2. Prompt Hallucination: This happens when AI misinterpret's user's prompt or losses track of context mid-conversation which leads it to answer to a different question than the one asked.

  3. Factual Hallucination: The AI states untruth with an absolute fact. This includes inventing fake historical data, unexisting urls, or citing completely wrong person.

  4. Nonsensical Hallucination: This kind of Hallucination happens when AI gives fact but which is actually irrelevant to the question. This response completely lack logic and meaning.

Why Does AI Hallucinate?

There are several causes why AI Hallucinate because pinpointing exact mistake on neural network is extremely complex, but the root causes generally fall into these three reasons:

  1. Data Quality and Limitations : Large Language Models (LLM) are trained on data from the internet. As the model is trained on the internet's data it is not 100% accurate and even though if it was 100% accurate it cannot cover every niche topic. So, when a model finds gap in its knowledge base it does not responds with "I don't know" but tries to fills it with by predicting next likely words which results in hallucination.

  2. The Generation Method: Different LLMs use different kind of decoding and text-generation methods, such as Beam Search, Sampling, Reinforcement Learning, and Maximum likelihood estimation. These settings balance a model's fluency, creativity, and accuracy. For example, Beam Search generation method prefer high probability, generic words which impact on accuracy for smooth sounding sentences.

  3. Input Context (Prompt): This is the only thing that end user actually controls. If the prompt is vague, complex it can take the LLM off of the course.

How to reduce Hallucination

While we cannot eliminate hallucination entirely but using better prompting technique we can reduce the hallucination drastically:

  1. Provide Clear Context: While writing prompts clearly define contexts, write specific prompts, clear exactly who it should be (assign AI a role), what data it should work with and constraints.

  2. Few-Shot (Multishot) Prompting: Give the LLM a few examples of the exact input and expected output format before asking your actual question. This gives the model a pattern to follow.

  3. Use Retrieval-Augmented Generation (RAG): Connect the AI to a trusted, external database or document so it pulls factual data from a specific source rather than relying solely on its pre-trained weights.

AI Hallucination: AI Bluffs with Confidence • Tejas Shahi