Most traditional machine learning is discriminative: it takes an input and produces a label or number.
Is this email spam? (Yes/no.) Is this photo a cat? (Cat/dog/bird/...) What will this house sell for? ($475,000.)
Generative AI does something fundamentally different: it produces new content.
Given a prompt, it generates text.
Given a description, it generates an image.
Given a melody, it generates a song.
Think of the difference like this:
- A discriminative model is like a critic: shown a painting, it judges what style it's in.
- A generative model is like an artist: given a description, it paints a new painting.
How Is This Even Possible?
The trick to generative AI is reframing the problem as one of prediction.
To generate something, the model predicts what should come next, one tiny piece at a time.
For text, "one tiny piece" means roughly one word at a time (or, more precisely, one token, which we'll define in the next section).
The model is trained on enormous amounts of text and asked, over and over: "Given everything so far, what's the most likely next word?"
That's it.
That's the trick.
The astonishing thing is that this simple task — predicting the next word — turns out to require the model to learn something close to actual understanding.
To predict the next word in:
"The detective examined the broken window, the muddy footprints leading away, and concluded that the intruder had..."
the model needs to grasp narrative, causation, and what kinds of conclusions detectives draw.
Doing this well across billions of examples produces a system that behaves a lot like it understands language.