Optimal uniform sampling for
stable geometric median coresets
Abstract
Uniform sampling need not approximate the cost of every candidate median, but it can preserve their relative quality throughout the candidate space. We prove that the worst-case sample complexity of constructing stable Euclidean geometric median coresets by unweighted uniform sampling without replacement is . For every dataset, sampled points suffice in every dimension, with the whole dataset used if it is smaller. For each , with probability at least , every sample-cost comparison implies a population-cost comparison, simultaneously for all candidate pairs. This removes the factor from the bound of Carmel, Krauthgamer, and Petruschka (APPROX/RANDOM 2026). The matching lower bound holds for the same sampling rule even for distinct points on the line. The proof represents distance as squared Hilbert distance, reducing all comparison errors to linear functionals of one empirical mean error. A finite-population variance bound controls this vector, and the triangle inequality converts the resulting error into a relative guarantee. The argument extends to negative-type metrics and gives the same optimal rate in , resolving the dimension-independence conjecture of Carmel and Krauthgamer (ICLR 2026).
Note. This paper was generated entirely by AI, including MiMo, using an automated research pipeline developed by Chenghua Liu and Hanyu Li.
1 Introduction
Uniform sampling offers a simple way to reduce the input to a median problem, but it cannot preserve every candidate cost. Consider a population consisting of points at the origin and one point at distance . A sample of points without replacement misses the outlier with probability . On that event, the origin has zero sample cost and positive population cost, irrespective of how large is. Thus a relative approximation to the entire objective asks more of a uniform sample than it can provide.
Preserving only near-optimal centers is sufficient for unconstrained optimization, but need not suffice once the center is required to lie in a subset of the ambient space. The best feasible center may be far from the unconstrained optimum. Stable coresets, introduced by Carmel and Krauthgamer [2], retain the comparisons needed in this situation: whenever one center is approximately as good as another on the sample, the same comparison holds on the population with controlled loss. The guarantee applies to every pair at once. Consequently, a single sample supports all restrictions of the candidate domain, including restrictions chosen after the sample is drawn.
For -median in , Carmel and Krauthgamer [2, Theorem 1.4] obtained stable coresets of size by uniform sampling and conjectured that the dimension dependence could be removed. For the Euclidean geometric median, Carmel, Krauthgamer, and Petruschka [1, Theorem 1.1] removed that dependence and proved the bound . Their construction uses uniform sampling without replacement; embeddings and an iterative size-reduction argument enter only its analysis. We prove that samples suffice with the same stability parameters and success probability. A matching lower bound for the same sampling rule shows that the remaining logarithm is unnecessary, even though the guarantee ranges over an unbounded space of candidate centers.
Write for the average distance to a dataset and . The relevant error is a difference of costs, rather than a cost itself. Subtracting two costs cancels terms that are common to the two centers, as formalized by the relative cost-difference framework of [2, Theorem 3.1] and its all-pairs version in [1, Section 3]. Yet centering alone does not yield an absolute error bound on the scale of the optimum: for a population of zeroes and one distant point, missing the outlier gives comparison error at distant candidate centers on an event of probability (Remark 2.5). In particular, a uniform bound of order is false. The proof must retain the dependence on the candidate locations until the final relative normalization.
A squared-Hilbert representation of Euclidean distance does exactly this. If is anchored at a population median and is the average feature vector of , expansion of squared distances gives
Every pair is controlled by the same empirical mean error. Its squared norm has expectation at most , so the comparison error is of order on one event of high probability. Both and are at most . This yields relative error without a union bound over centers. One additional first-moment estimate at the population median then converts relative cost differences into stable comparisons. The sample remains unweighted, and neither the median nor the feature map is computed.
The representation itself is classical [3]. Its connection to coreset construction is discussed in [2, Section 1.4]; related empirical-mean identities appear in energy distance [4, Proposition 14 and Theorem 22] and in integration bounds for support points [5, Theorem 4]. The estimate above uses the metric triangle inequality to make that mean control relative to the two candidate costs. The same argument therefore applies in negative-type metric spaces. In , it gives the optimal rate and settles the conjecture in [2, Section 1.2].
1.1 Model and main result
We treat a dataset as indexed, with . Thus repeated locations are allowed, but the sample indices are distinct. For every nonempty finite indexed dataset , define
| (1) |
where sums count multiplicities. A uniform sample of size , , means
All sampled points have equal weight. Normalizing costs by dataset size does not change any comparison within a dataset.
Definition 1.1 (Stable coreset).
For , a nonempty indexed subdataset of is a stable -coreset if, simultaneously for all ,
| (2) |
For , let be the least positive integer such that, for every dimension , every indexed dataset of size , and every integer , a uniform sample of size is a stable -coreset with probability at least . This is a threshold guarantee for all larger sample sizes, not a claim that stability is monotone under adding points to a particular sample. When , returning satisfies the desired implication deterministically.
Theorem 1.2 (Optimal uniform sample complexity).
- (i)
Let and . For every and every indexed dataset , a uniform sample of size is a stable -coreset with probability at least .
- (ii)
Let . For every integer , there exist and a set of distinct points such that a uniform sample of size fails to be a stable -coreset with probability at least .
Consequently,
The lower bound concerns the sample returned by uniform sampling, without reweighting or postprocessing; arbitrary weighted coresets are outside its scope. Its obstruction is already one-dimensional: two nearly balanced clusters have a population preference of order , while a sample smaller than order has a constant probability of reversing that preference. The proof in Section 3 makes the clusters consist of distinct points and controls the without-replacement distribution directly.
Section 2 proves the upper bound. In Section 4, the negative-type extension separates the case of an attained population median from the case of an approximate reference point. The latter permits arbitrarily small constant-factor sample overhead when the infimum is not attained. An alternative Euclidean proof in Appendix A averages one-dimensional empirical-distribution errors over Gaussian projections.
2 Uniform comparison and the stable-coreset bound
Fix a geometric median of , and put
A median exists: is continuous, and tends to infinity as . We use only to set the variance scale. The feature map below is defined on the entire candidate domain, which is needed to compare arbitrary centers after the sample has been drawn.
Lemma 2.1 (Squared-Hilbert representation).
Let be standard Gaussian measure on , let be Lebesgue measure on , and let be the real Hilbert space. For , define
Then , , and
| (3) |
In particular, .
Proof.
For ,
For and , is a centered Gaussian of variance , so . Tonelli’s theorem therefore gives
Taking proves square integrability and the anchored norm identity. ∎
The subtraction of the indicator at has two roles: it makes the features square-integrable, and it identifies their average squared norm with . No bound on an individual feature norm is required.
For any nonempty finite indexed dataset , define
We write the pairwise comparison error as
| (4) |
Lemma 2.2 (Cost-difference identity).
For every ,
| (5) |
Consequently, for every ,
| (6) |
Proof.
The identity isolates the only random quantity needed for every comparison: . Although the features need not be bounded by a common diameter, their population second moment is . The exact variance formula below also accounts for the dependence between sampled indices.
Lemma 2.3 (Finite-population variance).
Let belong to a real Hilbert space , and let be a uniformly random -element subset of , where . Set
If , then
| (7) |
For , this implies
| (8) |
The inequality also holds for .
Proof.
The remaining geometric factor in (6) is . It can grow with the centers, but the sum of their population costs grows enough to absorb it. This is the point at which the metric structure enters the proof.
Proposition 2.4 (Simultaneous relative comparison).
For , with probability at least , a uniform sample satisfies
| (9) |
Proof.
If , all data points coincide with , so . Assume . By (8) and Markov’s inequality, the event
| (10) |
has probability at least . For all , the triangle inequality averaged over the population and the optimality of give
| (11) |
Fix a sample satisfying (10). By (3), (6), and Cauchy–Schwarz,
Since the event (10) does not depend on , the conclusion holds simultaneously for every pair. ∎
Remark 2.5 (Why the error must depend on the center).
A uniform absolute bound of order for cannot hold with success probability greater than for all populations. To see this, let , choose , and take an indexed population of zeroes and one point at . Then , , and a uniform sample of size misses with probability exactly . On that event, every satisfies
For any fixed constant , this exceeds when . The valid estimate in the preceding proof instead has scale . Inequalities (11) convert this location-dependent scale into the relative comparison bound without imposing a diameter restriction.
Relative control of cost differences does not yet bound the term in an approximate sample comparison. To do so, it is enough to bound the sample cost at a single reference point. The next lemma recovers one-sided cost domination from that bound and the comparison estimate, then applies the relative cost-difference framework of [2, Theorem 3.1]. This requires no two-sided approximation to individual costs.
Lemma 2.6 (Stability from relative comparison).
Let . Suppose that
| (12) |
and that
| (13) |
Then is a stable -coreset of .
Proof.
Proof of Theorem 1.2(i).
If or , then , and stability holds deterministically. Otherwise, Proposition 2.4 and give (12) with probability at least . Uniform sampling also gives
Thus (13) holds with probability at least by Markov’s inequality. A union bound shows that both events hold with probability at least , without requiring independence. Lemma 2.6 completes the proof. ∎
3 Optimality for uniform sampling
Put two clusters near and , with a population imbalance of order . The population then favors one endpoint by more than the permitted stability loss. A sample with a majority from the other cluster reverses that comparison. We show that this happens with constant probability when is small: choose the population large enough to approximate the hypergeometric law by a binomial law, then compare that binomial law with the unbiased one. Small perturbations of size make every point distinct without changing either cost comparison. This refines the two-location construction in [1, Appendix A] for the stated without-replacement guarantee.
Proof of Theorem 1.2(ii).
Fix and an integer . Put
where is an integer. Set
Choose distinct points in and distinct points in , obtaining disjoint sets and . Both cardinalities are positive. Let , and write
The rounding error satisfies
| (16) |
We first compare the population costs at and . The locations of the two clusters give
Moreover,
Since and , we have . Therefore
In particular,
| (17) |
Now let and . On the event ,
Our choice of gives , which is equivalent to
Thus this event implies , contradicting stability by (17).
The cost inequalities reduce failure of stability to a single counting event. Its probability can be estimated without a central limit theorem. The variable is hypergeometric with population size , number of marked indices , and sample size . Let
For probability laws on a common finite set, write , and let denote the law of a random variable .
Draw independent uniform indices from . Conditional on no collision, the ordered tuple is uniform over injective tuples. If a collision occurs, replace the tuple by an independent uniform injective tuple. The resulting tuple has the without-replacement law, and the two cluster counts agree whenever there was no collision. Hence
| (18) |
The remaining discrepancy is the bias of the binomial law. We control it through the affinity of the underlying product measures, so the relevant quantity is , rather than . For laws , define . Cauchy–Schwarz gives
For the product laws
the sum defining factors across coordinates, so
Taking the sum of the Bernoulli coordinates cannot increase total variation, by the triangle inequality on each fiber of the summation map. Using for , and , we obtain
| (19) |
By (16) and the bound on , , so the last expression is at most . Symmetry gives . Combining this with (18) and (19) yields
This proves part (ii). In particular, for all sufficiently small , every positive integer at most fails to be a valid threshold in the definition of . Together with part (i), this proves . ∎
4 Extensions to negative-type metrics
The Euclidean argument used a squared-Hilbert representation to linearize costs and the triangle inequality to normalize the resulting error. These are separate requirements: the representation alone would not justify the relative comparison step. Both are available in a negative-type metric space. We use the squared-Hilbert characterization: a metric space is of negative type if there exist a real Hilbert space and a map such that
| (20) |
This is equivalent to the usual condition for every finite choice of points and real coefficients satisfying [3, 4]. In this section, costs and stability are defined on by
with the implication in Definition 1.1 required for all .
Corollary 4.1 (Attained medians in negative-type metrics).
Let satisfy (20), and let be a nonempty finite indexed dataset whose population -median is attained in . For and , a uniform sample of size is a stable -coreset with probability at least .
Proof.
Let attain , and set . Then . The cost-difference identity and finite-population variance calculation in Lemmas 2.2 and 2.3 apply to this map. Also,
The first inequality is the metric triangle inequality averaged over ; the second follows from optimality. These give the comparison estimate (9) by exactly the three inequalities in the proof of Proposition 2.4. Finally, , and the scalar calculation in Lemma 2.6 gives stability on the intersection of the same two -probability events. If , all points coincide and the conclusion is deterministic. ∎
For , the required representation is coordinatewise and a median is attained in every coordinate. Thus the extension removes the dimension factor without passing through a finite-dimensional Euclidean embedding.
Corollary 4.2 (The metric).
Let be the threshold defined as , with costs in place of Euclidean costs. Then . The upper bound and the one-dimensional lower bound have the constants of Theorem 1.2.
Proof.
Attainment was used to choose an anchor whose cost equals the lower bound on all candidate costs. An anchor within a factor of the infimum changes the variance bound by this factor and introduces one additional term in the scalar stability calculation. Tracking these two changes gives the following version, which also covers metric spaces without an attained median.
Proposition 4.3 (Approximate reference points).
Let satisfy (20), and let be a nonempty finite indexed dataset in . Suppose that, for some and ,
If
then a uniform sample of size is a stable -coreset with probability at least . Consequently, the conclusion of Corollary 4.1 holds without attainment after an arbitrarily small constant-factor increase in the sample-size bound.
Proof.
If , all data points coincide with , and . Assume , and anchor at . The resulting feature means satisfy
Markov’s inequality gives with probability at least . On this event, the cost-difference identity and the inequalities
give, simultaneously for all ,
Here is defined by (4) using -costs. Separately, , so with probability at least . Both events hold with probability at least .
On their intersection, for every ,
where . Thus any comparison implies
The difference between and the bracketed coefficient is
This proves stability.
Finally, if , then for every pair of data indices and every ,
Taking the infimum over shows that all data points coincide, so their common point attains the minimum. Therefore nonattainment implies . For every , the definition of the infimum then provides a point with . For each , the permitted upper bound on is positive, so can be chosen arbitrarily small. More uniformly, since on this interval, any works for every . As before, if the requested sample size exceeds , one returns . ∎
Appendix A An alternative proof by projected distribution functions
There is a second way to obtain the Euclidean comparison bound without covering the candidate space. In one dimension, a cost difference is an integral over the interval between the two candidates, so its error is bounded by the largest empirical-distribution discrepancy. Averaging the square of this discrepancy over Gaussian projections yields one random quantity that controls every pair of centers. The proof below implements this route directly under sampling without replacement; its larger constant does not affect the rate.
Proposition A.1 (Projection-based comparison).
Let be indexed, and let be a uniform sample of size . With probability at least ,
| (21) |
Consequently, for and , the sample is a stable -coreset with probability at least .
Proof.
If , then . Suppose , so . Fix , order the values , and break ties by index. Let count sampled indices among the first positions, and put
Write
The distribution functions change only at projected data values; ties restrict the eligible prefix endpoints. Hence
| (22) |
For a fixed sample, is measurable in : the supremum can be taken over the finitely many thresholds , and all resulting comparisons are measurable.
We first control all prefixes in the projected ordering. Sampling without replacement gives a finite-population bridge; dividing its centered count by the number of unrevealed positions produces a martingale. Forward and reverse orderings let us use it away from its singular endpoint. Specifically, for every fixed ,
| (23) |
For , define
Let reveal the sample membership of the first ordered indices. Conditional on , the remaining sampled indices are uniform among positions. Thus
and substitution gives for .
Let . The sample membership indicators have variance and pairwise covariance . Summing over the first positions yields
so
Since , Doob’s maximal inequality gives
For the reversed ordering, the discrepancy of a prefix of length is . Applying the same estimate in that ordering bounds the expected squared maximum over by . These two ranges cover all integer indices from to . The square of their combined maximum is at most the sum of the two squared maxima, proving (23).
For , let , and let be the difference between the normalized empirical measures of and after projection onto . The derivative vanishes outside the interval between and and has absolute value inside it. The signed measure has total mass zero. Integrating against this finite signed measure therefore gives
| (24) |
Values at the finitely many atoms do not affect the Lebesgue integral.
For , the identity and (24) imply, for every fixed sample ,
All integrals are finite because and Gaussian linear functionals have finite first and second moments. By Tonelli’s theorem and (23),
Markov’s inequality gives with probability at least . On this one event, the preceding bound and prove (21) for all simultaneously.
References
- [1] Amir Carmel, Robert Krauthgamer, and Nir Petruschka. Optimal stable coresets for geometric median via uniform sampling. In Approximation, Randomization, and Combinatorial Optimization. Algorithms and Techniques (APPROX/RANDOM 2026), volume 392 of Leibniz International Proceedings in Informatics, pages 30:1–30:14, 2026. https://doi.org/10.4230/LIPIcs.APPROX/RANDOM.2026.30.
- [2] Amir Carmel and Robert Krauthgamer. Stable coresets: Unleashing the power of uniform sampling. In 14th International Conference on Learning Representations (ICLR 2026), 2026. https://openreview.net/forum?id=sOpAa8iR0A.
- [3] I. J. Schoenberg. Metric spaces and positive definite functions. Transactions of the American Mathematical Society, 44(3):522–536, 1938. https://doi.org/10.1090/S0002-9947-1938-1501980-0.
- [4] Dino Sejdinovic, Bharath Sriperumbudur, Arthur Gretton, and Kenji Fukumizu. Equivalence of distance-based and RKHS-based statistics in hypothesis testing. The Annals of Statistics, 41(5):2263–2291, 2013. https://doi.org/10.1214/13-AOS1140.
- [5] Simon Mak and V. Roshan Joseph. Support points. The Annals of Statistics, 46(6A):2562–2592, 2018. https://doi.org/10.1214/17-AOS1629.