Discrete Denoising Flows

Alexandra Lindt, Emiel Hoogeboom

Abstract

Discrete flow-based models are a recently proposed class of generative models that learn invertible transformations for discrete random variables. Since they do not require data dequantization and maximize an exact likelihood objective, they can be used in a straight-forward manner for lossless compression. In this paper, we introduce a new discrete flow-based model for categorical random variables: Discrete Denoising Flows (DDFs). In contrast with other discrete flow-based models, our model can be locally trained without introducing gradient bias. We show that DDFs outperform Discrete Flows on modeling a toy example, binary MNIST and Cityscapes segmentation maps, measured in log-likelihood.

Introduction

Normalizing flows are powerful generative models that learn to transform a simple probability distribution into a complex one through a series of invertible steps. While they excel at continuous data, adapting them to discrete data (like text categories or segmentation maps) is notoriously difficult. Existing methods, such as Discrete Flows, rely on non-differentiable operations. To train them, researchers usually resort to biased gradient estimators, which often lead to poor optimization. Furthermore, training deep flows end-to-end is computationally expensive. Discrete Denoising Flows (DDFs) aim to solve both the gradient bias and the efficiency bottleneck.

Methodology: The Denoising Coupling Layer

The authors introduce the Denoising Coupling Layer, which operates on categorical variables without needing to "dequantize" them into continuous space.

The Denoising Trick

Instead of the standard addition or multiplication used in continuous flows, DDFs use a conditional permutation. A neural network predicts the most likely values of one part of the data ($x_b$) based on another part ($x_a$). The model then permutes $x_b$ so that the most "predictable" values are mapped to smaller integers. This effectively "denoises" the data, pushing it toward a simpler, lower-entropy distribution.

The argsort_top permutation logic used in DDFs to map high-probability categories to lower indices.

Local Training and Invertibility

Unlike most flows that require backpropagating through the entire chain of layers, DDFs are trained one layer at a time. Each layer's neural network is trained using a standard cross-entropy loss to predict the next part of the data. Once a layer is trained, its weights are fixed, and the model moves to the next layer. Because permutations are naturally reversible, the model remains perfectly invertible, making it ideal for lossless compression.

Experiments and Results

The authors evaluated DDFs against standard Discrete Flows (DF) on three distinct benchmarks: a quantized 8 Gaussians toy dataset, Binary MNIST, and Cityscapes semantic segmentation maps.

Quantitative Performance

Performance was measured in Bits Per Dimension (BPD), where lower values indicate better modeling and more efficient compression. In every test case, DDFs outperformed standard Discrete Flows. On the Cityscapes dataset (without splitpriors), DDFs achieved 0.79 BPD, nearly doubling the performance of standard Discrete Flows (1.46 BPD).

Qualitative Improvement

Visual samples from DDFs appear much sharper and more coherent than those from previous discrete flow models, which often produce noisy or "scrambled" results.

Comparison of density estimation on the 8 Gaussians toy dataset. (a) shows the baseline Discrete Flow, while (b) shows the improved modeling of DDFs.

Discussion and Limitations

DDFs represent a cleaner path to discrete generative modeling by framing flow as a sequence of entropy-reducing permutations. By training internal neural networks locally rather than backpropagating through the entire flow, the authors sidestep the need for biased gradient estimators like the straight-through estimator.

While DDFs show great promise, the model introduces a hyperparameter $h$ (the number of elements to sort in the permutation) which requires tuning. Additionally, while local training is efficient, future work must ensure it captures long-range dependencies as effectively as end-to-end models. Scaling the permutation logic to very large vocabularies remains an open challenge for application in natural language processing.

Summary updated

BibTeX
@inproceedings{lindt2021discrete,
  author = {Alexandra Lindt and Emiel Hoogeboom},
  title = {{Discrete Denoising Flows}},
  booktitle = {INNF @ ICML},
  year = {2021},
  url = {https://openreview.net/forum?id=HhcKxFKluuP},
}
Figure