Generative vs Discriminative Modeling
A discriminative model learns only the boundary between classes, directly; a generative model learns the full probability distribution each class was drawn from — a difference that shapes what each type of model can and cannot do beyond plain classification.
Prerequisites: Discriminative vs Generative Models, Gradient Descent
Suppose the task is: given a company's financial ratios, predict whether it will default within a year. Two entirely different modelling philosophies can both answer this. A discriminative model learns, directly, the boundary separating "defaults" from "doesn't default" in the space of input features — it never bothers modelling what defaulting companies' financials look like overall, only where the dividing line sits. A generative model instead learns the full probability distribution of financials for each class separately — and only at prediction time compares which distribution a new company's numbers are more consistent with. Both can produce the same yes/no answer. They differ sharply in what else they can do, how much data they need, and how they fail.
The analogy: describing a border versus describing both countries
A discriminative model is like someone who has only ever studied the border between two countries — they can tell you instantly which side of the line any coordinate falls on, but know nothing about either country away from that line. A generative model has studied both countries in full — geography, climate, culture — and derives the border only as a side-effect. The border-only expert is often faster and needs less study; the full-country expert can also answer entirely different questions ("generate a plausible new town that could exist there") the border-only expert has no way to answer.
What each side actually models
A discriminative model learns directly — the probability of the label given the input — often by directly parameterising a decision boundary (logistic regression, most neural network classifiers).
A generative model learns , the distribution of inputs within each class, together with the class prior , and then derives only indirectly via Bayes' rule:
In words: the probability of a label given the data is worked out by combining how likely that data would be if it came from each class (, the generative part), weighted by how common each class is overall (), and normalised by the overall probability of seeing that data at all () — the classification boundary emerges as a byproduct of fully modelling both classes, rather than being learned directly.
Worked example 1: Gaussian classes by hand
Suppose defaulting companies' debt ratio is modelled as and healthy companies' as , with equal priors. A new company has debt ratio . Evaluate each class's density: for default, ; for healthy, — symmetric distance, so both classes assign roughly equal likelihood (), and with equal priors the model outputs close to a 50/50 split. This company sits almost exactly on the boundary the generative model implies — and it can also report how implausible this ratio is under either story, something a bare discriminative boundary cannot express.
Worked example 2: what each model can do with a new, malformed input
A discriminative logistic regression, given an impossible debt ratio (likely a data error), will still confidently output a probability near 0 or 1 — the decision boundary is just a line, and every point is on one side or the other, with no notion of "this doesn't look like anything I've seen." The generative model can compute for both classes at and find both vanishingly small — flagging the point as implausible under either class, a form of built-in anomaly detection the discriminative model has no mechanism to provide.
Drag the complexity slider above — a discriminative model is exactly this: it fits the dividing boundary directly and never represents anything about the shape of each class's own data cloud, only where they separate.
Discriminative models learn directly and tend to need less data to draw an accurate boundary; generative models learn for each class and derive the boundary via Bayes' rule, at the cost of a harder modelling problem, in exchange for the ability to detect implausible inputs, generate new synthetic samples, and handle missing features naturally.
What this means in practice
Most workhorse classifiers in quant workflows — logistic regression, gradient-boosted trees, most neural classifiers — are discriminative, because when the only goal is an accurate label given complete, well-behaved features, discriminative models are simpler to train and often more accurate for a fixed amount of data. Generative approaches earn their extra complexity when the task needs more than a label: detecting out-of-distribution inputs, generating synthetic scenarios (see Denoising Diffusion Probabilistic Models and Generative Adversarial Networks), or handling missing or corrupted features gracefully, since a generative model can still reason about even when parts of are unobserved.
"Generative" here — modelling — is a different, older usage than the popular "generative AI" applied to language models producing fluent text; the two share a family resemblance but a classic generative classifier like naive Bayes and a large language model solve very differently shaped problems. Conflating "this uses a generative model" with "this can write essays" is a common category error.
Practice
- A dataset has only 200 labelled examples but a well-understood generative structure (e.g. two roughly Gaussian classes). Explain in one sentence why a generative model might outperform a discriminative one here, even though both could in principle fit the same boundary.
- Why can a purely discriminative classifier not, on its own, generate a new synthetic example that looks like it belongs to a given class?
Related concepts
Practice in interviews
Further reading
- Ng & Jordan, On Discriminative vs. Generative Classifiers (2002)
- Bishop, Pattern Recognition and Machine Learning, Ch. 4