Free · Daily brief + weekly playbookDaily 60-sec AI Voice Brief + Weekly Production AI Agent PlaybookGet the brief →

e-means clusters 10 billion embeddings into 16.7 million groups in under 3 hours on 8 GPUs

To search across billions of embeddings, you split them into groups, and classic k-means spends days doing it because it rereads the entire dataset again and again. e-means takes small batches of data, moves the group centers smoothly, and splits overloaded groups. Clustering 10 billion vectors into 16.7 million groups took under three hours on a single server with 8 GPUs. For vector search, that makes it realistic to recompute clusters every time the data is updated.

AI-processed from TG: @gonzo_ML (gonzo-обзоры ML статей); edited by Hamidun News
e-means clusters 10 billion embeddings into 16.7 million groups in under 3 hours on 8 GPUs
Source: TG: @gonzo_ML (gonzo-обзоры ML статей). Collage: Hamidun News.
Listen to article
Article Fact Sheet & Key Figures
ParameterDetails
Primary sourceTG: @gonzo_ML (gonzo-обзоры ML статей) ↗
Editor-in-Chief
Key metric #1Quality matches the exact GPU solver Flash-KMeans, but runs 9.5–45.5 times faster
Key metric #2Large batches beat full k-means in roughly two passes over the data
Key metric #3The parameter formulas do not account for dimensionality, so at very large scales they have to be tuned by hand

Imagine you have 10 billion embeddings, the numerical "fingerprints" of texts, images, or documents, and you need to split them into 16.7 million groups. Such partitioning underlies fast vector search, RAG over huge corpora, and cleaning training datasets.

Classic k-means does this by scanning all the data many times and recomputing the center of each group on every pass. At this scale, that means days of cluster time. The researchers, whose code lives in the facebookresearch/faiss repository, proposed the e-means algorithm and showed that the same task can be solved in under three hours on a single server with 8 GPUs.

In addition, according to them, the usual trade-off disappears: fast versions of k-means typically lost quality, but here quality does not suffer.

How it works in plain terms

Imagine you need to sort a million books onto a thousand shelves, where the "center" of each shelf is an averaged book. Full k-means scans the whole library at every step, recalculates the centers, and repeats this many times. One pass over all the data is called an epoch. The mini-batch version looks only at a random handful of books and adjusts the centers based on them. This is fast, but the centers start jittering because of the random samples.

e-means has three techniques. The first is an exponential moving average: a shelf's center shifts toward new books gradually, and accumulated information is not erased instantly. According to the authors, this decaying average keeps the centers inside the convex hull of the real points, meaning a center cannot drift off into empty space outside the cloud of data. The second is cosine step decay: at first the centers move in broad strides, then more and more cautiously. The third is frequent cluster splitting: when one group is overloaded, a new one is split off from it, so the centers cover the data better.

To choose the batch size and decay rate, the authors derived empirical power laws, meaning formulas fitted to experimental results rather than strictly proven.

What the numbers show

On embedding benchmarks, e-means reaches the test error of the converged exact GPU solver Flash-KMeans (a fast GPU implementation of standard k-means) 9.5–45.5 times faster in wall-clock time. The gain comes from two sources: the algorithm needs fewer passes over the data, and the authors wrote custom kernels that run at low precision. The paper's title promises "ten times fewer epochs," and according to the description, large batches beat full k-means in roughly two passes.

The most striking figure concerns scale: 10 billion embeddings into 16.7 million groups takes under three hours on a single server with 8 GPUs, whereas it used to take days on a cluster. For teams building indexes for approximate search or balancing huge datasets, this changes the framing itself: clustering can be rerun on every data update rather than planned as a separate project.

Limitations and what to do

The authors themselves note some caveats. The parameter formulas do not account for vector dimensionality, and at extreme scales the values have to be replaced with manually tuned ones. So "set it and forget it" may not work on your data, and the parameters should be checked on a subsample. In addition, all comparisons come from the authors' own paper: there are no independent reproductions yet, and the 9.5–45.5x gain depends on the dataset and hardware.

The practical takeaway is simple. If you use faiss for clustering or training quantizers and are bottlenecked by time, the e-means code lives in the contrib section of the repository, and it is worth running it on your own embedding sample alongside your current solution. Compare not only time but also final error on held-out data, since that is the metric the authors use to claim parity with the exact solver. If parity holds, you get the same clustering noticeably cheaper. If it does not, you will need to tune the batch size and decay rate by hand, as the authors recommend for large scales.

Sources: arXiv paper (2611.09501), code in faiss/contrib/e_means, and the project site e-means.github.io.

Story

Key Questions Answered

How it works in plain terms?

Imagine you need to sort a million books onto a thousand shelves, where the "center" of each shelf is an averaged book. Full k-means scans the whole library at every step, recalculates the centers, and repeats this many times. One pass over all the data is called an epoch. The mini-batch version looks only at a random handful of books and adjusts the centers based on them. This is fast, but the centers start jittering because of the random samples. e-means has three techniques.

What the numbers show?

On embedding benchmarks, e-means reaches the test error of the converged exact GPU solver Flash-KMeans (a fast GPU implementation of standard k-means) 9.5–45.5 times faster in wall-clock time. The gain comes from two sources: the algorithm needs fewer passes over the data, and the authors wrote custom kernels that run at low precision. The paper's title promises "ten times fewer epochs," and according to the description, large batches beat full k-means in roughly two passes.

What are the key details on Limitations and what to do?

The authors themselves note some caveats. The parameter formulas do not account for vector dimensionality, and at extreme scales the values have to be replaced with manually tuned ones. So "set it and forget it" may not work on your data, and the parameters should be checked on a subsample. In addition, all comparisons come from the authors' own paper: there are no independent reproductions yet, and the 9.5–45.5x gain depends on the dataset and hardware. The practical takeaway is simple.

ZK
Zhemal Khamidun — Head of AI at Alpina Digital · MIPT (academic supervisor of the Tech Entrepreneurship department). Building AI products since 2019. Hamidun News is a pet project that grew into a production aggregator with 6,000+ readers.
✦ Unified AI Workspace · Nomad

Test Frontier LLMs & Autonomous Agents in One Workspace

Run Claude Opus 5.5, GPT-6, Gemini 3.1, and DeepSeek side-by-side in Nomad AI (nomadnet.ai) — unified model routing, deep research, and multimodal workflows under one subscription.

Try Nomad AI →Launch Nomad Agent
Jemal Hamidun

Editor-in-chief · Cite this analysis

Jemal Hamidun

Head of AI at Alpina Digital · Academic Supervisor of the Tech Entrepreneurship Department at MIPT

Head of AI & CPO of AlpinaGPT at Alpina Digital, Academic Lead of Tech Entrepreneurship at MIPT. Founder of Hamidun News and Vibe Academy.

Ready-to-paste citation for journalists, blogs and Telegram channels

Source: Hamidun News — e-means clusters 10 billion embeddings into 16.7 million groups in under 3 hours on 8 GPUs https://news.hamidun.com/en/news/18488/e-means-clusters-10-billion-embeddings-into-16-7-million-gro

What do you think?
Loading comments…