NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

On the advantages of stochastic encoders

Lucas Theis, Eirikur Agustsson

Abstract

In traditional lossy compression, deterministic encoders are considered optimal for minimizing distortion at a given bit rate. However, as the field moves toward "perfect perceptual quality"—where the reconstructed data must match the statistical distribution of the original—this optimality is challenged. This paper investigates the theoretical advantages of stochastic encoders, demonstrating that introducing shared randomness between the encoder and decoder can reduce distortion by nearly 40% compared to the best deterministic methods.

Introduction

Lossy compression typically involves a trade-off between the number of bits used (rate) and the resulting error (distortion). Traditionally, this process is deterministic: a specific input always maps to a specific bitstring and a fixed reconstruction. Stochastic encoders, which incorporate noise into the encoding process, have historically been viewed as less efficient or merely a tool for mathematical analysis.

However, a new frontier in compression focuses on "perfect perceptual quality." This means the reconstructed data must have the exact same statistical distribution as the original data (i.e., no compression artifacts or blurring). Under this strict perceptual constraint, the authors show that stochasticity provides a significant hidden advantage.

Architectural Framework

The authors compare three primary encoding architectures to evaluate their performance under perceptual constraints:

  1. Deterministic Encoders: Map input $x$ to a discrete code $k$ via a fixed function.
  2. Stochastic Encoders with Independent Noise: The encoder and decoder use separate, uncorrelated noise sources.
  3. Stochastic Encoders with Shared Randomness: Both the encoder and decoder have access to a common noise source (dither).
Comparison of encoder architectures: (A) Deterministic, (B) Stochastic with independent noise, and (C) Stochastic with shared noise.

The paper proves that shared randomness is the critical component. Without it, stochasticity actually doubles the distortion compared to deterministic methods.

The Circular Toy Example

To provide a rigorous mathematical comparison, the authors utilize a synthetic dataset: a uniform distribution over a unit circle. The task is to compress a point on this circle using only 1 bit.

In the Deterministic Approach (Vector Quantization), the circle is divided into two halves (Voronoi regions). To maintain perfect perceptual quality, the decoder cannot simply output the centroid of the arc; it must randomly sample a point from the corresponding half-circle to ensure the overall output distribution remains uniform.

In the Stochastic Approach (Universal Quantization), shared randomness is used. The encoder adds a random offset before quantization, and the decoder subtracts the same offset. This allows the reconstruction's probability mass to be "centered" around the actual data point, rather than being spread across a fixed, wide arc.

The circular uniform distribution toy example. (A) Deterministic Voronoi regions. (B) Stochastic approach using shared randomness to center the reconstruction.

Key Results and Insights

The theoretical analysis yields several striking conclusions:

  • Significant Distortion Reduction: For the 1-bit circular example, the stochastic encoder achieved a Mean Squared Error (MSE) that was 38.9% smaller than the best possible deterministic encoder.
  • The Optimality Flip: While deterministic encoders are optimal for standard rate-distortion trade-offs, they are provably suboptimal under the "distribution-preserving" constraint.
  • Scaling with Bit Rate: As the bit rate increases, the performance gap between stochastic and deterministic encoders grows even wider when measured in Signal-to-Noise Ratio (SNR).

Conclusion and Future Work

This research highlights a fundamental shift in compression theory: when perceptual quality is paramount, stochasticity is not a drawback but a powerful tool. By using shared randomness, encoders can more effectively "center" their errors, leading to much higher fidelity reconstructions.

While the circular model provides a clean proof-of-concept, applying these findings to complex real-world data like high-resolution images remains a challenge. Future work will explore how these gains translate to modern neural compression architectures and the practicalities of implementing shared randomness in global communication standards.

Summary updated

BibTeX
@inproceedings{theis2021advantages,
  author = {Lucas Theis and Eirikur Agustsson},
  title = {{On the advantages of stochastic encoders}},
  booktitle = {Neural Compression @ ICLR},
  year = {2021},
  url = {https://openreview.net/forum?id=FZ0f-znv62},
}
Figure