Abstract
Lloyd's k-means algorithm is a long-running standard for clustering, with applications in data analysis, retrieval, quantization and data curation. In this paper, we introduce an exponential moving average optimization procedure for k-means with mini-batch updates, powered by modern deep learning machinery and new insights. We also establish scaling laws on how decay rate and batch size impact final performance. This gives us a formulaic rule to fix them for multiple problem sizes and embedding datasets, without the need for any hyperparameter sweep. The resulting clustering algorithm, coined e-means, is much faster than Lloyd k-means and converges to lower losses, frequently even beating k-means++. On a wide array of embeddings datasets, it beats the loss of Lloyd k-means at 25 epochs in 1.4 to 2.6 epochs, which translates to 10-45x GPU wall-clock speedups compared to state-of-the-art k-means implementations. As an example, e-means partitions DINO10B, a dataset of 10 billion DINO embeddings, into 16 million clusters in only 2.5 epochs, reaching a loss below Lloyd's at 25 epochs.
Community
I’m excited to open-source e-means: a modern, robust k-means algorithm developed at Meta FAIR. A replacement of Lloyd's algorithm, e-means delivers a ~10× speedup in both epochs and wall-clock time while achieving lower loss.
Try it in our browser demo : https://e-means.github.io/playground.html
Public release at : https://x.com/swann_bessa/status/2120200714630594911
I like that e-means uses an exponential moving average and gives a formula for decay rate and batch size, so no hyperparameter sweep is needed. Does that rule hold when the embeddings come from a very different model than the ones you tested?
This is an automated message from the Librarian Bot. I found the following papers similar to this paper.
The following papers were recommended by the Semantic Scholar API
- Beyond Data Schedule: Fast LLM Pretraining on Data Mixtures by Loss-Reweighting (2026)
- EvE: An Alternate Optimizer to Adam (2026)
- A Scaling Theory of Multi-Epoch Pretraining: Late-Time Overfitting and Ensembling (2026)
- Scaling Zero-Order Pretraining through Model Sharding (2026)
- GEM-KMeans: Memory-Efficient and Accurate Clustering on Massive Scale with GPU Optimization (2026)
- The Best Optimizer Depends on Batch Size (2026)
- Improving Data-Constrained Scaling with Hyperparameter Transfer and Ensembling (2026)
Please give a thumbs up to this comment if you found it helpful!
If you want recommendations for any Paper on Hugging Face checkout this Space
You can directly ask Librarian Bot for paper recommendations by tagging it in a comment: @librarian-bot recommend
Get this paper in your agent:
hf papers read 2611.09501 Don't have the latest CLI?
curl -LsSf https://hf.co/cli/install.sh | bash Models citing this paper 0
No model linking this paper
Datasets citing this paper 0
No dataset linking this paper
Spaces citing this paper 0
No Space linking this paper
Collections including this paper 0
No Collection including this paper