Reliable Clustering and Quantization via Distortion-Constrained Optimal Transport

Tianhao Wu, Wei Zhang, Haoran Pang, Haoran Yang, Hao ShiNeurIPS 2026

TL;DR

Standard clustering and vector quantization methods optimize for global average error, allowing a few "garbage-can" clusters to absorb messy data and ruin local accuracy. This paper introduces Distortion-Constrained Optimal Transport (DCOT), a drop-in assignment module that enforces strict quality budgets on every individual cluster. By refusing to let bad assignments hide behind a good global average, DCOT improves image reconstruction, prevents codebook collapse, and sharpens large-scale search—all without changing surrounding neural architectures.

What Problem Does This Paper Address?

At the heart of representation learning, image generation (like VQ-VAEs), and massive search engines (Approximate Nearest Neighbor, or ANN, retrieval) lies a deceptively simple task: grouping data points around a small set of representative prototypes or "codewords."

Historically, most systems rely on $k$-means or its cousins, which minimize average assignment distortion—the overall average squared distance between data points and their assigned centers. The catch? Averages lie. You can achieve a respectable global average even if 95% of your clusters are tight and pristine while the remaining 5% are sprawling, high-error disasters. In image reconstruction, those few over-distorted codewords create glaring visual artifacts; in search engines, sloppy coarse partitions route queries down the wrong path entirely.

Recently, researchers turned to Optimal Transport (OT)—a mathematical framework for finding the cheapest way to move "mass" (data points) to "targets" (cluster centers)—for smoother, geometry-aware soft assignments. Yet standard OT still only minimizes total global cost, leaving individual cluster quality unregulated.

Methods

The authors propose Distortion-Constrained Optimal Transport (DCOT). While using entropic OT and Sinkhorn matrix scaling (a fast, standard iterative method for OT) as a foundation, what is new is adding an explicit per-cluster average-distortion budget ($\tau_j$) directly into the transport problem.

Instead of capping the distance of single points (which gets brittle in noisy minibatches), DCOT caps the average distance of all mass assigned to a specific cluster. A prototype can still claim an outlier, provided the rest of its assigned points sit close enough to keep the cluster's average error within budget.

To solve this efficiently at scale ($O(nk)$ complexity per step), the authors design an alternating optimization algorithm:

  1. Sinkhorn Scaling with Cost Inflation: When dual variables ($\lambda_j$) detect a cluster exceeding its distortion budget, $\lambda_j$ increases, acting as a "cost inflation factor" that makes sending distant points to that cluster exponentially more expensive.
  2. Lightweight Root-Finding: Because the cluster constraints are separable, updating each $\lambda_j$ reduces to solving a simple, monotone 1D equation via Newton's method.
  3. Center Updates: Cluster prototypes update via standard weighted least-squares.

Crucially, DCOT is a pure plug-in module: you swap out the nearest-neighbor or standard OT assignment step in an existing model and leave encoders, decoders, and loss functions untouched.

Datasets

No new benchmarks are introduced. The authors evaluate DCOT across established datasets spanning three tasks:

  • Image Reconstruction (Vector Quantization): MNIST, CIFAR-10, and ImageNet.
  • Clustering: A synthetic 2D Gaussian toy dataset with uniform outliers, MNIST (prototype clustering), and pretrained CIFAR-10 / CIFAR-10-LT features (in the appendix).
  • Large-Scale ANN Retrieval: GIST1M ($10^6$ database vectors and 1,000 queries).

Key Insights and Ideas

  • OT Alone Isn't the Magic Bullet: A natural suspicion is that DCOT works simply because soft Optimal Transport is better than hard $k$-means. The authors test this directly by ablating the distortion constraints. Unconstrained OT actually hurts performance in 5 out of 8 backbone settings, whereas DCOT improves all 8. The magic is genuinely in the per-cluster distortion cap.
Table 2: Ablation of per-cluster distortion constraints. We report reconstruction PSNR. Original denotes the unmodified backbone, while OT and DCOT replace its assignment module without and with distortion constraints, respectively.
  • Zero Codebook Collapse: In VQ-VAEs, scaling up codebook sizes or embedding dimensions notoriously causes "codebook collapse," where the network ignores most of its available codewords. Because DCOT balances mass and enforces local reliability, it achieves 100% codebook utilization across every tested capacity on CIFAR-10, whereas standard VQ-VAE utilization drops as low as 2.4%.
  • Harder Data Yields Bigger Gains: On simple datasets like MNIST, standard codewords are already reliable. As visual diversity explodes (from CIFAR-10 to ImageNet), standard methods increasingly mash incompatible image patches into single codewords, giving DCOT's local quality control much more room to shine.

Key Results

  • Drop-in VQ Gains: Plugging DCOT into four distinct VQ architectures (VQ-VAE, Rotation VQ, SimVQ, DCVQ) improves every metric across the board. On CIFAR-10 with SimVQ, PSNR jumps by +1.97 dB (30.45 to 32.42) and perceptual error (LPIPS) drops by more than half (0.0191 to 0.0080).
Table 1: Plug-in effect of DCOT on MNIST and CIFAR-10 reconstruction. DCOT(X) replaces only the assignment module of method X. Lower LPIPS is better.
  • ImageNet Reconstruction: Compared against OptVQ (a strong OT-based baseline), DCOT boosts ImageNet PSNR from 23.25 to 25.67, increases SSIM from 0.5917 to 0.6881, and lowers LPIPS from 0.2559 to 0.1751.
Table 3: Main reconstruction comparison on MNIST, CIFAR-10, and ImageNet.
  • Outlier Clustering & Search Routing: On the noisy 2D toy task, DCOT slashes worst-cluster distortion from 2.24 down to 1.23. When plugged into the SAQ retrieval pipeline on GIST1M (4,096 coarse clusters), DCOT boosts Recall@100 by ~1.7 percentage points at nprobe = 20, directly saving 850 ground-truth neighbors from being missed during coarse routing at nprobe = 120.

Limitations and Future Work

  • Hyperparameter Tuning: The distortion budgets ($\tau$) aren't completely free—they require lightweight tuning (selecting a dataset-level multiplier like 0.6 or 0.7 via validation). Setting a budget too tight can make the transport problem mathematically infeasible for fixed marginals, requiring warm starts and moderate tightening.
  • Future Directions: The authors highlight developing fully self-tuning, adaptive budget strategies, as well as extending DCOT beyond static cluster assignments to dynamic or task-adaptive settings.

Summary updated

Abstract

Clustering and vector quantization are core primitives for representation learning and large-scale retrieval, yet widely used methods often produce clusters or codewords of highly uneven quality, especially in noisy or heterogeneous data. In this paper, we propose a distortion-constrained optimal transport (DCOT) framework that explicitly enforces per-cluster bounds on the average assignment distortion, defined as the expected distance between data points and their assigned representatives, ensuring more consistent and reliable representations. Our formulation couples an optimal transport assignment objective with cluster-level distortion constraints to control cluster quality. To solve this constrained problem, we develop an efficient alternating optimization algorithm that iteratively updates transport plans, representatives (codewords), and dual variables. We further provide theoretical guarantees including entropic consistency, coordinate descent, and sublinear convergence. Importantly, DCOT serves as a plug-in assignment module that can be seamlessly integrated into a wide range of vector quantization methods. Replacing the assignment step with DCOT consistently improves reconstruction quality across diverse architectures and training settings, demonstrating strong robustness and general applicability.
BibTeX
@inproceedings{wu2026reliable,
  author = {Tianhao Wu and Wei Zhang and Haoran Pang and Haoran YANG and Hao Shi},
  title = {{Reliable Clustering and Quantization via Distortion-Constrained Optimal Transport}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2026},
  url = {https://openreview.net/forum?id=KBzmOm0ugU},
}
Figure