Hallucination is the term for an AI output that presents information without adequate support. It can be an incorrect fact, a nonexistent reference, a detail added without evidence, or a conclusion that does not follow from the data provided. The term does not necessarily mean the system is trying to deceive anyone.
Generative models produce responses from learned patterns and the context they receive. In many cases, they can complete a plausible response even when they do not have enough information. That is why a fluent sentence with a confident tone can still be wrong.
Como funciona
A language model estimates which tokens are likely to come next, considering the prompt and the available context. This mechanism is useful for writing and summarizing, but it does not work like an automatic query to an up to date fact base. If the context is incomplete, ambiguous, or outside the model's knowledge, the response can still sound coherent without being well supported.
Failure can arise at several points: the question may assume something false, the documents may be outdated, retrieval may bring irrelevant passages, or the model may misinterpret a source. In systems with tools, execution can also fail, return partial data, or be summarized incorrectly.
Adding search or reference documents can reduce some errors, but it does not eliminate the problem. The system can still select an inadequate passage, confuse sources, or claim more than they allow. Checking should consider the final response and the evidence used.
Exemplo prático
A person asks an assistant to summarize a library's documentation and asks for the name of a function. The provided excerpt does not mention that function. Instead of saying it could not find the information, the model suggests a name that fits common programming conventions. The suggestion looks plausible, but it does not exist in the consulted documentation.
A better practice is to ask the system to point to the passage that supports each important claim and to check the name in the code or original documentation. For higher impact tasks, review should be done by a responsible person, not just by another model without verification.
Para que serve
Recognizing hallucinations helps plan more reliable systems. Teams can define what the assistant should answer, provide consultable sources, allow it to admit uncertainty, and route ambiguous cases to human review.
It is also useful to evaluate the system with examples close to real use. A measurement should observe whether responses are supported by sources, whether the system refuses when information is missing, and whether it maintains accuracy on questions with false premises. A correct answer by chance is not enough to demonstrate reliability.
When using AI, treat factual claims as content to verify, especially when they involve executable code, personal data, health, money, or legal obligations. Hallucination is an operational limitation to manage, not proof of intention or consciousness in the model.