# e-means

> Mini-batch EMA clustering algorithm outperforming Lloyd's k-means in fewer epochs

e-means is a clustering algorithm developed by Meta FAIR that applies exponential moving average (EMA) mini-batch updates to classical vector quantization. It reaches lower mean squared error than standard Lloyd k-means in roughly 1.4 to 2.6 epochs instead of 25, yielding 10x to 45x wall-clock GPU speedups without manual hyperparameter sweeps.

Website: https://arxiv.org/html/2611.09501

## What it is for

- Cluster massive embedding datasets for retrieval and vector search indexing
- Quantize vector databases and build inverted file (IVF) indexes in Faiss
- Compress and sparsify key-value attention caches in large language models
- Curate and deduplicate web-scale image or text feature datasets

## Features

- Exponential moving average centroid updates using mini-batches
- Automatic hyperparameter selection via empirically fitted scaling laws
- Dead cluster revival mechanism to prevent unassigned centroids
- Decaying cosine learning rate schedule tailored for fixed dataset clustering
- Finalization pass optimizing for either training MSE or out-of-sample test error
- Integration into the open-source Faiss library

## Pricing

Open source

## Details

- Type: Article or course
- Category: [AI](https://xiry.app/topics/ai.md)
- Open source: yes
- Platforms: Code library, Linux
- For: Machine learning engineers and researchers working with large-scale vector embeddings and indexing
- Alternative to: scikit-learn MiniBatchKMeans, Lloyd's k-means (Faiss-GPU), Flash-KMeans
- Tags: clustering, k means, faiss, embeddings, vector database, meta fair

## Why it was saved

- [@betterstackhq, 14 November 2026](https://www.instagram.com/p/DftV4WBRw-m/): It achieves better clustering quality in as few as 1.4 to 2.5 passes compared to 25 passes for traditional k-means, speeding up clustering by 10x to 45x on GPUs.

## Related

- [8 Ways to Improve RAG Applications](https://xiry.app/resources/8-ways-to-improve-rag-applications): Practical architectural strategies to fix common failure modes in RAG systems (Tip, Free)
- [CLaRa: Bridging Retrieval and Generation with Continuous Latent Reasoning](https://xiry.app/resources/clara-bridging-retrieval-and-generation-with-continuous-late): RAG framework using continuous latent reasoning and embedding-based context compression (Article or course, Free)
- [Custom RAG Pipeline over Apple Notes](https://xiry.app/resources/custom-rag-pipeline-over-apple-notes): RAG architecture for chatting with local Apple Notes via DeepSeek (Tip, Free)
- [Movie Vector Map](https://xiry.app/resources/movie-vector-map): Interactive 2D vector embedding map of over 36,000 movies. (Web app, Free)

Updated 14 November 2026. Page: https://xiry.app/resources/e-means

Make your own library: Xiry for Mac makes your saved Instagram reels and liked tweets searchable and pulls the useful stuff out, like this library. It's invite-only for now; request an invite at https://xiry.app/mac/download.
