Langevin Escape for Codebook Lloyd Traps
Implementation & benchmark of arXiv:2609.03405 — Semi-discrete quadratic Wasserstein energy and state-dependent Langevin exploration
Source paper: Semi-discrete quadratic Wasserstein energy and state-dependent Langevin exploration arXiv:2609.03405 ⓘ · analyzed Sep 4, 2026
AI-generated research hypothesis, automatically tested. Not peer-reviewed.
Idea description
Use state-dependent Langevin noise to perturb prototype or router-codebook optimization when balanced quantization reaches a poor stationary configuration. Retain the best-so-far state for deployment, allowing exploration to escape non-minimizing Lloyd fixed points without permanently corrupting the learned representation.
Formulas
Mathematical statement
The paper considers a Gaussian Euler chain for the semi-discrete energy $E(X)$, where $X\in\mathbb{R}^{Nd}$ concatenates all prototype coordinates, $h>0$ is the step size, $T(X)>0$ is a temperature rule, $\nabla E(X)$ is the vector of blocks $p_i(x_i-b_i)$, and $\xi_k\sim\mathcal N(0,I_{Nd})$. Its update is $X_{k+1}=X_k-h\nabla E(X_k)+\sqrt{2hT(X_k)}\xi_k$. The paper states that for every fixed Borel temperature rule bounded away from zero and sufficiently small step size, the chain is geometrically ergodic with a full-support invariant law. It also states that raw iterates do not converge, but the best-so-far energy converges almost surely to the global minimum and the running record approaches the global minimizer set. A practical feedback uses the observed energy gap: $E_{\mathrm{best},k}=\min_{j\leq k}E(X_j)$ and $T_k=T_{\min}+(T_{\max}-T_{\min})\sigma(\alpha(E_k-E_{\mathrm{best},k})/(E_{\mathrm{best},k}+\epsilon))$, where $T_{\min}>0$, $T_{\max}>T_{\min}$, $\alpha>0$, $\epsilon>0$, and $\sigma$ is the logistic function. The theorem motivates nonzero exploration and checkpointing, but the numerical temperature parameters must be tuned empirically.
Implementation notes
Apply this optimizer only to codebook or prototype parameters, not to all neural-network weights. At each outer step, obtain embeddings $z_b$, solve the approximate balanced Laguerre assignment using the dual-weight procedure above, compute the minibatch energy $E_k=B^{-1}\sum_b\|z_b-x_{a_b}\|^2/2$ with capacity correction, and form prototype gradients $g_{i,k}=p_i(x_i-b_i)$. Maintain $E_{\mathrm{best},k}=\min(E_{\mathrm{best},k-1},E_k)$ and calculate $q_k=(E_k-E_{\mathrm{best},k})/(|E_{\mathrm{best},k}|+\epsilon)$. Set $T_k=T_{\min}+(T_{\max}-T_{\min})\operatorname{sigmoid}(\alpha q_k)$. Draw independent $\xi_{i,k}\sim\mathcal N(0,I_d)$ and update each prototype by $x_{i,k+1}=x_{i,k}-h g_{i,k}+\sqrt{2hT_k}\xi_{i,k}$. If embeddings lie in a bounded domain, project prototypes into the same bounding box after the update. During joint encoder training, freeze encoder weights during exploration or perform one Langevin prototype step every 20 Adam steps. Always checkpoint the prototype set with the lowest validation or smoothed minibatch energy, because the paper explicitly distinguishes raw-iterate behavior from best-so-far convergence. The paper supplies the Euler structure and nonzero-temperature principle; $h$, $T_{\min}$, $T_{\max}$, and $\alpha$ are empirical. Test on a 32-code VQ-VAE on CIFAR-10 against Adam/Lloyd updates with equal prototype-update FLOPs. Compare best reconstruction error, final validation error, code usage entropy, dead-code frequency, and run-to-run variance. The desired signal is lower best-so-far quantization error and fewer collapsed-code runs, not convergence of the noisy iterates.
Verification
This idea has not been verified yet.
Verification happens in two stages: Stage 1 — a mechanism check on a toy system confirms the claimed mathematical phenomenon reproduces; Stage 2 — a benchmark implements the idea on a real (small) neural network task and compares it against a tuned baseline over 8 paired seeds with a permutation test.
Artifacts
Artifacts unavailable.