What is the difference between discriminative and generative models?

Answer

Discriminative models learn the decision boundary between classes — they model P(y|x), the probability of the label given the input. Examples: logistic regression, SVM, neural network classifiers. They focus on what makes inputs different. Generative models learn the joint distribution P(x, y) or P(x) — they can generate new data points similar to the training data. Examples: Naive Bayes, GANs, VAEs, diffusion models. Discriminative models generally achieve better classification accuracy; generative models are richer (handle missing data, generate samples) but harder to train.