[Paper Review] Compression with Flows via Local Bits-Back Coding
This paper introduces local bits-back coding, a novel compression technique that enables efficient, lossless compression using pretrained normalizing flow models. By leveraging the flow's invertible transformation and Jacobian-free computation, the method achieves near-theoretical codelengths with linear-time, fully parallelizable encoding and decoding, particularly effective for RealNVP-type flows on high-dimensional data like images.
Likelihood-based generative models are the backbones of lossless compression due to the guaranteed existence of codes with lengths close to negative log likelihood. However, there is no guaranteed existence of computationally efficient codes that achieve these lengths, and coding algorithms must be hand-tailored to specific types of generative models to ensure computational efficiency. Such coding algorithms are known for autoregressive models and variational autoencoders, but not for general types of flow models. To fill in this gap, we introduce local bits-back coding, a new compression technique for flow models. We present efficient algorithms that instantiate our technique for many popular types of flows, and we demonstrate that our algorithms closely achieve theoretical codelengths for state-of-the-art flow models on high-dimensional data.
Motivation & Objective
- To address the lack of computationally efficient coding algorithms for general normalizing flow models, which are otherwise strong in likelihood modeling.
- To close the gap between the strong theoretical performance of flow models in likelihood estimation and their practical applicability in lossless compression.
- To develop a universal, efficient coding framework applicable to various flow architectures without requiring model retraining or structural assumptions.
- To provide a compression interpretation of dequantization, commonly used in training flows on discrete data.
- To demonstrate that the proposed method achieves codelengths close to theoretical limits while maintaining practical computational efficiency on high-dimensional data.
Proposed method
- Introduces local bits-back coding, a technique that uses the flow model's invertible transformation to simulate bits-back coding without explicit Jacobian computation.
- Employs a black-box algorithm (Algorithm 1) based on iterative refinement to compute codelengths via Monte Carlo estimation of the bits-back process.
- Develops a compositional algorithm for RealNVP-type flows that exploits their autoregressive structure to achieve linear-time, fully parallelizable encoding and decoding.
- Leverages the change-of-variables formula to compute log-likelihoods efficiently, avoiding expensive Jacobian determinant calculations.
- Adapts the method to low-precision discrete data by reinterpreting dequantization as a form of bits-back coding, enabling compression of discrete datasets.
- Uses a single forward pass of the flow model for both encoding and decoding, minimizing computational overhead.
Experimental results
Research questions
- RQ1Can a general, efficient coding algorithm be constructed for arbitrary normalizing flow models without requiring model-specific tuning or retraining?
- RQ2Can local bits-back coding achieve codelengths close to the theoretical minimum predicted by the model's log-likelihood?
- RQ3Can the method be made computationally efficient enough for high-dimensional data such as images, with linear time and space complexity?
- RQ4How does the proposed method compare to existing coding techniques for VAEs and autoregressive models in terms of codelength and speed?
- RQ5What is the role of dequantization in the context of bits-back coding, and can it be interpreted as a compression mechanism?
Key findings
- The compositional algorithm for RealNVP-type flows achieves codelengths within 0.05 bits/dim of theoretical predictions on CIFAR10 and ImageNet datasets.
- On CIFAR10, the compositional algorithm encodes a single image in 0.77 seconds (±0.01), compared to 64.37 seconds for the black-box algorithm, demonstrating a 84x speedup.
- With batch processing, the compositional algorithm reduces encoding time to 0.09 seconds per image on CIFAR10, approaching the speed of a single forward pass of the flow model.
- The method is fully parallelizable for both encoding and decoding, enabling efficient batch processing and memory-efficient inference.
- The algorithm attains a net codelength of 3.88 bits/dim on 32x32 ImageNet, with approximately 40 bits/dim of auxiliary bits, outperforming VAEs in net codelength despite higher auxiliary cost.
- Dequantization is reinterpreted as a form of bits-back coding, providing a new theoretical justification for its use in training flows on discrete data.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.