Discriminative vs. Generative Models
You'll learn to
- -State the difference: a discriminative model judges an example, a generative model creates one
- -Run a tiny judge and a tiny generator side by side
- -See that a large language model's answers come from generation, even when they feel like judgments
Almost every model this course has discussed so far, the spam classifiers, the price predictors, the fraud detectors, has one thing in common. They are all discriminative models. Generative AI, the subject of this course's second phase, is a different kind of task, and this chapter is where that difference gets named precisely.
An Analogy: The Art Critic and the Painter
An art critic looks at a painting and says whether it is a landscape, whether it is forged, how much it is worth. A painter, given a blank canvas, makes a new painting that looks like it belongs to a style. The critic judges what exists. The painter creates what does not yet. Discriminative models are critics and generative models are painters.
Discriminative Models: Telling Things Apart
A discriminative model learns to distinguish categories, or to predict a value, given an input. Its whole job is to tell you which side of a boundary a new example falls on, or what value it maps to. Is this email spam? What will this house sell for? Does this image contain a cat? Each of these is a task where, given an input, you produce a judgment about it.
Generative Models: Creating New Examples
A generative model learns something different. It does not learn to judge an existing example, but to produce entirely new examples that could plausibly have come from the same source as its training data. Instead of asking "is this a picture of a cat", it learns what pictures of cats generally look like, well enough to make a brand-new one. Instead of asking "is this sentence grammatical", it learns what plausible language looks like, well enough to write a new sentence.
The demo has both in miniature. The first part is a word-list judge. The second is a generator that has seen only three sentences, and learned which word tends to follow which. Watch for sentences it produces that it never saw. Some read naturally and a few are odd. A real language model is vastly better at which words fit, but the principle is the same: it learned what tends to follow what, so it can say things it was never shown.
A large language model asked a question is doing something generative underneath: producing new text, one piece at a time, that plausibly continues the conversation. The result feels like a judgment, as in answering a question, but the mechanism is generation. The useful behavior on top of it is what makes it feel discriminative in everyday use.
Interview Signal is part of Pro
See a real weak answer next to a real strong one for this exact topic.
Quiz is part of Pro
Test what you just read with a short quiz, and bank the XP.
Discussion0
Join the Discussion
Sign in to leave comments, reply to others, or like insights.
No comments yet. Be the first to start the thread!