A generative model is a program that makes new examples that look like the examples it learned from. Image, voice, video and text generators all work this way. This lesson is a map of the main kinds of generative model. It shows what each kind is good and bad at, and how to judge what a model makes.
New to all this?Generative AI: Start Here is the plain-language starting point, with no maths and no code. It is recommended, not required: you can read this lesson without it, but beginners will find it easier to go there first.
After this lesson, you will be able to:
Tell a model that sorts things (a classifier) from a model that makes things (a generative model)
Explain a latent: the short list of numbers that stands for a picture inside the model
Name the four main kinds of generative model and say what each is good and bad at
Explain why picture generators can work at all: real pictures sit on a thin sheet inside all possible pixel grids
Some models sort things and some models make things. A model that sorts looks at a photo and answers "cat". A model that makes things draws a new cat photo that nobody took. The second kind is a generative modelGenerative ModelsGenerative models learn the underlying distribution of training data so they can create new, similar samples rather than just classify existing ones.Learn more: a program that makes new examples that look like the examples it learned from. Each new example is called a sample.
The idea is the same for every kind of generator. You give a prompt and the model makes a sample. Only the kind of output changes.
Every model you have met so far predicts a label or a number from an input. A cat classifier does not know what a cat looks like in full. It only knows what makes a cat different from a dog. It learns the boundary between classes, not the data itself.
Try it! Open any AI image generator (Midjourney, DALL-E, or even a free one like Playground AI). Type the same prompt three times. Notice how you get three different but plausible images each time. That is sampling from a learned distribution — the model is not retrieving stored images, it is creating new ones from its understanding of what images look like.
A generative model learns what the data looks like as a whole. Once it has, you can:
Generate new samples
Score how likely a given sample is
Interpolate: walk between two samples and watch one turn into the other
Condition: steer the result with a prompt, a label or another signal
This is the difference between a critic who can say "this is a good painting" and an artist who can actually paint.
Words you need8 terms
A program that makes new examples that look like the examples it learned from.
A model that gives an input a label, such as cat or dog. It is also called a discriminative model.
One new example that a model makes.
The short list of numbers that stands for a picture inside the model. All the latents together form the latent space.
The thin sheet, inside all possible pixel grids, where real pictures live.
Walking from one example to another in small steps so that one turns into the other.
A shape where most values sit near the middle.
A number for how far generated images are from real ones. Lower is better.
A 256 by 256 colour picture is 196,608 numbers. Choose those numbers at random and you almost always get noise, random speckle with no picture in it. Real photos are a tiny sliver of all the possible grids. The number of grids is far larger than the number of atoms in the universe. The counting is in the optional maths at the end of this lesson.
What Do You Think?
Why can't we just explicitly model p(x) with a lookup table or histogram for images?
This idea is not only philosophy. It is the reason generative models work at all. Real pictures sit on a thin sheet with only a few hundred real directions, so a model can learn that sheet from a finite set of examples. If pictures used every number independently, no finite dataset would be enough.
A latent is the short list of numbers that stands for a picture inside the model. All the possible latents form the latent spaceLatent SpaceLatent space is the compressed, abstract representation space where each point corresponds to a possible data sample.Learn more. The model learns a map from a latent, which is a point, to a full picture. Pick a point, run it through the generator, and a picture comes out.
The magic of latent spaces is that they are structured. Nearby points give similar pictures.
Try it: walk through a latent spaceInteractive
Loading visualization...
Drawn stand-in, not a trained model: a stylised face drawn from four fixed anchors.
Do: Drag the point between two anchors, then switch from linear to spherical interpolation.
Notice: The face changes smoothly. The arithmetic panel shows man minus woman plus smiling woman gives a smiling man.
Why: Nearby latents give similar pictures, so a walk between them is a smooth path.
You can:
Interpolate: Walk smoothly between two faces by interpolating their latent vectors
Disentangle: Find directions in latent space that correspond to individual attributes (hair color, age, expression)
This structure emerges automatically from training. The model discovers that organizing the latent space this way makes reconstruction or generation easier.
The field has settled on four main kinds of generative model. Each has its own strategy for learning what the data looks like. The deep-learning track covers the architecture side of GANs and VAEsGAN & VAE FoundationsGANs train a generator-discriminator pair adversarially; VAEs learn an encoder-decoder with a KL-regularized latent prior. The two pre-diffusion deep generative families and the architectures the generative-AI track builds on.Learn more, the pre-diffusion deep generative families this lesson builds on.
The family map
Generative modelsfour main kinds
Squeeze and rebuildAutoencoders and VAEs
Forger versus detectiveGANs
Remove noise step by stepDiffusion models
Reversible mapFlow-based models
Strengths and weaknesses
Family
Idea
Strength
Weakness
Autoencoders and VAEs
Squeeze the data into a latent, then rebuild it. A VAE shapes the latent so you can sample from it.
Clean latent space, good for interpolation, fast to sample
Outputs tend to be blurry
GANs
A forger (generator) tries to fool a detective (discriminator), and both improve.
Very sharp, realistic outputs
Unstable training, mode collapse (only a few kinds of output), no latent space by default
Diffusion models
Learn to undo a slow noising process. Start from noise and clean it up step by step.
Best quality, stable training
Slow, because there are many cleaning steps
Flow-based models
Learn a reversible map between simple noise and the data.
Exact score of how likely a sample is, fast with recent advances
Reversibility limits the design. Newer flow matching relaxes this
How do you judge a generative model? You cannot compute accuracy as you do for a classifier, because there is no single right answer. The field uses several scores.
Frechet Inception Distance (FID): A feature network turns each image into a short list of numbers. FID compares the bell curve of real features with the bell curve of generated ones, and measures the gap. Lower is better. FID reacts to both quality (are single images realistic?) and variety (does the model make different outputs?).
CLIP Score: For text-conditioned generation, measures how well generated images match their text prompts using the CLIP model.
Precision & Recall (Kynkäänniemi 2019): Modern complement to FID that decomposes "quality" (precision = fraction of generated samples on the data manifold) from "coverage" (recall = fraction of the data manifold covered). Reports quality and coverage as two numbers, which FID alone cannot do.
DINOv2-FID / FD-DINOv2: A drop-in replacement for FID that swaps Inception-v3 features for DINOv2 features. Several papers report that DINOv2 features agree better with human judgement than Inception features, and some now report it alongside FID. (Note: classic Inception Score is deprecated for rigorous evaluation — use FID + DINOv2-FID + precision/recall instead.)
Tests: The decoder is learned from pixels, so nothing here is hand-placed. Check that the reconstruction error is small, that decoded centres for A + B - C land within 0.25 pixels of the expected centre, and that stepping outside the training range makes the gap grow.
Generative models learn the data distribution itself. Unlike discriminative models that draw boundaries between classes, generative models learn P(data) and can create entirely new samples from the distribution
The manifold hypothesis explains why generation works. High-dimensional data (images, text) actually lives on low-dimensional surfaces; generative models learn to navigate these manifolds
Latent spaces compress data into meaningful representations. By encoding data into compact latent vectors, generative models capture the essential factors of variation (pose, lighting, expression) as navigable dimensions
Each generative family has distinct strengths. VAEs provide structured latent spaces, GANs produce sharp samples, diffusion models offer the best quality-diversity tradeoff, and flows provide exact likelihood computation
What is the fundamental difference between discriminative and generative models?
Where to next. If you are a beginner and have not read it yet, Generative AI: Start Here is the plain-language starting point. Otherwise read Autoencoders to see the squeeze and rebuild idea in practice, then Variational Autoencoders, which adds a little randomness so the squeezer can make new pictures. After that, read GANs for the forger and detective game, and Diffusion Models for the family behind most image tools.
An architecture diagram: boxes are components, arrows show the direction data flows, and moving dots mark the live flow.
Architecture diagram "Generative AI at a glance" with 8 components (Your prompt, Generative model, Text, Image, Audio, Video, 3D, Code) joined by 7 arrows showing how data flows between them.
👤Your prompt
🧠Generative model
💾Text
💾Image
💾Audio
💾Video
💾3D
💾Code
👤 user🧠 llm💾 storage
Nearby latents give similar pictures
An architecture diagram: boxes are components, arrows show the direction data flows, and moving dots mark the live flow.
Architecture diagram "Nearby latents give similar pictures" with 6 components (Point A, Generator, Picture A, Point B, close to A, Generator, Similar picture) joined by 4 arrows showing how data flows between them.
💾Point A
🧠Generator
💾Picture A
💾Point B, close to A
🧠Generator
💾Similar picture
💾 storage🧠 llm
How FID compares real and generated images
An architecture diagram: boxes are components, arrows show the direction data flows, and moving dots mark the live flow.
Architecture diagram "How FID compares real and generated images" with 7 components (Real images, Feature network, Bell curve, real, Generated images, Feature network, Bell curve, generated, FID: the gap) joined by 6 arrows showing how data flows between them.