Discriminative vs Generative Models
A discriminative model learns only the boundary between classes; a generative model learns how each class actually produces its data, which is more work but lets it do things a boundary alone cannot, like generate new examples or flag data that resembles no class at all.
Prerequisites: Bayes' Theorem, Naive Bayes Classifiers
Imagine training two currency experts to spot counterfeit banknotes. The first is shown thousands of real and fake notes side by side and learns, directly, a rule for telling them apart — texture here, color there — without ever thinking about why a real note looks the way it does. The second studies the actual printing process of genuine currency — ink chemistry, paper fiber, press mechanics — building a model of how a real note comes to exist at all. Both can spot a fake. But only the second, having modelled what a genuine note actually is, could also sketch a new genuine note, or recognize something that's neither a convincing fake nor a real note — a photocopy, say — as belonging to neither category. That's the discriminative/generative divide.
What each one actually learns
A discriminative model learns directly — the probability of the label given the input — or, more directly still, just a decision boundary separating classes, without ever modelling how itself arises. Logistic regression, support vector machines, and most neural network classifiers are discriminative: they are trained purely to draw the line, and everything about where the data came from is irrelevant to that goal.
A generative model learns — how the input data itself is distributed within each class — together with , the overall frequency of each class, and combines them via Bayes' theorem to get the same a discriminative model targets directly:
In words: the probability of a class given the data equals how likely that class was to produce data looking like this (), times how common that class is overall (), divided by how likely this data is under any class at all (, which normalizes everything to sum to one). Naive Bayes, Gaussian mixture models, and hidden Markov models are generative: they explicitly model for every class, and the classification boundary emerges as a side effect of comparing those class-conditional models, rather than being the direct training target.
A discriminative classifier is trained to draw exactly the boundary shown here, and nothing more — it has no opinion about what the point cloud on either side "looks like" beyond where the boundary should sit. A generative approach to the same data would instead fit a full distribution to each colored cluster separately, and the boundary in this same picture would fall out automatically wherever those two fitted distributions cross — same picture, opposite direction of construction.
Worked example 1: same classification, two different amounts of information used
Two classes of daily return regime, "calm" and "stressed," each with one feature, realized volatility . Suppose "calm" days have and "stressed" days have , with calm days occurring 80% of the time.
A generative approach fits these two normal distributions from labelled data, then classifies a new day with by computing and , weighting each by class frequency, and picking the larger. This also directly tells you how unusual is under each hypothesis — both densities are fairly low there, meaning sits in a gap between the two regimes, information a discriminative model discards.
A discriminative approach — logistic regression on the same data — fits a single boundary directly, say "predict stressed if ," and for just outputs "stressed" with some probability, with no representation of what a "typical" day's volatility looks like, only where the dividing line sits.
Worked example 2: what the generative model can do that the discriminative one can't
Suppose a genuinely new kind of day occurs — extremely low volatility, , far below anything seen in either training class (a market holiday, say). The discriminative boundary at classifies it confidently as "calm," since — it has no way to express doubt, because it never modelled what calm days actually look like, only which side of the line this point falls on.
The generative model computes using the fitted density and gets a value near zero — more than three standard deviations below the calm mean, essentially unseen territory for that class too. It can flag this point as unlikely under either class, not just assign it to the nearer side of a line. Because it models the data-generating process for each class, it recognizes when new data doesn't resemble any class well, something a purely discriminative boundary structurally cannot do.
A discriminative model answers "which side of the line is this point on," efficiently and often more accurately when all you need is the label. A generative model answers the harder question "how would this class have produced data, and does this point look like it came from any of them," which costs more to fit but buys the ability to generate new examples, handle missing features gracefully, and flag genuinely novel inputs.
What this means in practice
Most production classifiers in quant finance are discriminative, because the actual task — predict a label or probability from features — is exactly what discriminative training optimizes directly, and it typically needs less data than fitting full class-conditional distributions. Generative approaches earn their place where the extra capability matters: simulating synthetic scenarios for stress testing, detecting anomalous days resembling no known regime, or handling missing input features, which a generative model can marginalize over in a principled way.
It's tempting to assume the generative model is always "more informative" and therefore strictly better, since it does more work. In practice, when the actual downstream task is exactly classification and the class-conditional distributions are hard to specify correctly, a discriminative model trained directly on that task frequently outperforms a generative model whose distributional assumptions are wrong — a misspecified pollutes the generative model's decision boundary, while a discriminative model never had to get that distribution right in the first place. Choose based on whether you need the extra generative capability, not on an assumption that "more modelling" means "more accurate."
Related concepts
Practice in interviews
Further reading
- Ng & Jordan, On Discriminative vs. Generative Classifiers (2002)
- Bishop, Pattern Recognition and Machine Learning, ch. 4