---
id: 18488
lang: en
title: "e-means clusters 10 billion embeddings into 16.7 million groups in under 3 hours on 8 GPUs"
published_at: "2026-11-27 22:25:31"
source_name: "TG: @gonzo_ML (gonzo-обзоры ML статей)"
source_url: "https://t.me/gonzo_ML/6277"
canonical_url: "https://news.hamidun.com/en/news/18488"
categories: ["research"]
publisher: "AI News by Jemal Hamidun (news.hamidun.com)"
---

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

> **Краткая суть (BLUF):** 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.  - Quality matches the exact GPU solver Flash-KMeans, but runs 9.5–45.5 times faster - Large batches beat full k-means in roughly two passes over the data - The 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.

---
- **Первоисточник:** [TG: @gonzo_ML (gonzo-обзоры ML статей)](https://t.me/gonzo_ML/6277)
- **Каноническая ссылка:** https://news.hamidun.com/en/news/18488
- **Экосистема автора:** [Бесплатный интенсив по вайбкодингу — предзапись в Нике](https://t.me/vibecodeguidebot?start=agent_intensive_news_md) · [Nomad AI](https://nomadnet.ai) · [Telegram @jemal_hamidun](https://t.me/jemal_hamidun)
