|
Download docs/EXPERIMENT_LOG.md from Nabidnur/OPE-means: direct link, hf CLI and curl.
- Browser
- Download file 51 kB
-
https://huggingface.co/Nabidnur/OPE-means/resolve/main/docs/EXPERIMENT_LOG.md
- Command line
-
hf download hf://Nabidnur/OPE-means/docs/EXPERIMENT_LOG.md
-
curl -L -o EXPERIMENT_LOG.md https://huggingface.co/Nabidnur/OPE-means/resolve/main/docs/EXPERIMENT_LOG.md
51 kB
| # Experiment log: OPE-means (target #2, robust k-means) | |
| Benchmark: Jiang & Zhou 2026 (arXiv:2605.07130), data prepared exactly as their code | |
| (`benchmarks/get_robust_data.py`). Metric: robust k-means cost on the full dataset | |
| (z farthest points dropped), best and mean over their 10 seeds. Our runs: 1 CPU thread. | |
| Published numbers: their Table 2 (AMD EPYC 32 cores). | |
| ## Iteration 1 (SKIN only) | |
| | variant | SKIN-5 best / mean | SKIN-10 best / mean | time | | |
| |---|---|---|---| | |
| | trimmed seeding + 1 o-means pass + trimmed Lloyd + split-merge (stop at first predicted loss) | 5.767e4 / 6.007e4 ± 2.1e3 | 6.090e4 / 6.310e4 ± 1.8e3 | 0.7 s | | |
| | + evaluate top-3 split-merge proposals by actual cost (force) | 5.767e4 / 5.828e4 ± 668 | 6.090e4 / 6.143e4 ± 381 | 0.9 s | | |
| | + 5 cheap starts on a 200k sample | 5.765e4 / 5.878e4 ± 1.6e3 | 6.084e4 / 6.249e4 ± 1.7e3 | 2.2 s | | |
| | **+ both** | **5.765e4 / 5.793e4 ± 279** | **6.084e4 / 6.128e4 ± 559** | 2.3 s | | |
| | best published (paper Table 2) | 5.768e4 (OKMeans2) / 6.151e4 (TIKMeans) | 6.303e4 (TIKMeans) / 6.608e4 (TIKMeans) | 2.4 s (32 cores) | | |
| Reading. The closed-form gain test (split gain vs deletion cost) is too conservative to start | |
| moves on this data; judging the top proposals by their actual robust cost fixes the instability | |
| that the 2026 paper reports. Next: SUSY (5M rows), SHUTTLE, KDDFULL, and a matched re-run of | |
| OKMeans / OKMeans2 at the same thread count. | |
| ## Iteration 2 (SHUTTLE, wider search) | |
| | variant | SHUTTLE best / mean | SKIN-5 best / mean | SKIN-10 best / mean | | |
| |---|---|---|---| | |
| | base | 5.770e4 / 6.828e4 ± 7.2e3 | | | | |
| | force 3 proposals | 5.488e4 / 6.057e4 ± 3.5e3 | 5.767e4 / 5.828e4 | 6.090e4 / 6.143e4 | | |
| | 5 starts + force 3 | 5.762e4 / 6.189e4 ± 2.5e3 | 5.765e4 / 5.793e4 | 6.084e4 / 6.128e4 | | |
| | force 10 proposals, up to 30 moves | **5.482e4 / 5.900e4** ± 4.1e3 | 5.767e4 / 5.828e4 | 6.090e4 / 6.143e4 | | |
| | 5 starts + force 10, 30 moves | 5.551e4 / 5.938e4 ± 3.0e3 | **5.765e4 / 5.793e4** | **6.084e4 / 6.128e4** | | |
| | best published | 5.710e4 / 6.122e4 (TIKMeans) | 5.768e4 / 6.151e4 | 6.303e4 / 6.608e4 | | |
| Reading. A wider split-merge search (10 proposals, up to 30 accepted moves) beats the best | |
| published best and mean on SHUTTLE too; multi-start helps SKIN but not SHUTTLE. KDD Cup 99: the | |
| UCI paths now serve a 53-byte placeholder; data now come from the figshare mirror scikit-learn uses. | |
| ## Iteration 3 (large datasets; sparse segment sums + proposal screening) | |
| Setting `f10_screen`: 10 split-merge proposals judged by actual cost, up to 30 moves, proposals | |
| screened on a 200k sample before the full-data check. 10 seeds, 2 threads (shared machine). | |
| | dataset | OPE-means best | OPE-means mean ± sd | best published best | best published mean | OKMeans mean (2026) | time | | |
| |---|---|---|---|---|---|---| | |
| | KDDFULL | **3.3078e7** | **3.3178e7** ± 1.6e5 | 3.308e7 (OKMeans) | 3.320e7 ± 2e4 (TIKMeans) | 4.019e7 ± 7.7e6 | 28 s | | |
| | SUSY-5 | **4.7524e7** | **4.7704e7** ± 1.7e5 | 4.756e7 (OKMeans/2) | 4.801e7 (OKMeans2) | 4.830e7 | 22 s | | |
| | SUSY-10 | **4.8278e7** | **4.8463e7** ± 1.6e5 | 4.836e7 (OKMeans) | 4.873e7 (OKMeans) | 4.873e7 | 21 s | | |
| Published times: 9.5-13.5 s on 32 EPYC cores. | |
| Headroom test (SUSY-5, seeds 42/123/456): 30 starts, 30 proposals, 60 moves, 60 Lloyd | |
| iterations gives best 4.7537e7, mean 4.7660e7, no lower than the standard setting. The best runs of | |
| all strong methods sit near the optimum (≈ 4.75e7), so the margin on "best" is capped by the | |
| problem; the noticeable margins are in mean and worst-case cost, stability, and time. | |
| ## Baseline re-implementation check | |
| `benchmarks/okmeans_reimpl.py` re-implements OKMeans/OKMeans2 from the paper. It scores | |
| clearly worse than the paper's Table 2 on SKIN and SHUTTLE (SKIN-5 OKMeans mean 7.70e4 vs 6.49e4 | |
| published), so to avoid a straw-man baseline **every quality comparison uses the published numbers**. | |
| A matched-hardware timing comparison should run the authors' own code (planned). | |
| ## Iteration 4: a fair fight — new protocol, official baselines, held-out data (plan: `docs/ARIES2_PLAN.md`) | |
| **Protocol from here on.** Development uses dev seeds 1-5 only; the paper's 10 seeds are reserved for the final | |
| run. Held-out datasets COVTYPE-5/10 and DEEP-5/10 (`benchmarks/get_heldout_data.py`, the paper's own | |
| injection recipe) are never used in development. Baselines are the authors' own code | |
| (github.com/MasterZhou1/Robust-Clustering, commit d820666), run on this machine with 1 worker × 4 threads. | |
| **Calibration.** The authors' code on our prepared SHUTTLE file reproduces their published Table 2 exactly: | |
| TIKMeans best 5.7099e4 / mean 6.1216e4 (published 5.710e4 / 6.122e4). Their loader reads our `.npz` files | |
| unchanged, and their metric (`cost_colorless`: full-data robust cost, z farthest dropped) is ours. Their OKMeans | |
| and OKMeans2 on SHUTTLE: best 6.2623e4, mean 6.8233e4 ± 6.3e3, 1.6 s. | |
| **OPE-means v0 on dev seeds** (`f10_screen`: 10 proposals judged by actual cost, up to 30 moves, sample screening; | |
| 4 threads; `results/dev/ope_iter4_dev_baseline.jsonl`): | |
| | dataset | best | mean ± sd | worst | time | | |
| |---|---|---|---|---| | |
| | SHUTTLE | 5.4398e+04 | 5.6987e+04 ± 4.1e+03 | 6.5239e+04 | 0.4 s | | |
| | SKIN-5 | 5.7652e+04 | 5.8104e+04 ± 3.8e+02 | 5.8800e+04 | 1.2 s | | |
| | SKIN-10 | 6.0878e+04 | 6.1460e+04 ± 5.7e+02 | 6.2402e+04 | 1.5 s | | |
| | KDDFULL | 3.3078e+07 | 3.3078e+07 ± 2.4e+00 | 3.3078e+07 | 8.5 s | | |
| | SUSY-5 | 4.7526e+07 | 4.7683e+07 ± 1.3e+05 | 4.7911e+07 | 13.9 s | | |
| | SUSY-10 | 4.8368e+07 | 4.8422e+07 ± 4.1e+04 | 4.8477e+07 | 13.2 s | | |
| Reading. KDDFULL is solved to the same optimum on every seed. The open problems are the SHUTTLE outlier seed | |
| (6.52e4 against ~5.5e4 for the rest), the spread on SUSY-5 (4.753e7 to 4.791e7), and time on SUSY (8-21 s). | |
| **Official baselines, first pass.** All 10 of the authors' algorithms × 10 paper seeds completed on SHUTTLE, SKIN-5 | |
| and SKIN-10 (`results/robust_official/official_small_datasets.json`). On KDDFULL and SUSY their worker was killed | |
| for lack of memory (their code builds one Python object per row, 5M rows; a concurrent dev run tipped the 15 GB | |
| machine over), so those three datasets are re-run alone, one at a time. | |
| ## Iteration 5: exhaustive single-swap local search on a sample (`ope_iter5_localsearch`, dev seeds, 1 thread) | |
| The v0 split-merge ranks (split s, delete t) moves by the Gaussian gain (2/π)Nλ₁ minus the deletion cost and checks | |
| only the top-ranked move on the full data; when that one fails it stops. With k ≤ 10 every move can be tried: | |
| `local_search` proposes all k(k-1) split-delete pairs plus k × 3 delete-and-reseed moves (trimmed D² draws), scores | |
| each by 3 trimmed-Lloyd steps on a 50k screening subsample, refines the best 3 on the 200k sample, accepts the | |
| best if it lowers the sample's robust cost, and repeats to a local optimum. Then trimmed Lloyd on all rows. | |
| | variant | SHUTTLE mean ± sd | SKIN-5 mean ± sd | SKIN-10 mean ± sd | | |
| |---|---|---|---| | |
| | v0 (`f10_screen`, iteration 4) | 5.699e4 ± 4.1e3 (worst 6.52e4) | 5.810e4 ± 380 | 6.146e4 ± 570 | | |
| | ls1: local search, 1 start | 5.494e4 ± 900 | 5.769e4 ± 25 | 6.086e4 ± 83 | | |
| | ls1 + full-data split-merge polish | identical to ls1 | identical | identical | | |
| | **ls3: local search, 3 starts** | **5.3815e4 ± 47** | **5.767e4 ± 15** | **6.079e4 ± 4** | | |
| Bests: SHUTTLE 5.3757e4, SKIN-5 5.7658e4, SKIN-10 6.0786e4. For reference, the authors' code on this machine | |
| (paper seeds): SHUTTLE OKMeans mean 6.823e4, TIKMeans 6.122e4. The full-data polish never finds a move after the | |
| sample search, so it is dropped. Cost: ls3 takes 9-12 s on 1 thread (v0: 0.4-1.5 s at 4 threads), so the next | |
| step is to make the search cheaper without losing the local optimum. | |
| **Official baselines on the 5M-row datasets: memory.** Their `compute_distances_to_centers_vectorized` and | |
| `assign_to_clusters_vectorized` broadcast an n × k × d float64 array (4.3 GB on KDDFULL) plus its square, which does | |
| not fit this 15 GB machine. `benchmarks/patch_official_memory.py` appends row-chunked wrappers. Rows are | |
| independent, so results are unchanged: every cost on SHUTTLE and SKIN-5 (60 runs) is bit-identical to the unpatched | |
| code, and the chunked path itself (forced to 1,000-row chunks) returns identical arrays. With the patch their | |
| OKMeansFAISS and OKMeans2FAISS complete on KDDFULL. Plain OKMeans/OKMeans2 build a 70k × 70k KNN matrix (39 GB) and | |
| TIKMeans is also killed on KDDFULL, so where an algorithm cannot run in 15 GB we quote its published number, | |
| labelled as such. Note: OKMeans and OKMeansFAISS agree exactly on SHUTTLE but not on every SKIN seed (2-6 of 10 | |
| identical; float ties change the KNN order), so the FAISS variant is reported under its own name. | |
| ## Iteration 6: exact one-shot scoring of every candidate (`ope_iter6_fastscore_v2`, dev seeds, 1 thread) | |
| Profiling iteration 5 showed candidate scoring dominating. A candidate moves at most two centres, so its exact robust | |
| cost (before any Lloyd step) needs only the row's three nearest centres (computed once per round) and the distances | |
| to the moved centres: a parallel Numba kernel (`_one_shot_kernel`) scores all ~120 candidates of a round on 50k | |
| rows in 0.15 s, exact to 2e-16 against brute force for k = 3 and 10. Only the best 10 by one-shot cost get the | |
| 3 trimmed-Lloyd steps; the best 3 of those are refined on the 200k sample. | |
| | variant | SHUTTLE mean ± sd | SKIN-5 mean ± sd | SKIN-10 mean ± sd | time (1 thread, loaded machine) | | |
| |---|---|---|---|---| | |
| | ls3 (iteration 5) | 5.3815e4 ± 47 | 5.767e4 ± 15 | 6.079e4 ± 4 | 9-12 s | | |
| | **ls3 + one-shot top 10** | 5.3820e4 ± 50 | 5.768e4 ± 19 | 6.079e4 ± 4 | **3.8-4.5 s** | | |
| | ls5 + one-shot top 10 | 5.3802e4 ± 28 | 5.768e4 ± 17 | 6.079e4 ± 5 | 6.5-8.0 s | | |
| Same quality, about 3× faster; 5 starts are not worth their time. Current candidate: ls3 + one-shot top 10. | |
| ## Iteration 7: exact half-means children instead of the Gaussian offset (`ope_iter7_halfmeans`) — negative | |
| With exact scoring the Gaussian formula only places the split children. Alternatives: the exact half-means of the | |
| cut through c along u₁ (mean of the positive and of the negative projections, asymmetric), or both placements as | |
| separate candidates. | |
| | children | SHUTTLE mean ± sd | SKIN-5 mean ± sd | SKIN-10 mean ± sd | | |
| |---|---|---|---| | |
| | Gaussian c ± √(2/π)σ₁u₁ (iteration 6) | 5.3820e4 ± 50 | 5.768e4 ± 19 | **6.079e4 ± 4** | | |
| | exact half-means | 5.3828e4 ± 100 | 5.772e4 ± 35 | 6.0885e4 ± 89 | | |
| | both, scored by exact one-shot cost | 5.3797e4 ± 58 | 5.770e4 ± 22 | 6.0884e4 ± 90 | | |
| Worse on SKIN in both forms. The one-shot score prefers the half-means candidates (lower cost before Lloyd), but | |
| they settle into worse optima after Lloyd: the symmetric Gaussian start is the better *starting point*. Same lesson | |
| as PISCES iteration 21. The Gaussian placement stays. | |
| ## Iteration 8: local search on the 5M-row datasets (`ope_iter8_large`, dev seeds, 1 thread) | |
| | variant | KDDFULL mean | SUSY-5 mean (best) | SUSY-10 mean ± sd (worst) | | |
| |---|---|---|---| | |
| | v0 (iteration 4) | 3.3078e7 | 4.7683e7 (4.7526e7) | 4.8422e7 ± 4.1e4 (4.8477e7) | | |
| | ls3, 200k sample | 3.3078e7 (all seeds) | 4.7589e7 (4.7573e7) | 4.8404e7 ± 1.1e5 (4.8614e7) | | |
| | + full-data split-merge polish | | identical, 0 moves accepted | identical, 0 moves | | |
| | ls3, 500k sample | | 4.7596e7 (4.7555e7) | 4.8332e7 ± 1.9e3 (4.8335e7) | | |
| | ls3, 500k, 100 final Lloyd iterations | | identical | identical | | |
| | ls5, 500k | | identical | 4.8336e7 ± 6.9e3 | | |
| | ls3, 500k, starts chosen by full-data cost | | identical | **4.8323e7 ± 1.8e4 (best 4.8288e7)** | | |
| The full-data polish never accepts a move after the sample search, so it is dropped. On SUSY the 200k sample is 4% | |
| of the data and its local optimum is not always the full-data one; 500k fixes SUSY-10. Choosing among starts by | |
| full-data cost helps SUSY-10: competing optima differ by ~0.07%, about the noise of a 500k-sample cost. | |
| ## Iteration 9: the trimmed-Lloyd convergence bug, and fused Numba kernels (`ope_iter9_engineering`) | |
| **Bug.** `trimmed_lloyd` starts with `prev = inf` and stops when `prev - cost <= tol * prev`. On the first | |
| iteration that is `inf <= inf`, which is True, so the loop always stopped after **one** update, whatever `iters` | |
| said. Every OPE-means run up to iteration 8 used one-update Lloyd (this is why "100 final Lloyd iterations" changed | |
| nothing in iteration 8, and the "30 trimmed Lloyd iterations" in earlier entries were in fact one). Checked | |
| directly on SKIN-10 from the same start: original, any `iters` → 8.8716e4; fixed, 3 iterations → 8.0558e4, 30 | |
| iterations → 6.7907e4. The original function is kept unchanged (with `LLOYD_FIXED = False`) so earlier results stay | |
| reproducible. | |
| **Engineering.** `trimmed_lloyd_fast`: a parallel Numba assignment kernel (float64 accumulation, k ≤ 10 so plain | |
| loops beat a GEMM call) and a Numba sums kernel instead of a sparse one-hot product; the loop stops on convergence | |
| and returns the exact robust cost from its last assignment, so no extra distance pass. It matches the fixed original | |
| to 7 digits. Seeding can run on a 50k subsample (`seed_n`). Reported costs are now recomputed in float64 on the | |
| original rows, exactly as the authors' `cost_colorless` does (`exact_cost` in `ope_dev.py`). | |
| | variant (3 starts, one-shot top 10) | SHUTTLE mean ± sd | SKIN-5 mean ± sd | SKIN-10 mean ± sd | time | | |
| |---|---|---|---|---| | |
| | one-update Lloyd (iteration 6) | 5.3820e4 ± 49 | 5.7682e4 ± 19 | 6.0793e4 ± 4 | 4.1 s | | |
| | **converging Lloyd, fused kernels** | **5.3736e4 ± 0.0001** | **5.7641e4 ± 0.01** | **6.0774e4 ± 0.1** | 5.3-5.6 s | | |
| | + seeding on 50k | 5.3736e4 | 5.7641e4 | 6.0774e4 | 4.8-5.2 s | | |
| Every dev seed now reaches the same solution on all three datasets. Best published costs (any method, paper | |
| Table 2): SHUTTLE 5.710e4, SKIN-5 5.768e4, SKIN-10 6.303e4. | |
| **Iteration 9 on the 5M-row datasets** (converging Lloyd, 500k sample, 3 starts chosen by full-data cost): | |
| KDDFULL 3.3078e7 on every seed, **SUSY-5 4.7475e7 ± 2**, **SUSY-10 4.8215e7 ± 1** (every seed the same solution; | |
| best published 4.756e7 and 4.836e7). Time 60-106 s on 1 thread: Lloyd now really runs to convergence on 5M rows. | |
| ## Iteration 10: how much search is needed now (`ope_iter10_speed`, dev seeds, 1 thread, shared machine) | |
| | variant | SUSY-5 mean ± sd | SUSY-10 mean ± sd | SHUTTLE mean ± sd | SKIN-5 / SKIN-10 mean | KDDFULL | time (SUSY) | | |
| |---|---|---|---|---|---|---| | |
| | 3 starts, chosen by full-data cost (iteration 9) | 4.7475e7 ± 2 | 4.8215e7 ± 1 | | | | 60-106 s | | |
| | 3 starts, chosen by sample cost | 4.7475e7 ± 3 | 4.8215e7 ± 0.3 | | | | 57 s | | |
| | 1 start, 500k sample | 4.7475e7 ± 1.5 | 4.8215e7 ± 3 | 5.4497e4 ± 930 | 5.7641e4 / 6.0776e4 | 3.3078e7 | 25-28 s | | |
| | 1 start, 200k sample | 4.7484e7 ± 1.8e4 | 4.8215e7 ± 4 | | | | 22-24 s | | |
| | **v1: 3 starts if the data fit in the sample, else 1** | 4.7475e7 | 4.8215e7 | **5.3736e4 ± 1e-4** | **5.7641e4 / 6.0774e4** | 3.3078e7 | 25-28 s; 5.5-6.2 s small | | |
| With a converging Lloyd one start reaches the optimum on the large datasets; only SHUTTLE (43k rows) still needs | |
| several starts, which are cheap when the sample is the whole dataset. 200k misses once on SUSY-5. **OPE-means v1** | |
| (`aries.opemeans.OPE_V1`): exhaustive sample local search with exact one-shot scoring, converging fused trimmed | |
| Lloyd, 500k-row sample, seeding on 50k, `starts="auto"`, starts compared by full-data cost. | |
| **Official baselines, SUSY-5.** OKMeans, OKMeans2, k-means++ and both FAISS variants completed (10 seeds each). | |
| Their k-means-- hit their own 300 s per-run timeout on all 10 seeds; TIKMeans ran out of memory as on KDDFULL. | |
| ## Iteration 11: leave-one-out of OPE-means v1, small datasets (`ope_iter11_ablation_small`, dev seeds, 1 thread) | |
| | removed | SHUTTLE mean ± sd | SKIN-5 mean ± sd | SKIN-10 mean ± sd | time | | |
| |---|---|---|---|---| | |
| | nothing (v1) | 5.3736e4 ± 1e-4 | 5.7641e4 ± 0.02 | 6.0774e4 ± 0.1 | 5.4-6.4 s | | |
| | the whole local search (seed + converging Lloyd only) | 6.7485e4 ± 6.4e3 | 5.8512e4 ± 1.7e3 | 6.2322e4 ± 1.9e3 | 0.5-1.0 s | | |
| | split moves (reseed moves only) | 5.3736e4 | 5.7641e4 | 6.0774e4 | same | | |
| | reseed moves (split moves only) | 5.3736e4 | 5.7641e4 | 6.0774e4 | same | | |
| | one-shot scoring (Lloyd-score every candidate) | 5.3736e4 | 5.7641e4 | 6.0774e4 | 11-16 s | | |
| | extra starts (1 start everywhere) | 5.4497e4 ± 930 | 5.7641e4 | 6.0776e4 ± 3.7 | 1.8-2.1 s | | |
| Reading. The local search is the whole gain: without it the mean cost is 2.5-26% higher with large spread. | |
| Split moves and reseed moves are each sufficient here (each alone reaches the same optimum), so on these datasets | |
| they are redundant; the large datasets will tell whether both are needed. One-shot scoring is a pure speed-up | |
| (2-3× here, same answers). The extra starts matter only on SHUTTLE. | |
| ## Iteration 12: exact acceleration of trimmed Lloyd with Hamerly bounds (`ope_iter12_hamerly`, dev seeds, 1 thread) | |
| **What OKMeans does, and where the time goes.** OKMeans (and OKMeans2) draw a uniform coreset (24k-70k rows), drop | |
| the points with the largest K-nearest-neighbour distance as outliers, run k-means++ and Lloyd on the rest, then assign | |
| the full data. Its guarantee is a constant-factor reduction to k-means under a cluster-size assumption; in practice it | |
| inherits k-means' local optima (mean cost far above its best run). OPE-means v1 replaces that last step with an | |
| exhaustive single-swap local search, which is why every seed reaches the same solution; its time goes into | |
| converging trimmed Lloyd, on the sample (candidate refinement) and on all rows. | |
| **Hamerly bounds for trimmed Lloyd** (`trimmed_lloyd_hamerly`). Trimming needs every row's exact distance to its | |
| own centre anyway, so each row computes that one distance; only when it exceeds max(s_a, l_i) -- half the distance | |
| from its centre to the nearest other centre, and a lower bound on its second-nearest distance (decreased each | |
| iteration by the largest move among the other centres) -- are all k distances scanned. The test is exact, so the | |
| iterates are those of `trimmed_lloyd_fast`. From the same random start: SKIN-10 identical cost and centres | |
| (bit-identical), 0.29 s → 0.13 s, 12.6% of row-iterations need a full scan; SUSY-5 identical, 69.9 s → 42.6 s | |
| (74 iterations, 25% full scans). | |
| | variant | SHUTTLE | SKIN-5 | SKIN-10 | time | | |
| |---|---|---|---|---| | |
| | v1 | 5.3736e4 ± 1e-4 | 5.7641e4 ± 0.02 | 6.0774e4 ± 0.1 | 5.8-7.2 s | | |
| | v1 + Hamerly Lloyd | identical | identical | identical | 4.1-5.8 s | | |
| | + refine only the best candidate (top 1) | 5.3736e4 ± 0.05 | 5.7641e4 ± 0.02 | 6.0775e4 ± 0.1 | 2.9-3.9 s | | |
| | + Lloyd-score only the best 5 by one-shot cost | 5.3736e4 ± 0.05 | 5.7641e4 ± 0.02 | 6.0774e4 ± 0.1 | **2.6-3.5 s** | | |
| Same optimum on every seed at about half v1's time. (Shared machine: the official SUSY-10 baselines and the | |
| large-dataset ablation were running at the same time.) | |
| **Iteration 11, large datasets** (`ope_iter11_ablation_large`, v1 settings with plain fused Lloyd): | |
| | removed | KDDFULL mean ± sd | SUSY-5 mean ± sd | SUSY-10 mean ± sd | | |
| |---|---|---|---| | |
| | nothing (v1, iteration 10) | 3.3078e7 ± 0.001 | 4.7475e7 ± 1.5 | 4.8215e7 ± 3 | | |
| | the whole local search | 3.7321e7 ± 6.3e6 (+12.8%) | 4.7750e7 ± 1.2e5 (+0.58%) | 4.8494e7 ± 1.3e5 (+0.58%) | | |
| | split moves | identical | identical | identical | | |
| | reseed moves | identical | identical | identical | | |
| Same reading as on the small datasets: the local search is the whole gain, and either move family alone reaches the | |
| same optimum. **Honest consequence:** the principal-axis split (the part inherited from PISCES) is not needed for | |
| quality on this benchmark; exhaustive single-swap search with a converging trimmed Lloyd is what matters. | |
| **Outlier recovery** (precision = recall = F1, since exactly z rows are dropped; dev seeds for OPE-means, paper seeds | |
| for the authors' code run here): SKIN-5 OPE 0.7545 vs OKMeans 0.7592 / OKMeans2 0.7502 / TIKMeans 0.7419; | |
| SKIN-10 0.9400 vs 0.9464 / 0.9510 / 0.9404; SHUTTLE **0.0000** vs 0.1706 / 0.1706 / 0.1412. On the injected outliers | |
| OPE-means recovers about as many as the baselines. On SHUTTLE the "outliers" are the 17 members of the two smallest | |
| classes, not far-away points; the lower-cost solution places them near a centre, so the robust-cost objective and | |
| the label-based outlier set disagree there. This is reported as a limitation, not hidden. | |
| ## Iteration 13: OPE-means v2 (`ope_iter13_v2`, dev seeds, 1 thread) | |
| Hamerly Lloyd + a narrower candidate funnel, with both move families or reseed moves only. | |
| | funnel (Lloyd-scored by one-shot cost / refined on the sample) | SUSY-5 per seed (×1e7) | SUSY-10 per seed (×1e7) | SUSY time | | |
| |---|---|---|---| | |
| | v1: 10 / 3 | all 4.74747 | all 4.82146 | 25-28 s | | |
| | 5 / 1 (both or reseed only: identical) | 4.74747 except seed 2 4.75956 | 4.82146 except seed 2 4.85470 | 11.5 s | | |
| | 5 / 3 | seeds 2, 5 at 4.75956 | all 4.82146 | 14-16 s | | |
| | 10 / 3 | all 4.74747 | all 4.82146 | 14-16 s | | |
| | **10 / 1** | **all 4.74747** | **all 4.82146** | **10-11 s** | | |
| The failures come from Lloyd-scoring only 5 candidates, not from refining only one. With 10 / 1 and reseed moves | |
| only, every dev seed reaches the same optimum on all six datasets: SHUTTLE 5.3736e4 (3.1 s), SKIN-5 5.7641e4 (2.6 s), | |
| SKIN-10 6.0774e4 (2.3 s), KDDFULL 3.3078e7 (3.7 s), SUSY-5 4.7475e7 (10.2 s), SUSY-10 4.8215e7 (11.2 s), all on 1 thread | |
| on a shared machine. **Frozen as OPE-means v2** (`aries.opemeans.OPE_V2`), about 2.5× faster than v1 at the same | |
| answers. | |
| **Official baselines, SUSY-10** (authors' code here, paper seeds, 4 threads): OKMeans mean 4.8730e7 / best 4.8364e7, | |
| which reproduces their published Table 2 (4.873e7 / 4.836e7) on a 5M-row dataset; OKMeans2 4.8774e7; FAISS variants | |
| 4.873e7-4.876e7 in 15 s; k-means++ 5.17e7. | |
| ## Iteration 14: is v2's answer the best a much heavier search can find? (`ope_iter14_heavy_search`, dev seed 1) | |
| Heavy search: 10 starts, a 2M-row sample, both move families with 10 reseed draws per centre, 30 candidates | |
| Lloyd-scored and 3 refined per round, starts compared by full-data cost (4 threads, 12-230 s per run). | |
| | dataset | heavy search | OPE-means v2 | relative difference | | |
| |---|---|---|---| | |
| | SHUTTLE | 5.3736406403e4 | 5.3736406322e4 | +1.5e-9 | | |
| | SKIN-5 | 5.7640853829e4 | 5.7640892382e4 | -6.7e-7 | | |
| | SKIN-10 | 6.0774344933e4 | 6.0774568484e4 | -3.7e-6 | | |
| | KDDFULL | 3.3077792635e7 | 3.3077792636e7 | -3.1e-11 | | |
| | SUSY-5 | 4.7474707906e7 | 4.7474707893e7 | +2.6e-10 | | |
| | SUSY-10 | 4.8214623892e7 | 4.8214624339e7 | -9.3e-9 | | |
| A search up to 20× more expensive lands on the same solution everywhere, to within Lloyd's convergence tolerance. | |
| This is evidence (not a proof of global optimality) that v2 reaches the best solution single-swap local search can | |
| find on these datasets. | |
| ## Iteration 15: Constellations — a weighted sketch for the search (`ope_iter15_constellation`) — negative | |
| Idea: navigate on ~50k weighted "stars" instead of a uniform 500k sample. Each row is drawn with probability | |
| q(x) = ½·min(d(x), r)²/Σ + ½·1/(k|P_a(x)|) (a k-means sensitivity bound with distances to a pilot solution capped | |
| at the trimming radius r, so outliers cannot pose as bright stars) and weight 1/(mq); the search runs weighted | |
| (trimming removes outlier *mass* z). 4 threads, dev seeds: | |
| | | SHUTTLE | SKIN-5 | SKIN-10 | KDDFULL | SUSY-5 | SUSY-10 | | |
| |---|---|---|---|---|---|---| | |
| | v2 mean (time) | 5.3736e4 (3.2 s) | 5.7641e4 (2.2 s) | 6.0775e4 (1.9 s) | 3.3078e7 (3.0 s) | 4.7475e7 (6.0 s) | 4.8215e7 (6.7 s) | | |
| | Constellations, 50k stars | 5.3736e4 (3.3 s) | 5.7641e4 (1.9 s) | **6.1906e4** (1.8 s) | 3.3078e7 (3.2 s) | **4.7575e7** (7.8 s) | **4.8363e7** (9.7 s) | | |
| Worse on SKIN-10 and SUSY and not faster: a 50k sketch is too coarse for the search to find the optimum, and the | |
| rougher start makes the full-data stage longer. Kept in the code (`ope_constellation`), not used. | |
| ## Iteration 16: Tidal locking — exact trimmed Lloyd in which most points do no work (`ope_iter16_tidal`) | |
| A point is *locked* when its bounds prove that it keeps its centre (Hamerly) **and** that it stays on its side of | |
| the trimming radius, the "event horizon": the (n−z)-th smallest distance moves by at most the largest centre move | |
| D, so a point whose upper bound is below τ−D is surely kept and one whose lower bound is above τ+D surely trimmed. | |
| Locked points cost a few comparisons; only points near a Voronoi boundary or near the horizon get exact distances, | |
| and the cluster sums are updated incrementally for the points whose centre or status changed. | |
| Exactness: from the same random start, identical cost and centres (bit-identical) to Hamerly trimmed Lloyd run to | |
| its fixed point, on SKIN-10 and SUSY-10. Work: 13.5% (SKIN-10) and 6.4% (SUSY-10) of plain Lloyd's distance | |
| computations; per iteration about 2× faster than Hamerly (SKIN-10 0.12 → 0.06 s; SUSY-10 300 iterations | |
| 64.2 → 37.5 s). | |
| Inside OPE-means (4 threads, dev seeds, same session): | |
| | | SHUTTLE | SKIN-5 | SKIN-10 | KDDFULL | SUSY-5 | SUSY-10 | | |
| |---|---|---|---|---|---|---| | |
| | v2 (Hamerly, relative-cost stop) | 3.3 s | 2.1 s | 1.9 s | 3.1 s | 6.6 s | 6.7 s | | |
| | tidal, to the exact fixed point | 2.9 s | 2.1 s | 1.9 s | 3.5 s | 6.7 s | 7.0 s | | |
| | **tidal, stop at ≤ 1e-4 of rows changing** | 3.7 s | 2.1 s | 1.8 s | **2.7 s** | **5.2 s** | **5.8 s** | | |
| Every seed reaches the same optimum in every row. Run to its fixed point, tidal locking spends its savings on the | |
| extra iterations (and lowers the spread across seeds, e.g. SUSY-5 ±3.1 → ±0.15); with the 1e-4 stop it is 13-21% | |
| faster than v2 on the 5M-row datasets and equal on the small ones, whose time is in the sample-stage search. | |
| **Frozen as OPE-means v3** (`OPE_V3`). | |
| ## Final confirmation of OPE-means v3 (`results/final_ope/`, `benchmarks/run_final_ope.sh`) | |
| One session, one machine, 4 threads for every method; the paper's 10 seeds; OPE-means v3 frozen before the run; | |
| the authors' own code (commit d820666, memory-only patch). Held-out datasets (COVTYPE-5/10, DEEP-5/10) were run here | |
| for the first time. Tables: `python benchmarks/summarize_final.py`. | |
| **Headline.** On all 10 datasets OPE-means has a lower robust cost than every one of the authors' algorithms on | |
| every one of the 10 paper seeds (paired, same seed: 10/10 in each of the 57 dataset × baseline comparisons [corrected from 58 during the write-up: 6 algorithms × 10 datasets, minus TIKMeans out of memory on 3]). Mean | |
| paired change vs OKMeans: SHUTTLE −20.6%, SKIN-5 −11.9%, SKIN-10 −12.0%, KDDFULL −14.9%, SUSY-5 −1.7%, SUSY-10 | |
| −1.0%; held-out COVTYPE-5 −0.9%, COVTYPE-10 −0.6%, DEEP-5 −0.3%, DEEP-10 −0.4%. Time: faster than every OKMeans | |
| variant on the large datasets (KDDFULL 2.8 s vs 13-26 s, SUSY 5.2-5.9 s vs 13-32 s, DEEP 10 s vs 26-70 s), on par | |
| with OKMeans on SKIN and SHUTTLE (2-3 s), slower there than plain k-means++ (0.3-0.5 s, much higher cost). | |
| Outlier F1 equal to the best baseline within 0.01 everywhere except SHUTTLE (0.000 vs 0.171; the labelled outliers | |
| are the two smallest classes, not distant points). | |
| Not every paper seed reaches the dev-seed optimum: SUSY-10's worst run is 4.8415e7 (optimum 4.8215e7), SUSY-5's | |
| 4.7527e7, two SKIN-5 runs are 0.02% above. Each still beats every baseline on its seed. TIKMeans runs out of memory | |
| on KDDFULL and SUSY (15 GB machine); its published numbers apply there. | |
| ### SHUTTLE | |
| | method | best | mean ± sd | worst | mean time | outlier F1 | vs OPE-means (paired) | | |
| |---|---|---|---|---|---|---| | |
| | OPE-means | 5.37364e+04 | 5.37364e+04 ± 6.7e-02 | 5.37366e+04 | 3.17 s | 0.000 | | | |
| | KMeans++ | 6.04800e+04 | 7.05484e+04 ± 7.0e+03 | 8.52349e+04 | 0.33 s | 0.082 | OPE -23.09% (better on 10/10) | | |
| | OKMeans | 6.26229e+04 | 6.82329e+04 ± 6.2e+03 | 8.24371e+04 | 1.61 s | 0.171 | OPE -20.64% (better on 10/10) | | |
| | OKMeans2 | 6.26229e+04 | 6.82329e+04 ± 6.2e+03 | 8.24371e+04 | 1.98 s | 0.171 | OPE -20.64% (better on 10/10) | | |
| | OKMeans2FAISS | 6.26229e+04 | 6.82329e+04 ± 6.2e+03 | 8.24371e+04 | 0.95 s | 0.171 | OPE -20.64% (better on 10/10) | | |
| | OKMeansFAISS | 6.26229e+04 | 6.82329e+04 ± 6.2e+03 | 8.24371e+04 | 0.89 s | 0.171 | OPE -20.64% (better on 10/10) | | |
| | TIKMeans | 5.70990e+04 | 6.12155e+04 ± 2.6e+03 | 6.41069e+04 | 0.86 s | 0.141 | OPE -12.06% (better on 10/10) | | |
| ### SKIN-5 | |
| | method | best | mean ± sd | worst | mean time | outlier F1 | vs OPE-means (paired) | | |
| |---|---|---|---|---|---|---| | |
| | OPE-means | 5.76409e+04 | 5.76431e+04 ± 4.4e+00 | 5.76519e+04 | 2.24 s | 0.755 | | | |
| | KMeans++ | 5.82936e+04 | 7.52177e+04 ± 1.5e+04 | 1.12170e+05 | 0.46 s | 0.749 | OPE -20.88% (better on 10/10) | | |
| | OKMeans | 6.05978e+04 | 6.56663e+04 ± 3.8e+03 | 7.18760e+04 | 2.20 s | 0.759 | OPE -11.93% (better on 10/10) | | |
| | OKMeans2 | 5.76879e+04 | 6.45949e+04 ± 3.4e+03 | 7.14512e+04 | 2.66 s | 0.750 | OPE -10.51% (better on 10/10) | | |
| | OKMeans2FAISS | 6.19657e+04 | 6.46224e+04 ± 2.3e+03 | 6.84087e+04 | 2.14 s | 0.756 | OPE -10.69% (better on 10/10) | | |
| | OKMeansFAISS | 6.05978e+04 | 6.46873e+04 ± 2.8e+03 | 6.94218e+04 | 1.79 s | 0.756 | OPE -10.72% (better on 10/10) | | |
| | TIKMeans | 5.85379e+04 | 6.15127e+04 ± 1.9e+03 | 6.44145e+04 | 4.87 s | 0.742 | OPE -6.20% (better on 10/10) | | |
| ### SKIN-10 | |
| | method | best | mean ± sd | worst | mean time | outlier F1 | vs OPE-means (paired) | | |
| |---|---|---|---|---|---|---| | |
| | OPE-means | 6.07743e+04 | 6.07744e+04 ± 5.8e-02 | 6.07746e+04 | 2.07 s | 0.940 | | | |
| | KMeans++ | 7.90996e+04 | 1.01763e+05 ± 1.5e+04 | 1.23381e+05 | 0.49 s | 0.891 | OPE -38.91% (better on 10/10) | | |
| | OKMeans | 6.49954e+04 | 6.94494e+04 ± 5.6e+03 | 8.51515e+04 | 2.15 s | 0.946 | OPE -11.99% (better on 10/10) | | |
| | OKMeans2 | 6.48551e+04 | 7.04002e+04 ± 4.9e+03 | 7.92263e+04 | 2.80 s | 0.951 | OPE -13.27% (better on 10/10) | | |
| | OKMeans2FAISS | 6.42130e+04 | 7.00733e+04 ± 6.0e+03 | 8.17377e+04 | 2.22 s | 0.952 | OPE -12.67% (better on 10/10) | | |
| | OKMeansFAISS | 6.49954e+04 | 7.08601e+04 ± 5.5e+03 | 8.51515e+04 | 1.72 s | 0.949 | OPE -13.76% (better on 10/10) | | |
| | TIKMeans | 6.30321e+04 | 6.60843e+04 ± 1.3e+03 | 6.81099e+04 | 4.93 s | 0.940 | OPE -8.00% (better on 10/10) | | |
| ### KDDFULL | |
| | method | best | mean ± sd | worst | mean time | outlier F1 | vs OPE-means (paired) | | |
| |---|---|---|---|---|---|---| | |
| | OPE-means | 3.30778e+07 | 3.30778e+07 ± 7.5e-02 | 3.30778e+07 | 2.84 s | 0.619 | | | |
| | KMeans++ | 3.32131e+07 | 6.12255e+07 ± 2.2e+07 | 8.95047e+07 | 10.18 s | 0.553 | OPE -37.89% (better on 10/10) | | |
| | OKMeans | 3.30806e+07 | 4.01900e+07 ± 7.7e+06 | 5.47292e+07 | 25.82 s | 0.616 | OPE -14.90% (better on 10/10) | | |
| | OKMeans2 | 3.30806e+07 | 4.23037e+07 ± 9.3e+06 | 5.47420e+07 | 26.27 s | 0.618 | OPE -18.14% (better on 10/10) | | |
| | OKMeans2FAISS | 3.30804e+07 | 4.24979e+07 ± 9.2e+06 | 5.47423e+07 | 13.64 s | 0.613 | OPE -18.61% (better on 10/10) | | |
| | OKMeansFAISS | 3.30806e+07 | 4.01900e+07 ± 7.7e+06 | 5.47292e+07 | 12.96 s | 0.616 | OPE -14.90% (better on 10/10) | | |
| | TIKMeans | error | | | | | | | |
| ### SUSY-5 | |
| | method | best | mean ± sd | worst | mean time | outlier F1 | vs OPE-means (paired) | | |
| |---|---|---|---|---|---|---| | |
| | OPE-means | 4.74747e+07 | 4.74942e+07 ± 2.4e+04 | 4.75272e+07 | 5.23 s | 0.812 | | | |
| | KMeans++ | 4.78917e+07 | 4.88475e+07 ± 8.7e+05 | 5.09849e+07 | 14.61 s | 0.831 | OPE -2.74% (better on 10/10) | | |
| | OKMeans | 4.75554e+07 | 4.82988e+07 ± 6.4e+05 | 4.97142e+07 | 26.95 s | 0.799 | OPE -1.65% (better on 10/10) | | |
| | OKMeans2 | 4.75924e+07 | 4.81653e+07 ± 6.3e+05 | 4.96356e+07 | 27.14 s | 0.797 | OPE -1.38% (better on 10/10) | | |
| | OKMeans2FAISS | 4.75554e+07 | 4.80062e+07 ± 3.4e+05 | 4.87935e+07 | 14.83 s | 0.798 | OPE -1.06% (better on 10/10) | | |
| | OKMeansFAISS | 4.75554e+07 | 4.82988e+07 ± 6.4e+05 | 4.97142e+07 | 13.36 s | 0.799 | OPE -1.65% (better on 10/10) | | |
| | TIKMeans | error | | | | | | | |
| ### SUSY-10 | |
| | method | best | mean ± sd | worst | mean time | outlier F1 | vs OPE-means (paired) | | |
| |---|---|---|---|---|---|---| | |
| | OPE-means | 4.82146e+07 | 4.82402e+07 ± 6.0e+04 | 4.84146e+07 | 5.92 s | 0.982 | | | |
| | KMeans++ | 4.89968e+07 | 5.17273e+07 ± 2.4e+06 | 5.67655e+07 | 17.32 s | 0.980 | OPE -6.55% (better on 10/10) | | |
| | OKMeans | 4.83643e+07 | 4.87297e+07 ± 2.3e+05 | 4.90703e+07 | 29.77 s | 0.982 | OPE -1.00% (better on 10/10) | | |
| | OKMeans2 | 4.84148e+07 | 4.87740e+07 ± 2.3e+05 | 4.90703e+07 | 31.73 s | 0.982 | OPE -1.09% (better on 10/10) | | |
| | OKMeans2FAISS | 4.84819e+07 | 4.87570e+07 ± 2.0e+05 | 4.90703e+07 | 17.60 s | 0.982 | OPE -1.06% (better on 10/10) | | |
| | OKMeansFAISS | 4.83643e+07 | 4.87297e+07 ± 2.3e+05 | 4.90703e+07 | 17.50 s | 0.982 | OPE -1.00% (better on 10/10) | | |
| | TIKMeans | error | | | | | | | |
| ### COVTYPE-5 | |
| | method | best | mean ± sd | worst | mean time | outlier F1 | vs OPE-means (paired) | | |
| |---|---|---|---|---|---|---| | |
| | OPE-means | 2.57685e+06 | 2.57688e+06 ± 8.4e+01 | 2.57713e+06 | 2.32 s | 0.933 | | | |
| | KMeans++ | 2.58620e+06 | 2.67105e+06 ± 9.0e+04 | 2.81793e+06 | 1.82 s | 0.929 | OPE -3.42% (better on 10/10) | | |
| | OKMeans | 2.58011e+06 | 2.59983e+06 ± 1.5e+04 | 2.63623e+06 | 8.40 s | 0.932 | OPE -0.88% (better on 10/10) | | |
| | OKMeans2 | 2.57965e+06 | 2.59542e+06 ± 1.7e+04 | 2.63623e+06 | 9.29 s | 0.932 | OPE -0.71% (better on 10/10) | | |
| | OKMeans2FAISS | 2.58011e+06 | 2.59501e+06 ± 1.6e+04 | 2.63623e+06 | 3.41 s | 0.932 | OPE -0.69% (better on 10/10) | | |
| | OKMeansFAISS | 2.58011e+06 | 2.59983e+06 ± 1.5e+04 | 2.63623e+06 | 3.06 s | 0.932 | OPE -0.88% (better on 10/10) | | |
| | TIKMeans | 2.72608e+06 | 2.77408e+06 ± 3.8e+04 | 2.83526e+06 | 17.35 s | 0.918 | OPE -7.09% (better on 10/10) | | |
| ### COVTYPE-10 | |
| | method | best | mean ± sd | worst | mean time | outlier F1 | vs OPE-means (paired) | | |
| |---|---|---|---|---|---|---| | |
| | OPE-means | 2.58614e+06 | 2.58647e+06 ± 2.2e+02 | 2.58692e+06 | 1.99 s | 0.997 | | | |
| | KMeans++ | 2.62681e+06 | 2.79598e+06 ± 1.2e+05 | 3.08016e+06 | 1.65 s | 0.996 | OPE -7.34% (better on 10/10) | | |
| | OKMeans | 2.58900e+06 | 2.60302e+06 ± 9.2e+03 | 2.61860e+06 | 8.19 s | 0.997 | OPE -0.63% (better on 10/10) | | |
| | OKMeans2 | 2.58900e+06 | 2.60302e+06 ± 9.2e+03 | 2.61860e+06 | 8.91 s | 0.997 | OPE -0.63% (better on 10/10) | | |
| | OKMeans2FAISS | 2.58900e+06 | 2.60302e+06 ± 9.2e+03 | 2.61860e+06 | 3.43 s | 0.997 | OPE -0.63% (better on 10/10) | | |
| | OKMeansFAISS | 2.58900e+06 | 2.60302e+06 ± 9.2e+03 | 2.61860e+06 | 3.25 s | 0.997 | OPE -0.63% (better on 10/10) | | |
| | TIKMeans | 2.74346e+06 | 2.78483e+06 ± 3.1e+04 | 2.83553e+06 | 16.44 s | 0.997 | OPE -7.11% (better on 10/10) | | |
| ### DEEP-5 | |
| | method | best | mean ± sd | worst | mean time | outlier F1 | vs OPE-means (paired) | | |
| |---|---|---|---|---|---|---| | |
| | OPE-means | 7.78333e+07 | 7.78347e+07 ± 8.9e+02 | 7.78355e+07 | 10.06 s | 1.000 | | | |
| | KMeans++ | 7.79673e+07 | 7.88737e+07 ± 1.1e+06 | 8.15893e+07 | 23.55 s | 1.000 | OPE -1.30% (better on 10/10) | | |
| | OKMeans | 7.78880e+07 | 7.80777e+07 ± 2.4e+05 | 7.86324e+07 | 68.78 s | 1.000 | OPE -0.31% (better on 10/10) | | |
| | OKMeans2 | 7.78880e+07 | 7.80474e+07 ± 2.4e+05 | 7.86324e+07 | 70.29 s | 1.000 | OPE -0.27% (better on 10/10) | | |
| | OKMeans2FAISS | 7.78880e+07 | 7.80777e+07 ± 2.4e+05 | 7.86324e+07 | 26.53 s | 1.000 | OPE -0.31% (better on 10/10) | | |
| | OKMeansFAISS | 7.78880e+07 | 7.80777e+07 ± 2.4e+05 | 7.86324e+07 | 27.42 s | 1.000 | OPE -0.31% (better on 10/10) | | |
| | TIKMeans | 8.24988e+07 | 8.27830e+07 ± 2.6e+05 | 8.34321e+07 | 53.77 s | 1.000 | OPE -5.98% (better on 10/10) | | |
| ### DEEP-10 | |
| | method | best | mean ± sd | worst | mean time | outlier F1 | vs OPE-means (paired) | | |
| |---|---|---|---|---|---|---| | |
| | OPE-means | 7.78333e+07 | 7.78347e+07 ± 8.9e+02 | 7.78355e+07 | 9.76 s | 1.000 | | | |
| | KMeans++ | 7.81424e+07 | 7.92827e+07 ± 8.9e+05 | 8.16217e+07 | 23.37 s | 1.000 | OPE -1.81% (better on 10/10) | | |
| | OKMeans | 7.78948e+07 | 7.81690e+07 ± 3.5e+05 | 7.91241e+07 | 70.00 s | 1.000 | OPE -0.43% (better on 10/10) | | |
| | OKMeans2 | 7.78948e+07 | 7.81611e+07 ± 3.5e+05 | 7.91241e+07 | 70.16 s | 1.000 | OPE -0.42% (better on 10/10) | | |
| | OKMeans2FAISS | 7.78948e+07 | 7.81690e+07 ± 3.5e+05 | 7.91241e+07 | 26.98 s | 1.000 | OPE -0.43% (better on 10/10) | | |
| | OKMeansFAISS | 7.78948e+07 | 7.81690e+07 ± 3.5e+05 | 7.91241e+07 | 26.28 s | 1.000 | OPE -0.43% (better on 10/10) | | |
| | TIKMeans | 8.21909e+07 | 8.29012e+07 ± 3.9e+05 | 8.35346e+07 | 50.25 s | 1.000 | OPE -6.11% (better on 10/10) | | |
| ## Iteration 17: nature-inspired seeding — Murmuration and Compass (`ope_iter17_seeding`, dev seeds 1-20, 4 threads) — negative | |
| * **Murmuration** (density peaks + flock cohesion): density ρ from the sphere through each point's K-th nearest | |
| neighbour ("Gaussian surface"); δ = distance to the nearest denser point ("ant trail"); leaders maximise ρ·δ | |
| (Rodriguez & Laio 2014), sparse points cannot lead, leaders take mean-shift steps to their flock's mean. | |
| * **Compass** (the global-centre idea): from the global median, split rows by sign along the top principal axes and | |
| by distance (inner/outer shell); start at the k most populated regions. | |
| Seed cost alone (5 seeds, on a 200k sample): Murmuration starts *worse* than trimmed D² on SKIN-10 (1.82e5 vs 6.57e4), | |
| SUSY-10 (3.40e6 vs 2.68e6) and KDDFULL (4.40e6 vs 1.84e6); Compass starts better on SUSY-10 and KDDFULL, worse on SKIN. | |
| End to end (v3 otherwise unchanged), hit rate = share of runs within 1e-5 of the best cost found on that dataset: | |
| | dataset | trimmed D² (v3) | Murmuration | Compass | | |
| |---|---|---|---| | |
| | SHUTTLE | 100% (2.9 s) | 100% (4.0 s) | 100% (3.3 s) | | |
| | SKIN-5 | 95% (2.0 s) | 85% (4.2 s) | **100%** (1.8 s) | | |
| | SKIN-10 | 100% (1.8 s) | 95% (3.9 s) | 45% (2.5 s) | | |
| | KDDFULL | 100% (1.8 s) | 100% (3.7 s) | 100% (2.1 s) | | |
| | SUSY-5 | 90% (4.8 s) | 80% (5.5 s) | 75% (5.4 s) | | |
| | SUSY-10 | 100% (4.9 s) | 90% (5.5 s) | 80% (5.6 s) | | |
| Reading. Density-peak starts sit in dense cores; the search then settles more often into a nearby local optimum, | |
| while the spread-out trimmed D² start leads it to the one that minimises total distance. Neither seeding is kept. | |
| The remaining misses of v3 are 1/20 on SKIN-5 and 2/20 on SUSY-5. | |
| ## Iteration 18: correction — the move-type setting had no effect (bug), and the Ant colony | |
| **Bug.** In `local_search` the counter of accepted moves was also named `moves` (`moves = 0` before the loop), which | |
| overwrote the `moves` setting ("split" / "reseed" / "both") before it was read. Every run therefore used **both** | |
| move families. Consequences for earlier entries: | |
| * Iteration 11's "split moves" and "reseed moves" rows were both the full method: the conclusion "either move | |
| family alone reaches the same optimum" is **withdrawn**; the correct ablation is re-run below. | |
| * Iteration 13's v2_both and v2_reseed were the same configuration (hence identical results), and OPE-means v2/v3, | |
| described as "reseed moves only", in fact used both families. The frozen configurations now say `moves="both"`. | |
| * The final confirmation is **unaffected**: it ran exactly this code path. Re-running v3 after the fix reproduces the | |
| final run bit for bit (SKIN-10 seed 42: 60774.40183077059; SHUTTLE seed 123: 53736.40632201257, both identical). | |
| **Ant colony.** `colony` quick ants, each a full local search on its own 50k-row subsample, leave their centres in a | |
| shared pool ("pheromone"); the main search gets extra moves that put any of its centres onto a pooled one, so good | |
| pieces of different local optima can combine. Tested on dev seeds 1-20 against the correct move ablation. | |
| **Iteration 18 results** (`ope_iter18_moves_colony`, dev seeds 1-20, 4 threads; hit = within 1e-5 of the best cost | |
| found on that dataset): | |
| | dataset | both families (v3) | split moves only | reseed moves only | v3 + ant colony (5 ants) | | |
| |---|---|---|---|---| | |
| | SHUTTLE | 100% (2.9 s) | **0%**, worst +39.2% | 100% | 100% (8.8 s) | | |
| | SKIN-5 | 95% | 95% | 95% | 80% | | |
| | SKIN-10 | 100% | 95% | 95% | 95% | | |
| | KDDFULL | 100% | 100% | 100% | 100% | | |
| | SUSY-5 | 90% (4.8 s) | 90% | **15%**, worst +0.60% | **0%** (13.3 s) | | |
| | SUSY-10 | 100% (4.9 s) | 95% | **10%**, worst +0.42% | 10% (13.5 s) | | |
| Reading. **Both move families are essential, on different data.** The principal-axis split (PISCES' "two fish") is | |
| what reaches the optimum on SUSY (without it 10-15% of runs); the delete-and-reseed move is what reaches it on | |
| SHUTTLE (without it every run misses, by up to 39%). This replaces the withdrawn iteration 11 conclusion. | |
| The ant colony is **negative**: its ~50 pooled-centre moves per slot look good before Lloyd and crowd the split moves | |
| out of the 10-candidate funnel. The same crowding may explain v3's two SUSY-5 misses, so iteration 19 gives every move | |
| family its own quota in the funnel. | |
| ## Iteration 19: per-family funnel quota (`ope_iter19_quota`, dev seeds 1-20) — negative | |
| | dataset | v3 (10 by one-shot cost) | 5 per move family | 5 per family + ant colony | | |
| |---|---|---|---| | |
| | SHUTTLE / SKIN-10 / KDDFULL | 100% | 100% | 100% | | |
| | SKIN-5 | 95% | 95% | 85% | | |
| | SUSY-5 | 90% | **50%** | 35% | | |
| | SUSY-10 | 100% | **75%** | 55% | | |
| The crowding hypothesis is wrong: SUSY needs the split moves (iteration 18), and a quota of 5 cuts them from up to | |
| 10 funnel slots to 5. The colony stays negative. Next: a wider funnel (more split candidates get Lloyd-scored). | |
| ## Iteration 20: wider funnel (`ope_iter20_funnel`, dev seeds 1-20) — no change | |
| | funnel width (one-shot top-N Lloyd-scored) | SKIN-5 | SUSY-5 | SUSY-10 | others | time | | |
| |---|---|---|---|---|---| | |
| | 10 (v3) | 95% | 90% | 100% | 100% | 1.8-4.9 s | | |
| | 15 | 90% | 90% | 100% | 100% | +5-45% | | |
| | 20 | 90% | 95% | 100% | 100% | +10-50% | | |
| Within seed noise (one run in 20 either way) at a higher cost. **Conclusion of iterations 17-20:** none of the seeding | |
| (Murmuration, Compass), pooling (ant colony) or funnel changes (quota, width) raises the hit rate of v3; its rare | |
| misses (1/20 on SKIN-5, 2/20 on SUSY-5, each within 0.11% of the best) are basins that single-swap search from a | |
| trimmed D² start does not leave. v3 stays the frozen configuration. What these iterations did establish: both move | |
| families are essential (iteration 18), and the shadowed-setting bug is fixed with the final results unaffected. | |
| ## Iterations 21-23: Lévy flight — two-centre jumps when no single move helps (dev seeds 1-20, 4 threads) | |
| Foraging animals mostly take short steps and occasionally one long flight to a new patch. When the single-move search | |
| stops, OPE-means tries jumps that move **two centres at once** (multi-swap local search; Kanungo et al. 2004 show the | |
| p-swap neighbourhood tightens the approximation guarantee from ~25 to (3+2/p)²): every pair of centres, each re-placed | |
| at a trimmed-D² draw, scored exactly by the eclipse kernel, the best 10 Lloyd-scored and the best refined; a successful | |
| jump resumes the single-move search. Iteration 22 adds split-based jumps (split + re-place: 3 centres; double split: 4 | |
| centres), with the eclipse kernel extended to up to 4 changed centres (each row keeps its 5 nearest centres; exact to | |
| 3e-16 against brute force for k = 3, 5, 10). | |
| | dataset | v3 | Lévy (shared RNG) | Lévy + split jumps | **Lévy, own RNG (v4)** | Lévy ×1 + 50 split jumps | | |
| |---|---|---|---|---|---| | |
| | SHUTTLE | 100% (2.9 s) | 95% (seed 1 +3.5%) | 100% (5.0 s) | **100%** (3.4 s) | 100% (3.4 s) | | |
| | SKIN-5 | 95% (2.0 s) | 100% | 100% (4.6 s) | **100%** (3.0 s) | 100% (3.2 s) | | |
| | SKIN-10 | 100% (1.8 s) | 100% | 100% (3.7 s) | **100%** (2.4 s) | 100% (2.6 s) | | |
| | KDDFULL | 100% (1.8 s) | 100% | 100% (2.5 s) | **100%** (2.1 s) | 100% (2.2 s) | | |
| | SUSY-5 | 90% (4.8 s) | 90% | 90% | **90%** (5.2 s) | 90% | | |
| | SUSY-10 | 100% (4.9 s) | 100% | 100% | **100%** (5.0 s) | 100% | | |
| The first version shared the search's random stream, so even failed jumps changed later draws (SHUTTLE seed 1); | |
| with its own stream a run where no jump succeeds is identical to v3. Split jumps add time without adding hits. | |
| **The SUSY-5 trap (seeds 16 and 18, both +0.1%).** Not sample noise: on seed 16's own 500k sample the optimum is | |
| 0.098% cheaper than the miss (and 0.07-0.12% cheaper on five other samples). Matching the missed solution's centres to | |
| the optimum's: seed 16 has one centre 2.1 typical spacings away from where it belongs (the other nine within 0.54); | |
| seed 18 has three centres each 0.3-0.7 spacings off. Escaping needs either one long relocation that only pays after | |
| its neighbours re-adjust, or a coordinated shift of several centres; neither is reachable by improving steps of one or | |
| two centres. **Frozen as OPE-means v4** (`OPE_V4`): +1 hit in 120 dev runs, +0.4-1.0 s on the small datasets. | |
| **v4 on the paper's 10 seeds, all 10 datasets** (`results/final_ope_v4/`; nothing tuned on these seeds; the official | |
| baselines are those of the v3 final run). Hit = within 1e-5 of the best cost of v3 and v4 on that dataset: | |
| | dataset | v3 hits | v4 hits | worst run v3 → v4 | seeds changed (better) | | |
| |---|---|---|---|---| | |
| | SHUTTLE | 10/10 | 10/10 | +0.000% → +0.000% | 3 (3) | | |
| | SKIN-5 | 8/10 | **10/10** | +0.019% → +0.000% | 6 (5) | | |
| | SKIN-10 | 10/10 | 10/10 | +0.000% → +0.000% | 1 (1) | | |
| | KDDFULL | 10/10 | 10/10 | +0.000% → +0.000% | 0 | | |
| | SUSY-5 | 6/10 | 7/10 | +0.111% → +0.111% | 1 (1) | | |
| | SUSY-10 | 8/10 | 9/10 | **+0.415% → +0.116%** | 1 (1) | | |
| | COVTYPE-5 | 8/10 | 7/10 | +0.011% → +0.011% | 5 (2) | | |
| | COVTYPE-10 | 2/10 | 4/10 | +0.030% → +0.030% | 7 (5) | | |
| | DEEP-5 / DEEP-10 | 3/10 | 2/10 | +0.003% → +0.003% | 3 (1) | | |
| On COVTYPE and DEEP all runs lie within 0.03% of each other; the hit counts there move with Lloyd's stopping precision | |
| (tidal stop at 1e-4 of rows), not between basins. The SUSY-5 trap remains on 3 paper seeds. | |
| ## Iteration 24: the SUSY-5 trap is a settling problem (`ope_iter24_trap`, dev seeds 16 and 18) | |
| | change (on v4) | seed 16 | seed 18 | | |
| |---|---|---| | |
| | 10 / 25 re-seed draws per centre (instead of 3) | 4.7520e7 | 4.7527e7 | | |
| | refine the best 3 candidates (instead of 1) | **4.7475e7** | 4.7527e7 | | |
| | 8 trimmed-Lloyd steps before ranking (instead of 3) | **4.7475e7** | 4.7527e7 | | |
| | **15 steps before ranking** | **4.7475e7** | **4.7475e7** | | |
| The escaping move was in the candidate list; it was ranked out because it only shows its value once the neighbouring | |
| centres have re-settled. Full check across all datasets running. | |
| **Iteration 24, full check** (`ope_iter24_swap`, dev seeds 1-20): longer settling *moves* the SUSY-5 miss instead of | |
| removing it (8 steps: misses seed 18; 15 steps: fixes 16 and 18 but misses seed 17), 19/20 either way, at +10-35% time | |
| on every dataset. Not adopted. | |
| ## Iteration 25: the trap belongs to the sample — independent starts on independent samples (`ope_iter25_*`) | |
| Two starts on the *same* 500k sample miss the same seeds (16, 18), at twice the time: from that sample's landscape | |
| both starts fall into the trap. Giving the second start its **own** 500k sample fixes both. In v5 the second start | |
| resamples only when the data are larger than the sample (on SHUTTLE/SKIN the "sample" is the whole dataset and | |
| resampling would only reshuffle rows and shift the random stream: a first attempt that resampled there lost SKIN-5 | |
| seed 16; with the guard, all 60 small-data runs are bit-identical to v4). | |
| | dataset | v3 | v4 (Lévy) | **v5 (Lévy + independent samples)** | v5 time | | |
| |---|---|---|---|---| | |
| | SHUTTLE | 20/20 | 20/20 | **20/20** | 3.7 s | | |
| | SKIN-5 | 19/20 | 20/20 | **20/20** | 3.1 s | | |
| | SKIN-10 | 20/20 | 20/20 | **20/20** | 2.5 s | | |
| | KDDFULL | 20/20 | 20/20 | **20/20** | 3.7 s | | |
| | SUSY-5 | 18/20 | 18/20 | **20/20** | 10.3 s | | |
| | SUSY-10 | 20/20 | 20/20 | **20/20** | 10.8 s | | |
| | **total** | 117/120 | 118/120 | **120/120** | | | |
| **Frozen as OPE-means v5** (`OPE_V5`): every dev run on every dataset reaches the best solution found. Cost: about | |
| 2× time on the 5M-row datasets (SUSY 5 s → 10-11 s, still below the authors' OKMeans variants at 13-30 s). | |
| **v5 on the paper's 10 seeds, all 10 datasets** (`results/final_ope_v5/`; nothing tuned on these seeds). Hit = within | |
| 1e-4 of the best cost of v3, v4 and v5 on that dataset; times are each run's own session (v3: final-run session). | |
| | dataset | v3 hits (worst) | v4 hits (worst) | **v5 hits (worst)** | v5 time | v5 vs OKMeans (paired) | | |
| |---|---|---|---|---|---| | |
| | SHUTTLE | 10/10 (+0.000%) | 10/10 | 10/10 (+0.000%) | 4.0 s | −20.64% | | |
| | SKIN-5 | 8/10 (+0.019%) | 10/10 | 10/10 (+0.000%) | 2.8 s | −11.93% | | |
| | SKIN-10 | 10/10 | 10/10 | 10/10 (+0.000%) | 2.4 s | −11.99% | | |
| | KDDFULL | 10/10 | 10/10 | 10/10 (+0.000%) | 3.8 s | −14.90% | | |
| | SUSY-5 | 6/10 (+0.111%) | 7/10 (+0.111%) | **9/10 (+0.095%)** | 11.9 s | −1.68% | | |
| | SUSY-10 | 8/10 (+0.415%) | 9/10 (+0.116%) | **10/10 (+0.000%)** | 10.5 s | −1.05% | | |
| | COVTYPE-5 | 9/10 (+0.011%) | 9/10 | **10/10 (+0.000%)** | 6.0 s | −0.88% | | |
| | COVTYPE-10 | 4/10 (+0.030%) | 5/10 | 6/10 (+0.016%) | 6.3 s | −0.64% | | |
| | DEEP-5 | 10/10 (+0.003%) | 10/10 | 10/10 (+0.002%) | 22.7 s | −0.31% | | |
| | DEEP-10 | 10/10 (+0.003%) | 10/10 | 10/10 (+0.002%) | 22.1 s | −0.43% | | |
| v5 still has a lower cost than every one of the authors' algorithms on every seed on all 10 datasets, and its worst | |
| runs are the closest to the best of any version (largest gap +0.095% on SUSY-5, was +0.415% for v3). Time: faster than | |
| the fastest OKMeans variant (FAISS) on KDDFULL (3.8 vs 13 s), SUSY (11-12 vs 13-17.5 s) and DEEP (22 vs 26-27 s); | |
| **slower on COVTYPE** (6 vs 3.1-3.4 s; v3 took 2.3 s), where the data are just above the 500k sample size and get two | |
| starts plus Lévy flights. | |
| ## Write-up and release (`paper_ope/`, Hugging Face `Nabidnur/OPE-means`) | |
| Technical report `paper_ope/opemeans.pdf`; every number, table and plotted point is generated from the raw result | |
| files by `paper_ope/make_data.py`. Checks made while writing it: | |
| * **Worst seed vs best baseline run.** OPE-means v5's worst paper seed is lower than the best of the 60 baseline runs | |
| on all 10 datasets (margins: SHUTTLE −5.889%, SKIN-5 −0.081%, SKIN-10 −3.581%, KDDFULL −0.008%, SUSY-5 −0.074%, | |
| SUSY-10 −0.309%, COVTYPE-5 −0.108%, COVTYPE-10 −0.095%, DEEP-5 −0.068%, DEEP-10 −0.076%). 570/570 paired runs won. | |
| * **Search traces** (`paper_ope/tools/trace_runs.py`; `local_search(trace=[...])` records each accepted move, diagnostics | |
| only). The traced runs reproduce the v5 paper-seed-42 runs bit for bit on SHUTTLE, SKIN-10, KDDFULL and SUSY-10. | |
| Measured on all rows, SUSY-10's two starts end 0.005% and 0.003% above the final cost: the 1.1% gap between their | |
| *sample* costs was sample noise, and one accepted Lévy flight raised the full-data cost by 0.003% while lowering the | |
| sample cost. This is why starts are compared on all rows. | |
| * **2-D illustration**: 10 of 40 OKMeans-style seeds end at 2.1–3.3× the optimal cost (two centres in one cluster, | |
| one centre between two); OPE-means reaches the lowest cost of all 41 runs. | |
| * New tests `tests/test_opemeans.py`: eclipse kernels exact against brute force (k = 3, 5, 10; up to 4 changed | |
| centres), tidal locking reaches Hamerly's fixed point, end-to-end v5, tracing changes nothing. | |