You type "a red bicycle leaning against a lighthouse in the rain" and a few seconds later there is a picture. No one photographed that scene, and the model didn't search a library of images and stitch one together. It built the picture from patterns and numbers.

That word — generative — sounds like marketing. It isn't. It names one specific piece of engineering, and once you see it, text chatbots, image tools, voice cloning and video generators turn out to be variations on the same trick.

Generative AI is AI whose output is new data of the same kind it was trained on — sentences, pictures, audio, code — rather than a label, a score or a decision.

Generative AI vs other AI: sorting versus making

Most AI you encounter does not generate anything. Go back to the spam filter from the last article: it reads an email and outputs one thing, spam or not spam. It learned a boundary between two categories. Ask it to write an email and it has nothing to say — producing text was never its job.

Train a model on the same pile of emails and ask a different question: what does an email look like? Which words follow which, how a subject line tends to be shaped, how a sign-off usually reads. Give that model a first line and it will continue it, producing an email that resembles the ones it saw without being any of them.

A classifier learns where the boundary between categories is; a generative model learns the shape of the data itself. Both are machine learning, both are usually built from deep networks — last time's question of who chooses the features doesn't change — but the output differs in kind. That's also why "AI" and "generative AI" aren't synonyms: spam filtering, fraud scoring, recommendations and search ranking are all AI, and none of them produce content.

The core idea: learn what's plausible, then take many small random steps

Why not just store every possible output and look the right one up?

Because the possibilities are unimaginable in number. A reply of just 20 tokens drawn from a vocabulary of 50,000 allows 50,0002050{,}000^{20} possible strings — a number with about 94 digits. No dataset holds them. Memorization is off the table, so something else has to happen.

What the model learns instead is a probability distribution: for each possible next piece, a likelihood. Picture a list of candidates, each with a number saying how likely it is given everything already present. The network doesn't store answers; it stores this scoring ability, compressed into its weights.

Generation then means sampling: drawing one candidate at random, in proportion to those likelihoods. Not always the tallest bar — actually rolling the weighted wheel. One detail explains a lot of behavior you've noticed: the likelihoods are why the output is usually sensible, and the randomness is why the same prompt gives a different answer on Tuesday.

So the shared recipe has two ingredients:

  1. Learn from data how plausible each possible next piece is, given what's already there.
  2. Build the output from many small, partly random steps, each conditioned on what exists so far.

Text models and image models both follow it. They differ in what counts as "a piece."

Rendering

How generative AI writes text, one token at a time

An LLM — a large language model — is the text version of this recipe. "Large" means billions of adjustable weights; "language model" means it scores possible next pieces of text. The pieces are tokens: chunks roughly the size of a word, sometimes a word fragment. Because any text can be cut into tokens, "what comes next" is a question you can ask at every point in a sentence.

The loop, which is what people mean by autoregressive:

  1. Feed in the prompt plus everything generated so far.
  2. The model produces a likelihood for every candidate token — tens of thousands of them.
  3. Sample one.
  4. Append it and go back to step 1.

Stop when the model emits an end-of-sequence token or hits a length limit. A dial called temperature reshapes the wheel before each draw: turn it down and the model almost always takes the most likely token, producing safe, repetitive text; turn it up and unlikely tokens get a real chance, producing variety along with mistakes 4.

Notice what the model never does: it never plans the paragraph. At each step it makes one small decision — given these words, which piece fits? — and the paragraph accumulates from those decisions. That's exactly why the output reads so fluently, since each decision is easy and locally plausible. It's also why it can be fluently wrong: plausible next is not the same as true. That gets its own treatment later in this series.

How generative AI makes images: start with noise, clean it up

You'd expect the image case to reuse the token loop, and early attempts tried something like it. It works badly. A 512×512 color image is 786,432 numbers, and pixel values have no natural order to append them in. Guess them one at a time and you get static, not a bicycle.

Diffusion models — the approach behind Stable Diffusion, DALL·E 2 and most image and video generators — change what the model is asked to do. Don't learn to draw. Learn to clean 12.

Training runs backwards from the finished picture. Take a real photo, add a small amount of random noise, and ask the network to remove it. Do that at every noise level, from nearly-clean to almost-destroyed. The network's job is never "make an image" — it's "given this partly corrupted thing, say what the corruption is and take a bit of it away." That's a much smaller, learnable question.

Generation runs the process the other way. Start with pure random noise — literally static, no hidden picture inside it — and apply the learned cleaning step once. Now you have slightly less random static. Apply it again, and again, a few dozen times. Around step ten the layout firms up, later steps sharpen edges and texture, and near the end the scene is unmistakable. Asking a diffusion tool for more sampling steps means asking for a finer-grained set of cleanups; fewer steps run faster and lose fine detail 2.

From left to right, a diffusion model's output after progressively more denoising steps: dense random noise first, then recognizable buildings, then a clear image.

Your words enter through a separate text encoder that turns the prompt into numbers, and the cleaning network consults those numbers at every step — which is why swapping one word shifts the whole picture rather than one corner of it 3. One production detail worth knowing: systems like Stable Diffusion don't clean full-resolution pixels. They compress each image into a much smaller grid of numbers (roughly 48× fewer values), run the denoising loop in that compressed space, and decode back to pixels once at the end. That's what makes a few dozen steps affordable 3.

Why one core idea produces both

Text (LLM)Image (diffusion)
What must be produceda sequence of tokensa grid of pixel values
Why not in one shotastronomically many possible strings~800k numbers, no natural order
The "small piece"one tokenone small cleaning step
Where the loop startsyour promptpure random noise
How often it repeatsonce per tokena few dozen times
What your prompt doesbecomes the beginning of the sequencesteers every step

Same two ingredients in both columns: a network that scores local plausibility, and a loop of many small decisions with randomness mixed in. The only difference is what one decision is allowed to be. Change the unit from "a token" to "a bit of noise removed" and the same machinery produces a picture instead of a paragraph.

What "AI-generated content" does and doesn't tell you

If you remember the recipe, several everyday puzzles stop being mysterious.

It's new, but not arbitrary. The output generally isn't copied from one source — it's freshly sampled. Yet every likelihood in the wheel came from the training data, so subject matter, style and biases in that data show up in outputs.

It can't cite. Nothing in the loop records which training examples pushed which token higher, so "where did you get that?" has no honest answer available. That's a structural fact about the method, not a lack of effort.

Same prompt, different output. Randomness sits inside the loop, not on top of it. Reproducibility has to be engineered deliberately.

Fluent is not true. Each step is judged for plausibility alone, so a sentence that continues smoothly can be entirely fabricated.

One place where the picture simplifies: the weighted-wheel image suggests a visible list with numbers next to it, when in reality a network computes those likelihoods from the whole preceding context. And "noise" is not a hidden image buried in static that the model uncovers — it's random numbers, and the model applies learned statistics to them. What survives both simplifications is the actual mechanism: score the possibilities, take a small random step, repeat until done.