Skip to main content

AI coding glossary

Hallucination

Also known as: ai hallucination, llm hallucination, confabulation

In one sentence

When an LLM generates plausible-sounding but factually incorrect content, fabricated function signatures, invented APIs, wrong citations, or confident-but-fictional claims.

Full definition

Hallucination is the model's tendency to generate content that sounds plausible but is factually wrong, most commonly in coding contexts as invented function names, fabricated library APIs, made-up commit hashes, or confidently-stated wrong syntax. 2026 frontier models (Opus 4.7, GPT-5.5, Gemini 3.1 Pro) hallucinate dramatically less than 2023-era models but still produce occasional fabrications, especially on niche libraries or recent releases. The practical antidote in AI coding: ground the model in real context via RAG / MCP / @workspace indexing, run code in a sandbox before trusting it, and use linters / type checkers as a hallucination detector for syntax-level errors.

On skills-hub.ai

Related terms