Papers
Topics
Authors
Recent
Search
2000 character limit reached

E-Means Efficient Clustering Algorithm

Updated 11 November 2026
  • 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 kk-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 kk-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 kk-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,

E[m(X,Y)]≤m(EX,EY),\mathbb E[m(X,Y)]\leq m(\mathbb E X,\mathbb E Y),

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 kk-means error (Kharinov, 2012).
  • E-MVFCM and EB-MVFCM: exponential multi-view fuzzy cc-means models whose exponential component modifies the distance transformation rather than defining an EMA optimizer (Sinaga, 29 Mar 2025).
  • E2^2CM: 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 kk-means algorithm.

2. Objective and relation to kk-means

Given a dataset

X={x1,x2,…,xn}⊂RdX=\{x_1,x_2,\ldots,x_n\}\subset\mathbb R^d

and kk centroids C=(c1,…,ck)\mathcal C=(c_1,\ldots,c_k), e-means optimizes the standard nearest-centroid mean-squared error,

MSE⁡(X,C)=1n∑i=1n∥xi−ca(i)∥2,\operatorname{MSE}(X,\mathcal C) = \frac{1}{n} \sum_{i=1}^{n} \left\|x_i-c_{a(i)}\right\|^2,

where

a(i)=arg⁡min⁡j∈{1,…,k}∥xi−cj∥2.a(i)=\arg\min_{j\in\{1,\ldots,k\}}\|x_i-c_j\|^2.

The objective is the same as in ordinary kk-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 kk-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 B\mathcal B, let

nj=∣{x∈B:a(x)=j}∣n_j= \left| \{x\in\mathcal B:a(x)=j\} \right|

be the number of assigned points in cluster jj, and let

sj=∑x∈Ba(x)=jxs_j= \sum_{\substack{x\in\mathcal B\\a(x)=j}}x

be their vector sum.

E-means maintains two state variables for every cluster:

  • Nj∈R+N_j\in\mathbb R_+: an exponentially averaged cluster count;
  • Sj∈RdS_j\in\mathbb R^d: an exponentially averaged cluster sum.

For EMA decay γ∈[0,1)\gamma\in[0,1), the update is

Nj←γNj+(1−γ)nj,N_j\leftarrow \gamma N_j+(1-\gamma)n_j,

Sj←γSj+(1−γ)sj.S_j\leftarrow \gamma S_j+(1-\gamma)s_j.

The centroid is then

cj=SjNj.c_j=\frac{S_j}{N_j}.

Writing α=1−γ\alpha=1-\gamma, 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 cj(0)c_j^{(0)} are obtained by uniformly sampling kk points from the dataset. The associated statistics are initialized as

Nj=10−10,Sj=Njcj(0).N_j=10^{-10}, \qquad S_j=N_jc_j^{(0)}.

Consequently,

SjNj=cj(0)\frac{S_j}{N_j}=c_j^{(0)}

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 1−γt1-\gamma^t. The consistent initialization of SjS_j and NjN_j 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 TT is the number of epochs and BB the batch size, the total number of mini-batch updates is

M=T⌊nB⌋.M=T\left\lfloor\frac{n}{B}\right\rfloor.

The step size is

α(t)=α0(ε+(1−ε)12(1+cos⁡(πtM))),ε=0.1,\alpha(t) = \alpha_0 \left( \varepsilon+ (1-\varepsilon) \frac12 \left( 1+\cos\left(\frac{\pi t}{M}\right) \right) \right), \qquad \varepsilon=0.1,

with

γ(t)=1−α(t).\gamma(t)=1-\alpha(t).

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

Nj<τ1k∑i=1kNi,τ=0.1.N_j< \tau\frac1k\sum_{i=1}^{k}N_i, \qquad \tau=0.1.

The underused cluster is revived by splitting a donor cluster. A donor j′j' is sampled with probability proportional to Nj′N_{j'}. The donor and the revived cluster receive slightly perturbed versions of the donor centroid:

cj:=cj′⊙[1+δ,1−δ,1+δ,…],c_j:=c_{j'}\odot[1+\delta,1-\delta,1+\delta,\ldots],

cj′:=cj′⊙[1−δ,1+δ,1−δ,…],c_{j'}:=c_{j'}\odot[1-\delta,1+\delta,1-\delta,\ldots],

where ⊙\odot denotes elementwise multiplication and δ≪1\delta\ll1. The perturbation is at the machine-epsilon scale of BF16 in the reported implementation.

The statistics are reset consistently:

Sj=cjNj,Sj′=cj′Nj′,S_j=c_jN_j, \qquad S_{j'}=c_{j'}N_{j'},

with the donor count split approximately in half.

In an ablation on DEEP with n=106n=10^6 and k=16,384k=16{,}384, disabling revival increased training MSE by about 2.97%2.97\% and test MSE by 2.24%2.24\%. The reported dead-cluster proportions were approximately 0.3%0.3\% with revival, 14.3%14.3\% with resampling, and 26.3%26.3\% 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:

cj=1∣Aj∣∑i∈Ajxi,c_j= \frac{1}{|A_j|} \sum_{i\in A_j}x_i,

where AjA_j is the set of points assigned to cluster jj. 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 n/kn/k 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

α0=min⁡(ackakBaBnanTaT,1),\alpha_0 = \min\left( a_c k^{a_k}B^{a_B}n^{a_n}T^{a_T}, 1 \right),

with reported coefficients

ac=0.824,ak=−0.46,aB=0.90,an=−0.45,aT=−0.11.a_c=0.824,\qquad a_k=-0.46,\qquad a_B=0.90,\qquad a_n=-0.45,\qquad a_T=-0.11.

Thus the reported rule is

α0=min⁡(0.824 k−0.46B0.90n−0.45T−0.11,1).\alpha_0= \min\left( 0.824\,k^{-0.46}B^{0.90}n^{-0.45}T^{-0.11}, 1 \right).

According to the fitted relation, larger batch sizes require larger effective steps, whereas increasing kk or nn reduces the peak step. A larger epoch budget also leads to a modestly smaller peak step.

The batch-size law is

B=cBkbknbnTbT,B=c_B k^{b_k}n^{b_n}T^{b_T},

with

cB=0.035,bk=0.13,bn=0.88,bT=0.81.c_B=0.035,\qquad b_k=0.13,\qquad b_n=0.88,\qquad b_T=0.81.

The batch size is rounded to the nearest power of two and capped at nn. For datasets with n>2n>2 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 0.2%0.2\% of the best value on the batch-size curve. The reported held-out median excess MSE was 0.19%0.19\%. The fitted log-space models achieved approximately R2=0.95R^2=0.95 for the step law and R2=0.96R^2=0.96 for the batch law; the reported median held-out regret for the decay law was approximately 0.07%0.07\%.

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,

MSE⁡(X,C)=1n∑i∥xi−ca(i)∥2.\operatorname{MSE}(X,\mathcal C) = \frac1n \sum_i \|x_i-c_{a(i)}\|^2.

The experiments compare e-means with Lloyd kk-means, greedy kk-means++, Faiss, Flash-KMeans, cuML, Sculley mini-batch kk-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 9.5×9.5\times to 45.5×45.5\times, commonly summarized as $10$–45×45\times.

For $1$ million points and 16,38416{,}384 clusters, the reported e-means epoch range was $1.4$–$2.4$, with speedups of $9.5$–12.9×12.9\times. For $1$ billion points and 1,048,5761{,}048{,}576 clusters, it required $1.4$–$2.0$ epochs and achieved speedups of $21.2$–45.5×45.5\times.

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$–22.8×22.8\times over Flash-KMeans and CPU speedups of $9.0$–15.0×15.0\times 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 kk-means++ initialization, e-means still had lower mean error after five epochs in all eight configurations, although the advantage narrowed to approximately 0.06%0.06\%–0.33%0.33\%.

For the full 10-billion-vector DINO10B dataset with approximately 16.7 million clusters, the reported exact-assignment comparison was:

  • Lloyd at 25 epochs: 6,7846{,}784 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 kk-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

O(Bkd)O(Bkd)

work per batch and approximately

O(Tnkd)O(Tnkd)

work over TT epochs. EMA updates require approximately O(kd)O(kd) work per batch when all centroid statistics are materialized. Memory is approximately O(kd)O(kd) for sums, O(k)O(k) for counts, and O(Bd)O(Bd) 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 n/kn/k: 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 0.13%0.13\% 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 kk-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).

Topic to Video (Beta)

No one has generated a video about this topic yet.

Whiteboard

No one has generated a whiteboard explanation for this topic yet.

Follow Topic

Get notified by email when new papers are published related to e-means.