An Introduction to Neural Data Compression

Yibo Yang, Stephan Mandt, Lucas Theis

Abstract

Neural compression is the application of neural networks and other machine learning methods to data compression. While machine learning deals with many concepts closely related to compression, entering the field of neural compression can be difficult due to its reliance on information theory, perceptual metrics, and other knowledge specific to the field. This introduction hopes to fill in the necessary background by reviewing basic coding topics such as entropy coding and rate-distortion theory, related machine learning ideas such as bits-back coding and perceptual metrics, and providing a guide through the representative works in the literature so far.

Introduction

Traditionally, data compression has relied on handcrafted algorithms designed by domain experts, such as JPEG for images or H.264 for video. However, the rapid advancement of deep generative modeling has opened a new path: learning compression algorithms end-to-end directly from data. This field, known as neural data compression, acts as a bridge between classical information theory and modern deep learning.

A primary challenge in this field is the linguistic and conceptual gap between machine learning (ML) researchers and compression engineers. While ML researchers often focus on generating realistic samples or maximizing log-likelihoods, these goals do not automatically translate to efficient bit-rates. Furthermore, standard neural networks struggle with the discrete, non-differentiable operations—such as rounding numbers to integers—required to transmit digital bits. This paper provides a unified framework that maps generative modeling concepts directly to compression metrics like bit-rate and distortion.

Methodological Framework

Neural compression synthesizes several core techniques to achieve efficient data representation:

  • Lossless Compression via Generative Models: Autoregressive models, normalizing flows, and latent variable models can be paired with entropy coding techniques, such as Arithmetic Coding or Asymmetric Numeral Systems, to compress data toward its theoretical entropy limits.
  • Bits-Back Coding: This technique is used for latent variable models where the encoder utilizes a stochastic latent representation. By selecting a random sample based on a stream of auxiliary data, the sender can effectively "get bits back," making the compression cost equivalent to the Negative Evidence Lower Bound (NELBO) used in Variational Autoencoders (VAEs).
  • Differentiable Quantization: Lossy compression requires quantizing continuous neural network outputs into discrete symbols. Since rounding has a zero gradient, standard backpropagation fails. Researchers often use additive uniform noise during training as a mathematically rigorous, differentiable proxy for rounding.
  • Compression Without Quantization: Emerging paradigms like dithered quantization or minimal random coding avoid rounding entirely by transmitting continuous, stochastic samples using a finite number of bits.

Theoretical Insights

Variational Inference as Compression

Training a VAE is mathematically equivalent to optimizing a lossy compression scheme. The Evidence Lower Bound (ELBO) objective directly corresponds to the rate-distortion trade-off, where the KL-divergence term represents the bit-rate and the reconstruction term represents the distortion.

The Perception-Distortion Trade-off

There is a fundamental mathematical tension between reconstruction accuracy (pixel-by-pixel distortion) and perceptual realism. At low bit-rates, it is impossible to maximize both. Optimizing strictly for Mean Squared Error (MSE) often results in blurry images, while optimizing for realism using Generative Adversarial Networks (GANs) or other divergences can create sharp, realistic images that may "hallucinate" details not present in the original source.

Visualizing the trade-off between pixel-wise accuracy and perceptual realism in neural compression.

Task-Oriented Compression

Compression is not always intended for human consumption. In applications like satellite imagery or edge-device sensors, data can be compressed specifically to preserve features relevant to downstream neural networks, such as image classifiers, thereby significantly reducing bandwidth requirements.

Empirical Success and Future Frontiers

Neural image compression has seen rapid progress. In 2016, neural codecs barely competed with JPEG 2000; by 2018, they were outperforming state-of-the-art handcrafted codecs like BPG and HEVC. In recent iterations of the Challenge on Learned Image Compression (CLIC), classical codecs have been largely displaced from the top rankings by neural approaches.

Despite these successes, several hurdles remain:

  • Computational Complexity: Neural codecs require significantly more compute and memory than hardware-accelerated classical codecs, complicating deployment on mobile devices.
  • Safety and Hallucinations: The ability of modern neural codecs to generate realistic textures at low bit-rates poses risks in sensitive applications like medical imaging or security footage, where hallucinated details could lead to misinterpretation.
  • New Modalities: Extending these techniques to complex data types like 3D point clouds, implicit surfaces, and Neural Radiance Fields (NeRFs) remains a major open frontier.

Summary updated

BibTeX
@inproceedings{yang2022introduction,
  author = {Yibo Yang and Stephan Mandt and Lucas Theis},
  title = {{An Introduction to Neural Data Compression}},
  booktitle = {Found. Trends Comput. Graph. Vis},
  year = {2022},
  url = {https://openreview.net/forum?id=1K0CKWZkUu},
}
Figure