---
type: Concept
title: "Hallucinations in Large Language Models (LLMs)"
description: "A hallucination occurs when an LLM (such as ChatGPT, Gemini, or Claude) generates false information with confident certainty: a broken link, a fabricated book, or an inaccurate…"
resource: https://felipecferreira.com.br/en/library/llm-hallucinations/
generated: { by: process:okf-bridge, at: 2026-11-23T13:38:50Z }
published_at: 2026-11-23T13:36:47Z
modified_at: 2026-11-23T13:36:47Z
author:
  name: "Felipe Carvalho Ferreira"
  url: https://felipecferreira.com.br/sobre/
  "@id": https://felipecferreira.com.br/#/schema/person/44400987115f09994755b76e5fdf9d3a
  sameAs:
    - https://www.youtube.com/@felipecferreiraa
    - https://x.com/FelipeCF_X
    - https://www.instagram.com/felipecferreira.com.br/
    - https://www.linkedin.com/in/felipe-c-ferreira-a76646152/
    - https://www.tiktok.com/@felipecferreiraa
    - https://github.com/felipeferreiragestor
content_sha256: 3a968633e82549ac0ecc5732eb473c7c57a7e8984c93e72bbeb29cee5217592f
status: stable
sources:
  - id: canonical-html
    resource: https://felipecferreira.com.br/en/library/llm-hallucinations/
    title: "Official HTML page"
    last_modified: 2026-11-23T13:36:47Z
---

# Hallucinations in Large Language Models (LLMs)

## TL;DR

A hallucination occurs when an LLM (such as ChatGPT, Gemini, or Claude) generates false information with confident certainty: a broken link, a fabricated book, or an inaccurate fact. Here we explain where the term comes from, why it happens, and both the negative and positive sides of the phenomenon.

What are Hallucinations in Language Models ([LLMs](https://felipecferreira.com.br/en/library/what-are-llms-large-language-models/)) such as ChatGPT, Gemini, and Claude?

Hallucinations in LLMs refer to situations where these models generate false, inaccurate, or irrelevant information, even when operating on rigorous learning patterns.

Do you remember using one of these Artificial Intelligence chats and getting an answer that made no sense? Or having the model give you a link (URL) or mention a book that simply did not exist?

Well, it hallucinated!

I have been through plenty of experiences like these myself, having started using these models back in December 2022.

So, let us better understand "how" and "why" these hallucinations happen.

Not sure what Artificial Intelligence is? [Click Here](https://felipecferreira.com.br/en/library/what-is-artificial-intelligence/).

## Where Does the Term "Hallucination" Come From for LLMs? {#h-de-onde-vem-o-termo-alucinacao-para-os-llms}

The term was "borrowed" from what occurs in the human brain (and in some animals), where neurological issues can induce perceptions that differ from reality, whether due to pathology, substance use, or medication side effects.

These hallucinations can appear in various forms, ranging from minor inaccurate details to completely "fabricated" information.

## Why Do Hallucinations Occur in AI Models? {#h-por-que-as-alucinacoes-ocorrem-nos-modelos-de-ia}

Hallucinations occur due to several factors intrinsic to language models.

First, LLMs such as GPT-4 and similar systems are trained ([machine learning](https://felipecferreira.com.br/en/library/machine-learning/)) on massive volumes of textual data scraped from the internet, which can include inaccurate, untruthful, or biased information.

Another factor is the lack of genuine comprehension on the part of the models.

Although they can generate coherent and convincing text, LLMs do not understand context the way humans do, leading to misinterpretations and, in turn, hallucinations.

Let us look at some technical aspects of Hallucinations in LLMs.

### **Overfitting** {#h-overfitting-sobreajuste}

During training, the model may fit too closely to the training data, memorizing specific patterns instead of broad generalizations.

This can lead to responses that sound plausible but are factually incorrect when confronted with information outside the training set.

### **Imbalanced Probability Distribution** {#h-distribuicao-de-probabilidade-desequilibrada}

Language models generate text by predicting the next word based on probability.

If the probability distribution is imbalanced, the model may favor common words or phrases even when they are not the most accurate choice for the context.

### **Lack of Deep Semantic Understanding** {#h-falta-de-compreensao-semantica-profunda}

Despite their ability to produce coherent text, language models lack a deep understanding of the meaning of words and the real world.

They rely on statistical patterns in the training data, which can lead to errors whenever those patterns fail to reflect reality.

### **Bias in Training Data** {#h-vies-nos-dados-de-treinamento}

The data used to train models can contain inaccurate, incomplete, or biased information.

The model learns from that data, perpetuating those biases and generating hallucinations that mirror those inaccuracies.

### **Limitations in Model Architecture** {#h-limitacoes-na-arquitetura-do-modelo}

The architecture of language models, such as the Transformer, carries inherent limitations.

For example, autoregressive attention can lead to error propagation, where a mistake in one part of the response influences subsequent parts.

### **Lack of Built-in Fact-Checking Mechanisms** {#h-falta-de-mecanismos-de-verificacao-de-fatos}

Most language models do not have built-in mechanisms to verify the truthfulness of generated information (such as live internet access).

They can produce convincing yet false answers without any internal way to evaluate their factual accuracy.

### **Excessive Reliance on Statistical Patterns** {#h-dependencia-excessiva-em-padroes-estatisticos}

Language models rely heavily on statistical patterns in data to generate text.

When those patterns are insufficient to determine the right answer, the model may resort to "guessing," which leads to hallucinations.

In short, it is impossible (at least currently) for a language model (LLM) to be completely free of hallucinations. A 2025 paper explains why through computation theory; I review it in [taxonomy of hallucinations in LLMs (in Portuguese)](https://felipecferreira.com.br/biblioteca/taxonomia-de-alucinacoes-em-llms-definicao-tipos-e-mitigacao/).

They occur due to the probabilistic nature of the models, the limitations (and biases) of the data available for training, the model's lack of comprehension of reality (at least as perceived by us humans), among other factors.

## Can Hallucinations Be Positive? {#h-as-alucinacoes-podem-ser-positivas}

We can use LLM hallucinations in our favor when we want, for instance, the model to be more creative.

Whether for brainstorming (looking for solutions to problems or projects) or when we want the model to develop a story (short story, script, plot).

We can also use hallucination positively when developing images and videos with AI, as well as working in entertainment on the behavior of digital characters in games.

In addition, many language models include a "temperature" parameter.

You can control temperature in ChatGPT by using the [API](https://felipecferreira.com.br/en/library/what-is-an-api/) (OpenAI Playground) instead of the standard web interface.

The temperature of a language model is a randomness parameter.

*LLM Temperature Adjustment via OpenAI Playground. Source: Author screenshot in July 2024.*

We wrote a complete article about temperature; you can access it by [clicking here](https://felipecferreira.com.br/en/library/temperature-in-llms/).

A "higher" temperature can introduce more hallucinations.

## Strategies to Mitigate Hallucinations in AI Models {#h-estrategias-para-mitigar-alucinacoes-em-modelos-de-ia}

To minimize the effects of hallucinations in LLMs, several strategies can be adopted:

### Continuous Data Refinement {#h-refinamento-continuo-dos-dados}

Improving the quality of training data can significantly reduce hallucinations.

In this regard, having the model go through a fine-tuning process is essential.

### Human Feedback and Adjustments {#h-feedback-e-ajustes-humanos}

Incorporating a feedback system where humans (reinforcement learning from human feedback, [RLHF](https://felipecferreira.com.br/en/library/what-is-rlhf/)) can correct model responses helps better align LLMs over time.

### Verification Models {#h-modelos-de-verificacao}

Using complementary models (AIs) to verify the accuracy of generated information can help detect and correct hallucinations in real time.

### Improving Training Algorithms {#h-aprimoramento-dos-algoritmos-de-treinamento}

Ongoing research to improve the algorithms underlying LLMs is also crucial.

More sophisticated supervised learning methods can help reduce hallucinations.

## Important Note: An Error That Is Not a Hallucination {#h-nota-importante-um-erro-que-nao-e-alucinacao}

Have you ever used a model with internet access technology, but when you asked for an online search, it refused to perform it?

Or a model that generated a very short response even though it had a wide "range" of output [tokens](https://felipecferreira.com.br/en/library/what-are-tokens-in-llms/) available to work with?

Or asked a model to generate an image (Diffusion Models and Generative Adversarial Networks, GANs, combined with Transformers; that is, a model with generative capability) and it replied that it was unable to do that?

Well, we CANNOT call those cases hallucinations.

Errors of this kind are generally associated with a combination of design restrictions (safety guardrails, for example), specific configurations or adjustments undergoing maintenance, system bugs (involving complementary technologies like APIs), issues with the user request ([prompt](https://felipecferreira.com.br/en/library/prompt-engineering/)), and so on.

Let us remember that hallucination, in technical terms, refers specifically to generating factually inaccurate or nonexistent information, which is different from a task refusal.

## Conclusions {#h-conclusoes}

Hallucinations in Large Language Models represent a significant yet manageable challenge in artificial intelligence.

Understanding why they happen and how to mitigate them is crucial for building more effective and reliable AI systems.

Continuing research and implementing hallucination reduction strategies is essential for improving the precision and trustworthiness of these models.

Well, if you have been using these models as long as I have, you have probably noticed a drastic improvement in reducing the volume and frequency of these hallucinations.

Even so, we must always stay alert and verify specific facts or information we consider important. In [Deep Research](https://felipecferreira.com.br/en/library/deep-research/), for instance, I click on every link in the report before using any data point.

Anyone who skips that verification runs another risk: becoming an [instant AI expert (in Portuguese)](https://felipecferreira.com.br/biblioteca/ascensao-dos-especialistas-instantaneos-em-ia-o-efeito-dunning-kruger/), confident on the surface, yet shallow.

Stay up to date with the latest AI news and developments by subscribing to receive our regular updates!

## References {#h-referencias}

[IBM](https://www.ibm.com/topics/ai-hallucinations), [Cornell University](https://arxiv.org/abs/2401.11817) and [MachineLearningMastery](https://machinelearningmastery.com/a-gentle-introduction-to-hallucinations-in-large-language-models/).

## Related concepts

* [What Are LLMs (Large Language Models)?](https://felipecferreira.com.br/okf/en/concepts/what-are-llms-large-language-models.md)
* [What Is Artificial Intelligence?](https://felipecferreira.com.br/okf/en/concepts/what-is-artificial-intelligence.md)
* [Machine Learning](https://felipecferreira.com.br/okf/en/concepts/machine-learning.md)
* [What Is an API and How It Connects Your Systems](https://felipecferreira.com.br/okf/en/concepts/what-is-an-api.md)
* [Temperature in Language Models (LLMs)](https://felipecferreira.com.br/okf/en/concepts/temperature-in-llms.md)
* [Reinforcement Learning from Human Feedback (RLHF)](https://felipecferreira.com.br/okf/en/concepts/what-is-rlhf.md)
* [Tokens in Language Models (LLMs) and AI](https://felipecferreira.com.br/okf/en/concepts/what-are-tokens-in-llms.md)
* [Prompt Engineering: How to Get the Best Results](https://felipecferreira.com.br/okf/en/concepts/prompt-engineering.md)
* [Deep Research: What It Is and Why It Matters](https://felipecferreira.com.br/okf/en/concepts/deep-research.md)
