Two different questions
Generative and discriminative models are the two fundamental families of machine learning models, and the cleanest way to tell them apart is by the question each one answers. A discriminative model answers: given this input, what is the label? It learns the boundary that separates classes — spam from not-spam, cat from dog, fraud from legitimate. A generative model answers a harder question: what does the data look like, and how can I produce more of it? It learns the underlying distribution of the data well enough to create brand-new examples. Put simply, discriminative models tell things apart; generative models make new things.
What each model learns
A discriminative model focuses only on what is needed to draw the line between classes. It does not care how the data was produced, only how to map an input to the correct output label. Because it solves a narrower problem, it can be very accurate and efficient for that task. Logistic regression, most image classifiers, and fraud detectors are discriminative.
A generative model learns the joint structure of the data — effectively how likely different inputs are — which is much more information than a decision boundary. With that richer model it can sample new, realistic examples. Large language models learn the distribution of text and generate it one token at a time; diffusion models like Stable Diffusion learn the distribution of images and synthesise new ones. This extra power comes at the cost of being harder to train well and, for a pure labelling task, often less precise than a dedicated discriminative model.
Strengths and weaknesses
Discriminative models are typically more accurate, faster, and cheaper for classification, and they need less data to reach good performance because they solve an easier problem. Their weakness is that they cannot create anything — they only label what they are given — and they say nothing about how the data is structured.
Generative models can create text, images, audio, and code, fill in missing data, and serve as flexible foundations that handle many tasks. Their weaknesses are real: they are more expensive to train and run, can produce confident but wrong output (hallucination in language models), and are usually overkill if you only need a yes/no answer. Choosing the wrong family wastes resources — using a giant generative model to flag spam, or expecting a classifier to write copy, both miss the point.
Real-world examples
The split maps neatly onto familiar tools. Spam filters, credit-card fraud detection, medical image classifiers, sentiment analysers, and object detectors are discriminative — they take an input and return a label or score. ChatGPT, Claude, and Gemini (text), DALL-E, Midjourney, and Stable Diffusion (images), and music or voice generators are generative — they produce new content. Notably, today’s large generative models are so capable that they can be prompted to do classification, which blurs the line in practice even though the training objectives remain distinct.
How to choose
Start from the task, not the hype. If you need to assign a category, score, or decision to existing inputs, reach for a discriminative model: it will be more accurate, cheaper, and simpler to operate. If you need to produce new content or model the full shape of your data, you need a generative model. When a task involves both — generate a draft, then classify or filter it — you may combine the two. Matching the model family to the question is one of the most consequential and most overlooked decisions in applied AI.