Generative models like Normalizing Flows and Diffusion have revolutionized the generation of continuous, ordinal data such as natural images. However, they traditionally struggle with categorical data—discrete elements like text tokens or image segmentation classes that possess no inherent numerical relationship or ordering.
Existing solutions often rely on "dequantization," a process that adds small amounts of noise to discrete values to make them continuous. While effective for ordinal data (like pixel intensities), dequantization imposes an arbitrary order on categorical data, leading to suboptimal performance. Consequently, categorical data is usually handled by autoregressive models (like Transformers), which are powerful but notoriously slow to sample from due to their sequential generation process.
To bridge the gap between continuous latent spaces and discrete categorical outputs, researchers have introduced two novel frameworks: Argmax Flows and Multinomial Diffusion. These methods offer a faster alternative to standard autoregressive models and significantly outperform traditional dequantization approaches.
1. Argmax Flows
Argmax Flows define a discrete distribution by passing a continuous distribution (learned via a normalizing flow) through an argmax function.
The primary challenge with this approach is that the argmax function is not invertible, which is a requirement for training standard normalizing flows. To optimize the model, the authors introduce a probabilistic inverse that "lifts" discrete data back into a continuous space.
They propose three types of stochastic inverses: Thresholding-based, Gumbel-based, and Gumbel Thresholding. These inverses ensure that the continuous values sampled during training always map back to the correct categorical label when the argmax is applied. The argmax function naturally divides continuous Euclidean space into symmetric regions, providing a much more principled way to handle categories than simply mapping them to integers. During training, the variational posterior $q(v|x)$ learns to smooth out the sharp boundaries created by the argmax, making it easier for the normalizing flow to model the underlying distribution.
To handle large vocabularies (e.g., the 256 values in a byte), the model utilizes Cartesian Products, representing one large categorical variable as a combination of smaller ones (like 8 binary dimensions) to keep the dimensionality manageable.
2. Multinomial Diffusion
The second approach extends Denoising Diffusion Probabilistic Models (DDPM) directly to the categorical domain.
Instead of adding Gaussian noise, the forward process in Multinomial Diffusion gradually replaces categorical labels with uniform noise. At each step, a category is randomly resampled with a probability $\beta_t$.
For the reverse process, a neural network learns to denoise the signal. Unlike Gaussian diffusion, which predicts the added noise, this categorical model is trained to directly predict the probability distribution of the original, clean data ($x_0$) at each step.
A fascinating byproduct of Multinomial Diffusion is its capacity for unsupervised spell-checking. By feeding a corrupted sentence into the model at a low noise step ($t=1$), the denoising process can effectively fix character-level errors in a single forward pass.
Key Results and Performance
The models were rigorously evaluated on language modeling (text8 and enwik8 datasets) and unconditional image segmentation (using a repurposed Cityscapes dataset).
- Outperforming Dequantization: Argmax Flows consistently beat standard uniform and variational dequantization methods. On the
text8dataset, the Autoregressive Argmax Flow achieved 1.38 bits per character (bpc), compared to 1.43 bpc for variational dequantization. - Segmentation Success: On
Cityscapes, Argmax Flows with softplus thresholding achieved an Evidence Lower Bound (ELBO) of 0.303 bits per pixel, significantly outperforming rounding-based methods (1.010 bits). - Competitive Baselines: On language tasks, Argmax Flows outperformed existing latent variable models like CategoricalNF. Multinomial Diffusion also proved to be a strong non-autoregressive contender, performing better than Argmax Coupling flows on text.
Limitations and Future Directions
While these frameworks represent a significant step forward for categorical generative modeling, challenges remain. There is still a performance gap between fast "coupling" layers and slower "autoregressive" layers when modeling text, suggesting a need for more expressive coupling architectures. Additionally, while Cartesian products help manage vocabulary sizes, scaling to the extremely large vocabularies used in modern Large Language Models (50k+ tokens) remains a significant hurdle for flow-based architectures. Finally, like all diffusion models, Multinomial Diffusion still requires multiple iterations to sample, keeping sampling speed an area for future optimization.
Summary updated