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

Learning Optimal Lattice Vector Quantizers for End-to-end Neural Image Compression

Xi Zhang, Xiaolin Wu

TL;DR

This paper introduces Optimal Lattice Vector Quantization (OLVQ), a method that replaces simple scalar quantization in neural image compression with learnable, data-adaptive lattices. By learning the optimal geometry of the quantization "buckets" while enforcing orthogonality for computational efficiency, the authors achieve significant bitrate savings (up to 22.6%) without the massive complexity overhead of traditional vector quantization.

What Problem Does This Paper Address?

In end-to-end neural image compression, an autoencoder transforms an image into a "latent representation." To actually compress this data, we must quantize these continuous latent values into discrete ones.

Currently, most state-of-the-art models use Uniform Scalar Quantization (USQ)—essentially rounding each number to the nearest integer. While USQ is incredibly fast and easy to implement, it is mathematically "lazy." It treats every feature as independent, ignoring the complex correlations and dependencies that still exist in the latent space.

Comparison of Scalar, Lattice, and General Vector Quantizers

Vector Quantization (VQ) is the theoretical gold standard because it quantizes groups of numbers together, capturing these dependencies. However, VQ is notoriously difficult to implement in deep learning: finding the "nearest neighbor" in a high-dimensional codebook is an NP-hard problem, and the process is generally non-differentiable, making end-to-end training a massive challenge.

Methods

The authors propose a powerful middle ground: Lattice Vector Quantization (LVQ). In LVQ, codewords are arranged in a regular, repeating grid (a lattice) in high-dimensional space.

The paper’s core innovation, OLVQ, moves beyond fixed, traditional lattices (which assume data is distributed uniformly) by making the lattice learnable:

  1. Learnable Basis Matrix ($B$): Instead of using a predefined grid, the model learns a generator matrix $B$ that defines the lattice's shape, orientation, and scale. This allows the lattice to "tilt" and "stretch" to better fit the actual distribution of the latent features.
  2. Babai’s Rounding Technique (BRT): To keep encoding fast, they use BRT, which estimates the nearest lattice point using simple matrix inversion and rounding ($ql(v) = B \lfloor B^{-1}v \rceil$). This bypasses the expensive search required by general VQ.
  3. Orthogonality Constraint: BRT is only accurate if the basis vectors are nearly perpendicular (orthogonal). The authors add a specific penalty term to the loss function to force the learned lattice to remain "mostly orthogonal," ensuring that the fast rounding used during training matches the behavior during inference.
  4. Differentiable Training: During training, they replace the hard rounding operation with uniform noise (a standard trick in neural compression) to allow gradients to flow back through the quantizer.

Datasets

The authors trained their models on a high-resolution subset of ImageNet (images > 1MP). For evaluation, they used two industry-standard benchmarks:

  • Kodak: A classic set of 24 images.
  • CLIC (Challenge on Learned Image Compression): A more modern and diverse validation set.

Key Insights and Ideas

  • Geometry is Efficiency: By allowing the lattice to adapt its shape, the model can pack information more tightly. If two latent features are highly correlated, the lattice can "squash" in that direction to reduce quantization error.
  • The Orthogonality Trade-off: There is a tension between fitting the data perfectly (which might require a very skewed lattice) and maintaining fast encoding (which requires an orthogonal lattice). The paper demonstrates that you can get the best of both worlds by using a regularization term to guide the lattice toward a "friendly" shape.
  • Context Model Interaction: A fascinating finding is that OLVQ provides the biggest gains for simpler "context models" (the part of the system that predicts the probability of the data). As the context model becomes more complex (e.g., spatial-wise autoregressive), the relative benefit of OLVQ decreases because the context model is already doing the heavy lifting of capturing dependencies.

Key Results

The performance gains are substantial, measured in BD-rate (the percentage of bitrate saved for the same image quality):

Rate-distortion performance comparing different quantizers
  • Bitrate Savings: On the Bmshj2018 architecture with a simple context model, OLVQ achieved a 22.6% reduction in bitrate compared to standard scalar quantization.
  • Scaling: Even on more advanced models like SwinT-ChARM and LIC-TCM, the method consistently outperformed scalar quantization, typically saving between 1% and 12% depending on the context model used.
  • Speed: OLVQ is significantly faster than general Vector Quantization. For a 32-dimensional vector, OLVQ takes ~40ms for inference, whereas general VQ takes ~454ms. While slightly slower than the ~5ms of scalar quantization, it remains highly practical for real-world use.

Limitations and Future Work

The authors acknowledge that the gains from OLVQ are modest for "heavy-duty" models that already employ extremely sophisticated, computationally expensive context models. In these cases, the context model has already "learned" the dependencies that the lattice quantizer is trying to exploit.

Future Work could involve:

  • Applying OLVQ to the compression of neural network weights (model compression) rather than just images.
  • Exploring non-linear lattice transformations to capture even more complex data manifolds.
  • Optimizing the matrix operations in the basis transformation to further close the speed gap with scalar quantization.

Summary updated

BibTeX
@inproceedings{zhang2024learning,
  author = {Xi Zhang and Xiaolin Wu},
  title = {{Learning Optimal Lattice Vector Quantizers for End-to-end Neural Image Compression}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2024},
  url = {https://openreview.net/forum?id=dLr4H7Uj4H},
}
Figure