TL;DR
While standard rate-distortion theory proves that deterministic encoders are optimal for minimizing distortion alone, introducing noise during encoding can provide significant benefits when enforcing "perfect perceptual quality" (where reconstructions must match the data distribution). Using a clean toy model on a circular uniform distribution, the authors demonstrate that a stochastic encoder with shared randomness outperforms the best possible deterministic encoder, reducing distortion by nearly 39% at a 1-bit rate.
What Problem Does This Paper Address?
In classical lossy compression and neural image compression, encoders are almost always deterministic: an input passes through a transform, gets quantized, and is entropy-coded into bits. Stochastic encoders—which introduce random noise during the encoding step—are sometimes used for theoretical tractability or gradient estimation, but they typically underperform deterministic encoders in pure rate-distortion evaluations.
Recently, generative compression models have focused on the perception-distortion tradeoff, aiming for perfect perceptual quality ($\hat{X} \sim X$): ensuring the decompressed output is completely artefact-free and statistically indistinguishable from real data. Standard practice combines a deterministic encoder with a stochastic generative decoder (like a GAN or diffusion model). This paper investigates a fundamental question: Can adding stochasticity to the encoder itself ever outperform the best deterministic encoder under a perfect perceptual quality constraint?
Methods
The authors study a 1-shot compression problem using a circular uniform distribution on a 2D unit circle (parameterized by angle $\theta \sim \mathcal{U}[0, 2\pi)$). The target bit rate is 1 bit ($R=1$, choosing between two states), and distortion is measured via cosine distance/MSE: $$d(\theta, \hat{\theta}) = 1 - \cos(\hat{\theta} - \theta) = \frac{1}{2}\|\hat{\mathbf{x}} - \mathbf{x}\|^2$$
They compare two paradigms:
- Deterministic Vector Quantization (VQ) + Stochastic Decoder: The circle is split into two Voronoi semicircles. The encoder deterministically outputs the closer codebook index ($k \in \{0, 1\}$). To satisfy $\hat{X} \sim X$, the decoder randomly samples an angle uniformly from the corresponding Voronoi region.
- Universal Quantization (Stochastic Encoder + Shared Randomness): Adapting Ziv’s universal quantization trick, the encoder and decoder share a uniform random variable $U \sim \mathcal{U}[0, 1)$. The encoder computes: $$f(x, u) = \left\lfloor \frac{\theta}{\pi} + u \right\rfloor \bmod 2$$ The decoder reconstructs $\hat{\theta} = \pi(k - u)$, yielding a reconstruction distribution that is always centered symmetrically around the actual input $\theta$, rather than tied to fixed Voronoi boundaries.
Datasets
- Circular Uniform Distribution (Synthetic): Points uniformly distributed on the 2D unit circle ($p(\theta) = \frac{1}{2\pi}$).
- Real-world datasets: Not discussed in the paper (the work is an analytical, theoretical proof-of-concept).
Key Insights and Ideas
- Shared randomness is crucial: If the encoder and decoder only have independent sources of randomness, the authors prove that requiring perfect perceptual quality forces at least a twofold increase in mean squared error compared to an unconstrained MSE-optimal codec (Appendix B). Shared randomness allows the decoder to "cancel" the encoder's dithering noise.
- Centered reconstruction distributions: In deterministic VQ, inputs near the Voronoi boundary suffer high distortion because the decoder must sample uniformly across the entire semicircle regardless of where the point fell inside it. Universal quantization centers the posterior conditional reconstruction window directly around the true data point.
- Convexity and constraints: In unconstrained Lagrangian rate-distortion optimization ($R + \lambda D$), deterministic encoders are always optimal. However, when imposing hard distribution-matching constraints ($\hat{X} \sim X$), the optimization landscape changes, opening the door for stochastic encoders to win.
Key Results
- 1-bit Rate ($R = 1$):
- Optimal Deterministic Encoder (VQ): Expected distortion is $\mathbb{E}[d] = 1 - \frac{4}{\pi^2} \approx 0.5947$.
- Stochastic Encoder (UQ): Expected distortion is $\mathbb{E}[d] = 1 - \frac{2}{\pi} \approx 0.3634$.
- The stochastic encoder achieves an approximate 38.9% reduction in distortion.
- Arbitrary Bit Rates ($R = \log_2 N$):
- As the bit rate increases, the distortion of both approaches converges to 0: $$\mathbb{E}_{\text{VQ}}[d] = 1 - \left(\frac{N \sin(\pi/N)}{\pi}\right)^2, \quad \mathbb{E}_{\text{UQ}}[d] = 1 - \frac{N \sin(\pi/N)}{\pi}$$
- Interestingly, the performance gap between deterministic and stochastic encoders widens in terms of Signal-to-Noise Ratio (SNR) as the rate increases.
Limitations and Future Work
- One-shot toy setting: The analysis evaluates single-sample encoding. In classical asymptotic vector quantization ($n \to \infty$ dimensions/blocks), deterministic encoders asymptotically achieve optimal rate-distortion bounds. It remains an open theoretical question whether this asymptotic optimality still holds under the perfect perceptual quality constraint, or if stochastic encoders retain an advantage in high dimensions.
- Shared seed requirement: The performance gains rely on synchronized, shared pseudorandomness between the encoder and decoder.
- Application to practical neural codecs: The paper provides an analytical proof-of-concept on 1D/2D circular geometry; evaluating whether these gains translate to complex continuous distributions (e.g., real images and learned neural transforms) is left for future work.
Summary updated