Classification via Class Specific Generative Models

64 concepts55 papers1 proposal

When we train a standard neural network to classify images or text, we are usually building a discriminative model. The network looks at all the classes simultaneously and attempts to draw geometric boundaries between them in a high-dimensional space. It answers a specific question: What features best separate class A from class B?

While highly effective, this approach has a fundamental vulnerability. Because the model only cares about finding a separating boundary, it often latches onto "shortcuts"—spurious correlations, such as classifying an image of a cow based entirely on the presence of green grass. As Li demonstrates in Generative Classifiers Avoid Shortcut Solutions, a powerful alternative is to flip the problem entirely by using generative classification. Instead of drawing boundaries between classes, we build independent generative models for each individual class, forcing the system to learn what makes a class inherently itself.

Shifting from Boundaries to Distributions

To understand why this works, consider a dataset with multiple categories. Instead of training a single multi-class network to output a probability distribution over labels $P(Y|X)$, generative classification trains a separate model for each category to estimate the data distribution $P(X|Y)$.

During inference, when a new, unseen sample $X$ arrives, it is passed through every single class-specific model. We then use Bayes' rule to invert the probabilities:

$$P(Y|X) = \frac{P(X|Y)P(Y)}{P(X)}$$

The sample is assigned to the class whose specialized model determines that the sample was most likely to have been generated by its internal distribution.

This paradigm can be implemented across a wide variety of architectures. For instance, early work by Schmah et al. in Generative versus discriminative training of RBMs for classification of fMRI images utilized independent Restricted Boltzmann Machines (RBMs) to capture the complex, distributed structures of fMRI data, outperforming standard discriminative methods when data was scarce.

In modern deep learning, this concept translates to deploying state-of-the-art generative architectures as classifiers. In Towards the first adversarially robust neural network model on MNIST, Schott et al. used class-conditional Variational Autoencoders (VAEs) to perform classification by calculating which model yielded the highest evidence lower bound (ELBO) for a given input. Similarly, Zimmermann et al. adapted diffusion-style models in Score-Based Generative Classifiers, evaluating the exact log-likelihood of a sample across class-conditioned score functions to achieve highly accurate, mathematically grounded classification.

This approach is not limited to images. In natural language processing, Taddy showed in Document Classification by Inversion of Distributed Language Representations that document classification can be elegantly solved by training independent language models on different text domains and comparing their generative likelihoods—a strategy successfully mirrored by Huang in Profiling Irony and Stereotype Spreaders with Language Models and Bayes' Theorem.

Classification via Reconstruction Fidelity

Calculating exact probability densities $P(X|Y)$ can sometimes be computationally expensive or mathematically intractable. To circumvent this, many generative classification systems use an elegant proxy: reconstruction error.

Imagine training an autoencoder or a neural denoiser exclusively on images of the digit 3. Over time, the network becomes exceptionally good at compressing and reconstructing the specific curves and topological features that define a 3. If you feed this network an image of a 7, its internal bottleneck will fail to capture the unfamiliar shape, resulting in a high reconstruction error.

By training a bank of these models—one for each class—classification becomes a competition of reconstruction fidelity. The model that reconstructs the input with the highest accuracy wins, identifying the correct label.

This intuition underpins several breakthroughs across different data modalities:

Why Generative Classification Works

Training $N$ independent models for $N$ classes sounds more complex than training a single multi-class network. However, decoupling the classes yields profound structural advantages that resolve some of deep learning's most persistent flaws.

Adversarial Robustness

Discriminative models are notoriously fragile; a tiny, imperceptible pixel perturbation can push an image across a tightly drawn decision boundary, causing a catastrophic misclassification. Generative classifiers are fundamentally different. As analyzed by Li et al. in Are Generative Classifiers More Robust to Adversarial Attacks?, because these models evaluate whether an input structurally aligns with the entire data distribution of a class, an attacker cannot simply nudge a sample over a line. They must fundamentally alter the structure of the input to match the target class's distribution, making generative classifiers inherently more robust.

Eliminating Catastrophic Forgetting

In standard neural networks, learning a new class over time causes "catastrophic forgetting"—the weights shift to accommodate the new decision boundary, erasing the old ones. In a generative classification framework, classes are completely modular. If you want to add a new class to your system, you simply train a new generative model for that class in isolation. Li demonstrated in Class-Incremental Learning With Generative Classifiers that this direct generative approach completely bypasses the need for complex data replay mechanisms, turning a difficult continual learning problem into a straightforward task of parallel density estimation.

Natural Out-of-Distribution Detection

When a discriminative model is given an entirely irrelevant input (e.g., showing a picture of a car to a cat-vs-dog classifier), it is forced to assign it to one side of its decision boundary, often with high confidence. Generative classifiers handle this naturally. If an input is passed to a bank of class-specific models and all of them report a low likelihood or a massive reconstruction error, the system can immediately flag the sample as out-of-distribution. This property is heavily exploited by Liang et al. for scientific anomaly discovery in Outlier Detection in the DESI Bright Galaxy Survey, and by Liu et al. in Class-Specific Semantic Generation and Reconstruction Learning for Open Set Recognition to establish secure boundaries around known categories.

Key Foundational Work

Recognizing Handwritten Digits Using Mixtures of Linear Models (1994) — contributed 1 concept elements to this direction.
Transformation Invariant Autoassociation with Application to Handwritten Character Recognition (1994) — contributed 1 concept elements to this direction.
Bayesian Classification (1988) — contributed 1 concept elements to this direction.
History & citationVersion 1 · 2026-10-04

Current · Permanent link

View frozen version 1

Cite this direction

Latest version (a living page):

@misc{lacuna_generative_classification_6f905238,
  title = {generative classification},
  author = {{Lacuna}},
  howpublished = {Lacuna research direction},
  year = {2026},
  url = {https://lacuna.tiptreesystems.com/direction/generative-classification/rdr_6f905238cbef43cca1a5a7d37b0ef1cd},
  note = {Latest version of a living research direction; cite a version for a fixed text. Accessed 2026-11-19},
}

This exact version (version 1, frozen text):

@misc{lacuna_generative_classification_6f905238_v1,
  title = {generative classification},
  author = {{Lacuna}},
  howpublished = {Lacuna research direction},
  year = {2026},
  url = {https://lacuna.tiptreesystems.com/direction/generative-classification/rdr_6f905238cbef43cca1a5a7d37b0ef1cd/v/1},
  note = {Version 1, frozen 2026-10-04. Accessed 2026-11-19},
}
About

These directions overlap with this one through shared papers.

See something wrong? Report a mistake