E-Means Efficient Clustering Algorithm
- E-means is an optimization procedure to improve $k$-means clustering by using exponential moving averages (EMAs) of centroids and ensuring gradual updates.
- for quickly and effectively processing large, high dimensional datasets.
- E-Means combines various techniques like annealing, dead cluster revival, and finalization of centroids that can significantly reduces the number of data passes
e-means is a mini-batch optimization procedure for -means clustering that uses exponential moving averages (EMAs) of cluster counts and vector sums rather than conventional full-batch centroid recomputation or stochastic-gradient updates. Introduced for large, high-dimensional embedding datasets, it combines EMA centroid updates with cosine-annealed step sizes, dead-cluster revival, optional finalization procedures, and empirically fitted scaling laws for batch size and learning rate. The method is designed to reduce the number of data passes required to reach a specified clustering loss while retaining the squared-Euclidean -means objective (Bessa et al., 6 Nov 2026).
1. Terminology and scope
The designation “e-means” is not historically univocal. In the contemporary clustering literature, it denotes the EMA-based method introduced in “e-means: outperforming k-means (in one-tenth the epochs)” (Bessa et al., 6 Nov 2026). Earlier or unrelated works use similar terminology in different senses.
The 2012 paper “Reclassification formula that provides to surpass K-means method” does not formally call its method e-means. It introduces the Kh-method, an alternative to conventional -means based on an exact reclassification formula and iterative correction (Kharinov, 2012). The Kh-method retains the within-cluster squared-error objective but allows group reassignments and seeks partitions stable under permitted reclassifications.
In mathematical analysis of means, “e-mean” may be used descriptively for an expectation-of-means inequality,
whose validity for all positive random variables characterizes concavity of the representing function of a numerical mean (Gibilisco et al., 2016). Other papers use related terminology for extended means and invariant means, electronic teaching and learning resources, exponential multi-view fuzzy clustering, or ME-estimators based on e-statistics (Velychko, 2018, Pasteczka, 2022, Sinaga, 29 Mar 2025, Wang et al., 28 May 2026).
In clustering, therefore, e-means should be distinguished from:
- The Kh-method: an exact group-reclassification procedure for reducing -means error (Kharinov, 2012).
- E-MVFCM and EB-MVFCM: exponential multi-view fuzzy -means models whose exponential component modifies the distance transformation rather than defining an EMA optimizer (Sinaga, 29 Mar 2025).
- ECM: Early Exit Class Means, a neural-network inference mechanism based on intermediate-layer class centroids (Görmez et al., 2021).
- ME-estimation: point estimation by minimizing an e-statistic (Wang et al., 28 May 2026).
The remainder of this article uses e-means in its principal contemporary sense: the EMA-based mini-batch -means algorithm.
2. Objective and relation to -means
Given a dataset
and centroids , e-means optimizes the standard nearest-centroid mean-squared error,
where
The objective is the same as in ordinary -means. The difference lies in the optimization procedure.
Lloyd’s algorithm alternates between assigning every observation to its nearest centroid and replacing each centroid with the arithmetic mean of all points assigned to it. Each iteration requires a complete pass through the dataset. Classical mini-batch -means instead updates centroids using batches and step-size rules, including MacQueen’s sequential rule and Sculley’s scalable mini-batch method.
The e-means paper identifies several limitations of conventional mini-batch approaches:
- their final approximation error is often higher than Lloyd’s;
- step-size and batch-size parameters commonly require tuning;
- large-batch gradient updates can become unstable;
- clusters may become dead and receive no further assignments.
E-means retains mini-batch processing but maintains smoothed sufficient statistics for each cluster. Its centroid is always computed as a ratio of an exponentially averaged vector sum and an exponentially averaged count. This mean-preserving structure distinguishes it from unconstrained gradient displacement.
3. EMA centroid updates
For a mini-batch , let
be the number of assigned points in cluster , and let
be their vector sum.
E-means maintains two state variables for every cluster:
- : an exponentially averaged cluster count;
- : an exponentially averaged cluster sum.
For EMA decay , the update is
The centroid is then
Writing , the update can be interpreted as moving the centroid toward the current batch’s assigned-point mean through smoothed count and sum statistics. Because the centroid is represented as a weighted mean of accumulated assigned data, the method preserves a mean-like geometric structure. The paper contrasts this with SGD updates, which can move a centroid outside the convex hull represented by assigned points.
Initialization
The initial centroids are obtained by uniformly sampling points from the dataset. The associated statistics are initialized as
Consequently,
at initialization, while the small initial count makes the initialization’s statistical contribution negligible after real batches have been processed.
E-means does not use a separate Adam-style EMA bias correction such as division by . The consistent initialization of and makes the centroid ratio well-defined from the first update.
Update geometry
The EMA construction is intended to remain stable at large batch sizes. In the paper’s interpretation, gradient-based updates apply a displacement that need not preserve the convex-hull property of assigned observations, whereas the EMA centroid remains a smoothed mean. This geometric explanation is supported by the form of the update and by empirical comparisons, but the complete algorithm—with annealing, revival, and approximate assignment—does not have a general global-convergence proof.
4. Annealing, revival, and finalization
Cosine-annealed step size
E-means does not use a fixed EMA decay as its principal recipe. If is the number of epochs and the batch size, the total number of mini-batch updates is
The step size is
with
The high initial step permits rapid adaptation from a random initialization. The decreasing step stabilizes centroids as assignments become more reliable. Ablation results in the paper report that cosine annealing usually improves training MSE and often improves test MSE relative to a tuned fixed step, although its test-MSE effect can be neutral or slightly negative in some settings.
Dead-cluster revival
A cluster is checked for underuse every five batches. It is considered underused when
The underused cluster is revived by splitting a donor cluster. A donor is sampled with probability proportional to . The donor and the revived cluster receive slightly perturbed versions of the donor centroid:
where denotes elementwise multiplication and . The perturbation is at the machine-epsilon scale of BF16 in the reported implementation.
The statistics are reset consistently:
with the donor count split approximately in half.
In an ablation on DEEP with and , disabling revival increased training MSE by about and test MSE by . The reported dead-cluster proportions were approximately with revival, with resampling, and without revival.
Finalization
The EMA state used during optimization is not necessarily the best final representation for every evaluation criterion.
For training-loss minimization, e-means can record assignments from the final epoch and replace every centroid with the exact mean of its assigned points:
where is the set of points assigned to cluster . This does not increase the loss for those fixed assignments.
For out-of-sample performance, the method can use a second, slower EMA of counts and sums. Its half-life controls the degree of smoothing. The slower EMA can improve test MSE, particularly when is small, by trading some training-set fit for reduced overfitting.
5. Formulaic scaling laws
A central aim of e-means is to reduce dependence on hyperparameter sweeps. The authors fit empirical power laws in log space using optimization runs on the DEEP dataset and assess transfer to other datasets.
The peak step size is modeled as
with reported coefficients
Thus the reported rule is
According to the fitted relation, larger batch sizes require larger effective steps, whereas increasing or reduces the peak step. A larger epoch budget also leads to a modestly smaller peak step.
The batch-size law is
with
The batch size is rounded to the nearest power of two and capped at . For datasets with million, the paper reports using the batch-law prediction divided by $8$.
The batch law is based on a quality “knee”: the largest batch size whose validation MSE lies within of the best value on the batch-size curve. The reported held-out median excess MSE was . The fitted log-space models achieved approximately for the step law and for the batch law; the reported median held-out regret for the decay law was approximately .
These laws are empirical regressions rather than convergence theorems. Their validity was assessed on high-dimensional embedding workloads, and the paper identifies low-dimensional, very small, and low-intrinsic-dimensionality datasets as settings where they may be less reliable. The fitted laws do not include an explicit embedding-dimension term because attempts to fit one produced an unstable exponent.
6. Evaluation, performance, and limitations
Experimental domains
The principal evaluation covers image descriptors, image embeddings, text embeddings, and very large embedding collections. Datasets include SIFT, DEEP, SPACEV, SimSearchNet++, AG-News, ImageNet-CLIP, arXiv, and DINO10B. Their dimensions range from $96$ to $1024$, and dataset sizes range from approximately $0.75$ million to $10$ billion vectors.
The principal metric is held-out MSE,
The experiments compare e-means with Lloyd -means, greedy -means++, Faiss, Flash-KMeans, cuML, Sculley mini-batch -means, Staleness-Reduction, SuperKMeans, SGD, Adam, and SparseAdam. GPU experiments use H100 80-GB GPUs, while CPU experiments use a 64-core Xeon Platinum 8462Y+.
Reported convergence and speed
Across the main GPU comparisons, e-means reached the test MSE of Flash-KMeans at 25 iterations in approximately $1.4$–$2.6$ epochs. Reported GPU speedups range from approximately to , commonly summarized as $10$–.
For $1$ million points and clusters, the reported e-means epoch range was $1.4$–$2.4$, with speedups of $9.5$–. For $1$ billion points and clusters, it required $1.4$–$2.0$ epochs and achieved speedups of $21.2$–.
On eleven VIBE datasets, e-means required between $1.6$ and $2.6$ epochs to reach the Lloyd-at-25 reference, with GPU speedups of $8.0$– over Flash-KMeans and CPU speedups of $9.0$– over Faiss.
At five epochs, e-means achieved lower test MSE than Flash-KMeans at 25 iterations on all eight tabulated configurations. Against Flash-KMeans with greedy -means++ initialization, e-means still had lower mean error after five epochs in all eight configurations, although the advantage narrowed to approximately –.
For the full 10-billion-vector DINO10B dataset with approximately 16.7 million clusters, the reported exact-assignment comparison was:
- Lloyd at 25 epochs: GPU-hours on 64 machines;
- e-means at $2.5$ epochs: $779$ GPU-hours on 32 machines.
E-means exceeded Lloyd’s test loss in $2.5$ epochs. With approximate IVF assignment, it reached Lloyd’s test loss in approximately three to four epochs on one machine; one reported configuration required approximately $22.8$ GPU-hours.
These results are empirical and workload-dependent. They do not establish that e-means globally dominates Lloyd’s algorithm or -means++ on every dataset.
Failure modes and implementation constraints
The method remains subject to the computational cost of nearest-centroid assignment. Exact assignment requires approximately
work per batch and approximately
work over epochs. EMA updates require approximately work per batch when all centroid statistics are materialized. Memory is approximately for sums, for counts, and for batch storage.
Approximate IVF assignment can reduce assignment cost but introduces assignment noise. The paper reports that IVF may alter training MSE, while test MSE can sometimes improve through a regularization effect. Stale IVF indices can produce sawtooth loss curves and degrade final quality.
Other limitations include:
- Cluster imbalance: very small clusters provide unreliable EMA statistics.
- Low : finalization becomes more important when few observations support each cluster.
- Overfitting: training MSE may continue to decrease while test MSE increases.
- Scaling-law transfer: the fitted exponents may be suboptimal outside the high-dimensional embedding regime.
- Numerical precision: BF16, FP8, and INT8 assignment were evaluated, with FP32 EMA statistics; reported test-MSE differences were approximately within of BF16 in the tested configurations.
- No general convergence theorem: the full procedure combines nonconvex assignments, annealed EMA updates, revival, and optional approximate assignment.
E-means is therefore best characterized as an engineering and optimization method for fixed-data mini-batch -means at large scale. Its defining mechanism is the ratio of EMA cluster sums to EMA cluster counts; its practical system consists of annealing, dead-cluster revival, finalization, and formulaic parameter selection. The reported reductions in epochs, losses, and GPU time are substantial on the evaluated embedding workloads, while their generality depends on data distribution, cluster scale, dimensionality, assignment accuracy, and hardware implementation (Bessa et al., 6 Nov 2026).