SuperEMeans: Making e-means 3× faster lkuffo.com · 17 points · 0 comments · HN t...

@best

SuperEMeans: Making e-means 3× faster lkuffo.com · 17 points · 0 comments · HN thread

TL;DR The author's team extends their SuperKMeans library to SuperEMeans, combining dimension pruning with the e-means mini-batch clustering algorithm. On 5M OpenAI and 10M Cohere vectors, it runs clustering up to about 3× faster than e-means at comparable search recall, with the code open-sourced on GitHub.

  • e-means promises Lloyd's-level clustering quality in 2 epochs instead of the usual 10; SuperKMeans speeds up Lloyd's by 2-10× by avoiding scanning vector dimensions.
  • On OpenAI 5M 1536-d vectors at 2 epochs, SuperEMeans took 128 s versus 203 s for e-means and 985 s for Lloyd's 10-iteration k-means, with recall@100 of 0.967 at 1% probed centroids.
  • On Cohere 10M 1024-d vectors, SuperEMeans took 295 s versus 526 s for e-means and 2504 s for Lloyd's, but e-means scanned about 8% more vectors for the same recall.
  • The extra scanning comes from cluster imbalance caused by mini-batch updates; raising e-means' revival threshold from 0.1 to 0.3 brought scan cost closer to Lloyd's on Cohere.
  • At 5 epochs, SuperEMeans was 3× to 3.2× faster than e-means (436 s vs 1283 s on Cohere; 162 s vs 513 s on OpenAI) with unchanged recall.
  • Hierarchical k-means did not combine well with e-means, which the author suspects is related to how cluster revival works.

Discussion No comments have been posted yet, so there is no thread to summarize. The post has 17 points on Hacker News, which suggests modest interest from readers.

#clustering #vectorSearch #kmeans #embeddings #benchmarks