Preventing Local Pitfalls in Vector Quantization via Optimal Transport
Borui Zhang, Wenzhao Zheng, Jie Zhou, Jiwen Lu
TL;DR
The paper tackles training instability in vector-quantized networks by identifying local minima in code assignment as the root cause of index collapse. It reframes quantization as an optimal-transport problem between data features ${\bm{Z}}$ and codebook vectors ${\bm{C}}$, solved efficiently with the Sinkhorn-Knopp algorithm and a entropy-regularized objective that includes $H({\bm{A}})$ and a balance parameter $\epsilon$. To ensure robustness across diverse data, a simple normalization of the distance matrix is introduced, and a multi-head quantizer expands the effective codebook size to $n^B$, enabling richer discretization. Empirically, OptVQ achieves 100% codebook utilization, outperforms state-of-the-art VQNs on reconstruction tasks (e.g., ImageNet, MNIST, CIFAR-10), and demonstrates stable training without resorting to subtle initializations or distillation. This work highlights the practical value of global-structure-aware quantization for scalable, stable representation learning in generative and discriminative vision models.
Abstract
Vector-quantized networks (VQNs) have exhibited remarkable performance across various tasks, yet they are prone to training instability, which complicates the training process due to the necessity for techniques such as subtle initialization and model distillation. In this study, we identify the local minima issue as the primary cause of this instability. To address this, we integrate an optimal transport method in place of the nearest neighbor search to achieve a more globally informed assignment. We introduce OptVQ, a novel vector quantization method that employs the Sinkhorn algorithm to optimize the optimal transport problem, thereby enhancing the stability and efficiency of the training process. To mitigate the influence of diverse data distributions on the Sinkhorn algorithm, we implement a straightforward yet effective normalization strategy. Our comprehensive experiments on image reconstruction tasks demonstrate that OptVQ achieves 100% codebook utilization and surpasses current state-of-the-art VQNs in reconstruction quality.
