Online Clustered Codebook

Chuanxia Zheng, A. Vedaldi
2/14/2026

No official code found. Best implementation: lyndonzheng/CVQ-VAE (189 stars, MIT, last commit 2024-09-19).

Abstract

Vector Quantisation (VQ) is experiencing a comeback in machine learning, where it is increasingly used in representation learning. However, optimizing the codevectors in existing VQ-VAE is not entirely trivial. A problem is codebook collapse, where only a small subset of codevectors receive gradients useful for their optimisation, whereas a majority of them simply "dies off" and is never updated or used. This limits the effectiveness of VQ for learning larger codebooks in complex computer vision tasks that require high-capacity representations. In this paper, we present a simple alternative method for online codebook learning, Clustering VQ-VAE (CVQ-VAE). Our approach selects encoded features as anchors to update the "dead" codevectors, while optimising the codebooks which are alive via the original loss. This strategy brings unused codevectors closer in distribution to the encoded features, increasing the likelihood of being chosen and optimized. We extensively validate the generalization capability of our quantiser on various datasets, tasks (e.g. reconstruction and generation), and architectures (e.g. VQ-VAE, VQGAN, LDM). CVQ-VAE can be easily integrated into the existing models with just a few lines of code.

View on arXivView PDF

Code Implementations(1)

lyndonzheng/CVQ-VAECommunity100%
MIT

[ICCV 2023] Online Clustered Codebook

18913PythonJul 26, 20232 years agoMIT

Similar Papers

Cite this paper

@article{zheng2026online,
  title  = {Online Clustered Codebook},
  author = {Chuanxia Zheng and A. Vedaldi},
  year   = {2026},
  eprint = {2307.15139},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/pdf/2307.15139},
  journal = {ICCV 2023 2023}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2307.15139.svg)](https://codeofpaper.com/paper/2307.15139)

Discussion