What Is Generative AI: LLMs, Image Models, and Why They Hallucinate
LLMs generate text token by token via statistical prediction — no plan, no "knowing." Learn how it works, where it performs, and why it hallucinates.
You ask an AI to "write a professional email" and it delivers something solid in two seconds. Then you ask it to confirm a historical date and it states, with the exact same confidence, something entirely wrong. That's not a bug — it's the expected behavior of a system that generates content from patterns. Understanding why explains almost everything about using these tools without getting burned by them.
This post is the overview: what generative AI is, how it works in plain terms, examples by content type, and where it fails. The detailed mechanics of an LLM — tokens, temperature, attention — live in the sibling post on how LLMs generate answers.
What generative AI is
Generative AI is the branch of artificial intelligence that creates new content — text, images, audio, video, code — from patterns learned from large amounts of data. The name sets it apart from "traditional" AI, which classifies or predicts from a given input.
| Traditional AI (classifies / predicts) | Generative AI (creates) | |
|---|---|---|
| Typical question | "Is this email spam?" | "Write a reply to this email" |
| Output | A label, a number, a probability | New content: a paragraph, an image, audio |
| Examples | Spam filter, credit score, movie recommendations | Chatbots, image generators, coding assistants |
| How it fails | Wrong label | Invents something plausible and false |
Both are machine learning; the difference is what comes out of the model. The term reached the general public with ChatGPT in late 2022, but the technical foundation came earlier: the 2017 paper "Attention Is All You Need" introduced the Transformer architecture, which sits behind practically every relevant language model today.
How it works, in two paragraphs
A language model (LLM) is, at heart, a predictor of the next piece of text. It doesn't work with words but with tokens — fragments that can be a word, part of a word, or a punctuation mark. GPT-4, for example, uses a vocabulary of roughly 100,000 tokens. Given your prompt, the model computes the probability of every possible next token, picks one, appends it, and repeats. There's no internal script for the answer: it's iterative prediction, one token at a time, with the attention mechanism deciding which parts of the context weigh most at each step.
Training has two main phases. In pre-training, the model reads enormous amounts of text (web, books, code) and learns to predict the next token. Then comes tuning with human feedback (RLHF and similar techniques), which teaches the model to follow instructions and respond like an assistant. That second phase is what turns a text completer into an "assistant" — and also what gives it a confident tone even when it's wrong.
How AI generates images
Image generators follow a different logic. Diffusion models learn to remove noise from images; to generate, they start from pure noise and clean it up step by step, guided by the prompt text. That text is first turned into vectors by language encoders.
The details have changed a lot since the first Stable Diffusion. Stable Diffusion 3, for example, uses three text encoders (two CLIP and one T5) and replaces classic diffusion with rectified flow, a formulation that connects noise and image in a straight line (March 2024 paper; Diffusers documentation). "More steps, more quality" is no longer a rule either: there are distilled ("turbo") versions built to generate in a few steps.
And there's a third path: image generation inside the multimodal model itself. In March 2025 OpenAI launched GPT-4o image generation, described as "embedded natively, deep in the architecture" of the model rather than as a separate tool (system card). Google takes a similar line with the image models in the Gemini family (the "Nano Banana" models).
Examples of generative AI by type
Names change every few months, so treat this list as a snapshot from November 2026, taken from the vendors' own model pages (OpenAI, Anthropic, Google). It's not a ranking.
- Text and chat: ChatGPT (the GPT-6 family in OpenAI's API), Claude (Opus, Sonnet and Haiku 5.5, plus Fable 5.1) and Gemini (Gemini 4 and the 3.x line).
- Images: OpenAI's GPT-Image models, Google's Nano Banana, and open models like Stable Diffusion 3.5, plus services like Midjourney.
- Video: short clips from text or images — Google, for instance, lists Gemini Omni Flash, which generates up to 15 seconds with audio.
- Audio and voice: speech synthesis, transcription and real-time conversation (OpenAI's GPT-Realtime models, Google's Gemini Live and TTS models) and music (Google's Lyria).
- Code: the same text LLMs, plugged into the editor or into agents that read the repository, run tests and propose changes.
In practice the line between types is fading: the main models accept text and images as input, and several generate more than one type of output.
Where it works well
After a few years of using these tools in day-to-day development, the cases where the results are consistent:
- Boilerplate and transformations with a clear pattern: endpoint scaffolding, type conversions between languages, schema mapping.
- Summarizing and extracting from text that's in the context — the model doesn't rely on its "memory", only on what you handed it.
- First drafts: emails, documentation, copy variations. Rarely publishable as-is, but it kills the blank page.
- A second pair of eyes on code: explaining a snippet, flagging something suspicious.
- Answering questions about your documents with RAG, which retrieves the relevant passages and puts them in the context before answering — explained in what is RAG.
The quality of the request matters a lot. If the output comes back generic, the problem is usually the prompt — see how to write clear prompts and prompt engineering without formulas.
Limits: where generative AI fails
Hallucination
The best-known problem: the model generates statistically plausible text, and "plausible" and "correct" sometimes diverge sharply. The root is the same as generation itself: the model has no "I know" or "I don't know" state, only probabilities. When the right answer is unlikely given the patterns it learned, it produces the most likely continuation — which can be fluent and false. You'll see per-model hallucination rates circulating; they vary a lot with the task and the benchmark, so distrust any number that doesn't come with its source and task attached.
Knowledge cutoff
Models are trained on data up to a date and then frozen. Anything after that only gets in if you put it in the context or the app gives the model a search tool.
Memory belongs to the app, not the model
The model itself keeps nothing between one call and the next; it only "remembers" what's in the context window. The memory you see in ChatGPT (launched in 2024) or in Claude is an application feature: it saves information from conversations and injects it into the context of later ones. It works, but it's reused context, not learning.
Exact reasoning
Arithmetic with large numbers and rigorous logic remain weak spots when the model "calculates in text". The practical fix is letting the model run code: current assistants have a Python or data-analysis tool for exactly this.
Prompt injection
When the model acts — reads pages, emails, files and calls tools — malicious text inside that content can pull it away from its original instructions. Mitigation is still incomplete; it's the main risk of AI agents.
What changed since 2023
- Reasoning models. Starting with OpenAI o1 (2024) and o3 (2025), models began to "think" before answering, spending more tokens to make fewer mistakes on multi-step problems. Today it's a standard feature: at Anthropic, for example, current models decide on their own how much to reason ("adaptive thinking").
- Long context. Claude's current lineup accepts 1 million tokens of context — roughly 555,000 words on the current tokenizer, according to Anthropic.
- Agents. The model moved past chatting and now runs workflows: it picks tools, executes, checks, and repeats.
- AI in search. Generated answers at the top of Google changed site traffic, and publishers now have to decide how to deal with AI Overviews.
Frequently asked questions
Are generative AI and machine learning the same thing?
No. Machine learning is the broader field: any system that learns patterns from data. Generative AI is the part of ML focused on creating new content. Every LLM is machine learning, but not all machine learning is generative — a spam filter isn't.
What's the difference between generative AI and traditional AI?
Traditional AI classifies or predicts (spam or not, credit risk, the next recommended movie). Generative AI produces new content (text, images, audio). That's why the failures differ too: traditional AI gets the label wrong; generative AI can invent something convincing.
Why does AI hallucinate?
Because it generates the most likely continuation, not the true one. When information is missing from training or from the context, the model doesn't stop to say "I don't know" by default — it fills in with whatever looks right. Putting the source in the context (RAG) and asking for citations reduces the problem but doesn't eliminate it.
Can generative AI be used for critical decisions?
With sources in the context, validation rules and human review, yes for many cases. Without those safeguards, in medical, legal or financial decisions, no: errors arrive with the same confidence as correct answers.
The model doesn't know what it doesn't know
Generative AI is great at producing, summarizing and transforming content — and bad at guaranteeing it's true. The confident tone is a product of training, not a sign of correctness. Use it for synthesis, drafts and format transformation; check facts against primary sources; and don't ask the same model that generated the information to verify its own answer. Treat everything headed to production as a draft.
One detail that makes tokens tangible: ask for "a 300-word text" and count the result. Because the model works in tokens, not words, the count rarely matches. I check AI-generated drafts in the word counter before pasting them anywhere with a length limit.
- 01 Does the PageSpeed Score Affect SEO? 100/100 and Failing Google doesn't rank on PageSpeed's 0 to 100 score but on Core Web Vitals from real users. Here's why a site scores 100/100 and still fails in the field.
- 02 Unit test vs integration test: the difference in practice The difference between unit and integration tests with API and database examples: what each one catches, what it costs, and when to use each in your project.