TL;DR
This paper introduces two plug-and-play, inference-time optimizations for neural image and video codecs that require absolutely no model retraining. By replacing standard uniform scalar quantization with mathematically optimal space-tessellating vector quantization and using decoder-side entropy gradients to correct reconstruction errors, the authors achieve a 1% to 3% bitrate reduction across a wide variety of state-of-the-art models.
What Problem Does This Paper Address?
End-to-end neural codecs—typically structured as rate-distortion autoencoders—have rapidly evolved to challenge traditional compression standards like VVC. However, standard architectures still suffer from two subtle inefficiencies during inference:
- Sub-optimal Quantization: They almost universally rely on simple Uniform Scalar Quantization (SQ) (i.e., rounding to the nearest integer) to map continuous latent variables to discrete values for entropy coding.
- Wasted Decoder Information: During decoding, the network calculates the probability mass functions to parse the bitstream, meaning the entropy gradient with respect to the latents is readily available. Yet, this information is completely ignored.
The authors tackle these gaps by proposing two generic, architecture-agnostic techniques that exploit these latent properties directly at inference time, boosting the performance of off-the-shelf models.
Methods
The authors introduce two core decoupled techniques:
1. Uniform Vector Quantization (Hex-Quant & Oct-Quant)
The authors first prove a key theoretical threshold (Theorem 1): if a neural network is expressive enough, no non-uniform scalar quantization method can outperform uniform scalar quantization. To achieve lower quantization error, one must move to Vector Quantization (VQ).
Instead of dealing with the training instabilities of learning a VQ codebook, they use predefined, geometrically optimal space-tessellation grids:
- Hex-Quant (2D): Latents are grouped into pairs and quantized using a regular hexagonal grid.
- Oct-Quant (3D): Latents are grouped into triplets and quantized using a truncated octahedron grid.
To make this work with off-the-shelf models, they numerically integrate the baseline model’s learned 1D probability density functions (PDFs) over these multi-dimensional geometric regions to compute the new multi-dimensional probability mass functions (PMFs) required by the entropy coder.
2. Latent Shift via Entropy Gradients
At the decoder side, the true reconstruction error gradient (which tells you how to tweak the latents to make the image look better) is unavailable because the original ground-truth image is missing. However, by applying Karush-Kuhn-Tucker (KKT) conditions to the rate-distortion optimization problem, the authors reveal that the unavailable reconstruction gradient and the available entropy gradient point in opposite directions for an optimized codec.
They introduce Latent Shift, which uses the decoder-side entropy gradient as a proxy "compass" to shift the decoded latents in a direction that minimizes reconstruction distortion. The optimal step sizes are calculated at the encoder and signaled to the decoder using just a few bits.
Datasets
The methods were evaluated strictly using standard, widely accepted compression benchmarks on off-the-shelf pre-trained models:
- Image Codecs: Evaluated on the Kodak dataset and the CLIC-2021 Challenge test set.
- Video Codecs: Evaluated on the UVG (Ultra Video Group) dataset and the standard Bunny video sequence.
Key Insights and Ideas
- Uniform SQ is "Good Enough" for Scalars: The proof that uniform SQ is sufficient among all scalar methods highlights why complex learned non-uniform scalar quantizers rarely yield meaningful gains in deep networks—the network simply learns to warp the space internally instead.
- The Decoder's Hidden Compass: Because neural codecs are trained on a joint rate-distortion loss ($L = R + \lambda D$), the rate and distortion surfaces become mathematically locked together at convergence. This allows the decoder to use the rate (entropy) gradient to navigate the distortion surface blindly.
- Perfect Orthogonality: Because Vector Quantization reduces the noise introduced by discretization and Latent Shift optimizes the positioning of those discrete points, the two methods are entirely orthogonal. Their performance gains stack almost perfectly when combined (
Join).
Key Results
- Overall Bitrate Savings: Combining both methods (
Join) yields an average BD-rate saving of 1% to 3% across various pre-trained architectures (such asmbt2018,cheng2020-attn, andDCVC) without any retraining. - Video Performance: Applying the methods to the residual coding of video codecs (SSF and DCVC) led to average bitrate savings of 2.0% to 2.7% on the UVG dataset.
- Traditional Codec Integration: The Latent Shift concept was successfully adapted to traditional non-neural video compression. It achieved a 0.1% Luma BD-rate saving on the state-of-the-art ECM (Enhanced Compression Model) and was officially adopted into ECM-10.0 by the Joint Video Experts Team (JVET).
Limitations and Future Work
- The Curse of Dimensionality: While uniform VQ is theoretically better in higher dimensions, scaling past 3D causes an exponential explosion in the number of unique quantization codes. This makes standard arithmetic coding impossible due to current bit-resolution constraints.
- Sub-optimal Decoder Awareness: Since the off-the-shelf decoders were originally trained assuming uniform SQ, they are unaware of the altered noise distribution introduced by VQ. Retraining the decoder block with VQ relaxation could yield even higher gains.
- Asymmetric Complexity: While decoding overhead is negligible (<1% time increase), finding the optimal step size for Latent Shift requires an iterative search at the encoder, increasing encoding times by 5x to 10x. Future work will look into establishing universal step sizes to eliminate this overhead.
Summary updated