Meta FAIR introduces e-means: a clustering algorithm that outperforms k-means
Meta FAIR introduces e-means: a clustering algorithm that outperforms k-means
Meta FAIR's e-means reaches classic k-means quality in 1.4–2.6 epochs and accelerates large-scale vector clustering, reducing GPU costs for RAG and vector search.
Meta FAIR has introduced e-means, a clustering algorithm that reaches the quality of classic k-means in just 1.4–2.6 epochs and significantly speeds up work with large vector databases.
k-means remains one of the most widely used ML algorithms: vector search, RAG, embedding clustering, dataset cleaning and balancing, weight and KV-cache quantization, codebook creation for image and audio tokens, data analysis, and anomaly detection. However, on billions of vectors, each full k-means pass is very expensive.
The authors propose updating cluster centers with an exponential moving average over batches. For each cluster, the algorithm stores the number of points and their sum; with each new batch, these values are updated so that recent data has more weight while older data is gradually forgotten. The cluster center remains the ordinary mean — the sum divided by the number of points.
As a result, centers start moving after the first batches instead of after a full pass over the data. Batch size and update step are computed using ready-made formulas, so no hyperparameters need to be tuned manually.
In the end, e-means reaches classic k-means quality much faster and even with slightly lower loss. In the largest test — 10 billion embeddings and 16 million clusters — it used almost 9 times fewer GPU-hours.
This is especially important for RAG systems on huge databases, where index construction can require thousands of GPU hours.
Why it matters
AnalysisFaster clustering can reduce the cost of building indexes for large RAG systems and other AI workloads that rely on embedding clusters.
Discuss in community
Share your questions and insights with developers
Related in Ecosystem
Practical guides, core terminology, and agent skills
Metadata Filtering in RAG
A technique for combined searching in vector databases (Self-Querying Retriever). It allows for the integration of semantic search by meaning with strict database filters based on metadata: publication date, document author, access level, language, or company department.
Meta Llama (The Premier Open Standard for Artificial Intelligence)
The flagship series of open language models from Meta (Llama 3, 3.3). Available for free download, modification, and local deployment on personal servers without restrictions or censorship.
Jev and System One AI: A Complete Practical Guide to the Decision Model from TypeSafe
A deep engineering breakdown of the flagship Jev model: System One architecture versus LLMs, Choice/Score/Noul primitives, request parallelism, confidence mathematics, video use cases, code, and an overview of local open-weight alternatives (Laya, GLiNER2.5, CLM-8B).
DeepSeek open-sources part of its chat interface
DeepSeek has released the source code for a portion of its chat UI, including web search, deep thinking, and conversation history features.