TL;DR
Discrete Denoising Flows (DDFs) introduce a new invertible generative model designed specifically for categorical data without requiring continuous relaxations. By framing flow transformations as conditional permutations and training each layer locally via standard cross-entropy, DDFs eliminate gradient bias and achieve superior compression rates (in bits per dimension) compared to prior Discrete Flows.
What Problem Does This Paper Address?
Normalizing flows are popular generative models because they offer exact likelihood evaluation and efficient sampling via invertible mappings. However, adapting them to discrete and categorical data (such as binarized images or segmentation maps) is challenging:
- Continuous relaxations introduce bias: Standard continuous flows require dequantization, while previous discrete flows (such as Discrete Flows or Integer Discrete Flows) insert discrete operations (e.g.,
argmaxor rounding) into coupling layers. Backpropagating through these non-differentiable operations requires biased gradient estimators (like relaxed Gumbel-Softmax), impairing optimization. - Compression trade-offs: While Variational Autoencoders with bits-back coding or autoregressive models (like PixelCNN) can compress discrete data, they either perform poorly when encoding individual samples or are prohibitively slow to decode.
The authors set out to build an invertible model for categorical random variables that achieves exact likelihoods without gradient bias and trains computationally efficiently.
Methods
DDFs preserve the bipartite coupling layer architecture from continuous flows (like RealNVP) but fundamentally rethink the transformation:
-
Conditional Permutation (
cond_perm): An input vector $x$ is partitioned into $[x_a, x_b]$. While $x_a$ remains unchanged, a neural network $n$ predicts unnormalized logits $\theta = n(x_a)$ over categories for $x_b$. Using these predictions, $x_b$ is transformed into $z_b$ via a coordinate-wise permutation: $$\text{perm}_{\theta_i} = \begin{pmatrix} 1 & 2 & \dots & K \\ \text{argsort\_top}_h(\theta_i) \end{pmatrix}$$ The operation maps the classes the network is most confident about to smaller indices (e.g., class 1 or 2). Inverting this during inference is trivial: simply apply the inverse permutation using the conditioned network's outputs. -
Top-$h$ Sorting: Sorting all $K$ classes entirely can destroy spatial correlations needed by deeper layers. The authors introduce $\text{argsort\_top}_h$, a hyperparameterized sort that reorders only the top $h \le K$ most predictable classes while leaving the rest untouched.
- Greedy Local Training: Instead of backpropagating end-to-end through discrete operations, each coupling layer is trained locally and independently as a standard supervised predictor using ordinary cross-entropy loss. Once layer $l$ is trained, the dataset is transformed through it, and layer $l+1$ is trained on the resulting representations.
Input x ---> [Split: xa, xb] ---> xb permuted by network n(xa) ---> [Combine & Shuffle] ---> z
Datasets
The authors evaluate DDFs against standard Discrete Flows (DFs) across three benchmarks:
- Discretized 8 Gaussians: A 2D synthetic mixture of 8 Gaussians arranged in a circle, quantized into $K = 91$ discrete bins.
- Binarized MNIST: Handwritten digits binarized into $K = 2$ classes ($28 \times 28$ pixels).
- 8-Class Cityscapes: Urban semantic segmentation maps downsampled to $32 \times 64$ resolution with $K = 8$ semantic categories.
Key Insights and Ideas
- Decorrelation via Predictive Sorting: If network $n(x_a)$ accurately predicts $x_b$, permuting the predicted top classes to low indices concentrates the marginal distribution of $z_b$ toward class 1. This decorrelates the data dimensions, making an independent (factorized) categorical base distribution in latent space a dramatically better fit.
- Zero Gradient Bias: Because the transformation parameters are trained purely as supervised classifiers using standard cross-entropy, the training objective has an exact, analytical gradient. There is no straight-through estimator or temperature relaxation required.
- The Role of $h$: For shallow networks or the final layer, setting $h = K$ provides maximal compression. For intermediate layers in multi-class problems, setting $h < K$ (e.g., $h = 4$ for Cityscapes) preserves structural context for downstream layers to learn from.
Key Results
Performance was evaluated using Bits Per Dimension (BPD, lower is better), comparing DDFs against standard Discrete Flows (DFs) under identical network budgets:
| Dataset | Splitpriors? | Discrete Flow (DF) | DDF (Ours) |
|---|---|---|---|
| 8 Gaussians | No | $5.05 \pm 0.05$ | $4.58 \pm 0.02$ |
| Binary MNIST | No | $0.37 \pm 0.01$ | $0.23 \pm 0.01$ |
| Binary MNIST | Yes | $0.17 \pm 0.01$ | $0.16 \pm 0.01$ |
| Cityscapes | No | $1.46 \pm 0.00$ | $0.79 \pm 0.01$ |
| Cityscapes | Yes | $0.65 \pm 0.03$ | $0.59 \pm 0.03$ |
- Impact of Pure Flows: The advantage of DDFs is particularly striking when models are trained without splitpriors (e.g., dropping Cityscapes from 1.46 to 0.79 BPD), proving that the denoising coupling mechanism itself has far superior modeling capacity compared to previous discrete coupling formulations.
- Visual Fidelity: Samples generated by DDFs exhibit noticeably sharper structural boundaries and coherent semantic regions compared to the noisy artifacts produced by baseline Discrete Flows.
Limitations and Future Work
- Greedy Layer-wise Training: Because layers are trained sequentially and locally, earlier layers cannot adapt to representations formed by later layers, potentially leaving mutual information unharvested.
- Hyperparameter Sensitivity for Multi-class Data: Tuning the top-$h$ sorting parameter requires cross-validation/grid search on multi-class data ($K > 2$) to balance between decorrelating classes and preserving feature geometry.
- Performance vs. Autoregressive Models: While DDFs provide single-pass sampling and efficient single-sample compression, the paper notes that autoregressive models (e.g., PixelCNN) still hold state-of-the-art likelihood performance on categorical image data, albeit at significantly higher decoding latency.
Summary updated