OPE-means β€” robust k-means without the seed lottery

ARIES series, report #2. OPE-means solves k-means with outliers (choose k centres, drop the z farthest points, minimise the k-means cost of the rest). On the benchmark of OKMeans / OKMeans2 (Jiang & Zhou, NeurIPS 2026), run with the authors' own code on the same machine, OPE-means has a lower robust cost than every one of their algorithms on every one of the 570 paired runs β€” and its worst seed beats every baseline's best seed on all 10 datasets (4 of them held out).

πŸ“„ Technical report: paper/opemeans.pdf Β· πŸ§ͺ Notebooks: notebooks/ Β· πŸ“’ Full experiment log (25 iterations, negative results included): docs/EXPERIMENT_LOG.md

every paired run

Headline results (the paper's 10 seeds, 4 CPU threads, authors' code commit d820666)

dataset OPE-means v5 mean cost OKMeans mean cost reduction vs OKMeans vs best baseline OPE time OKMeans (FAISS) time
SHUTTLE 53736 68233 βˆ’20.64% βˆ’12.06% 4.0 s 0.9 s
SKIN-5 57641 65666 βˆ’11.93% βˆ’6.20% 2.8 s 1.8 s
SKIN-10 60774 69449 βˆ’11.99% βˆ’8.00% 2.4 s 1.7 s
KDDFULL 3.3078e+07 4.019e+07 βˆ’14.90% βˆ’14.90% 3.8 s 13.0 s
SUSY-5 4.7479e+07 4.8299e+07 βˆ’1.68% βˆ’1.09% 11.9 s 13.4 s
SUSY-10 4.8215e+07 4.873e+07 βˆ’1.05% βˆ’1.05% 10.5 s 17.5 s
COVTYPE-5 † 2.5769e+06 2.5998e+06 βˆ’0.88% βˆ’0.70% 6.0 s 3.1 s
COVTYPE-10 † 2.5863e+06 2.603e+06 βˆ’0.64% βˆ’0.64% 6.3 s 3.2 s
DEEP-5 † 7.7834e+07 7.8078e+07 βˆ’0.31% βˆ’0.27% 22.7 s 27.4 s
DEEP-10 † 7.7834e+07 7.8169e+07 βˆ’0.43% βˆ’0.42% 22.1 s 26.3 s

† held out: built with the paper's recipe, never used during development. Reductions are paired by seed (mean of 10). "Best baseline" is, per dataset, the baseline with the lowest mean cost among OKMeans, OKMeans2, their FAISS variants, TIKMeans and k-means++.

  • 57/57 dataset Γ— baseline comparisons won on all 10 seeds; 570/570 paired runs won (smallest margin 0.008%, median 2.8%).
  • Worst OPE-means seed vs best baseline run (60 per dataset): lower on 10/10 datasets.
  • 120/120 development runs reach the best solution found; a search 20Γ— heavier finds nothing better.
  • Faster than the fastest OKMeans variant on KDDFULL (3.4Γ—), SUSY and DEEP; slower on SHUTTLE, SKIN and COVTYPE (see limitations).

Why OKMeans plays a lottery, and how OPE-means stops it

problem

OKMeans' guarantee covers the outlier filter; the clustering itself is one draw of k-means++ followed by Lloyd. Lloyd only moves a centre to the mean of its cluster, so a draw that puts two centres in one cluster and one centre between two is never repaired. On SHUTTLE the authors' OKMeans ranges from 6.26e4 to 8.24e4 over their 10 seeds.

architecture

OPE-means keeps the trimmed objective and replaces that draw by a search:

component what it does what it buys
🐟 Principal-axis split split cluster s at its Gaussian half-means c Β± √(2/Ο€) σ₁ u₁ and delete centre t (all k(kβˆ’1) pairs) reaches the optimum on SUSY (without it: 10–15% of runs)
🌱 Delete-and-re-seed delete t, re-seed at a trimmed-D² draw reaches the optimum on SHUTTLE (without it: 0% of runs, up to +39%)
🌘 Eclipse scoring a move changes ≀ 2 centres, so each row's new distance needs only its 3 nearest centres: the exact cost of all 120 moves in one Numba pass 2–3Γ— faster search, identical answers
πŸ¦… LΓ©vy flight when no single move helps, two-centre jumps (135 per flight, 5-nearest eclipse kernel) fixes SKIN-5 and the worst SUSY-10 seed
🎲 Independent samples each start searches its own 500k-row sample; starts compared on all rows a trap belongs to a sample: SUSY-5 dev hits 18/20 β†’ 20/20
🌊 Tidal locking exact trimmed Lloyd: rows locked inside their Voronoi cell and on one side of the trimming horizon Ο„ Β± D do no work 6–14% of Lloyd's distance computations, bit-identical

one search round mechanisms

Analysis

cost and time hit rates
ablation trajectory

Version journey on the paper's seeds (runs reaching the best known solution, of 100): v3 85 β†’ v4 (+LΓ©vy) 90 β†’ v5 (+independent samples) 95. Worst v5 run: +0.095% (SUSY-5), +0.016% (COVTYPE-10), ≀ 0.002% elsewhere.

Negative results (all logged): exact half-means children, full-data split–merge polish, Constellations (weighted sketch), Murmuration (density-peak + flock seeding), Compass (global-centre seeding), ant colony (pooled centres), per-family funnel quotas, wider funnels, longer settling, LΓ©vy split jumps. Three bugs found during development and their corrections are documented in the report (Β§6.5) and the log.

Rating (self-assessment, honest)

criterion score why
Quality vs the 2026 SOTA (OKMeans/OKMeans2) 9.5 / 10 wins 570/570 paired runs with the authors' own code; worst seed beats their best on 10/10 datasets
Reliability (seed independence) 9 / 10 120/120 dev runs at the best known solution; 95/100 paper runs (worst +0.095%)
Speed 7 / 10 faster on the 5M-row datasets and DEEP; ~2Γ— slower on COVTYPE, 1.4–4.5Γ— slower on SHUTTLE/SKIN (all < 4 s)
Rigor and reproducibility 9.5 / 10 official code, same machine, dev/report seed split, held-out data, every number generated from raw files, bugs disclosed
Generality 6 / 10 tested for k ≀ 10 only; the O(kΒ²) move set needs sampling for large k; no new approximation guarantee
Overall 8.5 / 10 a near-deterministic, state-of-the-art robust k-means on this benchmark, with clear limits

Limitations

  • Time: on COVTYPE (587k rows, just above the 500k sample) OPE-means takes ~2Γ— OKMeans (FAISS); on SHUTTLE and SKIN 1.4–4.5Γ— (all under 4 s). Plain k-means++ is faster everywhere, at a much higher cost.
  • Small k only: the benchmark has k ≀ 10; every round tries O(kΒ²) moves.
  • Outlier F1 equals the best baseline within 0.012 on 8 datasets, 0.018 lower on SUSY-5, and 0.000 vs 0.171 on SHUTTLE (its "outliers" are the two smallest classes, not distant points). The objective is cost.
  • No new guarantee; v5 and the baselines' times come from different sessions on the same machine.

Quick start

import numpy as np
from aries.opemeans import ope_means, OPE_V5, robust_cost
X = np.load("my_data.npy").astype(np.float32)          # n x d
C, cost, info = ope_means(X, k=10, z=int(0.01 * len(X)), seed=0, **OPE_V5)
print(cost, robust_cost(X, C, int(0.01 * len(X))))

Requirements: pip install -r requirements.txt (numpy, numba, faiss-cpu). Tests: python -m pytest -q tests/.

Reproduce

python benchmarks/get_robust_data.py DATA_DIR && python benchmarks/get_heldout_data.py DATA_DIR
git clone https://github.com/MasterZhou1/Robust-Clustering OFFICIAL && git -C OFFICIAL checkout d820666
bash benchmarks/run_final_ope.sh DATA_DIR OFFICIAL 4        # authors' baselines (+ OPE-means v3)
bash benchmarks/run_final_ope_v5.sh DATA_DIR 4               # OPE-means v4 and v5
python paper/make_data.py                                    # every number, table and plot of the report

Files

path contents
aries/opemeans.py the algorithm (frozen configs OPE_V1 … OPE_V5), Numba kernels
benchmarks/ data preparation, the memory-only patch for the authors' code, run scripts, summaries
results/final_ope/ the authors' algorithms (JSON, per run) and OPE-means v3; final_ope_v4/, final_ope_v5/
results/dev/ every development run (seeds 1–20)
paper/ LaTeX source, PDF, figure sources (TikZ/PGFPlots, PlotNeuralNet styles), make_data.py, tools/trace_runs.py
notebooks/ 01_quickstart (synthetic, ~1 min), 02_results_analysis (all headline numbers from raw results)
tests/ exactness of the eclipse kernels and of tidal locking, end-to-end smoke tests

Citation

@techreport{aries2_opemeans_2026,
  title  = {OPE-means: Exhaustive Swap Search with Exact Eclipse Scoring Makes Robust k-Means Seed-Independent},
  author = {Aryan},
  institution = {ARIES Series, Technical Report No. 2},
  year   = {2026}
}

Baseline: Jiang & Zhou, Simple KNN-Based Outlier Detection Achieves Robust Clustering, NeurIPS 2026 (arXiv:2605.07130). PlotNeuralNet layer styles: H. Iqbal, MIT licence (paper/PLOTNEURALNET_LICENSE).

Downloads last month

-

Downloads are not tracked for this model. How to track
Inference Providers NEW
This model isn't deployed by any Inference Provider. πŸ™‹ Ask for provider support

Paper for Nabidnur/OPE-means