Clustering with Weak Distance Oracles

Aryan Esmailpour, Rahul Raychaudhury, sainyam galhotra, Stavros SintosNeurIPS 2026

TL;DR

Modern clustering often relies on cheap, lightweight embedding models or heuristics to estimate distances between items—meaning those distances can be wildly noisy or outright wrong nearly half the time. While prior algorithms relied on expensive "ground-truth" checks to clean up this mess, this paper proves you don't need them at all. Using only a noisy distance oracle, the authors show how to compress massive datasets into tiny, clean summaries whose clustering cost remains within a constant factor of the true optimum.

What Problem Does This Paper Address?

Imagine clustering millions of images or documents using $k$-means or $k$-median. Computing exact semantic distances for all pairs with a massive deep neural network is prohibitively expensive. Instead, practitioners often use cheap proxies—compact neural architectures, simple metadata heuristics, or human feedback.

To formalize this, researchers recently introduced "weak–strong" oracle models: a cheap weak oracle gives noisy distances, and an expensive strong oracle gives exact ones. Historically, every algorithm in this setup still leaned on the strong oracle as a crutch, trying to minimize strong queries rather than eliminate them.

The authors ask a bold question: What if we throw away the strong oracle entirely? Suppose your only window into the metric space is a weak oracle that returns the true distance with probability $1/2 + \varepsilon$ (just slightly better than a coin flip!) and an arbitrary, adversarially corrupted number the rest of the time. Worse, the oracle's randomness is fixed once—asking the same pair twice yields the exact same lie. Under these treacherous conditions, the goal is to build a $\text{Coreset+}$: a small subset of representative points plus a mapping from every input point to a representative, whose total assignment cost is within $O(1)$ of the optimal $k$-clustering.

Methods

If you can't trust individual distances, how do you map geometry? If you already knew a group of points $U$ lived tightly together in the true metric, the median of their weak distances to an outside point $v$ would reliably filter out noise (since $>50\%$ of queries are uncorrupted). Prior work used strong queries to find these tight groups.

To find them using only weak queries, the authors invent three empirical primitives:

  • Separation: The median weak distance between pairs across two sets.
  • Density: The fraction of pairs inside a set $U$ with weak distance $\le r$.
  • Cohesiveness: Ensuring $U$ can't be split into two chunks whose separation exceeds $r$ (ruling out two far-apart dense clusters masquerading as one).

When a set $U$ of size $\Theta(\log n)$ is both dense and cohesive, it is guaranteed to cluster tightly around a hidden "anchor" point $a_U$, letting us estimate distances to $v$ via medians!

Estimating distance to a dense, cohesive candidate set U via median weak distances.

However, because candidate sets are chosen after looking at oracle answers, a few "exceptional" outside points might have correlated corruptions that make them look artificially close to $U$. The authors build a clever multi-round peel-and-filter pipeline around two variants of Stage 1:

  1. AlgQ (Quasi-polynomial time): Samples $\Theta(k \cdot \text{polylog } n)$ points and brute-force checks subsets of size $\Theta(\log n)$ to find dense, cohesive candidate sets, sparsifying them into a net.
  2. AlgP (Polynomial time): Replaces brute-force search with a larger sample and a Semidefinite Programming (SDP) relaxation that guides weighted random sampling to efficiently recover dense candidate sets.

In Stages 2 & 3, both algorithms expand neighborhoods around candidates until growth slows down, draw fresh validation samples to neutralize "exceptional" points, and safely filter and map half the active points per round to multiple low-cost representatives.

Datasets

To test $k$-means ($p=2$) under simulated adversarial noise (where corrupted queries swap intra-cluster and inter-cluster distances), the authors evaluate on three datasets—no new benchmarks are introduced, following standard clustering evaluations:

  • MNIST: 60,000 handwritten digit images, tested via two embeddings: 2D t-SNE and 50D truncated SVD.
  • Credit: A standard real-world tabular benchmark dataset.
  • Stochastic Block Model (SBM): Synthetic graph-based cluster data.

Key Insights and Ideas

  • Weak queries already hold all the geometry you need: AlgQ uses $O(nk \text{ polylog } n)$ weak queries—matching the weak-query budget of prior hybrid methods, while dropping their $O(k^2 \text{ polylog } n)$ strong queries down to zero.
  • A fundamental computational-statistical gap: Why does AlgP output a larger coreset of size $O(k^2 \text{ polylog } n)$ instead of AlgQ's $O(k \text{ polylog } n)$? Assuming the Planted-Clique Conjecture, the authors prove no polynomial-time algorithm using only weak distances can beat $O(k^{2-\varepsilon})$ centers! This quadratic jump in $k$ is the mathematical price of speed under noise.
  • Practical compression: Once a tiny $\text{Coreset+}$ is built cheaply from noisy queries, you only need expensive ground-truth evaluations on that tiny summary to extract final $k$ centers.

Key Results

  • Theoretical Bounds: AlgQ finds an $O(1)$-$\text{Coreset+}$ of size $O(k \text{ polylog } n)$ in $O(nk \text{ polylog } n)$ weak queries (query-optimal up to log factors). AlgP runs in $n^{O(1)}$ time, returning $O(k^2 \text{ polylog } n)$ centers with $O((nk + k^4)\text{ polylog } n)$ queries.
  • Empirical Robustness: Using a practical heuristic-accelerated version (OUR-ALG) across error rates $p_{\text{err}} \in [0.05, 0.25]$:
  • On MNIST (t-SNE) at $15\%$ noise ($p_{\text{err}} = 0.15$), OUR-ALG compresses 60,000 points down to 4,400 points (a 93% reduction) and lands within 4% of the optimal ground-truth clustering cost. Noise-oblivious $k$-means++ and coreset baselines degrade catastrophically, exceeding optimal cost by >1000%.
  • On SBM, baselines suffer >20$\times$ optimal cost as noise rises, whereas OUR-ALG stays flat near $1\times$ optimum across all datasets.

Limitations and Future Work

  • Exact-$k$ Extraction & Implementation: Using only weak queries yields a compressed $\text{Coreset+}$ (more than $k$ centers); getting exact $k$ centers in the experiments still relies on evaluating ground-truth distances on the small coreset. Furthermore, for runtime efficiency in experiments, OUR-ALG uses a heuristic in Stage 1 rather than the full theoretical SDP/enumeration machinery.
  • Independent Noise Assumption: The oracle model assumes corruptions happen independently across pairs.
  • Future Directions: Extending these weak-oracle primitives to fair clustering, hierarchical clustering, clustering with outliers, and tougher noise models featuring correlated corruptions.

Summary updated

Abstract

Clustering is a fundamental task in unsupervised learning, serving as a core tool for data mining and exploratory data analysis. Classical $k$-clustering objectives such as $k$-median and $k$-means formalize this task, but typically assume access to exact pairwise distances. This assumption is increasingly unrealistic in modern applications where distances are estimated through proxy embedding models, learned similarity functions, human feedback, or other low-cost procedures that may be noisy. We study $k$-clustering in an unknown metric space where the algorithm has access only to a weak distance oracle: for each pair of objects, the oracle returns the true distance with probability of $1/2+\varepsilon$ , where $\varepsilon$ is a constant, and otherwise may return an arbitrary corrupted value. We present randomized algorithms that, given a metric space with $n$ vertices and a parameter $k$, use only weak distance-oracle queries to compute a set of representative centers together with a mapping from every input object to one of these centers, such that the total mapping cost is within a constant factor of the optimal $k$-clustering cost. Our first algorithm returns $O(k\cdot\mathsf{polylog}(n))$ centers using $O(n\cdot k\cdot \mathsf{polylog}(n))$ weak-oracle queries and runs in quasi-polynomial time. We also give a polynomial-time algorithm that returns $O(k^2\cdot\mathsf{polylog}(n))$ centers using $O((n\cdot k+k^4)\cdot \mathsf{polylog}(n))$ weak-oracle queries. Preliminary experiments for $k$-means clustering show that our approach remains close to the optimum under substantial oracle noise, while noise-oblivious baselines degrade sharply.
BibTeX
@inproceedings{esmailpour2026clustering,
  author = {Aryan Esmailpour and Rahul Raychaudhury and sainyam galhotra and Stavros Sintos},
  title = {{Clustering with Weak Distance Oracles}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2026},
  url = {https://openreview.net/forum?id=5W2OIUKFcN},
}
Figure