Lune

NeurIPS2020Top-tier venue

BanditPAM: Almost Linear Time k-Medoids Clustering via Multi-Armed Bandits

Mo Tiwari, Martin Jinye Zhang, James Mayclin, Sebastian Thrun, Chris Piech, Ilan Shomorony

Abstract

Clustering is a ubiquitous task in data science. Compared to the commonly used k-means clustering, k-medoids clustering requires the cluster centers to be actual data points and supports arbitrary distance metrics, which permits greater interpretability and the clustering of structured objects. Current state-of-the-art k-medoids clustering algorithms, such as Partitioning Around Medoids (PAM), are iterative and are quadratic in the dataset size n for each iteration, being prohibitively expensive for large datasets. We propose BanditPAM, a randomized algorithm inspired by techniques from multi-armed bandits, that reduces the complexity of each PAM iteration from O(n 2 ) to O(n log n) and returns the same results with high probability, under assumptions on the data that often hold in practice. As such, BanditPAM matches state-of-the-art clustering loss while reaching solutions much faster. We empirically validate our results on several large real-world datasets, including a coding exercise submissions dataset from Code.org, the 10x Genomics 68k PBMC single-cell RNA sequencing dataset, and the MNIST handwritten digits dataset. In these experiments, we observe that BanditPAM returns the same results as state-of-the-art PAM-like algorithms up to 4x faster while performing up to 200x fewer distance computations. The improvements demonstrated by BanditPAM enable k-medoids clustering on a wide range of applications, including identifying cell types in large-scale single-cell data and providing scalable feedback for students learning computer science online. We also release highly optimized Python and C++ implementations of our algorithm 1 .

Ask Lune

Know this paper in minutes, not an afternoon.

Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.

9 top-tier papers have cited it since. Know what they found before your reviewers do.

Questions to start from

Lune can draw on

the full paper · the top-tier papers that cite it · related work

Get the answer

Free to start. No credit card required.

Lineage

Builds onCited byLeft to right by year; the more cited, the higher.

Cited by top-tier papers9

  1. Towards Understanding and Enhancing Robustness of Deep Learning Models against Malicious Unlearning AttacksWei Qian, Chenxu Zhao, Wei Le, Meiyi Ma et al.KDD 2023 · 38 citations
  2. Adaptive Sampling for Efficient Softmax ApproximationTavor Z. Baharav, Ryan Kang, Colin Sullivan, Mo Tiwari et al.NeurIPS 2024 · 7 citations
  3. Simple, Scalable and Effective Clustering via One-Dimensional ProjectionsMoses Charikar, Monika Henzinger, Lunjia Hu, Maximilian Vötsch et al.NeurIPS 2023 · 6 citations
  4. Faster Maximum Inner Product Search in High DimensionsMo Tiwari, Ryan Kang, Jaeyong Lee, Donghyun Lee et al.ICML 2024 · 6 citations
  5. BanditPAM++: Faster k-medoids ClusteringMo Tiwari, Ryan Kang, Donghyun Lee, Sebastian Thrun et al.NeurIPS 2023 · 6 citations

Related papers

  1. OneBatchPAM: A Fast and Frugal K-Medoids AlgorithmAntoine de Mathelin, Nicolas Enrique Cecchi, François Deheeger, Mathilde Mougeot et al.AAAI 2025 · 3 citations
  2. Fast Local Search Algorithms for Clustering with Adaptive Sampling and Bandit StrategiesJunyu Huang, Zhen Zhang, Beirong Cui, Jianxin Wang et al.NeurIPS 2025
  3. Fast kk-Means via Data-Aware Grouping and Gap-Optimized Lower BoundXiaogang Huang, Dan Zhuang, Jianbao Chen, Tiefeng Ma et al.ICDE 2026
  4. Scalable Differentially Private Clustering via Hierarchically Separated TreesVincent Cohen-Addad, Alessandro Epasto, Silvio Lattanzi, Vahab Mirrokni et al.KDD 2022 · 8 citations
  5. Sample-and-Search: An Effective Algorithm for Learning-Augmented k-Median Clustering in High DimensionsKangke Cheng, Shihong Song, Guanlin Mo, Hu DingAAAI 2026
Dusk over the sea between two cliffs drawn in fine vertical lines