Types of generative models: LLMs, diffusion, GANs and VAEs

Generative AI isn't one technique. Four families of models do most of the creating: LLMs write text, diffusion models create images and video by removing noise, GANs learn through a contest between two networks, and VAEs learn a compressed map of their data and sample new examples from it. Multimodal models combine several kinds of input and output.

Everyday analogy

Four kinds of artist. A storyteller (LLM), a sculptor who chips away noise (diffusion), a forger trying to fool an art expert (GAN), and a sketch artist who learns the essence of faces and draws new ones (VAE).

Example

ChatGPT, Claude and Gemini are built on LLMs; Stable Diffusion and Midjourney are diffusion models; StyleGAN made the famous "this person does not exist" faces; and a VAE sits inside Stable Diffusion to compress images.

Random noiseGeneratorthe forgerFake imageReal imageDiscriminatorthe expertfeedback: “I caught you” → the forger improvesReal or fake?
A GAN is a contest: the generator makes fakes, the discriminator tries to catch them, and both improve.
Inputa face photoEncoderLatent spacesmall map of featuressample a pointDecoderNew outputa new face
A VAE squeezes data into a small map of features, then decodes new points on that map into new examples.
FamilyMainly createsHow it learnsKnown for
LLMText and codePredicts the next tokenChatbots, writing, coding
DiffusionImages, video, audioLearns to remove noise step by stepStable Diffusion, Midjourney, video tools
GANImages and videoA generator and a discriminator competeRealistic faces, style transfer, fast filters
VAEImages, molecules, structured dataEncodes data into a latent space, then decodesCompression, anomaly detection, drug discovery
MultimodalSeveral types at onceShares one representation across text, images and soundAssistants that see, hear and speak

GANs: the forger and the expert

The generator turns random noise into fake examples. The discriminator sees real and fake examples and guesses which is which. Both are trained together: every time the forger is caught, it learns to make better fakes. GANs generate very fast, but they can be unstable to train.

VAEs: learning a map of the data

The encoder squeezes each input into a small latent space (a mean and a spread rather than a single point). You can pick any point on that map and the decoder turns it into a new example, or move smoothly between two examples.

Today: most image and video tools use diffusion, text tools use LLMs, and GANs remain useful where speed matters, such as real-time camera filters.

Going deeper: autoencoders and the hidden map

An autoencoder learns without any labels. An encoder squeezes each input into a much smaller code, and a decoder tries to rebuild the original from that code alone. Training simply rewards a good rebuild (a small reconstruction loss). Because the middle is so narrow, the network is forced to keep only what really matters.

Analogy: you summarise a 10-page report into 5 bullet points, and a colleague rebuilds the report from those bullets. If their version is close to the original, your bullets captured the essentials. The bullets are the latent space.

The numbers in that small code are latent variables: hidden factors you never see directly but that explain the data. For photos of faces they might end up meaning smile, head angle or lighting.

Plain autoencoderVariational autoencoder (VAE)
Each input becomesOne fixed point on the mapA small cloud: a mean and a spread
The map isPatchy; random points may decode to rubbishSmooth and organised by a regularisation term, so nearby points decode to similar things
Can create new examples?Not reliablyYes: pick any point and decode it

With a well-organised VAE you can turn one dial at a time, for example slowly increasing "smile" while head angle stays the same. Versions such as β-VAE push each dial to control one separate feature, which is called disentanglement.

More from GANs: changing one style into another

A trained GAN generator turns random noise into realistic new data. A variant called CycleGAN learns to translate between two collections without matching pairs: horse photos into zebra photos, summer scenes into winter, or one person's voice into another's. That same power is behind many deepfakes, so see Staying safe with AI.

Useful beyond creating new content

UseHow it helpsExample
Spotting outliersThe model learns what "normal" looks like, so rare cases stand outAn unusual claim pattern; rare road conditions a self-driving car rarely saw in training
Reducing biasThe hidden map shows which kinds of examples are rare in the training data, so they can be given more weightA face dataset with very few older faces or darker skin tones
Extra training dataGenerate realistic synthetic examples where real ones are scarce or privateSynthetic patient records for testing software

Try it yourself

About 10 min

Spot the model family

  1. List 6 AI tools you know (chatbots, image makers, face filters, voice tools).
  2. Write which family each mainly uses: LLM, diffusion, GAN, VAE or multimodal.
  3. Check two of them online.

What you should see: Most chat tools are LLMs, most image tools are diffusion, and assistants that see and speak are multimodal.

Use any free AI chatbot (ChatGPT, Claude, Gemini or Copilot). Never paste private or confidential information.

Build it for real · guided projectYour first machine learning model: predict house pricesAbout 75 min · Copy-paste code · step by step
Test what you learned

Take a quick quiz, or look up any word in the glossary.