Abstract
This paper introduces a framework for learning discrete latent representations using lattices—structured grids of points in Euclidean space. By employing a technique called "dithering" and leveraging a mathematical result known as the "Crypto-Lemma," the authors demonstrate how to train discrete models using standard gradient descent. This approach effectively bridges the gap between the flexibility of continuous Gaussian Variational Autoencoders (VAEs) and the rigidity of discrete quantization methods like VQ-VAE.
Introduction
In representation learning, the goal is often to compress complex data, such as images or audio, into a lower-dimensional "latent space." Standard VAEs typically utilize continuous Gaussian distributions for this space because they are easy to optimize using the reparameterization trick. However, many real-world applications—including data compression, planning, and symbolic reasoning—inherently require discrete representations.
The primary challenge in discrete representation learning is that operations like rounding or quantization are non-differentiable. This makes them "invisible" to the gradient-based optimization techniques that power deep learning. While existing solutions like VQ-VAE or "Concrete" distributions exist, they often lack a strong theoretical connection to continuous models or the mathematical structure necessary for advanced algebraic operations between latent objects.
Methodology
The proposed framework utilizes Lattices as the latent alphabet. Lattices are regular arrangements of points in space, ranging from simple square grids ($\mathbb{Z}^n$) to more complex structures like the hexagonal $A_2$ or the 8-dimensional $E_8$ lattice.
Dithering and the Crypto-Lemma
To overcome the non-differentiability of quantization, the authors introduce a "dither"—a specific type of uniform noise $U$—which is added to the encoder output before the quantization step. A key mathematical foundation here is the Crypto-Lemma, which proves that the distribution of the resulting quantization error is identical to the distribution of the dither itself. This allows the model to maintain a differentiable path during training, as the noise effectively "smooths" the discrete jumps of the lattice.
Training Strategies
The paper outlines two distinct training strategies:
- Direct Lattice Training: The model is trained from scratch using a modified Evidence Lower Bound (ELBO) loss, where the representation cost is calculated using continuous densities despite the discrete nature of the final output.
- Gaussian Proxy: A standard Gaussian VAE is trained first, then mapped to a lattice by matching the second moments (variance) of the noise. This provides a convenient way to discretize existing continuous models.
Experimental Results
The researchers evaluated their approach on two classic image benchmarks: MNIST (handwritten digits) and OMNIGLOT (characters from 50 different alphabets). The models were tested across various configurations, including linear and gated nonlinear architectures.
Geometric Efficiency
A central finding is that the geometric properties of the lattice directly impact machine learning performance. Lattices with better "Normalized Second Moments" (NSM)—a measure of how efficiently they cover space—consistently yielded better results. Specifically, the $E_8$ lattice, famous in geometry for its incredible packing efficiency in 8 dimensions, outperformed simpler square and hexagonal lattices in terms of negative log-likelihood.
Performance and Speed
Lattice-based VAEs achieved test log-likelihoods comparable to state-of-the-art methods like VQ-VAE and Concrete VAEs. Furthermore, they were found to be computationally practical, with training times similar to standard VAEs. Unlike VQ-VAE, which uses deterministic quantization, these lattice models benefit from importance sampling during testing, leading to superior density estimation.
Discussion and Future Work
One of the most promising aspects of this work is the Group Property of lattices. Unlike arbitrary discrete sets, lattices are mathematical groups, meaning you can add or subtract latent points and remain within the lattice. This opens the door for "latent algebra," where symbolic reasoning (e.g., "King - Man + Woman = Queen") can be performed directly in a structured discrete space.
However, limitations remain. Scaling to very high-dimensional lattices, such as the 24-dimensional Leech Lattice, is computationally expensive because finding the "nearest neighbor" in such complex grids is difficult. Additionally, at very large hidden dimensions (e.g., 200), the lattice methods currently trail behind VQ-VAE, possibly due to inefficiencies in product lattice constructions. Future research will focus on implementing functional latent algebras and improving scaling for high-dimensional data.
Summary updated