← Back to BLACKWIRE GHOST BUREAU ALGORITHM ADVANCES Graph comparing epoch count and wall‑clock time for e‑means versus Lloyd's k‑means

e‑means reaches lower loss in 1.2–3 epochs, while Lloyd's algorithm needs 20–50 iterations.

E-MEANS SLASHES K-MEANS TRAINING TIME BY TENFOLD WITH LOWER LOSS

*e-means delivers 10–45× GPU speedups and 8–15× CPU gains while beating Lloyd's loss in as few as 1.2 epochs. The method eliminates hyper‑parameter tuning through scaling‑law driven batch and step sizes.*

By GHOST Bureau - BLACKWIRE  |  November 10, 2026, 04:00 CET  |  e-means, k-means, clustering, GPU acceleration, machine learning

A new clustering algorithm called e‑means is reshaping how practitioners run k‑means. The method claims ten‑fold GPU speedups and up to fifteen‑fold CPU gains while delivering lower test loss than the classic Lloyd implementation. In a benchmark of 100,000 points split into 200 clusters, e‑means reaches Lloyd's loss ceiling in just 1.2 to 3 epochs, a stark contrast to Lloyd's typical 20‑50 passes. The breakthrough hinges on mini‑batch exponential moving averages, automatic scaling‑law driven hyper‑parameters, and fused GPU kernels that eliminate the epoch‑level overhead of full‑batch updates. The result is a lean, high‑throughput clustering engine that promises to cut training time dramatically without sacrificing quality.

What makes e-means faster than traditional Lloyd?

e-means replaces Lloyd's full‑batch update with mini‑batch exponential moving averages. Each mini‑batch updates every cluster's count and sum, then computes the centroid as their ratio. The update rule S_j←(1‑α)S_j+αs_j and N_j←(1‑α)N_j+αn_j forgets older assignments at rate α, letting the centroid track recent data. Lloyd performs one full pass per epoch; e-means runs 97 updates per epoch. Specialized GPU kernels fuse nearest‑centroid assignment, turning the algorithmic advantage into wall‑clock speedups. Across a range of scales, e-means reaches a test loss below Lloyd's at 25 epochs, but does so in just 1.2 to 3 epochs.

How does e-means avoid hyper‑parameter tuning?

The project derives batch size and step size directly from scaling laws based on log n, log k, and log T. No manual tuning is required. The system also adds a cosine‑scheduled decay for the step α, moving from α₀ to 0.1 as training progresses. Dead‑cluster revival splits large clusters to replace clusters that fall below a size threshold. A finalization stage computes each cluster's exact last‑epoch mean, shaving loss with negligible extra runtime. All these components are baked into the algorithm, delivering consistent performance without user‑level adjustments.

e‑means delivers ten‑fold speedups while beating Lloyd's loss in a fraction of the epochs.

What are the real‑world performance gains?

Measured end‑to‑end on a synthetic set of 100,000 points clustered into 200 groups, e-means cuts wall‑clock time by 10–45× on GPU against Flash‑KMeans and 8–15× on CPU against Faiss. The test loss drops below Lloyd's after just 1.2 to 3 epochs, compared with Lloyd's typical 20‑50 iterations. The method maintains or improves clustering quality while delivering an order‑of‑magnitude reduction in epochs and runtime.

Why does e-means matter for the broader ML ecosystem?

k‑means remains one of the few static‑dataset problems still solved with full‑batch optimization. By marrying modern deep‑learning tools—exponential moving averages, scaling‑law driven hyper‑parameters, and fused GPU kernels—e-means shows that mini‑batch approaches can dominate legacy methods. The project builds on earlier Meta FAIR work that used gradient descent for mini‑batch k‑means, but finds exponential moving averages far more efficient for static data. The result is a drop‑in replacement that accelerates pipelines in data mining, computer vision, and any domain relying on rapid, high‑quality clustering.

Frequently asked questions

How many epochs does e-means need to beat Lloyd's loss?

e-means reaches a test loss below Lloyd's at 25 epochs, but does so in just 1.2 to 3 epochs.

What speedup does e-means achieve on GPU versus Flash‑KMeans?

Measured end‑to‑end, e-means provides a 10–45× wall‑clock reduction on GPU against Flash‑KMeans.

Does e-means require hyper‑parameter tuning?

No. e-means automatically sets batch size and step size using scaling laws, eliminating manual hyper‑parameter tuning.

The e‑means advance proves that legacy clustering can be overhauled with modern optimization tricks. By erasing the need for manual tuning and exploiting hardware‑friendly kernels, it forces the community to rethink the default reliance on full‑batch Lloyd. Expect rapid adoption in any pipeline where clustering speed and accuracy are mission‑critical.

Sources: Hacker News article "E-means: Outperforming k-means in one-tenth the epochs" (https://e-means.github.io/)