top of page

o-means vs k-means: Speed Gain Shrinks at Matched Error

Writer: Salil Trehan
Salil Trehan
Nov 15
17 min read

Updated: Nov 16

Short answer. In this o-means vs k-means test, I ran the released o-means, a GPU k-means trainer from Owlgebra AI, on Modal GPUs and compared it with e-means, the trainer it builds on. On SIFT with 16,384 centroids (400,000 rows, 128 dimensions, one A10G, 3 seeds, equal epochs, the authors' default settings) o-means was about 2.4 times faster than e-means at the same number of epochs, and held-out error was within seed noise after the first epoch. That 2.4 times is not a same-quality speedup: e-means reaches its best error at about 2 epochs, and at the best error both methods reach, o-means was about 1.0 times as fast (computed, 5 seeds, interpolated). Held-out error here is the mean squared distance from held-out vectors, rows never used for training, to their exact nearest centroid, and lower is better. Speedups are computed ratios of measured wall times. On a hard synthetic mixture with 16,384 centroids (A100, 3 seeds, equal epochs) it was 2.3 to 2.4 times faster at 3 and 5 epochs, but its error was 4.5 to 6.3% worse from 2 epochs on. At 4,096 centroids on that mixture it gave no speedup (0.72 to 1.09 times). On SIFT at 4,096 centroids the released code also crashed in one kernel on 2 of 3 GPUs, with one seed per cell and the cause not isolated. The authors' own 4.49 times is a different measurement: matched error, an RTX 5090, eight datasets. I did not measure search recall for any method.


TL;DR


  • On SIFT, 16,384 centroids, one A10G, 3 seeds, equal epochs: about 2.4x faster than e-means (computed from measured wall times), error within seed noise after epoch 1. At matched error (5 seeds, computed) the gain is about 1.0x at the best error both reach.

  • On a synthetic hard mixture, 16,384 centroids, A100, 3 seeds, equal epochs: 2.3 to 2.4x faster at 3 and 5 epochs, error 4.5 to 6.3% worse from 2 epochs. At matched error: 1.3 to 2.0x (computed), and o-means never reaches e-means 8-epoch error.

  • At 4,096 centroids on that mixture: 0.72 to 1.09x, no gain. Search recall not measured.


Short on time? Jump to the decision flow near the end of the post.


Terms. The held-out set is 20,000 rows taken from the same source after the 400,000 training rows (SIFT train split, or my generator), so training and held-out rows are disjoint. The error values are unitless squared distances in each dataset's own scale (for example 43,418 on SIFT and about 100 to 135 on my synthetic mixture), so only comparisons between methods on the same data mean anything. e-means is the k-means trainer from the e-means paper (Bessa et al.) that keeps centroids as an exponential moving average over batches and, by default, finds each row's nearest centroid by brute force. nlist is the number of cells the centroids are grouped into, and nprobe is how many of the nearest cells each row searches (the same two settings as in my IVF vs HNSW benchmark on 200,000 SIFT vectors, where IVF runs k-means into nlist cells and scans nprobe lists). Two-level assignment means a row first scores the cell centres and then scans only the centroids in its nprobe nearest cells, so it is approximate: the true nearest centroid can sit in a cell that was not probed. Split links, as I read them in the o-means code, make a row also check the split child and grandchild of its winning centroid, the centroids created when under-used centroids are revived by splitting. The recency-weighted closing mean is the final averaging step o-means uses for runs under 2 epochs, which weights the most recent batches more heavily (README).


Two bar charts comparing the released o-means with e-means on SIFT with 16,384 centroids. Left: o-means is 2.32x, 2.45x, 2.39x and 2.41x faster at 1, 2, 3 and 5 epochs. Right: held-out error differs by -0.63%, +0.13%, +0.05% and -0.01%.
Figure 1. On SIFT with 16,384 centroids, the released o-means ran about 2.4 times faster than e-means at every equal epoch budget, with held-out error within seed noise after the first epoch (at matched error the gain is smaller, see below). SIFT subset n=400k, d=128, k=16,384, NVIDIA A10G, 3 seeds, warmed up, nlist 128, nprobe 16, equal epochs.

What I ran. The o-means code is by Bajaj, Nupur and Garg at Owlgebra AI (blog post dated Nov 12 2026, paper listed as coming soon), MIT licensed, in the owlgebra-ai/faiss repository under contrib/o_means. I read the code first and ran it only inside Modal containers, on an A10G, an L40S, an A100 80GB PCIe and an A100 SXM4, with torch 2.8.0+cu128 and Triton 3.4.0. The baseline is the faiss GPU e-means (Emeans) from faiss-cpu 1.16.0. In the authors' words, o-means is the e-means loop with approximate two-level nearest-centroid assignment turned on by default, plus early cell rebuilds, split links, a recency-weighted closing mean and FP16 Triton kernels. It needs a CUDA float32 tensor, Triton and compute capability 8.0 or higher, and has no CPU path. Separately, I built a CPU analogue of the two-level idea on a Mac mini; it is always labelled analogue below and is not o-means.


How much faster is o-means at 16,384 centroids on SIFT?

About 2.4 times faster than e-means at every epoch budget from 1 to 5, with error unchanged after the first epoch. This is my measurement of the released o-means on one A10G (24 GB), on a 400,000-row SIFT subset with 128 dimensions and 16,384 centroids, 3 seeds, equal epochs for both methods, and the authors' default nlist 128 and nprobe 16. Both methods ran after a warm-up at full size, and the times exclude Triton compile time. The speedup column is computed from measured wall times per seed, so it need not equal the ratio of the rounded means. The error column is o-means minus e-means in held-out error as a percentage of e-means, so a negative number means o-means was better.


Epochs

Wall s (e-means / o-means), measured

Speedup, computed (min to max)

Error, o-means vs e-means (sd)

1

0.064 / 0.027

2.32x (2.13 to 2.66)

-0.63% (0.06)

2

0.097 / 0.039

2.45x (2.39 to 2.52)

+0.13% (0.14)

3

0.133 / 0.056

2.39x (2.36 to 2.43)

+0.05% (0.07)

5

0.218 / 0.090

2.41x (2.40 to 2.43)

-0.01% (0.13)


Caveats. This is an equal-epoch comparison, not matched error; the next section gives the matched-error numbers. The runs lasted 0.03 to 0.2 seconds, so the seconds are noisy while the ratios were steadier, and I do not know whether 2.4x holds on minutes-long jobs.


The one-epoch advantage

At 1 epoch o-means had 0.63% lower error (sd 0.06). That fits the recency-weighted closing mean the authors describe for runs under 2 epochs, but I did not run an ablation, so I do not claim it as the cause. Above 1 epoch the difference is inside seed noise.


The discarded cold-start run

My first GPU run had no warm-up and showed compile artefacts at 1 and 2 epochs. I discarded it and re-ran with a warm-up at full size per epoch budget. The discarded file, gpu_sift_k16384_A10G.csv, is kept for the record.


At matched error

At the best error both methods reach on SIFT with 16,384 centroids, o-means was about 1.0 times as fast as e-means; the 2.4 times above is an equal-epoch figure. Setup: one A10G, 5 seeds, e-means run on a finer epoch grid, author-default nlist and nprobe. e-means plateaus at about 43,325 held-out error from 2 epochs (0.097 s). o-means reaches that error at 5 epochs (43,324, 0.093 s). All speedups below are computed by interpolation from the measured error and time curves, not measured directly.


Setting

o-means budget

Matched-error speedup, computed

Error vs e-means plateau

SIFT, 16,384 centroids, A10G

5 epochs

about 1.0x

43,324 vs 43,325

SIFT, 16,384 centroids, A10G

2 epochs

about 2.2x

about 0.14% worse

SIFT, 16,384 centroids, A10G

3 epochs

about 1.6x

within noise

Hard mixture, 16,384 centroids, A100 80GB

2 to 8 epochs

1.3x to 2.0x

never reaches e-means 8-epoch error (111.7 vs 106.1)


Caveats. The SIFT 2.2x and 1.6x rows buy speed with a small error cost (0.14% at 2 epochs), so they are a trade, not a free gain. The hard mixture figure is a range over o-means budgets, and its error gap stays open: 111.7 against 106.1 is 5.2% worse (computed from the unrounded means) at e-means 8 epochs. The seconds are 0.09 to 0.1 s, so the ratios are noisy at this scale. Different seeds (5 here, 3 above) and a finer e-means grid explain why these numbers differ from the equal-epoch tables.


What does the speedup cost on a hard mixture?

On 16,384 tight clusters the error gap is 4.5 to 6.3% from 2 epochs and grows with epochs. The data is my own synthetic generator in common.py, a 16,384-mode mixture with 400,000 rows and 96 dimensions. I built it to be hard for the shortcut: with 16,384 tight modes, a missed nearest cell costs more error than on SIFT. That is my explanation for the gap, and I did not test it. I ran it on an A100 80GB PCIe with 3 seeds, equal epochs and the authors' default nlist and nprobe. The speedup held, and the accuracy cost came with it.


Two line charts on a synthetic hard mixture. At 16,384 centroids o-means speedup rises from 1.50x to 2.36x over 1 to 5 epochs while its error above e-means rises from 2.1% to 6.3%. At 4,096 centroids speedup stays between 0.72x and 1.09x and error stays under 0.5%.
Figure 2. On data with many tight clusters the two-level shortcut still pays at 16,384 centroids but costs accuracy, and at 4,096 centroids it gives no speedup. Synthetic 16,384-mode mixture, n=400k, d=96, NVIDIA A100 80GB PCIe, 3 seeds, equal epochs, author-default nlist and nprobe.

Epochs

Speedup, computed, at 16,384 centroids

Error gap at 16,384 centroids

1

1.50x

+2.1%

2

2.14x

+4.5%

3

2.26x

+5.1%

5

2.36x

+6.3%


The error gap is o-means minus e-means held-out error as a percent of e-means error. The 2-epoch row is my own computation from the per-seed rows of gpu_hard_A100.csv (mean of per-seed ratios; the speedup ranged 2.10 to 2.18 across seeds, and the error gap 4.4 to 4.6%), and it was checked by hand, not taken from the RESULTS.md table. The other rows are from RESULTS.md. Seed sd of the error gap was 0.14 to 0.62 points. The README's own synthetic stress case reports +1.2 to 1.7% over e-means at equal epochs (authors' claim: 65,536 modes, d=96, k=16,384, default nprobe). My gap is larger on a different generator, so I do not read it as contradicting theirs. Wall times were 0.02 to 0.1 s, excluded Triton compile, and are noisy at that scale. All 48 of 48 jobs in this grid ran without failure.


Does o-means help at 4,096 centroids? Not on what I measured.

No gain on the hard mixture. At 4,096 centroids the speedup was 0.72 to 1.09 times on an A100 (GPU, hard mixture, computed ratios), and the CPU analogue on SIFT was equal or slower. The GPU setup is the same as above (n=400k, d=96, A100 80GB PCIe, 3 seeds, equal epochs).


Epochs

Speedup, computed, at 4,096 centroids

Error gap at 4,096 centroids

1

0.72x

+0.04%

2

0.91x

+0.44%

3

0.93x

+0.45%

5

1.09x

+0.37%


The 2-epoch row is my computation from gpu_hard_A100.csv (speedup 0.90 to 0.92 across seeds). The other rows are from RESULTS.md.


On the CPU analogue with SIFT (n=400k, d=128, 4,096 centroids, 5 epochs) the two-level variant took 8.46 s against 7.97 s for dense assignment, even though it evaluated only 51% of the distances. The README reports that the gain is smallest at small k and grows with k. My runs are consistent with that direction, but they are not an independent confirmation. I have no GPU timing for SIFT at 4,096 centroids: that setting crashed on the A10G from 2 epochs on, and the crash grid in the next section has no e-means baseline and does not exclude compile time, so it gives no usable timing.


The e-means paper reports no gain from its own optional IVF assignment at 100 million points with 2^18 centroids (DINO10B, GPU hours to reach Lloyd's 25-epoch test loss, authors' hardware). That is a different regime and I did not test it.


Why did the released code crash at 4,096 centroids?

I do not know. The observation is that the released code failed in its fine-assignment kernel on 2 of 3 GPUs at SIFT with 4,096 centroids. Each cell below is one fresh Python process, seed 0, nlist 32, nprobe 16, torch 2.8.0 and Triton 3.4.0.


Epochs (batch rows)

A10G 24GB

L40S 48GB

A100 SXM4

1 (8,192)

pass

pass

pass

2 (16,384)

illegal memory access

pass

pass

3 (16,384)

fail (two error texts)

pass

pass

5 (32,768)

illegal memory access

fail

pass


Every failure was in the fine-assignment kernel at line 307 of triton_two_level.py, inside two_level_assign, and it reproduced with CUDA_LAUNCH_BLOCKING=1. Failures appear as batch rows grow (8,192 passed; 16,384 and 32,768 failed) and as GPU memory shrinks. That is a pattern across one seed per cell, not a diagnosis. A size-dependent out-of-bounds access is a hypothesis I did not test.


Controls: the same job at 16,384 centroids ran clean on the A10G, and the hard mixture at 4,096 centroids with batch rows 32,768 ran clean on the A100. The authors used an RTX 5090 and possibly other library versions. No crash report has been filed upstream yet.


Why is my 2.4x not their 4.5x?

They measure time to matched error on an RTX 5090 over 8 held-out datasets; my 2.4x is equal epochs on one dataset on an A10G, so the two numbers answer different questions. My own matched-error figure on that dataset is about 1.0x at the best error both reach (computed, see the matched-error section), which I did not expect to match theirs either. The authors (Owlgebra AI blog, Nov 12 2026) report a geometric mean of 4.49 times over e-means across 24 values, which are 8 held-out datasets at 1, 2 and 3 epochs, and k from 8,192 to 65,536, with a range of 2.54 to 7.25 times. The contrib README (not the blog page) reports 4.08 times without interpolation. I did not reproduce any of these, and I did not separate their kernels from their algorithm.


Item

Authors' number and condition

Mine and condition

Label

Speedup vs e-means

4.49x geomean, matched error, RTX 5090, 8 datasets

2.32x to 2.45x, equal epochs, A10G, SIFT only

claim vs measured (my ratios computed)

Kernels alone

1.43x, e-means algorithm on o-means FP16 kernels (README)

not separated

authors' claim

Algorithm on top

3.13x, same setup (README)

not separated

authors' claim

Fewer evaluations

about 7x fewer gave about 3x less time (README)

analogue only, see below

authors' claim


The README's split multiplies out as follows, and the product is my arithmetic.


1.43 x 3.13 = 4.48   (computed; authors report 4.49x geomean)

The blog also says more than 100 times, which is a geometric mean against GPU Lloyd baselines (126 times against Flash-KMeans, 181 times against faiss GPU, to reach Lloyd at 25 iterations; per-dataset minimums 69 and 78 times). That is a different baseline from e-means, and I did not reproduce it.


Where does o-means sit in the k-means family?

e-means matches Lloyd at 25 passes in 2 to 3 epochs on my CPU SIFT runs, and o-means keeps that loop while, by the authors' account, turning on approximate assignment by default at moderate k. The CPU numbers are mine: faiss NumpyEmeans on a Mac mini M4, 4 threads, shared host (load1 2.06 to 3.82 across runs), SIFT n=400k, d=128, 3 seeds, 95% intervals, at 4,096 and 16,384 centroids. At 16,384 centroids held-out error (unitless squared distances in SIFT's own scale) was 43,418 (plus or minus 129) for Lloyd at 25 passes, 43,364 (34) for e-means at 2 epochs and 43,336 (31) at 5. At 4,096 centroids it was 46,545 (79) for Lloyd and 46,433 (57) for e-means at 3 epochs. On SIFT at 4,096 centroids, e-means at 3 epochs took 4.83 s against 32.30 s for Lloyd at 25 passes, 6.7 times less (computed from the two measured times in the same results file; 6.8 times using the 4.74 s e-means timing from the CPU analogue file).


Method

What changes

Measured result (CPU, SIFT)

Label

Lloyd

all rows, exact, many passes

32.3 s at 4,096 centroids, 25 passes

measured

Mini-batch

small batches, exact search

about 1.4% worse than e-means at 5 epochs (1.43% at 4,096 and at 16,384 centroids)

measured, gap computed

e-means

EMA centroids, exact by default

matches Lloyd at 2 to 3 epochs

measured

o-means

e-means loop plus two-level cells

2.4x at equal epochs on A10G at 16,384 centroids (about 1.0x at the best error both reach)

measured (GPU), ratio computed


Caveats. In my sanity check (mixture with n=100k, d=64, k=500, CPU) my harness needed a median of 5 epochs to match Lloyd, against about 3 in the reference, so it is a sanity check and not an exact reproduction. The e-means abstract reports reaching Lloyd's 25-epoch loss in 1.4 to 2.6 epochs (authors' claim, abstract page only).


Approximate assignment is an old idea

e-means itself describes it. By default e-means assigns exactly by brute force, but for extreme scale its paper indexes the centroids with an IVF rebuilt at each update (section 3.4 and appendix M.2). The authors report no gain at 100 million points (2^18 centroids), 4.3 times cheaper at 1 billion (2^21) and 34 times at 10 billion (2^24), measured in GPU hours to reach Lloyd's 25-epoch test loss on DINO10B; each IVF cell in their Table 3 is the best of 3 IVF settings tried. By the o-means authors' account, what they add is on-by-default approximate assignment, early cell rebuilds, split links, a recency-weighted closing mean and FP16 kernels, and they report the gain is smallest at small k and grows with k. The o-means blog cites Philbin 2007 and Nister 2006 as prior approximate and hierarchical k-means. I know that only from an automated summary of the blog page, not from reading the full page text, and I did not check it line by line. I read the o-means README and code directly.


Method

What it approximates

Per-pass cost

Confidence

Philbin et al., CVPR 2007

nearest centroid via randomized k-d forest

about N x one forest query, plus rebuild

abstract read; cost not read

Nister and Stewenius, CVPR 2006

recursive small-branch k-means

about N x L x b x d

secondary source

Seeded-ANN k-means, arXiv 2502.06163, 2025 (no venue stated)

Lloyd's reassignment via approximate NN search

not read

abstract page only

e-means optional IVF, arXiv 2611.09501, 2026 (preprint)

centroid search at extreme scale

rebuilt each update

paper text read

Sculley, WWW 2010 (poster)

none, mini-batch steps

b x k x d per step

secondary source

Elkan 2003 and Hamerly 2010, venues not verified

none, exact via bounds

worst case N x k x d

secondary source


Seeded-ANN k-means (Spalding-Jamieson, Robson and Zheng, arXiv 2502.06163, v1 10 Feb 2025, no venue stated) is cited as prior art on its own abstract, which says it targets Lloyd's reassignment step with approximate nearest-neighbor search. I quote none of its results. The point is that two-level or approximate assignment inside k-means is not new with o-means.


k-means++ at large k

At 500 centroids (CPU, mixture n=100k, d=64, Lloyd 25 passes, 10 seeds) k-means++ init gave 65.64 against 66.07 for random rows, a paired difference of -0.43 with a 95% interval of plus or minus 0.22, and seed sd 0.18 against 0.30. That tests initialisation only. At 4,096 centroids or more I did not measure it; the cost argument is arithmetic, since seeding takes k sequential passes.


Does a CPU get the same shortcut?

A two-level analogue inside e-means on a CPU got about 2.5 times at 16,384 centroids and nothing at 4,096; it is not o-means. It has no FP16, no split links, no recency closing mean and no GPU kernels, and it says nothing about GPU o-means. Setup: Mac mini M4, 4 threads, shared host (load1 2.06 to 3.82 across runs), SIFT n=400k, d=128, 3 seeds, default nprobe 16.


Centroids

Share of dense distance evaluations

Wall s (analogue / dense), 5 epochs

Ratio (computed)

16,384

14.0%

11.0 / 27.6

2.5x

4,096

51%

8.46 / 7.97

0.94x


At 16,384 centroids the in-training miss rate (the nearest centroid not among the probed cells) was 0.6%, and 0.3% on the final centroids, with error within 0.2% of dense in every seed (seeds from -0.17%). At 3 epochs the times were 6.53 s against 16.46 s. The ratio was 2.4 to 2.7 over 1, 2, 3 and 5 epochs, and 2.48 to 2.55 per seed at 3 and 5 epochs (computed). Doubling nprobe cut the gain to 1.5 times, and probing all cells was slower than dense. On the hard mixture at 4,096 centroids the CPU analogue's in-training miss rate was 7 to 11% over 1 to 5 epochs (8 to 9% at 3 epochs) with error 0.4 to 0.5% above dense.


The CPU 2.5 times and the GPU 2.4 times at 16,384 centroids look alike but mean different things: different hardware, an analogue instead of the released code, and a comparison against a different dense baseline. The e-means paper's own IVF ablation (n=2^24, k=2^16, 2 epochs, 5 seeds) had the lowest test MSE at 4 probes; I do not equate that with my nprobe sweep. The o-means README reports a missed nearest centroid on 0.5 to 2.4% of rows for four datasets and 4 to 13% on GloVe-200, with about 0.1% error cost (authors' claim).


Which one should you use?

At k in the thousands stay with e-means; at k in the tens of thousands on a supported GPU, compare held-out error against e-means before adopting o-means. This is a rule of thumb from my runs (SIFT and one synthetic mixture, A10G and A100), not a measured cutoff. The gain scaled with k and the risk scaled with how clustered the data is.


Start: you need k-means centroids on n rows
 |
 +-- Is k >= 16,384?
 |     no  -> e-means (hard mixture, k=4096: o-means gave 0.72x to 1.09x). STOP
 |     yes -> next
 |
 +-- NVIDIA GPU with compute capability >= 8.0?
 |     no  -> e-means on whatever you have. STOP
 |     yes -> next
 |
 +-- Run e-means at 2 to 3 epochs on a sample: held-out MSE and wall time.
 +-- Run o-means at the same epochs, same sample (warm up, exclude compile).
 |     crash? -> fall back to e-means.
 |
 +-- Error gap vs e-means (thresholds are judgement)
       <= 0.5%  -> adopt o-means (SIFT at 1 epoch was 0.63% better, then +0.13% to -0.01% from 2 to 5 epochs)
       0.5-2%   -> adopt only if time matters more than 1% of error
       > 2%     -> stay on e-means (hard mixture gave 2.1% at 1 epoch, 6.3% at 5)

Always compare held-out error, not training loss, at equal epochs or matched error, never at different budgets.


For IVF or PQ codebook training, the same rule applies, and I have no recall number: the authors' README reports training error only, and I did not measure recall of an index trained either way. For embedding deduplication, the same k threshold and the same held-out error check apply, using only the rows above.


FAQ

Is o-means faster than e-means at 16,384 centroids?

On SIFT with 16,384 centroids (400,000 rows, 128 dimensions, one A10G, 3 seeds, equal epochs, authors' default settings), o-means was about 2.4 times faster than e-means at the same number of epochs (1 to 5). The ratio is computed from my measured wall times. It is not a same-quality speedup: at the best error both reach, o-means was about 1.0 times as fast (computed, 5 seeds, interpolated), and 1.3 to 2.0 times on the hard mixture. The authors' much larger figures against Lloyd baselines, and their 4.49 times against e-means, were not reproduced.


Is o-means faster than e-means at 4,096 centroids?

No gain in my runs. On a synthetic hard mixture (400,000 rows, 96 dimensions, 4,096 centroids, A100 80GB PCIe, 3 seeds, equal epochs), o-means ran 0.72 to 1.09 times the speed of e-means, computed from measured wall times. On SIFT at 4,096 centroids the released code crashed on 2 of 3 GPUs, so I have no GPU timing there.


What is o-means in one sentence?

By the authors' description, the e-means loop with approximate two-level nearest-centroid assignment on by default at moderate k, plus early cell rebuilds, split links, a recency closing mean and FP16 Triton kernels.


Does e-means already use approximate assignment?

Optionally, at extreme scale; the default is exact brute force (e-means paper, authors' claim).


Does o-means hurt accuracy?

On SIFT with 16,384 centroids, held-out error was within seed noise after the first epoch (A10G, 3 seeds, equal epochs). On my synthetic 16,384-mode mixture with 16,384 centroids (A100, 3 seeds, equal epochs), o-means error was 4.5 to 6.3% higher from 2 epochs on. I did not measure search recall for any method.


Does it run on a CPU or a Mac?

No. The released o-means needs a CUDA float32 tensor, Triton and compute capability 8.0 or higher, and has no CPU path. I built a CPU analogue of the two-level idea inside e-means; on SIFT with 16,384 centroids it ran about 2.5 times faster than dense assignment on a Mac mini M4, but it is not o-means.


Why did it crash?

I do not know. On SIFT with 4,096 centroids the released code failed in its fine-assignment kernel on 2 of 3 GPUs (A10G and L40S failed, A100 SXM4 passed), one seed per cell, torch 2.8.0 and Triton 3.4.0. Failures appeared as batch rows grew. A size-dependent out-of-bounds access is an untested hypothesis. No upstream report has been filed.


Will it improve IVF recall?

I did not measure it.


Is e-means better than mini-batch?

On CPU SIFT at 5 epochs, mini-batch was about 1.4% worse (my measurement, gap computed).


Does k-means++ help at large k?

At 500 centroids the init gain was small. I did not measure it at 4,096 or more.


Where are the code and paper?

The code is owlgebra-ai/faiss, contrib/o_means, MIT licensed. The blog says the paper is coming soon.


What I did not measure

  • Search recall or IVF query quality for any method, including indexes trained with o-means or e-means (for recall and nDCG measured on a different task, see retrieval evaluation metrics and when each one misleads).

  • The authors' RTX 5090 results, SPACEV 10M, GloVe-200, DEEP, k above 16,384, d above 128, and multi-GPU runs.

  • Any independent replication of the 4.49x, 126x or 181x figures, or of the e-means IVF numbers, and any separation of kernels from algorithm.

  • Jobs longer than a fraction of a second: every GPU timing here is 0.02 to 0.2 s, and minutes-long jobs were not tested.

  • H100 or consumer Blackwell behaviour.

  • The cause of the crash, version dependence, and behaviour with other torch or Triton versions.

  • Elkan, Hamerly, Yinyang, hierarchical k-means, SPANN and seeded-ANN k-means as measured methods.

  • k-means++ at 4,096 centroids or more.

  • Streaming data, out-of-GPU-memory data, spherical mode, FP8 or INT8.

  • CPU speedups of o-means itself.


References. e-means: Bessa, Mazare, Szilvasy, Touvron, Picard, Douze and Jegou, arXiv 2611.09501, submitted 6 Nov 2026 (arXiv). Seeded-ANN k-means: Spalding-Jamieson, Robson and Zheng, arXiv 2502.06163, 10 Feb 2025 (arXiv). o-means: Bajaj, Nupur and Garg, Owlgebra AI blog, Nov 12 2026 (blog); code in owlgebra-ai/faiss, contrib/o_means (repository). Venues for the classic papers appear in the prior-art table above only where my notes record them; the Elkan and Hamerly venues are not verified.


I ran the same kind of check on a different claim, a closed-form weight edit against LoRA and many-shot prompting: Weight-space editing vs fine-tuning: 64 demos won on 0.8B.

About the author


Salil Trehan builds AI and ML systems, writes up the measurements, and runs a lot of experiments.

Code and result files for this post: github.com/trehansalil/kmeans-at-scale-benchmarks (folder o-means-2026-11).

Questions or corrections: LinkedIn or book a call on Topmate.


Comments


Commenting on this post isn't available anymore. Contact the site owner for more info.

Post your queries here!

Thanks for submitting!

  • Facebook
  • Twitter
  • LinkedIn

©2026 by Salil Trehan. Proudly created in honor of Data Science

bottom of page