betaFeedback

WorksComputer Science

Stochastic non-metric MDS for noisy high-dimensional data

Abstract

Multidimensional scaling (MDS) constructs low-dimensional embeddings that approximate pairwise distances in a high-dimensional dataset. MDS exists in several flavors, with metric MDS approximating distances directly and non-metric MDS additionally optimizing for an arbitrary monotonic transformation of the high-dimensional distances. Empirically, metric MDS is known to suffer from the curse of dimensionality. Here we extend prior theoretical results for metric MDS on fully uninformative data to a more general case of finite, high-dimensional data with concentrated distances. We show that the metric MDS embeddings of such datasets stay distributionally close to the data-independent limit case. We then show that non-metric MDS is more robust to high-dimensional noise and can yield informative embeddings of such data. While existing implementations of non-metric MDS are slow, we develop a fast implementation using stochastic gradient descent in PyTorch. Using our implementation, we conduct an empirical study using multiple simulated and real-world datasets, including population-genomic and scRNA-seq data, and show that non-metric MDS can strongly outperform other methods in terms of global structure preservation.

Introduction

Multidimensional scaling (MDS) [8] is one of the classic dimensionality-reduction and embedding methods developed in the 1960s (Shepard, 1962a;b; Kruskal, 1964a;b). Its goal is to find low-dimensional embedding vectors zi∈Rpz_i \in\mathbb{R}^p such that pairwise distances ∥zi−zj∥\lVert z_i-z_j\rVert between them approximate some given pairwise distances DijD_{ij}. MDS is well-known in the field of dimensionality reduction as the algorithm aiming to preserve global structure of the data [30], as opposed to various neighbor-embedding algorithms such as t-SNE [50] and UMAP [36] that aim to preserve local structure.

Empirically, MDS often struggles to produce a meaningful embedding of high-dimensional data [11]. Here we formalize this observation and study the behavior of MDS under distance concentration. We show that the so-called metric MDS, where ∥zi−zj∥\lVert z_i-z_j\rVert should directly approximate given DijD_{ij}, suffers from the curse of dimensionality and remains close to a data-independent embedding [34, 9]. In contrast, we demonstrate that non-metric MDS, a more flexible but less widely used flavor of MDS, where ∥zi−zj∥\lVert z_i-z_j\rVert should approximate DijD_{ij} only up to an arbitrary monotonic transformation (i.e. approximate the order of distances and not the distances themselves), is more robust and can better tolerate high-dimensional noise, while still producing informative embeddings.

Most existing implementations of non-metric MDS, such as the one in scikit-learn [38] in Python or the smacof package in R [13, 33], have quadratic memory and cubic runtime complexity, precluding its use for datasets with sample sizes n≫10 000n \gg10\,000. Indeed, simply storing the n×nn \times n matrix of pairwise distances D\mathbf{D} in memory can already be prohibitive for large nn. While several stochastic versions of metric MDS have been developed in various contexts [2, 52, 28, 15, 19], fast implementations of non-metric MDS do not exist. Here we fill this gap.

In summary, our contributions are:

  1. we establish a perturbation bound for the limiting solution of metric MDS;

  2. we show that non-metric MDS is more robust and can tolerate higher-dimensional noise;

  3. we develop a stochastic implementation of non-metric MDS in PyTorch;

  4. we show that non-metric MDS can outperform other methods in global embedding quality.

We argue that our results are relevant for modern embedding methods, as many of them include MDS-based loss terms to ensure global structure preservation (see Discussion).

Related Work

On the theoretical side, so-called classical MDS (see below) has recently received attention from mathematicians and was shown to exhibit surprising properties in the continuous n→∞n \to\infty limit [24, 32]. Buja et al. [9] characterized the solution of metric MDS in the continuous limit for fully uninformative inputs.

On the practical side, multiple papers independently re-introduced stochastic metric MDS in various contexts. Agrafiotis [2] developed a stochastic metric MDS with batch size b=2b = 2, calling it stochastic proximity embedding (SPE). This method was developed in the context of computational chemistry, to visualize large collections of chemical compounds [3]. Zheng et al. [52] developed stochastic implementations of weighted MDS in the context of graph drawing. In that setting, the input matrix of distances is the matrix of shortest-path graph distances between pairs of graph nodes. For optimization, the authors sampled pairs of points, essentially using mini-batches of size b=2b = 2. Hangan et al. [19] adopted this approach for dimensionality reduction and Fang et al. [15] used a similar approach with b=n/10b = n/10 for their FastMDS. Lambert et al. [28] developed SQuadMDS (stochastic quartet MDS) that optimizes metric MDS using mini-batches of size b=4b = 4 (quartets). The authors developed a C++ implementation and used it to obtain metric MDS embeddings of MNIST and the Tasic datasets, also analyzed here. Furthermore, the authors suggested a hybrid between SQuadMDS and tt-SNE.

At the same time, we are not aware of any scalable implementations of non-metric MDS. All examples in Borg & Groenen [8] and Mair et al. [33] have n<100n < 100.

Non-metric MDS is closely related to ordinal embeddings, which learn an embedding from a set of triplet comparisons such as “jj is closer to ii than to kk”. There are several landmark-based methods that provide approximate implementations suitable for large sample sizes [4, 16]. Non-metric MDS also uses only the rank order of the high-dimensional distances, but over all pairs, and not just over a subset of triplets. Therefore we do not include ordinal embeddings into our benchmark comparison.

Background

Notation. Let the high-dimensional dataset consist of nn vectors xi∈Rd\mathbf{x}_i \in\mathbb{R}^d, forming an n×dn \times d data matrix X\mathbf{X}. Let D\mathbf{D} be an n×nn \times n pairwise distance matrix with DijD_{ij} being some distance (e.g. Euclidean, cosine, etc.) between xi\mathbf{x}_i and xj\mathbf{x}_j. Alternatively, we may be given (e.g. experimentally obtain) some distance matrix D\mathbf{D} directly, without access to any underlying X\mathbf{X}, and without knowing the value of dd.

The goal of any MDS algorithm is to construct low-dimensional embedding vectors zi∈Rp\mathbf{z}_i \in\mathbb{R}^p such that their pairwise distances approximate pairwise distances DijD_{ij}. Typically p=2p = 2 for visualization purposes. We refer the reader to Borg & Groenen [8] for a detailed systematic treatment of MDS.

Classical MDS. In classical MDS, also known as Torgerson's scaling [49] and as principal coordinates analysis [17], the assumption is that D\mathbf{D} is a matrix of Euclidean distances. If so, it can be converted into the Gram matrix of centered vectors Gij=(xi−xˉ)T(xj−xˉ)G_{ij} = (\mathbf{x}_i - \bar{\mathbf{x}})^\mathsf{T}(\mathbf{x}_j - \bar{\mathbf{x}}) by double-centering the matrix of squared distances:

G=−(I−1n/n)(D⊙D/2)(I−1n/n),(1)\mathbf{G} = -(\mathbf{I} - \mathbf{1}_n/n)(\mathbf{D} \odot\mathbf{D}/2)(\mathbf{I} - \mathbf{1}_n/n), \tag*{(1)}

where ⊙\odot denotes elementwise multiplication, and 1n\mathbf{1}_n denotes the n×nn \times n matrix of all ones. If G=UΛUT\mathbf{G} = \mathbf{U}\mathbf{\Lambda}\mathbf{U}^{\mathsf{T}} is the eigendecomposition of G\mathbf{G}, then Z=UΛ1/2\mathbf{Z} = \mathbf{U}\mathbf{\Lambda}^{1/2} gives the principal components of X\mathbf{X} and the classical MDS of D\mathbf{D}.

Note that if D\mathbf{D} is not a matrix of Euclidean distances, then classical MDS is not equivalent to principal component analysis (PCA) of X\mathbf{X}. If Λ\boldsymbol{\Lambda} contains negative eigenvalues, then D\mathbf{D} cannot be obtained as Euclidean distances between vectors of any dimensionality (Schoenberg, [40]). Recent work studied properties and extensions of classical MDS in this regime ([45, 14]), but this is very different from non-metric MDS which learns an ordinal transformation while retaining Euclidean output metric.

Metric MDS The loss function of metric MDS is the squared error between DijD_{ij} and ∥zi−zj∥\lVert\mathbf{z}_i-\mathbf{z}_j\rVert:

LmMDS=∑i<j(∥zi−zj∥−Dij)2(2)\mathcal{L}_{\mathrm{mMDS}} = \sum_{i<j}\left(\lVert\mathbf{z}_i-\mathbf{z}_j\rVert-D_{ij}\right)^2 \tag*{(2)}

It is called (raw) stress. It is often more convenient to work with the raw stress divided by n(n−1)/2n(n-1)/2, which we will call the average stress. The common approach for minimizing the stress loss function relies on the iterative SMACOF algorithm (scaling by majorizing a complicated function; de Leeuw, [12]), which in this case is equivalent to gradient descent with learning rate 1/(2n)1/(2n). This algorithm is used in most common MDS implementations, e.g. in R ([13, 33]) and in the scikit-learn library (Pedregosa et al., [38]) in Python. SMACOF converges to a local minimum of LmMDS\mathcal{L}_{\mathrm{mMDS}}, but note that LmMDS\mathcal{L}_{\mathrm{mMDS}} is not convex and has many local minima, so the final embedding depends on the initialization.

Non-metric MDS Non-metric MDS (Shepard, 1962a;b; Kruskal, 1964a;b) additionally allows an arbitrary monotonic transformation f(⋅)f(\cdot) of the input distances:

LnMDS=∑i<j(∥zi−zj∥−f(Dij))2s.t.2n(n−1)∑i<jf(Dij)2=1.(3)\mathcal{L}_{\mathrm{nMDS}} = \sum_{i<j}\left(\lVert\mathbf{z}_i-\mathbf{z}_j\rVert-f(D_{ij})\right)^2 \quad\text{s.t.} \quad\frac{2}{n(n-1)}\sum_{i<j}f(D_{ij})^2=1. \tag*{(3)}

Here, to avoid a trivial solution with f(⋅)=0f(\cdot)=0, the transformed values f(Dij)f(D_{ij}) are usually constrained to have mean squared off-diagonal value equal to 1 ([13, 33]). Fixing f(⋅)f(\cdot) to be proportional to the identity recovers metric MDS up to the scaling factor. The standard approach for minimizing this loss function is alternating minimization: after each step of the SMACOF algorithm, an optimal f(⋅)f(\cdot) is fit by isotonic (monotonic) regression of the current ∥zi−zj∥\lVert\mathbf{z}_i-\mathbf{z}_j\rVert values on DijD_{ij} values. The resulting f(Dij)f(D_{ij}) values are then scaled to satisfy the constraint.

Stress-1 It is often more convenient to use some normalized version of stress, for example so-called stress-1 ([25 b]):

\operatorname{Stress\mathchar`-1}=\sqrt{\frac{\sum_{i<j}\left(\lVert\mathbf{z}_i-\mathbf{z}_j\rVert-f(D_{ij})\right)^2}{\sum_{i<j}\lVert\mathbf{z}_i-\mathbf{z}_j\rVert^2}} \tag*{(4)}

where ff is the identity in the case of metric MDS. For fixed DijD_{ij} and ff, stress-1 depends on the overall scale of Z\mathbf{Z}. A minimizer of the raw stress is, up to a scale factor, also a minimizer of stress-1. We therefore always report the stress-1 after rescaling Z\mathbf{Z} by the optimal factor. The optimal factor can be computed analytically: with d=f(Dij)\mathbf{d}=f(D_{ij}) and d′=∥zi−zj∥\mathbf{d}'=\lVert\mathbf{z}_i-\mathbf{z}_j\rVert, both flattened, it is ∥d∥2/⟨d,d′⟩\lVert\mathbf{d}\rVert^2/\langle\mathbf{d},\mathbf{d}'\rangle, and the resulting stress-1 is 1−cos⁡2∠(d,d′)\sqrt{1-\cos^2\angle(\mathbf{d},\mathbf{d}')}.

If Z\mathbf{Z} is a minimizer of raw stress (Eq. (2) or Eq. (3)), the stress-1 of the optimally rescaled Z\mathbf{Z} can also be obtained from the stress-1 ss of Z\mathbf{Z} itself (note that scikit-learn returns ss): it equals s2/(1+s2)\sqrt{s^2/(1+s^2)}, and the optimal factor is 1+s21+s^2 (Borg & Groenen, [8]).

Furthermore, at such a minimum, the rescaled stress-1 equals the square root of the raw stress divided by ∑i<jf(Dij)2\sum_{i<j}f(D_{ij})^2, the squared norm of the target distances (Borg & Groenen, [8]). If f(⋅)f(\cdot) is normalized as in Eq. (3), this squared norm is simply the number of pairs, n(n−1)/2n(n-1)/2, so the rescaled stress-1 coincides with the square root of the average stress, i.e. of the loss that is being minimized.

Scikit-learn implementation and our improvements The scikit-learn library (Pedregosa et al., [38]) in Python contains implementations of metric and non-metric MDS using the SMACOF algorithm. While working on this paper, we identified a number of issues with that implementation and fixed them in a series of four PRs (PR numbers hidden to preserve anonymity), which have been merged into the version 1.8 (released in December 2025). Apart from fixing some implementation errors in non-metric MDS, we implemented the classical MDS algorithm (as manifold.ClassicalMDS class) and set it as default initialization for metric and non-metric MDS. All scikit-learn experiments reported below used version 1.8 and default hyperparameters (default from version 1.10), and the algorithm always reached the default convergence criterion.

Figure 1. (a) Metric MDS of a 10 000 × 10 000 distance matrix with all off-diagonal elements equal to 1+εij1+\varepsilon_{ij} with εij∼N(0,0.01)\varepsilon_{ij}\sim\mathcal{N}(0,0.01). The dashed circle has radius π/4\pi/4. (b) Radial density of points in panel (a). Linear increase corresponds to the uniform 2D density. The dashed line shows theoretical prediction.

The curse of dimensionality for metric MDS

Here we will extend and combine prior results by Mattner [34], Buja et al. [9], and Aggarwal et al. [1] to show that finite, noisy, high-dimensional data yields an uninformative metric MDS embedding. The motivates the use of non-metric MDS for high-dimensional data.

The standard result on distance concentration is that in the presence of high-dimensional noise, all pairwise distances become approximately the same [1]. For instance, consider an arbitrary 2D dataset with nn points (e.g. sampled from a mixture of well-separated Gaussians, as we will do in § 6). To mimic high-dimensional noise, we append dd additional non-discriminative dimensions with i.i.d. values with mean 0, variance σ2\sigma^2, and finite 4th moment, so that the resulting dataset has dimensionality d+2d+2. As dd increases, all pairwise distances DijD_{ij} will concentrate around 2dσ2\sqrt{2d\sigma^2} as all vectors become close to orthogonal and each of them has squared norm close to dσ2d\sigma^2 [18, 20].

Dividing all distances by 2dσ2\sqrt{2d\sigma^2}, we see that the n×nn\times n distance matrix approaches Dij=1−δijD_{ij}=1-\delta_{ij} with all off-diagonal elements equal to 1. The continuous limit of metric MDS, corresponding to n→∞n\to\infty, on this fully uninformative input was analyzed by Mattner [34] and Buja et al. [9].

Let P(R2)\mathcal{P}(\mathbb{R}^2) denote the set of probability measures on R2\mathbb{R}^2. For ρ∈P(R2)\rho\in\mathcal{P}(\mathbb{R}^2) and X,Y∼i.i.d.ρX,Y\mathrel{\overset{\mathrm{i.i.d.}}{\sim}}\rho the average stress functional is

S[ρ]=Eρ[(∥X−Y∥−1)2]=∬(∥x−y∥−1)2ρ(x)ρ(y) dx dy.(5)S[\rho]=\mathbb{E}_{\rho}\left[(\lVert X-Y\rVert-1)^2\right]=\iint(\lVert x-y\rVert-1)^2\rho(x)\rho(y)\,dx\,dy. \tag*{(5)}

Theorem 1 (Limiting metric MDS embedding, Mattner [34]; Buja et al. [9]). The unique minimizer of S[ρ]S[\rho] over P(R2)\mathcal{P}(\mathbb{R}^2) with E[ρ]=0\mathbb{E}[\rho]=0 is the Riesz s=1s=1 equilibrium measure with density

ρ∗(x)=2π2(π/4)2−∥x∥2(6)\rho^*(x)=\frac{2}{\pi^2\sqrt{(\pi/4)^2-\lVert x\rVert^2}} \tag*{(6)}

with support on ∥x∥<π4\lVert x\rVert<\frac{\pi}{4}.

It achieves an average stress value of S∗:=S[ρ∗]=1−π212≈0.1775S^*:=S[\rho^*]=1-\frac{\pi^2}{12}\approx0.1775.

We include a detailed proof of this theorem in Appendix § 13. The main observation is that the Laplacian of the functional derivative of SS yields the Riesz s=1s=1 potential. This is solved by the Riesz s=1s=1 equilibrium measure [39, 29, 10]. Different from the idealized setting, real data is finite and pairwise distances are only concentrated, not exactly equal. Using the energy distance DE2D_E^2 [46], defined for two (possibly discrete) distributions as

DE2(μ,ν)=2∬∥x−y∥ dμ(x) dν(y)−∬∥x−x′∥ dμ(x) dμ(x′)−∬∥y−y′∥ dν(y) dν(y′),(7)D_E^2(\mu,\nu)=2\iint\lVert x-y\rVert\,d\mu(x)\,d\nu(y)-\iint\lVert x-x'\rVert\,d\mu(x)\,d\mu(x')-\iint\lVert y-y'\rVert\,d\nu(y)\,d\nu(y'), \tag*{(7)}

we establish the following perturbation bound for this setting:

Proposition 2. Let Dij′=1−δij+εijD'_{ij}=1-\delta_{ij}+\varepsilon_{ij} be an n×nn \times n, zero-diagonal, symmetric dissimilarity matrix, so that its root-mean-squared deviation from the fully uninformative DD is Δ=2n(n−1)∑i<jεij2\Delta=\sqrt{\frac{2}{n(n-1)}\sum_{i<j}\varepsilon_{ij}^{2}}. Then for any global minimizer X′X' of metric MDS for dissimilarities D′D', we have

DE2(X′,ρ∗)≤π224n+2S∗Δ+2Δ2≈0.411n+0.843Δ+2Δ2.(8)D_{\mathrm{E}}^{2}(X',\rho^{*}) \le\frac{\pi^{2}}{24n}+2\sqrt{S^{*}}\Delta+2\Delta^{2}\approx\frac{0.411}{n}+0.843\Delta+2\Delta^{2}. \tag*{(8)}

Appendix D contains the proof, which relies on bounding the energy distance by the stress functional, taking finite samples from ρ∗\rho^{*}, and using a reverse triangle inequality.

The marginal distribution of the norm ∥X∥\lVert X\rVert for X∼ρ∗X\sim\rho^{*} is a rescaled Kumaraswamy (a=2a=2, b=1/2b=1/2) distribution on [0,π/4)[0,\pi/4) with density p(r)=4r/(π(π/4)2−r2)p(r)=4r/(\pi\sqrt{(\pi/4)^{2}-r^{2}}) (Corollary 6). Our simulation with n=10 000n=10\,000 (Figure 1) nearly equidistant points confirms that the optimum of metric MDS stays close to the continuous limit.

😈 Curse of dimensionality: Metric MDS of noisy high-dimensional data with large sample size will look like a disk with points concentrated on the boundary, with radius Dπ‾/4D\overline{\pi}/4, where D‾\overline{D} is the average high-dimensional pairwise distance in the data.

Non-metric MDS is more robust to high-dimensional noise

We experimentally measured the robustness of metric and non-metric MDS to high-dimensional noise using the following simulation. We simulated a noisy dataset by generating n=99n=99 points from 3 equisized classes, equidistant from each other with distance D=10D=10 in R2\mathbb{R}^{2}. We then added d∈[1,106]d\in[1,10^{6}] noise dimensions with i.i.d. N(0,σ2)\mathcal{N}(0,\sigma^{2}) values with σ=1\sigma=1. Then we ran both versions of MDS using random initialization (in order to isolate the behavior of the optimization from the quality of the initial embedding; we only used random initialization in this section) and measured the kkNN classification accuracy in the embedding, averaged over 10 runs with different noise and random initialization. We found that non-metric MDS could tolerate much higher noise dimensionality dd before kkNN accuracy collapsed (Figure 2a).

We then asked what value of dd leads to the accuracy collapse. The pairwise distances between noise vectors concentrate around 2dσ2\sqrt{2d\sigma^{2}}. Metric MDS considers absolute distances and gets strongly distorted when these distances become comparable to DD. This happens when dmMDS∗=Θ(D2/σ2)d^{*}_{\mathrm{mMDS}}=\Theta(D^{2}/\sigma^{2}).

For large dd, the pairwise distances between noisy observations can be approximated by 2dσ2+D2≈2dσ2+D2/(22dσ2)\sqrt{2d\sigma^{2}+D^{2}}\approx\sqrt{2d\sigma^{2}}+D^{2}/(2\sqrt{2d\sigma^{2}}). Non-metric MDS gets strongly distorted when the last term (‘signal’) becomes comparable to the fluctuations of the first term (‘noise’), so that the noise affects the ranking of distances. The distances between noise vectors follow a χ\chi-distribution and its standard deviation asymptotically equals σ\sigma. Equating the second term above to σ\sigma yields

dnMDS∗=Θ(D4/σ4).d^{*}_{\mathrm{nMDS}}=\Theta(D^{4}/\sigma^{4}).

To verify this experimentally, we ran our simulation for various values of D∈[3,30]D\in[3,30] and found the minimal d∗(D)d^{*}(D) value with the average kkNN accuracy below 0.7 (‘collapse’). In log-log coordinates, d∗(D)d^*(D) was close to a linear function (Figure 2b) with regression slopes 2.2 for metric MDS and 4.1 for non-metric MDS, in an excellent agreement with our prediction. In a more varied setup, with varying clusters sizes, noise types, and only approximate equidistance, the regression slopes were all within [2.0, 2.3] and [3.9, 4.1], for metric and non-metric MDS, respectively (Appendix § 12).

Leave-one-out kNN classification accuracy and breaking noise dimensionality

Figure 2. (a) Leave-one-out kkNN classification accuracy (k=10k = 10) in MDS embeddings of noisy three-class dataset. There are n=99n = 99 points from 3 equisized classes, equidistant from each other with distance D=10D = 10 in R2\mathbb{R}^{2}. We add d∈[1,106]d \in[1,10^{6}] noise dimensions with i.i.d. N(0,1)\mathcal{N}(0,1) values. Metric and non-metric MDS are run with random initializations. Average over 10 runs. (b) Minimum dd that yields the average kkNN accuracy below 0.7 for D∈[3,30]D \in[3,30].

For reference, classical MDS (equivalently, PCA) was similarly robust (Figure 2); random matrix theory suggests that the scaling for classical MDS is also Θ(D4/σ4)\Theta(D^4/\sigma^4) (Baik et al. [6]). Note that in the experiments in this section we used random initializations for metric and non-metric MDS, which is why PCA appears to perform better. In practice, we always initialize MDS with classical MDS, and below we will show that non-metric MDS can outperform PCA on real-world data. The main lesson of this section is that non-metric MDS is more robust to high-dimensional noise than metric MDS.

Stochastic non-metric MDS

SGD implementation in PyTorch To be able to run non-metric MDS on datasets with large sample size, we implemented a simple stochastic approximation of both metric and non-metric MDS (Listing S1). We first describe the algorithmic steps used in both setups. In each training epoch, we randomly split the dataset into ⌊n/b⌋\lfloor n/b \rfloor mini-batches of size bb. If the input data are given as X matrix, then for each mini-batch, we compute b×bb \times b values of DijD_{ij} (in order to avoid storing the entire n×nn \times n matrix D in memory, as this can be prohibitive for large nn). Then we use the average stress (Eq. (2)) as the loss, with the sum only running over the b2b^2 terms in the mini-batch.

The DijD_{ij} values in each mini-batch are divided by a normalization coefficient such that their mean squared off-diagonal value equals 1 (as in scikit-learn’s non-metric MDS). This makes the optimization independent of the scale of the input data, so that the same learning rate and initialization scale can be used for all datasets. The coefficient is computed on the first mini-batch of each epoch and used for all mini-batches of that epoch, so that the target scale does not change from batch to batch. Note that the resulting scale discrepancy between our stochastic metric MDS and scikit-learn’s metric MDS does not affect the stress-1 values we report, as they are computed after optimally rescaling the embedding (§ 3).

The entire model is an instance of torch.nn.Embedding, initialized with PCA (in case X is used as input) or with classical MDS (in case D is used). We scale the initialization to have a pre-specified standard deviation σinit\sigma_{\mathrm{init}} of the first component. For optimization we use SGD with learning rate 1/(2b)1/(2b) (as in SMACOF) and cosine learning-rate decay over ηepochs\eta_{\mathrm{epochs}}. This is in agreement with Agrafiotis [2] and Zheng et al. [52] who argued that starting with a large learning rate and decaying it down to zero helps optimizing stochastic metric MDS. The embedding is initialized with sparse=True and SGD does not use momentum so that each batch only updates its own coordinates.

For the stochastic version of non-metric MDS, the only modification to the above is that DijD_{ij} values are transformed with isotonic regression (we use IsotonicRegression from scikit-learn) before they are normalized. As isotonic regression can be slow, we opted to fit it only on the first batch in each epoch; for subsequent batches in the same epoch, we use the fitted regression model to transform the DijD_{ij} values. Fitting isotonic regression more often led to only very minor improvements in the final loss (Table S1).

BlobsMNIST
TimeStress-1TimeStress-1
Once every 100 epochs22±022 \pm0 s0.245±.0000.245 \pm.000——
Once every 10 epochs22±022 \pm0 s0.244±.0000.244 \pm.000182±2182 \pm2 s0.303±.0020.303 \pm.002
Once every epoch (default)23±123 \pm1 s0.244±.0000.244 \pm.000192±2192 \pm2 s0.298±.0020.298 \pm.002
Once every 10 batches26±126 \pm1 s0.244±.0000.244 \pm.000235±0235 \pm0 s0.299±.0020.299 \pm.002
Every batch55±055 \pm0 s0.244±.0000.244 \pm.000654±2654 \pm2 s0.299±.0020.299 \pm.002

Table S1. Runtime and stress-1 of our stochastic non-metric MDS implementation depending on how often the isotonic regression is run. Results are shown for the Blobs and the MNIST datasets. All hyperparameters (batch size, number of epochs, etc.) are kept constant at the values described in the main text (Blobs: batch size 100, sample size 5000, 200 epochs; MNIST: batch size 1000, sample size 70 000, 20 epochs).

Default hyperparameters We use σinit=0.5\sigma_{\mathrm{init}} = 0.5 which we found to work better than 1 on some of the datasets. For small datasets with n≤5 000n \le5\,000, we use batch size b=100b = 100 for non-metric MDS, and in other cases we use b=1 000b = 1\,000. The default number of epochs is set to ηepochs=200\eta_{\mathrm{epochs}} = 200 if n≤50 000n \le50\,000 and to ηepochs=20\eta_{\mathrm{epochs}} = 20 otherwise. We found these parameters to work well across all considered datasets. We increased the number of epochs to ηepochs=500\eta_{\mathrm{epochs}} = 500 for non-metric MDS of the Tasic dataset, see below. Note that on some of our datasets a much smaller number of training epochs would suffice to reach a similar final loss.

Implementation details We observed that larger batch sizes were beneficial and allowed to achieve lower loss. However, the runtime of our implementation scales as b2⋅⌊n/b⌋=O(nb)b^2 \cdot\lfloor n/b \rfloor= O(nb), and in the non-metric case, the isotonic regression also becomes slower with larger bb. We found b=1000b = 1000 to be a reasonable compromise.

All experiments were run on a laptop with Intel Core i5-8265U CPU at 1.6 GHz and 16 Gb RAM.

Stress-1 was computed on all pairs for n≤5000n \le5000 and on a random subsample of 5000 points for larger datasets. We ran all experiments for three random seeds and report means and standard deviations.

Experimental results

Non-metric MDS mitigates the curse of dimensionality

We started with analyzing a synthetic noisy blob dataset, with 5 000 points sampled from a mixture of three well-separated spherical 2D Gaussians (with means sampled from [−10,10][-10, 10] and variances 1) with additional 1000 non-discriminative standard Gaussian dimensions (Figure 3). Classical MDS (i.e., PCA) produced an embedding with well-separated classes (Figure 3a), essentially recovering the original 2D data. At the same time, metric MDS produced only a weak class separation (Figure 3b) and in fact typically failed to yield separated classes when using random initialization (Figure S3; by default we used classical MDS as initialization for metric MDS). The stress-1 value 0.40 (Table 1) was very close to the prediction of Thm. 1 of S∗≈0.42\sqrt{S^*} \approx0.42.

Figure 3. Classical, metric, and non-metric MDS embeddings of the noisy blobs dataset (n=5 000n = 5\,000 in 1002 dimensions). Values in the lower-right are triplet accuracies (see text). (b–c) Embeddings obtained using the SMACOF implementation in scikit-learn with our improvements. The dashed circle in (b) shows our theoretical prediction and has radius Dˉπ/4\bar{D}\pi/4, where Dˉ\bar{D} is the average high-dimensional pairwise distance. (d) Shepard diagram for the non-metric MDS: embedding distances plotted against normalized high-dimensional distances. Dashed line shows monotonic regression fit.

Stress-1Runtime
BlobsGen.DigitsTasicMNISTBlobsGen.DigitsTasicMNIST
nn5 0003 4501 79723 82270 000
Metric0.400.410.33––359 s358 s15 s––
with SGD0.400.410.330.250.3621 s19 s5 s1 m2 m
Non-metric0.240.130.28––1086 s473 s152 s––
with SGD0.240.130.280.060.3018 s23 s8 s23 m3 m

Table 1. Stress-1 values and runtimes using the SMACOF and SGD implementations. On all datasets, our stochastic implementation achieves the same embedding quality as the reference non-stochastic implementation while being much faster. Tasic and MNIST datasets are too large for the non-stochastic implementation. The runtimes correspond to the setup described in the text. All stress-1 values for SGD have stds 0.00; all runtimes for SGD have stds at most 1s (1m).

Figure S3. Metric MDS embedding of the noisy blobs dataset with the classical MDS and random initializations.

To evaluate the embeddings in a loss-independent way, we used triplet accuracy (for each sample A we randomly selected samples B and C from the upper/lower halves of pairwise distance distribution from A; we then computed the fraction of such triplets where A–C embedding distance was smaller than A–B). We also used Pearson and Spearman correlations between pairwise distances in the embedding space and in the original space (here we randomly sampled 5000 points and computed all distances within this subset). These are commonly used metrics to assess global embedding quality (e.g. [7, 23, 21, 11]).

On the noisy blob dataset, the triplet accuracy was higher for classical MDS (0.90) than for metric MDS (0.83). The metric MDS had the shape predicted above in § 4: it was mostly contained within the circle with radius Dˉπ/4\bar{D}\pi/4 (Figure 3b, dashed line), with higher density along the circle and lower density inside it. Indeed, the high-dimensional distances in this dataset were tightly concentrated around Dˉ≈2⋅1000\bar{D} \approx\sqrt{2 \cdot1000} (Figure 3d), making it impossible to reproduce them in 2D.

Using the scikit-learn implementation of non-metric MDS with our improvements (see § 3), we found that non-metric MDS resulted in a clearer class separation (Figure 3c) and the highest triplet accuracy (0.92). Isotonic regression transformed tightly concentrated high-dimensional distances to a range between 0 and 2 (Figure 3d; in the MDS literature this kind of plot is known as Shepard diagram). Pearson and Spearman evaluations yielded the same conclusions (Table S2–Table S3).

BlobsGen.DigitsTasicMNIST
Classical0.760.830.590.92 ±.00\pm.000.52 ±.01\pm.01
Metric0.670.700.730.90 ±.00\pm.000.62 ±.00\pm.00
Non-metric0.850.910.740.87 ±.00\pm.000.76 ±.00\pm.00
tt-SNE0.68 ±.04\pm.040.66 ±.01\pm.010.56 ±.00\pm.000.46 ±.01\pm.010.36 ±.01\pm.01
UMAP0.69 ±.05\pm.050.71 ±.05\pm.050.43 ±.02\pm.020.50 ±.05\pm.050.34 ±.01\pm.01
PaCMAP0.68 ±.00\pm.000.64 ±.01\pm.010.54 ±.00\pm.000.56 ±.01\pm.010.34 ±.00\pm.00

Table S2. Pearson correlation coefficient between pairwise distances in the high-dimensional space and in the embedding. The highest value in each column is highlighted in bold, together with all values within 0.02. Deterministic runs are shown without stds. Non-metric MDS always achieves the best (or one of the best) result(s).

BlobsGen.DigitsTasicMNIST
Classical0.780.840.580.91 ±.00\pm.000.49 ±.01\pm.01
Metric0.680.710.730.91 ±.00\pm.000.62 ±.00\pm.00
Non-metric0.850.960.760.95 ±.00\pm.000.78 ±.00\pm.00
tt-SNE0.61 ±.09\pm.090.62 ±.01\pm.010.51 ±.00\pm.000.55 ±.00\pm.000.33 ±.01\pm.01
UMAP0.70 ±.04\pm.040.62 ±.07\pm.070.37 ±.02\pm.020.58 ±.02\pm.020.30 ±.01\pm.01
PaCMAP0.69 ±.00\pm.000.62 ±.01\pm.010.49 ±.00\pm.000.67 ±.01\pm.010.30 ±.00\pm.00

Table S3. Spearman correlation coefficient between pairwise distances in the high-dimensional space and in the embedding. The highest value in each column is highlighted in bold, together with all values within 0.02. Deterministic runs are shown without stds. Non-metric MDS always achieves the best (or one of the best) result(s).

We observed the same behavior in the 1000 Genomes dataset (The 1000 Genomes Project Consortium, [48]), where we used the preprocessed data from de Bodt et al. [11], resulting in 53 999 feature dimensions which we converted to the distance matrix (Figure 4). Here input distances were also highly concentrated (Figure 4d). As a result, metric MDS struggled to represent the data and produced a nearly spherical embedding with triplet accuracy (0.86) lower than that of classical MDS (0.92). The radius of the metric MDS embedding was in good agreement with our theoretical prediction (Figure 4b) as was the stress value of 0.41 ≈S∗\approx\sqrt{S^*} (Table 1). In contrast, non-metric MDS produced a more informative embedding with better class separation and much higher triplet accuracy (0.96). In genomics it is common to pre-process the data with PCA. Doing it prior to metric MDS improved the triplet accuracy of the resulting embedding (50 PCA dimensions: 0.89; 10 dimensions: 0.91) but did not reach the level of non-metric MDS.

Figure 4. Classical, metric, and non-metric MDS embeddings of the 1000 Genomes dataset (n=3450n = 3450 in 53 999 dimensions). See caption of Figure 3 for explanations. Colors correspond to the sampling population (26 global populations), see The 1000 Genomes Project Consortium [48]. The dashed circle in (b) shows our theoretical prediction and has radius Dˉπ/4\bar{D}\pi/4.

On the other hand, on the Digits dataset (available in scikit-learn) there was little difference between the performance of metric and non-metric MDS (Figure S4). This makes sense because the pairwise distances in this dataset were less tightly concentrated (Figure S4).

Figure S4. Classical, metric, and non-metric MDS embeddings of the Digits dataset (n=1797n = 1797 in 64 dimensions). See caption of Figure 3 for explanations.

Stochastic non-metric MDS is accurate and fast

Using all three datasets presented above (noisy blobs, 1000 Genomes, and Digits), we compared our stochastic implementation with the scikit-learn implementation with our modifications. We found that both implementations achieved the same stress-1 values on all three datasets and for both metric/non-metric MDS (Table 1, left). At the same time, the stochastic implementation was much faster in all cases (Table 1, right). The speed-up was particularly noticeable for non-metric MDS.

The scikit-learn implementation constructs the full D\mathbf{D} matrix in memory, which becomes prohibitive for n≫10 000n \gg10\,000. Due to memory overflow, we were unable to run it on our two further datasets: the Tasic dataset of single-cell transcriptomic data from Tasic et al., [47], analyzed previously in Kobak & Berens [23] and de Bodt et al. [11] (we followed the preprocessing from these two papers), and the MNIST dataset. Therefore, for these two datasets, all following results were obtained using our stochastic implementation.

On the Tasic dataset, non-metric MDS produced an embedding with the shared highest triplet accuracy (0.99, as for PCA, vs. 0.94 for metric MDS) and the highest Spearman correlation (0.95, vs. 0.91–0.92 for PCA and metric MDS) (Figure 5). One salient feature of this dataset is that it contains a small amount of various non-neural cells that transcriptomically are (a) far away from all neural cells; and (b) far away from each other. Non-metric MDS emphasized this structure by locating non-neural cells along an arc going around the cluster of neural cells. This happened at a price of squeezing all neural cells together, compared to the metric MDS embedding. Note that here we increased the nepochsn_{\mathrm{epochs}} value for non-metric MDS to 500; our default value of 200 produced a similar-looking embedding but with a less pronounced arc structure.

Figure 5. Classical, metric, and non-metric MDS embeddings of the Tasic dataset (n=23 822n = 23\,822 in 50 dimensions). See caption of Figure 3 for explanations. Colors correspond to cell types (warm colors: inhibitory neurons; cold colors: excitatory neurons; brown/grey colors: non-neural cells). See Figure S6 for the same Shepard diagram as in (d), but colored by cell identity of cell pairs.

Figure S6. Shepard diagram for the non-metric MDS embedding of the Tasic dataset. Reproduced from Figure 5d but here each pair of cells is colored based on the cells’ identities: excitatory/excitatory and inhibitory/inhibitory neuron pairs are shown in blue; excitatory/inhibitory neuron pairs — in orange; non-neural/non-neural pairs — in green; neural/non-neural pairs — in red.

On the MNIST dataset, the difference between metric and non-metric MDS was visually not very apparent (Figure S5), but non-metric MDS did show higher global structure preservation, especially for the distance correlations (Table S2–Table S3). Similar to the Digits dataset, the MNIST dataset arguably lacks global structure that can be represented by any MDS. One aspect of the data visible in the non-metric MDS embedding is the higher density of digits ‘1’ (orange color in Figure S5).

Figure S5. Classical, metric, and non-metric MDS embeddings of the MNIST dataset (n=70 000n = 70\,000 in 784 dimensions). See caption of Figure 3 for explanations.

Across datasets, non-metric MDS achieves the highest global structure preservation

Across all five datasets, non-metric MDS achieved the highest performance in 14 out of 15 cases (five datasets and three evaluation metrics), including a shared highest in 3 cases (Table 2, Table S2, Table S3).

BlobsGen.DigitsTasicMNIST
Classical0.90 ±.000.92 ±.000.80 ±.000.99 ±.000.72 ±.00
Metric0.83 ±.000.86 ±.000.84 ±.000.94 ±.000.77 ±.00
Non-metric0.92 ±.000.96 ±.000.85 ±.000.99 ±.000.82 ±.00
t-SNE0.81 ±.040.79 ±.010.75 ±.000.79 ±.000.65 ±.01
UMAP0.85 ±.020.82 ±.030.67 ±.010.82 ±.030.64 ±.00
PaCMAP0.86 ±.000.80 ±.010.74 ±.000.86 ±.010.64 ±.00

Table 2. Triplet accuracies. The highest value in each column is highlighted in bold, together with all values within 0.02. Non-metric MDS always achieves the best (or one of the best) result(s). See Table S2–Table S3 for Pearson and Spearman correlations between pairwise distances. Scikit-learn implementation for the first three datasets, our stochastic SGD for the last two.

For completeness, we also evaluated the t-SNE and the UMAP embeddings of all five datasets. These two algorithms are currently by far the most popular methods of representing high-dimensional data in 2D [11]. Both t-SNE and UMAP are designed to preserve the nearest neighbors, which makes them excel at local structure preservation. Indeed, these two algorithms strongly outperformed all flavors of MDS in terms of local quality metrics, such as kNN recall and kNN accuracy (Table S4–Table S5). t-SNE and UMAP were also much faster than our stochastic non-metric MDS implementation (Table S6). At the same time, their capacity to preserve global structure of the data is known to be very poor [11] and indeed, this is what we confirmed on our datasets (Table 2, Table S2, Table S3). We have also evaluated PaCMAP [51] as the neighbor-embedding method designed to preserve global structure as well; however, its triplet performance was not consistently better than that of t-SNE and UMAP (Table 2).

Table S4: kkNN recall, that is the fraction of k=10k = 10 original nearest neighbors that are among the k=10k = 10 nearest neighbors in the embedding (evaluated on a subset of 5000 query points for datasets with n>5000n > 5000). The highest value in each column is highlighted in bold, together with all values within 0.02. Deterministic runs are shown without stds. As expected, t-SNE always achieves the best result (on Blobs, within-class noise is too large and high-dimensional neighbors are near-random).

BlobsGen.DigitsTasicMNIST
Classical0.010.040.120.02±.000.02 \pm.000.01±.000.01 \pm.00
Metric0.010.040.150.04±.000.04 \pm.000.01±.000.01 \pm.00
Non-metric0.010.040.130.03±.000.03 \pm.000.01±.000.01 \pm.00
t-SNE0.02±.000.02 \pm.000.20±.000.20 \pm.000.59±.000.59 \pm.000.45±.000.45 \pm.000.36±.000.36 \pm.00
UMAP0.03±.000.03 \pm.000.14±.000.14 \pm.000.49±.000.49 \pm.000.25±.000.25 \pm.000.10±.000.10 \pm.00
PaCMAP0.01±.000.01 \pm.000.11±.000.11 \pm.000.44±.010.44 \pm.010.21±.000.21 \pm.000.08±.000.08 \pm.00

Table S4.

Table S5: kkNN accuracy (k=10k = 10) in the embedding. The highest value in each column is highlighted in bold, together with all values within 0.02. Deterministic runs are shown without stds. As expected, t-SNE always achieves the best or one of the best result(s).

BlobsGen.DigitsTasicMNIST
Classical1.000.56±.020.56 \pm.020.65±.020.65 \pm.020.21±.000.21 \pm.000.43±.010.43 \pm.01
Metric1.000.49±.010.49 \pm.010.72±.010.72 \pm.010.44±.010.44 \pm.010.47±.000.47 \pm.00
Non-metric1.000.59±.010.59 \pm.010.69±.020.69 \pm.020.23±.010.23 \pm.010.48±.000.48 \pm.00
t-SNE1.00±.001.00 \pm.000.89±.010.89 \pm.010.99±.030.99 \pm.030.90±.010.90 \pm.010.97±.000.97 \pm.00
UMAP1.00±.001.00 \pm.000.83±.010.83 \pm.010.99±.020.99 \pm.020.90±.000.90 \pm.000.97±.000.97 \pm.00
PaCMAP1.00±.001.00 \pm.000.85±.010.85 \pm.010.99±.020.99 \pm.020.89±.000.89 \pm.000.98±.000.98 \pm.00

Table S5.

Table S6: Runtimes of all methods. Deterministic runs are shown without stds. openTSNE and UMAP are run single-threaded.

BlobsGen.DigitsTasicMNIST
Classical2 s23 s0 s0 m0 m
Metric (SMACOF)359 s358 s15 s––
Metric (SGD)21±021 \pm0 s19±019 \pm0 s5±05 \pm0 s1±01 \pm0 m1±01 \pm0 m
Non-metric (SMACOF)1086 s473 s152 s––
Non-metric (SGD)18±018 \pm0 s23±023 \pm0 s8±08 \pm0 s23±123 \pm1 m3±03 \pm0 m
t-SNE35±035 \pm0 s23±023 \pm0 s7±07 \pm0 s1±01 \pm0 m5±05 \pm0 m
UMAP7±07 \pm0 s9±19 \pm1 s4±04 \pm0 s0±00 \pm0 m2±02 \pm0 m
PaCMAP6±06 \pm0 s45±145 \pm1 s1±01 \pm0 s0±00 \pm0 m1±01 \pm0 m

Table S6.

Discussion

Our contribution in this paper is two-fold. Conceptually, we showed that metric MDS suffers from the curse of dimensionality. We derived a perturbation bound stating that the global optimum of metric MDS remains close to a circular embedding under high-dimensional noise. We confirmed this effect in simulations and real datasets using scikit-learn’s implementation of metric MDS.

Practically, we developed a fast implementation of non-metric MDS, showed that non-metric MDS is more robust than metric MDS and can strongly outperform other embedding methods in terms of global structure preservation, in particular on datasets with prominent high-dimensional noise. Non-metric MDS was introduced over 60 years ago but has received little attention in modern manifold-learning and dimensionality-reduction literature. We are not aware of any modern benchmark studies of dimensionality-reduction methods that include non-metric MDS or of any prior scalable implementations.

Future work and possible applications Several recent studies have developed hybrid methods combining neighbor-embedding methods such as tt-SNE ([50]) or UMAP ([36]) that exhibit high local structure preservation with global methods such as PCA or MDS. For example, SQuadMDS-hybrid ([28]) includes both tt-SNE and metric MDS losses in its composite loss term. Similarly, DREAMS ([27]) regularized tt-SNE towards a pre-computed PCA or MDS embedding. Our results suggest that non-metric MDS can be a good choice for a global counterpart in such hybrid methods. Other examples of modern methods relying on metric MDS are PHATE ([37]) and HeatGeo ([22]) which approximate diffusion-based graph distances in 2D. Here also, non-metric MDS could provide additional flexibility to embed the diffusion-based distances.

A recent work by Li et al. [31] suggested a deflation procedure that can remove the contribution of high-dimensional noise from a distance matrix. It would be interesting to study if this can be combined with metric MDS to achieve similar results as with non-metric MDS.

AI Use Statement

In this work, we used generative AI tools (Claude and ChatGPT) to formulate mathematical claims, to provide critical ingredients for the proofs, and to write down the final proofs. We used interactively sessions with Claude 4.7 for Theorem 1 and Appendix C and ChatGPT 5.5 for Proposition 2 and Appendix D. We manually and in detail checked the correctness of all generated proofs. For instance, Claude’s initial proof of Theorem 1 only showed that the KKT conditions lead to the Riesz equilibrium measure, but did not verify that it actually satisfies the KKT conditions. Moreover, there was initially no convexity argument and Claude only claimed that ρ∗\rho^* is optimal among radially symmetric distributions. When prompted to verify the off-support KKT condition, Claude hallucinated a minimum principle for subharmonic functions. But when we pushed back, it came up with the correct solution based on the maximum principle for subharmonic functions, which indeed exists and yields a valid proof.

All code for the initial submission was implemented manually by the authors. During revision, we used Claude Sonnet 5.5 and Opus 5.5 to refactor the codebase and to extend our benchmark with additional evaluations and methods.

The manuscript text was written by hand.

Data and Code

All our code is available at https://github.com/kobaklab/nmds. All used datasets are openly available online, with links in the Github README files.

Supplementary tables

Supplementary figures

Figure S1. Stress-1 and triplet accuracies obtained using the SGD implementation of metric MDS using different batch sizes. All y-axis ranges are fixed to 0.015.

Figure S2. Empirically optimal 2D MDS layouts of nn equidistant points, obtained using the scikit-learn implementation. (a) For n=2n = 2 and 3 exact equidistance can be achieved. Starting with n=4n = 4 pairwise equidistance needs to be approximated. Empirically, for n=4,…,7n = 4, \ldots, 7 a regular polygon is optimal. At n≥8n \ge8 our experiments showed that adding additional points inside the polygon achieves lower loss. (b) Average stress values for the regular polygons and MDS embeddings (averaged over 3 seeds, standard deviations were negligible), as a function of sample size nn. Dotted lines show the optimal stress for the continuum limits from Lemma 4 and Theorem 1.

Supplementary listing

1 import numpy as np
2 import time
3 import torch
4 from sklearn.manifold import ClassicalMDS
5 from sklearn.decomposition import PCA
6 from sklearn.isotonic import IsotonicRegression
7 from scipy.spatial.distance import cdist

9 def stochasticMDS(
10     X,
11     n_components=2,
12     precomputed_distances=False,
13     non_metric=False,
14     n_epochs="auto",
15     batch_size="auto",
16     print_every_epoch="auto",
17     init_scale=0.5,
18     init=None,
19     seed=42,
20     compute_all_distances="auto",
21 ):
22 
23 ### Default hyperparameter values
24 sample_size = X.shape[0]

26 if batch_size == "auto":
27     if sample_size <= 5000 and non_metric:
28         batch_size = 100
29     else:
30         batch_size = 1000
31     batch_size = min(batch_size, sample_size)

33 if n_epochs == "auto":
34     if sample_size < 50_000:
35         n_epochs = 200
36     else:
37         n_epochs = 20

39 if print_every_epoch == "auto":
40     if n_epochs > 20:
41         print_every_epoch = 10
42     else:
43         print_every_epoch = 1

45 ### Initialization
46 if init is not None:
47     Z = init
48 else:
49     if precomputed_distances:
50         Z = ClassicalMDS(
51             n_components=n_components, metric="precomputed"
52         ).fit_transform(X)
53     else:
54         Z = PCA(
55             n_components=n_components, random_state=seed
56         ).fit_transform(X)
57     Z /= np.std(Z[:, 0])
58     Z *= init_scale

60 if compute_all_distances == "auto":
61     compute_all_distances = sample_size <= 10_000
62 if compute_all_distances and not precomputed_distances:
63     X = euclidean_distances(X)
64     precomputed_distances = True

66 generator = torch.Generator().manual_seed(seed)

68 ### Set up the model
69 model = torch.nn.Embedding.from_pretrained(
70     torch.tensor(np.ascontiguousarray(Z, dtype=np.float32)), freeze=False, sparse=True,
71 )

73 optimizer = torch.optim.SGD(
74     model.parameters(), lr=1 / (2 * batch_size)
75 )
76 scheduler = torch.optim.lr_scheduler.CosineAnnealingLR(
77     optimizer, T_max=n_epochs
78 )
if non_metric:
    ir = IsotonicRegression(out_of_bounds="clip")

### Training loop
n_batches = sample_size // batch_size
for epoch in range(n_epochs):
    shuffle = torch.randperm(sample_size, generator=generator)

    epoch_loss = 0
    for batch in range(n_batches):
        ind = shuffle[
            batch * batch_size :
            (batch + 1) * batch_size
        ]
        ind_np = ind.numpy()

        if precomputed_distances:
            dists = X[np.ix_(ind_np, ind_np)]
        else:
            batch_X = torch.from_numpy(X[ind_np])
            dists = torch.cdist(batch_X, batch_X).fill_diagonal_(0).numpy()

        optimizer.zero_grad()
        embedding = model(ind)
        model_dists = torch.cdist(
            embedding, embedding
        )

        ### Non-metric part
        if non_metric:
            if epoch >= start_nonmetric_from_epoch:
                if batch == 0:
                    ir.fit(
                        dists.ravel(),
                        (
                            model_dists.detach().
                            numpy().ravel()
                        )
                    )

                dists = ir.transform(
                    dists.ravel()
                ).reshape(
                    dists.shape
                )

        ### Normalization
        if batch == 0:
            dists_scaling = np.sqrt(
                np.sum(dists ** 2) / (batch_size ** 2 - batch_size)
            )
        dists = dists / dists_scaling

        dists = torch.tensor(
            dists.astype(np.float32)
        )

        ### Loss function = average stress
        loss = 0.5 * torch.sum(
            (model_dists - dists) ** 2
        )

        loss.backward()
        optimizer.step()
        epoch_loss += loss.item()

    scheduler.step()
    epoch_loss /= n_batches

    Z = model.weight.detach().numpy()
    return Z, epoch_loss

Listing S1: Stochastic MDS implementation.

Extended robustness analysis

In addition to the setup in Figure 2, we also ran a larger suite of robustness experiments. In particular, we

  • explored two dataset sizes, n∗=99n^* = 99 and n∗=297n^* = 297;

  • made the total number of points random by sampling n∼Poisson⁡(n∗)n \sim\operatorname{Poisson}(n^*);

  • made the sizes of the three clusters random, by sampling their sizes from Multinomial⁡(n;1/3,1/3,1/3)\operatorname{Multinomial}(n; 1/3, 1/3, 1/3);

  • varied the pairwise distances between clusters in 10 geometric steps between D=8D = 8 and D=64D = 64;

  • broke the noise-free equidistance of the clusters by jittering the points away from their cluster centers by standard Gaussians in the first two dimensions, scaled by D/10D/10;

  • used different standard deviations per noise dimension of σ=1\sigma= 1 and σ=2\sigma= 2;

  • varied the type of noise in the additional dd noise dimension between Gaussian, uniform, and exponential (all with standard deviation σ\sigma);

  • increased the range of noise dimensions to d∈[20,15 000 000]d \in[20, 15\,000\,000].

All configurations are summarized in Table S7. We ran each (d,D)(d, D) configuration 10 times, each time with a different noise realization (and, where random, different cluster sizes and jitter) and a different random initialization of MDS, and averaged the kNN accuracy over the 10 runs. We then fitted a power law to the 10 points (D,d∗(D/σ))(D, d^*(D/\sigma)), where d∗d^* is the smallest number of noise dimensions at which the averaged kNN accuracy dipped below 0.7. For metric MDS, the fitted slopes were within [2.0,2.3][2.0, 2.3] and for non-metric MDS within [3.9,4.1][3.9, 4.1] in close alignment with our theoretical predictions of 2 and 4, respectively.

Noiseσ\sigmaJitterSizeSamplingmMDSnMDScMDS
Gaussian1.0No=99= 99Fixed2.244.114.75
Gaussian1.0Yes∼99\sim99Random2.224.054.04
Uniform1.0Yes∼99\sim99Random2.223.984.07
Exponential1.0Yes∼99\sim99Random2.334.044.04
Gaussian2.0Yes∼99\sim99Random2.333.944.23
Gaussian1.0Yes∼297\sim297Random2.023.923.94

Table S7. Extended robustness analysis settings. The first line summarizes the setup for Fig. 2b, the other lines show the settings for the extended analysis. The last three columns are slopes for metric, non-metric, and classical MDS.

Optima of metric MDS for equidistant inputs

Lemma 3 (Optimal regular polygons). For n≥2n \ge2 points placed on a regular nn-gon of circumradius rr, the stress-minimizing radius is

rn∗=12ncot⁡π2n→n→∞2π.r_n^* = \frac{1}{2n}\cot\frac{\pi}{2n} \xrightarrow{n\to\infty} \frac{2}{\pi}.

The corresponding optimal average stress is

Sn∗=1−2n(n−1)cot⁡2(π2n)→n→∞1−8π2.S_n^* = 1 - \frac{2}{n(n-1)}\cot^2\left(\frac{\pi}{2n}\right) \xrightarrow{n\to\infty} 1 - \frac{8}{\pi^2}.

Proof. Place the vertices at xk=re2πik/nx_k = r e^{2\pi i k/n} for k=0,…,n−1k = 0,\ldots,n-1. The chord length between vertices kk and k+jk+j is ∥xk−xk+j∥=2rsin⁡(πj/n)\lVert x_k-x_{k+j}\rVert= 2r\sin(\pi j/n). For each j=1,…,n−1j = 1,\ldots,n-1 there are exactly nn pairs (i,i+j)(i,i+j), so the average per-pair stress is

Sn=nn(n−1)∑j=1n−1(2rsin⁡(πjn)−1)2=1n−1∑j=1n−1(2rsin⁡(πjn)−1)2.S_n = \frac{n}{n(n-1)}\sum_{j=1}^{n-1}\left(2r\sin\left(\frac{\pi j}{n}\right)-1\right)^2 = \frac{1}{n-1}\sum_{j=1}^{n-1}\left(2r\sin\left(\frac{\pi j}{n}\right)-1\right)^2.

Expanding and applying the identities ∑j=1n−1sin⁡2(πj/n)=n/2\sum_{j=1}^{n-1}\sin^2(\pi j/n)=n/2 and ∑j=1n−1sin⁡(πj/n)=cot⁡(π/(2n))\sum_{j=1}^{n-1}\sin(\pi j/n)=\cot(\pi/(2n)), we get

Sn=2nn−1r2−4cot⁡(π/(2n))n−1r+1.S_n=\frac{2n}{n-1}r^2-\frac{4\cot(\pi/(2n))}{n-1}r+1.

This convex quadratic in rr is minimized at rn∗=cot⁡(π/(2n))/nr_n^*=\cot(\pi/(2n))/n. The corresponding minimal value of SnS_n is

Sn∗=1−2n(n−1)cot⁡2(π2n).S_n^*=1-\frac{2}{n(n-1)}\cot^2\left(\frac{\pi}{2n}\right).

As n→∞n\to\infty, cot⁡(π/(2n))∼2n/π\cot(\pi/(2n))\sim2n/\pi, so rn∗→2/πr_n^*\to2/\pi and Sn∗→1−8/π2S_n^*\to1-8/\pi^2.

Recall that P(R2)\mathcal{P}(\mathbb{R}^2) denotes the set of probability measures on R2\mathbb{R}^2. For ρ∈P(R2)\rho\in\mathcal{P}(\mathbb{R}^2) and X,Y∼i.i.d.ρX,Y\overset{\mathrm{i.i.d.}}{\sim}\rho, the average stress functional (corresponding to the raw stress divided by n(n−1)/2n(n-1)/2, not to the stress-1) was defined in (5) as

S[ρ]=Eρ[(∥X−Y∥−1)2]=∬(∥x−y∥−1)2ρ(x)ρ(y) dx dy.(9)S[\rho]=\mathbb{E}_{\rho}\left[(\lVert X-Y\rVert-1)^2\right]=\iint(\lVert x-y\rVert-1)^2\rho(x)\rho(y)\,dx\,dy. \tag*{(9)}

Lemma 4 (Optimal circle). For the uniform measure μr\mu_r on a circle of radius rr, the stress-minimizing radius is r∗=2/πr^*=2/\pi, with optimal stress

S[μ2/π]=1−8/π2≈0.1894S[\mu_{2/\pi}]=1-8/\pi^2\approx0.1894

Proof. This follows by a limit argument from Lemma 3, but for the convenience of the reader, we include a direct proof as well. For X,Y∼i.i.d.μrX,Y\overset{\mathrm{i.i.d.}}{\sim}\mu_r, the angle between them Φ\Phi is distributed according to Uniform⁡[0,2π)\operatorname{Uniform}[0,2\pi) and ∥X−Y∥=2rsin⁡(Φ/2)\lVert X-Y\rVert=2r\sin(\Phi/2). Using that ∫02πsin⁡(ϕ/2) dϕ=4\int_0^{2\pi}\sin(\phi/2)\,d\phi=4 and ∫02πsin⁡2(ϕ/2) dϕ=π\int_0^{2\pi}\sin^2(\phi/2)\,d\phi=\pi, we get

E∥X−Y∥=4rπ,E∥X−Y∥2=2r2.\mathbb{E}\lVert X-Y\rVert=\frac{4r}{\pi},\qquad\mathbb{E}\lVert X-Y\rVert^2=2r^2.

Hence S[μr]=2r2−8r/π+1S[\mu_r]=2r^2-8r/\pi+1, which is minimized at r∗=2/πr^*=2/\pi with optimal stress 1−8/π21-8/\pi^2. This confirms the continuous limit.

The following theorem was shown independently by Mattner [35, 34] and Buja et al. [9].

Theorem 5 (Limiting MDS embedding, detailed version of Thm. 1). Up to translation, the unique minimizer of S[ρ]S[\rho] over P(R2)\mathcal{P}(\mathbb{R}^2) is the Riesz s=1s=1 equilibrium measure with density

ρ∗(x)=2π2(π/4)2−∥x∥21(∥x∥<π4).(10)\rho^*(x)=\frac{2}{\pi^2\sqrt{(\pi/4)^2-\lVert x\rVert^2}}\mathbf{1}\left(\lVert x\rVert<\frac{\pi}{4}\right). \tag*{(10)}

It achieves optimal stress

S∗=1−π212≈0.1775.(11)S^*=1-\frac{\pi^2}{12}\approx0.1775. \tag*{(11)}

Proof. We proceed in eight steps.

Since S[ρ]S[\rho] depends only on pairwise distances ∥X−Y∥\lVert X-Y\rVert, translating ρ\rho does not affect S[ρ]S[\rho], so we can assume E[X]=0\mathbb{E}[X]=0 without loss of generality. We show in Step 1 that SS is strictly convex on the set of zero-centered probability distributions ρ\rho. As a result, any such ρ\rho satisfying the Karush–Kuhn–Tucker (KKT) conditions is the unique global minimizer; Steps 2–7 then confirm ρ∗\rho^* is that point. Note that we need KKT conditions because our optimization problem has both equality and inequality constraints: we optimize (9) over ρ\rho that has to be non-negative and integrate to one.

Step 1: Strict Convexity of S. To show that SS is convex, we consider two zero-centered probability measures ρ≠ρ′\rho\ne\rho'. Denoting η=ρ′−ρ\eta=\rho'-\rho, we have

S[ρ′]=S[ρ+η]=∬(∥x−y∥−1)2(ρ(x)+η(x))(ρ(y)+η(y)) dx dy=S[ρ]+∫(2∫(∥x−y∥−1)2ρ(y) dy)η(x) dx+∬(∥x−y∥−1)2η(x)η(y) dx dy=S[ρ]+∫δSδρ(x)η(x) dx+S[η].\begin{aligned} S[\rho']&=S[\rho+\eta]=\iint(\lVert x-y\rVert-1)^2(\rho(x)+\eta(x))(\rho(y)+\eta(y))\,dx\,dy\\ &=S[\rho]+\int\left(2\int(\lVert x-y\rVert-1)^2\rho(y)\,dy\right)\eta(x)\,dx+\iint(\lVert x-y\rVert-1)^2\eta(x)\eta(y)\,dx\,dy\\ &=S[\rho]+\int\frac{\delta S}{\delta\rho}(x)\eta(x)\,dx+S[\eta]. \end{aligned}

Strict convexity means that the functional increases faster than a local linear approximation. The second term is linear in η\eta (and the functional η↦∫δSδρη\eta\mapsto\int\frac{\delta S}{\delta\rho}\eta is the local linear approximation at ρ\rho), so to demonstrate strict convexity we need to show that S[η]>0S[\eta] > 0. We have

S[η]=∬(∥x−y∥−1)2η(x)η(y) dx dy=∬(∥x∥2−2xTy+∥y∥2−2∥x−y∥+1)η(x)η(y) dx dy=(a)∬(−2xTy−2∥x−y∥)η(x)η(y) dx dy=−2∫xTη(x) dx∫yη(y) dy−2∬∥x−y∥η(x)η(y) dx dy=(b)−2∬∥x−y∥η(x)η(y) dx dy>(c)0,\begin{aligned} S[\eta] &= \iint\left(\lVert x-y\rVert- 1\right)^2 \eta(x)\eta(y)\,dx\,dy \\ &= \iint\left(\lVert x\rVert^2 - 2x^{\mathsf{T}}y + \lVert y\rVert^2 - 2\lVert x-y\rVert+ 1\right)\eta(x)\eta(y)\,dx\,dy \\ &\overset{(a)}{=} \iint\left(-2x^{\mathsf{T}}y - 2\lVert x-y\rVert\right)\eta(x)\eta(y)\,dx\,dy \\ &= -2\int x^{\mathsf{T}}\eta(x)\,dx\int y\eta(y)\,dy - 2\iint\lVert x-y\rVert\eta(x)\eta(y)\,dx\,dy \\ &\overset{(b)}{=} -2\iint\lVert x-y\rVert\eta(x)\eta(y)\,dx\,dy \\ &\overset{(c)}{>} 0, \end{aligned}

where we dropped terms not depending on both xx and yy at (a) because ∫η=0\int\eta= 0 and used Eη(X)=0\mathbb{E}_{\eta}(X)=0 at (b). Inequality (c) follows because η≠0\eta\ne0 with ∫η=0\int\eta= 0 and ∥x−y∥\lVert x-y\rVert is a strictly conditionally negative definite kernel [41].

Thus, SS is strictly convex on the set of zero-centered probability distributions.

Step 2: Expand S[ρ]S[\rho]. Expanding the square in equation (9), we get

S[ρ]=E∥X−Y∥2−2E∥X−Y∥+1.(12)S[\rho] = \mathbb{E}\lVert X-Y\rVert^2 - 2\mathbb{E}\lVert X-Y\rVert+ 1. \tag*{(12)}

Note that this identity only holds if all terms on the right are finite. We will now show that this is true for any ρ\rho for which S[ρ]<∞S[\rho] < \infty, and we are only interested in this case as we are looking for the minimum of SS. The pointwise bound a2≤2(a−1)2+2a^2 \le2(a-1)^2 + 2, valid since (a−2)2≥0(a-2)^2 \ge0, gives E∥X−Y∥2≤2S[ρ]+2<∞\mathbb{E}\lVert X-Y\rVert^2 \le2S[\rho] + 2 < \infty. We denote E∥X∥2\mathbb{E}\lVert X\rVert^2 as σ2\sigma^2. Conditioning on XX yields

EY[∥X−Y∥2]=EY[∥X∥2−2X⋅Y+∥Y∥2]=∥X∥2+E∥Y∥2=∥X∥2+σ2,\mathbb{E}_{Y}\left[\lVert X-Y\rVert^2\right] = \mathbb{E}_{Y}\left[\lVert X\rVert^2 - 2X\cdot Y + \lVert Y\rVert^2\right] = \lVert X\rVert^2 + \mathbb{E}\lVert Y\rVert^2 = \lVert X\rVert^2 + \sigma^2,

where we used E[Y]=0\mathbb{E}[Y] = 0 and E∥Y∥2=σ2\mathbb{E}\lVert Y\rVert^2 = \sigma^2. Taking the outer expectation, we get E∥X−Y∥2=2σ2\mathbb{E}\lVert X-Y\rVert^2 = 2\sigma^2. The left part is finite, hence σ2<∞\sigma^2 < \infty.

Thus,

S[ρ]=2σ2−2E∥X−Y∥+1.S[\rho] = 2\sigma^2 - 2\mathbb{E}\lVert X-Y\rVert+ 1.

Step 3: KKT conditions. We can now compute the functional derivative of S[ρ]S[\rho] with respect to ρ\rho. For

σ2[ρ]=∫∥x∥2ρ(x) dx,\sigma^2[\rho] = \int\lVert x\rVert^2\rho(x)\,dx,

the functional is linear in ρ\rho (the integrand ∥x∥2\lVert x\rVert^2 does not depend on ρ\rho), so its functional derivative is simply the integrand:

δσ2δρ(x)=∥x∥2.\frac{\delta\sigma^2}{\delta\rho}(x) = \lVert x\rVert^2.

For the interaction term

E∥X−Y∥=∬∥x−y∥ρ(x)ρ(y) dx dy,\mathbb{E}\lVert X-Y\rVert= \iint\lVert x-y\rVert\rho(x)\rho(y)\,dx\,dy,

the functional is quadratic in ρ\rho with symmetric kernel k(x,y)=∥x−y∥k(x,y)=\lVert x-y\rVert. Thus by the product rule we get

δδρ(x)(E∥X−Y∥)=2∫∥x−y∥ρ(y) dy.\frac{\delta}{\delta\rho(x)}\left(\mathbb{E}\lVert X-Y\rVert\right) = 2\int\lVert x-y\rVert\rho(y)\,dy.

Together we obtain the functional derivative

δSδρ(x)=2∥x∥2−4∫∥x−y∥ρ(y) dy.\frac{\delta S}{\delta\rho}(x) = 2\lVert x\rVert^2 - 4\int\lVert x-y\rVert\rho(y)\,dy.

This agrees with the expression in Step 1 up to the additive constant 2σ2+22\sigma^2+2, which is irrelevant since ∫η=0\int\eta=0.

At the minimum, the local linear approximation to SS must equal zero or some constraint must be active. Taking the expression for the local linear approximation from Step 1, we obtain the condition for the minimum as

∫δSδρ(x)η(x) dx=0,\int\frac{\delta S}{\delta\rho}(x)\eta(x)\,dx=0,

for all η\eta such that η(x)=0\eta(x)=0 for x∉supp⁡(ρ)x\notin\operatorname{supp}(\rho). In words, at the optimum, moving an infinitesimal bit of mass from any occupied point x∈supp⁡(ρ)x\in\operatorname{supp}(\rho) to any other occupied point x′∈supp⁡(ρ)x'\in\operatorname{supp}(\rho) must leave SS unchanged to first order. This is of course satisfied when δSδρ=0\frac{\delta S}{\delta\rho}=0, but not only then. As we are optimizing over the space of probability distributions, the constraint of them integrating to 1 implies that ∫η=0\int\eta=0, so the condition is also satisfied when δSδρ=C\frac{\delta S}{\delta\rho}=C for any constant CC. This is effectively the Lagrange multiplier arising from the equality constraint.

Off the support, we cannot decrease ρ\rho further due to the inequality constraint ρ(x)≥0\rho(x)\ge0. So η\eta can only place mass there, not take it away. To ensure that placing mass off the support with some perturbation η\eta that has η(x)>0\eta(x)>0 for some x∉supp⁡(ρ)x\notin\operatorname{supp}(\rho) does not decrease the functional, δSδρ(x)\frac{\delta S}{\delta\rho}(x) must be at least as large as on the support.

Taking this together, we arrive at the full set of KKT conditions at a minimizer:

δSδρ(x)=Cfor x∈supp⁡(ρ),δSδρ(x)≥Cfor x∉supp⁡(ρ).\begin{aligned} \frac{\delta S}{\delta\rho}(x)&=C &&\text{for }x\in\operatorname{supp}(\rho),\\ \frac{\delta S}{\delta\rho}(x)&\ge C &&\text{for }x\notin\operatorname{supp}(\rho). \end{aligned}

Rearranging the on-support condition gives

2∫∥x−y∥ρ(y) dy=∥x∥2−12Cfor x∈supp⁡(ρ).(13)2\int\lVert x-y\rVert\rho(y)\,dy=\lVert x\rVert^2-\frac{1}{2}C \qquad\text{for }x\in\operatorname{supp}(\rho). \tag*{(13)}

Step 4: Laplacian trick. Apply Δx\Delta_x to both sides of equation ⋆. For the right-hand side, Δx(∥x∥2)=4\Delta_x(\lVert x\rVert^2)=4 in R2\mathbb{R}^2. For the left-hand side, we use

Δx∥x−y∥=1∥x−y∥for x≠y.(14)\Delta_x\lVert x-y\rVert=\frac{1}{\lVert x-y\rVert} \qquad\text{for }x\ne y. \tag*{(14)}

To see this, note that we can assume y=0y=0 by translation. Then for r=∥x∥r=\lVert x\rVert we have Δr=r′′+r′/r=0+1/r\Delta r=r''+r'/r=0+1/r by the radial Laplacian formula in R2\mathbb{R}^2. Since 1/r1/r is locally integrable in R2\mathbb{R}^2, Δx∥x−y∥=1/∥x−y∥\Delta_x\lVert x-y\rVert=1/\lVert x-y\rVert distributionally with no delta correction at x=yx=y. Commuting Δx\Delta_x with the integral (justified for ρ\rho with σ2<∞\sigma^2<\infty by regularizing ∥x−y∥ϵ=∥x−y∥2+ϵ2\lVert x-y\rVert_\epsilon=\sqrt{\lVert x-y\rVert^2+\epsilon^2}, differentiating under the integral for fixed ϵ>0\epsilon>0, then passing ϵ→0\epsilon\to0 by dominated convergence) yields

∫ρ(y)∥x−y∥ dy=2for x∈supp⁡(ρ).(15)\int\frac{\rho(y)}{\lVert x-y\rVert}\,dy=2 \qquad\text{for }x\in\operatorname{supp}(\rho). \tag*{(15)}

Step 5: Riesz equilibrium measure. Equation equation ⋆⋆ is the condition that the Riesz s=1s=1 potential

V(x)=∫ρ(y)∥x−y∥ dyV(x)=\int\frac{\rho(y)}{\lVert x-y\rVert}\,dy

is constant (and equal to 2) on supp⁡(ρ)\operatorname{supp}(\rho). This is satisfied by the Riesz s=1s=1 equilibrium ((Riesz, 1938; Landkof, 1972, § II.3.13, pp. 163–164, and Appendix, pp. 399–400; Chafai et al., 2022, Lem. 1.2)

ρ∗(x)=2π2(π/4)2−∥x∥21(∥x∥<π/4).(16)\rho^*(x)=\frac{2}{\pi^2\sqrt{(\pi/4)^2-\lVert x\rVert^2}}\mathbf{1}(\lVert x\rVert<\pi/4). \tag*{(16)}

Step 6: Verifying the on-support KKT condition. The minimizer ρ∗\rho^* is radially symmetric on the disc B(0,π/4)B(0,\pi/4), hence the functional derivative δSδρ\frac{\delta S}{\delta\rho} is also radially symmetric. The functional derivative is also harmonic because

ΔδSδρ(x)=8−4V(x)=0.\Delta\frac{\delta S}{\delta\rho}(x)=8-4V(x)=0.

Any radially symmetric harmonic function must be of the form alog⁡∥x∥+ba\log\lVert x\rVert+b. If we show that δSδρ\frac{\delta S}{\delta\rho} is finite at x=0x=0, it will follow that it must be constant. We denote R=π/4R=\pi/4 and compute

δSδρ(0)=−4∫∥y∥ρ∗(y) dy=−4∫0Rr⋅4rπR2−r2 dr\frac{\delta S}{\delta\rho}(0)=-4\int\lVert y\rVert\rho^*(y)\,dy=-4\int_0^R r\cdot\frac{4r}{\pi\sqrt{R^2-r^2}}\,dr
=(a)−16R2π∫0π/2sin⁡2θ dθ=−16R2π⋅π4=−π24,\overset{(a)}{=}-\frac{16R^2}{\pi}\int_0^{\pi/2}\sin^2\theta\,d\theta=-\frac{16R^2}{\pi}\cdot\frac{\pi}{4}=-\frac{\pi^2}{4},

where at (a) we substituted r=Rsin⁡(θ)r=R\sin(\theta). Note that this implies C=δSδρ(0)=−π2/4C=\frac{\delta S}{\delta\rho}(0)=-\pi^2/4.

Step 7: Verifying the off-support KKT condition.

Part A: V(x)=2V(x)=2 on ∂B(0,π/4)\partial B(0,\pi/4). By Step 5, we have V(x)=2V(x)=2 for all ∥x∥<π/4\lVert x\rVert<\pi/4, and by continuity V(x)=2V(x)=2 on the boundary.

Part B: V(x)≤2V(x)\le2 for ∥x∥>π/4\lVert x\rVert>\pi/4. For ∥x∥>π/4\lVert x\rVert>\pi/4 (so ∥x−y∥>0\lVert x-y\rVert>0 for all y∈supp⁡(ρ∗)y\in\operatorname{supp}(\rho^*)), differentiating under the integral and using Δx(1/∥x−y∥)=1/∥x−y∥3\Delta_x(1/\lVert x-y\rVert)=1/\lVert x-y\rVert^3 yields

ΔxV(x)=∫ρ∗(y)∥x−y∥3 dy>0.\Delta_xV(x)=\int\frac{\rho^*(y)}{\lVert x-y\rVert^3}\,dy>0.

So VV is subharmonic on the unbounded domain R2∖B(0,π/4)\mathbb{R}^2\setminus B(0,\pi/4), with V=2V=2 on ∂B(0,π/4)\partial B(0,\pi/4) and V(x)→0V(x)\to0 as ∥x∥→∞\lVert x\rVert\to\infty. By the maximum principle, V≤2V\le2 on the entire exterior.

Part C: Boundary data at r=π/4r=\pi/4. Define

g(x)=δSδρ(x)−C=2∥x∥2−4∫∥x−y∥ρ∗(y) dy−C.g(x)=\frac{\delta S}{\delta\rho}(x)-C=2\lVert x\rVert^2-4\int\lVert x-y\rVert\rho^*(y)\,dy-C.

so that the off-support KKT condition is g(x)≥0g(x)\ge0 for ∥x∥≥π/4\lVert x\rVert\ge\pi/4. Since ρ∗>0\rho^*>0 on the open disk, the on-support equality equation ⋆\star holds for all ∥x∥<π/4\lVert x\rVert<\pi/4, i.e. g≡0g\equiv0 on B(0,π/4)B(0,\pi/4). The function gg is radial (since ρ∗\rho^* is) and globally C1C^1: for

∇g(x)=4x−4∫x−y∥x−y∥ρ∗(y) dy,\nabla g(x)=4x-4\int\frac{x-y}{\lVert x-y\rVert}\rho^*(y)\,dy,

the integrand is dominated by the L1L^1 function ρ∗\rho^* (since ∥(x−y)/∥x−y∥∥=1\lVert(x-y)/\lVert x-y\rVert\rVert=1), so dominated convergence yields continuity of ∇g\nabla g on R2\mathbb{R}^2. Writing g(r)g(r) for the radial profile, the interior identity g≡0g\equiv0 on B(0,π/4)B(0,\pi/4) together with C1C^1 matching across r=π/4r=\pi/4 gives

g(π/4)=0,g′(π/4)=0.(17)g(\pi/4)=0,\qquad g'(\pi/4)=0. \tag*{(17)}

Part D: Radial ODE outside the disk. For ∥x∥>π/4\lVert x\rVert>\pi/4, differentiating under the integral and using the 2D identity Δx∥x−y∥=1/∥x−y∥\Delta_x\lVert x-y\rVert=1/\lVert x-y\rVert (Step 4) gives

Δg(x)=8−4V(x)≥0,\Delta g(x)=8-4V(x)\ge0,

where the inequality is Part B. For radial gg, Δg=g′′+g′/r\Delta g=g''+g'/r, so

(rg′(r))′=rΔg(r)≥0(r>π/4).(18)\left(rg'(r)\right)'=r\Delta g(r)\ge0\qquad(r>\pi/4). \tag*{(18)}

Part E: Two integrations. By equation 16, the function rg′(r)rg'(r) is non-decreasing on (π/4,∞)(\pi/4,\infty). For any r>π/4r>\pi/4, the fundamental theorem of calculus and the boundary data equation 15 give

rg′(r)≥π/4⋅g′(π/4)=0,rg'(r)\ge\pi/4\cdot g'(\pi/4)=0,

hence g′(r)≥0g'(r) \ge0 for r≥π/4r \ge\pi/4. A second integration from π/4\pi/4 to rr yields

g(r)≥g(π/4)=0(r≥π/4),g(r) \ge g(\pi/4) = 0 \qquad(r \ge\pi/4),

which is the off-support KKT condition.

Step 8: Optimal stress. We compute the terms σ2\sigma^2 and E∥X−Y∥\mathbb{E}\lVert X-Y\rVert in equation 12. First,

σ2=∫∥x∥2ρ(x) dx=r=∥x∥∫0Rr2⋅2π2R2−r22πr dr=4π∫0Rr3R2−r2 dr\sigma^2 = \int\lVert x\rVert^2\rho(x)\,dx \overset{r=\lVert x\rVert}{=} \int_0^R r^2 \cdot\frac{2}{\pi^2\sqrt{R^2-r^2}}2\pi r\,dr = \frac{4}{\pi}\int_0^R \frac{r^3}{\sqrt{R^2-r^2}}\,dr
=(i)4π∫0π/2R3sin⁡3(θ)R1−sin⁡2(θ)Rcos⁡(θ) dθ=4R3π∫0π/2sin⁡3(θ) dθ=4R3π⋅23=8R33π=π224,\overset{(i)}{=} \frac{4}{\pi}\int_0^{\pi/2}\frac{R^3\sin^3(\theta)}{R\sqrt{1-\sin^2(\theta)}}R\cos(\theta)\,d\theta= \frac{4R^3}{\pi}\int_0^{\pi/2}\sin^3(\theta)\,d\theta= \frac{4R^3}{\pi}\cdot\frac{2}{3}=\frac{8R^3}{3\pi}=\frac{\pi^2}{24},

where at (i) we substituted r=Rsin⁡(θ)r=R\sin(\theta). Integrating equation ⋆\star against ρ∗\rho^* gives

E∥X−Y∥=12σ2−14C.\mathbb{E}\lVert X-Y\rVert= \frac{1}{2}\sigma^2-\frac{1}{4}C.

Substituting everything into equation 12 and using C=−π2/4C=-\pi^2/4 from Step 6:

S∗=2σ2−2E∥X−Y∥+1=2σ2−σ2+12C+1=π212−π224−π28+1=1−π212≈0.1775.S^* = 2\sigma^2-2\mathbb{E}\lVert X-Y\rVert+1=2\sigma^2-\sigma^2+\frac{1}{2}C+1=\frac{\pi^2}{12}-\frac{\pi^2}{24}-\frac{\pi^2}{8}+1=1-\frac{\pi^2}{12}\approx0.1775.

This completes the proof.

The final version of our proof is essentially a more verbose version of Mattner [34]’s argument. We include it for the convenience of the reader. While proving this theorem, we were not aware of the work of Mattner [34] and Buja et al. [9]. Both works were pointed out to us by a MathOverflow user (we will give further details in the deanonymized version).

Corollary 6 (Distribution of point norms under ρ∗\rho^*). If X∼ρ∗X\sim\rho^*, the radius ∥X∥\lVert X\rVert has as rescaled Kumaraswamy (a=2,b=1/2)(a=2,b=1/2) density

fR(r)=4rπ(π/4)2−r21(r<π/4).f_R(r)=\frac{4r}{\pi\sqrt{(\pi/4)^2-r^2}}\mathbf{1}(r<\pi/4).

Proof. The density fR(r)=2πr⋅ρ∗(r)f_R(r)=2\pi r\cdot\rho^*(r) is obtained by integrating ρ∗\rho^* over the circle of radius rr. This is the Kumaraswamy density

abxa−1(1−xa)b−1abx^{a-1}(1-x^a)^{b-1}

for a=2a=2, b=1/2b=1/2 rescaled from [0,1)[0,1) to [0,π/4)[0,\pi/4).

From the Continuum Minimizer to Finite Configurations

Theorem 1 identifies the continuum minimizer ρ∗\rho^*. We now quantify how close the empirical distribution of a finite stress-minimizing configuration is to ρ∗\rho^*, both for exact unit targets and for noisy targets. The natural yardstick is the energy distance, whose square is half the second-order remainder already computed in Step 1 of the proof of Theorem 1, S[η]=2DE2(ρ∗+η,ρ∗)S[\eta]=2D_E^2(\rho^*+\eta,\rho^*), see Lemma 8.

Notation and standing assumptions. Throughout, X=(x1,…,xn)∈R2×nX=(x_1,\ldots,x_n)\in\mathbb{R}^{2\times n} with n≥2n\ge2, we write m=n(n−1)m=n(n-1) for the number of ordered off-diagonal pairs. The finite MDS stress of the Problem Formulation is

Sn(X)=1m∑i≠j(∥xi−xj∥−1)2,(19)S_n(X)=\frac{1}{m}\sum_{i\ne j}(\lVert x_i-x_j\rVert-1)^2, \tag*{(19)}

a sum over ordered pairs i≠ji\ne j only: there are no self-distances, equivalently the diagonal target distances are set to zero. Given a symmetric perturbation ϵij=ϵji\epsilon_{ij}=\epsilon_{ji} of the unit targets, 1+ϵij1+\epsilon_{ij}, the perturbed stress and the root-mean-square perturbation are

Snϵ(X)=1m∑i≠j(∥xi−xj∥−1−ϵij)2,δn2=1m∑i≠jϵij2.(20)S_n^\epsilon(X)=\frac{1}{m}\sum_{i\ne j}(\lVert x_i-x_j\rVert-1-\epsilon_{ij})^2,\qquad\delta_n^2=\frac{1}{m}\sum_{i\ne j}\epsilon_{ij}^2. \tag*{(20)}

Since SnS_n depends only on the pairwise differences xi−xjx_i-x_j, it is invariant under a common translation of all points, so we restrict to centered configurations, i.e. the linear subspace V={X:∑ixi=0}≅R2(n−1)V=\{X:\sum_i x_i=0\}\cong\mathbb{R}^{2(n-1)}. On VV both SnS_n and SnεS_n^\varepsilon are continuous and coercive, meaning the value tends to +∞+\infty as ∥X∥→∞\lVert X\rVert\to\infty on VV. A continuous coercive function on a finite-dimensional space attains its minimum, since its sublevel sets are closed (by continuity) and bounded (by coercivity), hence compact, so the Weierstrass theorem applies. We fix global minimizers

Xn∈arg⁡min⁡X Sn(X),Xnε∈arg⁡min⁡X Snε(X),αn=Sn(Xn)=min⁡XSn(X).(21)X_n\in\underset{X}{\arg\min}\,S_n(X),\qquad X_n^\varepsilon\in\underset{X}{\arg\min}\,S_n^\varepsilon(X),\qquad\alpha_n=S_n(X_n)=\min_X S_n(X). \tag*{(21)}

To a configuration XX we associate the centered empirical measure μX=1n∑i=1nδxi−xˉ\mu_X=\frac{1}{n}\sum_{i=1}^n\delta_{x_i-\bar{x}} with xˉ=1n∑ixi\bar{x}=\frac{1}{n}\sum_i x_i; centering changes neither pairwise distances nor the stress.

The energy distance and the stability identity

Definition 7 (Energy distance). For probability measures μ,ν\mu,\nu on R2\mathbb{R}^2 with finite first moment, the squared energy distance is

DE2(μ,ν)=2∬∥x−y∥ dμ(x) dν(y)−∬∥x−x′∥ dμ(x) dμ(x′)−∬∥y−y′∥ dν(y) dν(y′).(22)D_E^2(\mu,\nu)=2\iint\lVert x-y\rVert\,d\mu(x)\,d\nu(y)-\iint\lVert x-x'\rVert\,d\mu(x)\,d\mu(x')-\iint\lVert y-y'\rVert\,d\nu(y)\,d\nu(y'). \tag*{(22)}

Because the Euclidean-distance kernel ∥x−y∥\lVert x-y\rVert is strictly conditionally negative definite [41], one has DE2(μ,ν)≥0D_E^2(\mu,\nu)\ge0 with equality if and only if μ=ν\mu=\nu. Thus, DED_E is a genuine metric on distributions [46, 42]. The first finite moment is no real restriction here. Both μX\mu_X and ρ∗\rho^* are compactly supported, and more generally any measure of finite stress has finite second moment (Step 2), hence finite first moment.

The next lemma is the quantitative counterpart of the strict convexity established in Step 1 of the proof of Theorem 1. It upgrades “S[η]>0S[\eta]>0” to an exact identity with DE2D_E^2 as the leading term.

Lemma 8 (Quadratic stability). Let

g(x)=2∥x∥2−4∫∥x−y∥ dρ∗(y)+π24g(x)=2\lVert x\rVert^2-4\int\lVert x-y\rVert\,d\rho^*(y)+\frac{\pi^2}{4}

be the KKT slack from the proof of Theorem 1 (Step 7), so that g≡0g\equiv0 on B(0,π/4)B(0,\pi/4) and g≥0g\ge0 on R2\mathbb{R}^2. Then for every centered probability measure μ\mu with finite second moment (equivalently S[μ]<∞S[\mu]<\infty, cf. Step 2),

S[μ]−S∗=2DE2(μ,ρ∗)+∫g dμ≥2DE2(μ,ρ∗),(23)S[\mu]-S^*=2D_E^2(\mu,\rho^*)+\int g\,d\mu\ge2D_E^2(\mu,\rho^*), \tag*{(23)}

with equality whenever μ\mu is supported in the closed disk B‾(0,π/4)\overline{B}(0,\pi/4).

Proof. Write η=μ−ρ∗\eta=\mu-\rho^*. Both μ\mu and ρ∗\rho^* are centered probability measures, so

∫dη=0,∫x dη(x)=0.(24)\int d\eta=0,\qquad\int x\,d\eta(x)=0. \tag*{(24)}

Since SS in equation (9) is a quadratic form, write

B(α,β)=∬K(x,y) dα(x) dβ(y)B(\alpha,\beta)=\iint K(x,y)\,d\alpha(x)\,d\beta(y)

for the symmetric bilinear form with kernel K(x,y)=(∥x−y∥−1)2K(x,y)=(\lVert x-y\rVert-1)^2, so that S[ρ]=B(ρ,ρ)S[\rho]=B(\rho,\rho). Expanding S[ρ∗+η]S[\rho^*+\eta] and using the symmetry B(ρ∗,η)=B(η,ρ∗)B(\rho^*,\eta)=B(\eta,\rho^*),

S[μ]=B(ρ∗,ρ∗)+2B(ρ∗,η)+B(η,η)=S[ρ∗]+2B(ρ∗,η)+B(η,η).(25)S[\mu]=B(\rho^*,\rho^*)+2B(\rho^*,\eta)+B(\eta,\eta)=S[\rho^*]+2B(\rho^*,\eta)+B(\eta,\eta). \tag*{(25)}

To evaluate the linear coefficient B(ρ∗,η)B(\rho^*,\eta), integrate the kernel against ρ∗\rho^* first. Using ∫x dρ∗(x)=0\int x\,d\rho^*(x)=0 and ∫∥x∥2 dρ∗(x)=σ∗2\int\lVert x\rVert^2\,d\rho^*(x)=\sigma_*^2 (with σ∗2=π224\sigma_*^2=\frac{\pi^2}{24} from Step 8),

∫K(x,y) dρ∗(x)=∫(∥x−y∥2−2∥x−y∥+1) dρ∗(x)=(∥y∥2+σ∗2)−2∫∥x−y∥ dρ∗(x)+1=∥y∥2−2∫∥x−y∥ dρ∗(x)+(σ∗2+1),\begin{aligned} \int K(x,y)\,d\rho^*(x)&=\int\left(\lVert x-y\rVert^2-2\lVert x-y\rVert+1\right)\,d\rho^*(x)\\ &=\left(\lVert y\rVert^2+\sigma_*^2\right)-2\int\lVert x-y\rVert\,d\rho^*(x)+1\\ &=\lVert y\rVert^2-2\int\lVert x-y\rVert\,d\rho^*(x)+(\sigma_*^2+1), \end{aligned}

where the underbraced term is half the first variation δS/δρ\delta S/\delta\rho from Step 3 evaluated at ρ∗\rho^*, equal to g(y)/2−π2/8g(y)/2-\pi^2/8 by the definition of gg. Therefore

2B(ρ∗,η)=∫(g(y)−π24) dη(y)+2(σ∗2+1)∫dη(y),2B(\rho^*,\eta)=\int\left(g(y)-\frac{\pi^2}{4}\right)\,d\eta(y)+2(\sigma_*^2+1)\int d\eta(y),

and since ∫dη=0\int d\eta=0 the configuration-independent constant 2(σ∗2+1)2(\sigma_*^2+1) drops out, so equation 23 becomes

S[μ]=S[ρ∗]+∫(g(x)−π24) dη(x)+B(η,η).(26)S[\mu]=S[\rho^*]+\int\left(g(x)-\frac{\pi^2}{4}\right)\,d\eta(x)+B(\eta,\eta). \tag*{(26)}

Linear term. Since ∫dη=0\int d\eta=0, the constant π2/4\pi^2/4 in equation (26) integrates to zero, leaving ∫(g−π24) dη=∫g dη\int(g-\frac{\pi^2}{4})\,d\eta=\int g\,d\eta. Because g≡0g\equiv0 on supp⁡ρ∗\operatorname{supp}\rho^* we have ∫g dρ∗=0\int g\,d\rho^*=0, hence ∫g dη=∫g dμ\int g\,d\eta=\int g\,d\mu; and ∫g dμ≥0\int g\,d\mu\ge0 because g≥0g\ge0 everywhere (Step 7) and μ\mu is a nonnegative measure.

Quadratic term. Expand K(x,y)=∥x−y∥2−2∥x−y∥+1K(x,y)=\lVert x-y\rVert^2-2\lVert x-y\rVert+1. The identity ∥x−y∥2=∥x∥2−2x⊤y+∥y∥2\lVert x-y\rVert^2=\lVert x\rVert^2-2x^\top y+\lVert y\rVert^2 together with the moment conditions equation (24) makes the ∥x−y∥2\lVert x-y\rVert^2 and the constant $1integratetozeroagainstintegrate to zero against\eta\otimes\eta (exactly as at steps (a)--(b) of Step 1), leaving

B(η,η)=−2∬∥x−y∥ dη(x) dη(y)=2DE2(μ,ρ∗),B(\eta,\eta)=-2\iint\lVert x-y\rVert\,d\eta(x)\,d\eta(y)=2D_E^2(\mu,\rho^*),

where the second equality is the bilinear expansion of η=μ−ρ∗\eta=\mu-\rho^*, matching equation (22).

Substituting both terms into equation (26) yields the identity equation (23); dropping ∫g dμ≥0\int g\,d\mu\ge0 gives the inequality. If supp⁡μ⊆B‾(0,π/4)\operatorname{supp}\mu\subseteq\overline{B}(0,\pi/4) then ∫g dμ=0\int g\,d\mu=0 and equality holds.

Exact targets: finite minimizers converge to ρ∗\rho^*

We first record how the finite stress equation 17 sits inside the continuum functional equation 9. Evaluating SS at the empirical measure counts all n2n^2 ordered pairs, and the nn diagonal pairs each contribute (∥xi−xi∥−1)2=1(\lVert x_i-x_i\rVert-1)^2=1:

S[μX]=1n2∑i,j(∥xi−xj∥−1)2=1n2[nSn(X)+n]=n−1nSn(X)+1n.(27)S[\mu_X]=\frac{1}{n^2}\sum_{i,j}\left(\lVert x_i-x_j\rVert-1\right)^2=\frac{1}{n^2}\left[nS_n(X)+n\right]=\frac{n-1}{n}S_n(X)+\frac{1}{n}. \tag*{(27)}

The additive 1n\frac{1}{n} is the self-pair contribution. With the diagonal targets set to zero it is absent from SnS_n, but the atomic measure μX\mu_X places mass 1/n21/n^2 on each diagonal pair of μX⊗μX\mu_X\otimes\mu_X. Crucially this term is independent of XX, so it neither affects which configuration minimizes nor survives in the leading order of the bounds below. Since the scalar map t↦n−1nt+1nt\mapsto\frac{n-1}{n}t+\frac{1}{n} is strictly increasing, equation (27) gives S[μX]≤S[μX′]S[\mu_X]\le S[\mu_{X'}] if and only if Sn(X)≤Sn(X′)S_n(X)\le S_n(X') for any two configurations X,X′X,X'; hence SnS_n and X↦S[μX]X\mapsto S[\mu_X] share the same minimizers, and in particular the finite minimizer XnX_n of SnS_n also minimizes X↦S[μX]X\mapsto S[\mu_X] over all nn-point configurations.

Proposition 9 (Finite minimizers under exact targets). For an=S[μXn]−S∗≥0a_n=S[\mu_{X_n}]-S^*\ge0 we have

0≤an≤1−S∗n=π212n.(28)0\le a_n\le\frac{1-S^*}{n}=\frac{\pi^2}{12n}. \tag*{(28)}

and hence the empirical measure μXn\mu_{X_n} of the finite minimizer deviates from the continuum minimizer ρ∗\rho^* by

DE(μXn,ρ∗)≤π24n.(29)D_E(\mu_{X_n},\rho^*)\le\frac{\pi}{\sqrt{24n}}. \tag*{(29)}

Moreover, the minimal off-diagonal stress is squeezed against the continuum optimizer,

1−nn−1π212=S∗−1−S∗n−1≤αn≤S∗=1−π212.(30)1-\frac{n}{n-1}\frac{\pi^2}{12}=S^*-\frac{1-S^*}{n-1}\leq\alpha_n\leq S^*=1-\frac{\pi^2}{12}. \tag*{(30)}

Proof. Let Y1,…,Yn∼i.i.d.ρ∗Y_1,\ldots,Y_n\mathrel{\overset{\mathrm{i.i.d.}}{\sim}}\rho^*. Since the summands of Sn(X)S_n(X) equation (19) are identically distributed with

E(∥Yi−Yj∥−1)2=S[ρ∗]=S∗for i≠j,\mathbb{E}\left(\lVert Y_i-Y_j\rVert-1\right)^2=S[\rho^*]=S^*\qquad\text{for }i\ne j,

we have

ESn(Y)=S∗.(31)\mathbb{E}S_n(Y)=S^*. \tag*{(31)}

As a result, there must be some configuration that does not exceed this expectation, so that

αn=min⁡XSn(X)≤ESn(Y)=S∗,(32)\alpha_n=\min_X S_n(X)\leq\mathbb{E}S_n(Y)=S^*, \tag*{(32)}

which is the upper bound in equation (30). Applying the affine relation equation (27) and using that XnX_n minimizes S[μX]S[\mu_X],

S[μXn]=min⁡XS[μX]≤ES[μY]=n−1nESn(Y)+1n=n−1nS∗+1n.S[\mu_{X_n}]=\min_X S[\mu_X]\leq\mathbb{E}S[\mu_Y]=\frac{n-1}{n}\mathbb{E}S_n(Y)+\frac{1}{n}=\frac{n-1}{n}S^*+\frac{1}{n}.

Subtracting S∗S^* gives

an≤1−S∗n=π212n,a_n\leq\frac{1-S^*}{n}=\frac{\pi^2}{12n},

and an≥0a_n\geq0 because ρ∗\rho^* is the global minimizer of SS over all probability measures (Theorem 1), so S[μXn]≥S∗S[\mu_{X_n}]\geq S^*. This is equation (28). Lemma 8 then yields

2DE2(μXn,ρ∗)≤S[μXn]−S∗=an≤π212n,2D_E^2(\mu_{X_n},\rho^*)\leq S[\mu_{X_n}]-S^*=a_n\leq\frac{\pi^2}{12n},

which is equation (29). Finally, an≥0a_n\geq0 combined with equation (27) reads

n−1nαn+1n≥S∗,\frac{n-1}{n}\alpha_n+\frac{1}{n}\geq S^*,

which we can rearrange to the lower bound in equation (30).

Noisy targets: a deterministic perturbation bound

The passage from exact to noisy targets rests on a single deterministic inequality, the reverse triangle inequality in the space of pairwise residuals.

The statement holds for arbitrary target distances, so we phrase it that way. For a symmetric off-diagonal dissimilarity matrix D=(dij)i≠jD=(d_{ij})_{i\ne j} write

SD(X)=1m∑i≠j(∥xi−xj∥−dij)2,∥D−D′∥=(1m∑i≠j(dij−dij′)2)1/2,S_D(X)=\frac{1}{m}\sum_{i\ne j}\left(\lVert x_i-x_j\rVert-d_{ij}\right)^2,\qquad\lVert D-D'\rVert=\left(\frac{1}{m}\sum_{i\ne j}(d_{ij}-d'_{ij})^2\right)^{1/2},

so that Sn=S1S_n=S_1 and Snε=S1+εS_n^\varepsilon=S_{1+\varepsilon} with ∥(1+ε)−1∥=δn\lVert(1+\varepsilon)-1\rVert=\delta_n.

Lemma 10 (Reverse triangle inequality for the stress). Let D,D′D,D' be dissimilarity matrices.

(i) For every configuration XX,

∣SD(X)−SD′(X)∣≤∥D−D′∥.(33)\left|\sqrt{S_D(X)}-\sqrt{S_{D'}(X)}\right|\leq\lVert D-D'\rVert. \tag*{(33)}

(ii) If XDX_D and XD′X_{D'} minimize SDS_D and SD′S_{D'}, then

SD(XD′)−SD(XD)≤4∥D−D′∥SD(XD)+4∥D−D′∥2.(34)S_D(X_{D'})-S_D(X_D)\leq4\lVert D-D'\rVert\sqrt{S_D(X_D)}+4\lVert D-D'\rVert^2. \tag*{(34)}

The square root of a raw stress is the Euclidean norm of its residual vector ([8]), which makes (i) an instance of the reverse triangle inequality. Related perturbation bounds for stress minimization under noise, under stronger assumptions and by a different argument, appear in ([5]).

Proof. Fix XX and collect the residuals into vectors in Rm\mathbb{R}^m,

a=1m(∥xi−xj∥−dij)i≠j,a′=1m(∥xi−xj∥−dij′)i≠j,a=\frac{1}{\sqrt{m}}\left(\lVert x_i-x_j\rVert-d_{ij}\right)_{i\ne j},\qquad a'=\frac{1}{\sqrt{m}}\left(\lVert x_i-x_j\rVert-d'_{ij}\right)_{i\ne j},

so that

∥a∥2=SD(X),∥a′∥2=SD′(X),\lVert a\rVert_2=\sqrt{S_D(X)},\qquad\lVert a'\rVert_2=\sqrt{S_{D'}(X)},

and

∥a−a′∥2=∥D−D′∥.\lVert a-a'\rVert_2=\lVert D-D'\rVert.

The triangle inequality gives ∥a∥2≤∥a′∥2+∥a−a′∥2\lVert a\rVert_2\le\lVert a'\rVert_2+\lVert a-a'\rVert_2 and, interchanging aa and a′a', ∥a′∥2≤∥a∥2+∥a−a′∥2\lVert a'\rVert_2\le\lVert a\rVert_2+\lVert a-a'\rVert_2, hence

∣∥a∥2−∥a′∥2∣≤∥a−a′∥2=∥D−D′∥,\left|\lVert a\rVert_2-\lVert a'\rVert_2\right|\le\lVert a-a'\rVert_2=\lVert D-D'\rVert,

which is equation 31.

For (ii)(ii), apply equation 31 at XD′X_{D'}, then optimality of XD′X_{D'} for SD′S_{D'}, then equation 31 at XDX_D,

SD(XD′)≤SD′(XD′)+∥D−D′∥≤SD′(XD)+∥D−D′∥≤SD(XD)+2∥D−D′∥.\sqrt{S_D(X_{D'})}\le\sqrt{S_{D'}(X_{D'})}+\lVert D-D'\rVert\le\sqrt{S_{D'}(X_D)}+\lVert D-D'\rVert\le\sqrt{S_D(X_D)}+2\lVert D-D'\rVert.

The term 2∥D−D′∥2\lVert D-D'\rVert arises because the perturbation is used twice. Squaring gives equation 32.

Taking D=1D=1 and D′=1+εD'=1+\varepsilon, so that ∥D−D′∥=δn\lVert D-D'\rVert=\delta_n, XD=XnX_D=X_n, XD′=XnεX_{D'}=X_n^\varepsilon, and αn=Sn(Xn)\alpha_n=S_n(X_n) as in equation 19, inequality equation 32 reads

Sn(Xnε)−αn≤4δnαn+4δn2.(35)S_n(X_n^\varepsilon)-\alpha_n\le4\delta_n\sqrt{\alpha_n}+4\delta_n^2. \tag*{(35)}

Corollary 11 (Finite minimizers under noisy targets). The minimizer XnεX_n^\varepsilon of the perturbed stress satisfies

DE2(μXnε,ρ∗)≤π224n+2S∗ δn+2δn2≈0.411n+0.843δn+2δn2.(36)D_E^2(\mu_{X_n^\varepsilon},\rho^*)\le\frac{\pi^2}{24n}+2\sqrt{S^*}\,\delta_n+2\delta_n^2\approx\frac{0.411}{n}+0.843\delta_n+2\delta_n^2. \tag*{(36)}

In particular, perturbed finite minimizers remain close to ρ∗\rho^* whenever both n−1n^{-1} and the RMS perturbation δn\delta_n are small; the worst-case dependence on the noise is DE=O(δn)D_E=O(\sqrt{\delta_n}).

Proof. By Lemma 8, adding and subtracting the exact-target value S[μXn]S[\mu_{X_n}],

2DE2(μXnε,ρ∗)≤S[μXnε]−S∗=(S[μXnε]−S[μXn])+(S[μXn]−S∗).2D_E^2(\mu_{X_n^\varepsilon},\rho^*)\le S[\mu_{X_n^\varepsilon}]-S^*=(S[\mu_{X_n^\varepsilon}]-S[\mu_{X_n}])+(S[\mu_{X_n}]-S^*).

The second bracket is S[μXn]−S∗=an≤π212nS[\mu_{X_n}]-S^*=a_n\le\frac{\pi^2}{12n} by equation 26. In the first bracket, we use the affine relation equation 25,

S[μXnε]−S[μXn]=n−1n(Sn(Xnε)−Sn(Xn))=n−1n(Sn(Xnε)−αn)≤n−1n(4δnαn+4δn2),S[\mu_{X_n^\varepsilon}]-S[\mu_{X_n}]=\frac{n-1}{n}\left(S_n(X_n^\varepsilon)-S_n(X_n)\right)=\frac{n-1}{n}\left(S_n(X_n^\varepsilon)-\alpha_n\right)\le\frac{n-1}{n}\left(4\delta_n\sqrt{\alpha_n}+4\delta_n^2\right),

using equation 33. Bounding n−1n≤1\frac{n-1}{n}\le1, αn≤S∗\sqrt{\alpha_n}\le\sqrt{S^*} from equation 28, and dividing by 2 gives equation 34, with numerical constants from π224≈0.411\frac{\pi^2}{24}\approx0.411 and 2S∗=21−π212≈0.8432\sqrt{S^*}=2\sqrt{1-\frac{\pi^2}{12}}\approx0.843.

Remark 12 (Evaluating DED_E numerically). The quantity most aligned with the theory is DE(μn,ρ∗)D_E(\mu_n,\rho^*), computable from equation 20 as

DE2(μn,ρ∗)=2n∑i=1nEY∼ρ∗∥xi−Y∥−1n2∑i,j∥xi−xj∥−EY,Y′∼ρ∗∥Y−Y′∥.(37)D_E^2(\mu_n,\rho^*)=\frac{2}{n}\sum_{i=1}^{n}\mathbb{E}_{Y\sim\rho^*}\lVert x_i-Y\rVert-\frac{1}{n^2}\sum_{i,j}\lVert x_i-x_j\rVert-\mathbb{E}_{Y,Y'\sim\rho^*}\lVert Y-Y'\rVert. \tag*{(37)}

The self-interaction constant is EY,Y′∼ρ∗∥Y−Y′∥=π212≈0.822\mathbb{E}_{Y,Y'\sim\rho^*}\lVert Y-Y'\rVert=\frac{\pi^2}{12}\approx0.822 (Step 8). For a point inside the support, ∥x∥≤π/4\lVert x\rVert\le\pi/4, the on-support identity equation ⋆\star gives the closed form EY∼ρ∗∥x−Y∥=12(∥x∥2+π28)\mathbb{E}_{Y\sim\rho^*}\lVert x-Y\rVert=\frac{1}{2}\left(\lVert x\rVert^2+\frac{\pi^2}{8}\right).

Remark 13. Note that if the mean εˉ\bar{\varepsilon} of the εij\varepsilon_{ij} over ijij is zero, this δn\delta_n is equal to the standard deviation of the perturbation values. If the mean is not zero, our bound still holds. But a potentially better bound could be obtained by attributing εˉ\bar{\varepsilon} of εij\varepsilon_{ij} to the equidistant part of the target distances and rescaling ρ∗\rho^* and the constants in the bound by 1+εˉ1+\bar{\varepsilon}.

References

  1. [1]Charu C Aggarwal, Alexander Hinneburg, and Daniel A Keim. On the surprising behavior of distance metrics in high dimensional space. In International conference on database theory, pp. 420–434. Springer, 2001.
  2. [2]Dimitris K Agrafiotis. Stochastic proximity embedding. Journal of Computational Chemistry, 24 (10):1215–1221, 2003.
  3. [3]Dimitris K Agrafiotis, Huafeng Xu, Fangqian Zhu, Deepak Bandyopadhyay, and Pu Liu. Stochastic proximity embedding: methods and applications. Molecular Informatics, 29(11):758–770, 2010.DOI
  4. [4]Jesse Anderton and Javed Aslam. Scaling up ordinal embedding: A landmark approach. In International Conference on Machine Learning, pp. 282–290. PMLR, 2019.
  5. [5]Ery Arias-Castro and Siddharth Vishwanath. Stability of sequential lateration and of stress minimization in the presence of noise. arXiv preprint arXiv:2310.10900, 2023.
  6. [6]Jinho Baik, Gérard Ben Arous, and Sandrine Péché. Phase transition of the largest eigenvalue for nonnull complex sample covariance matrices. The Annals of Probability, 33(5):1643 – 1697, 2005.DOI
  7. [7]Etienne Becht, Leland McInnes, John Healy, Charles-Antoine Dutertre, Immanuel WH Kwok, Lai Guan Ng, Florent Ginhoux, and Evan W Newell. Dimensionality reduction for visualizing single-cell data using UMAP. Nature Biotechnology, 37(1):38–44, 2019.DOI
  8. [8]Ingwer Borg and Patrick JF Groenen. Modern multidimensional scaling: Theory and applications. Springer, 2005.
  9. [9]Andreas Buja, BF Logan, JA Reeds, and Larry A Shepp. Inequalities and positive-definite functions arising from a problem in multidimensional scaling. The Annals of Statistics, pp. 406–438, 1994.DOI
  10. [10]Djalil Chafai, Edward B Saff, and Robert S Womersley. Threshold condensation to singular support for a riesz equilibrium problem. arXiv preprint arXiv:2206.04956, 2022.DOI
  11. [11]Cyril de Bodt, Alex Diaz-Papkovich, Michael Bleher, Kerstin Bunte, Corinna Coupette, Sebastian Damrich, Enrique Fita Sanmartin, Fred A Hamprecht, Emőke-Ágnes Horvát, Dhruv Kohli, Smita Krishnaswamy, John A. Lee, Boudewijn P. F. Lelieveldt, Leland McInnes, Ian T. Nabney, Maximilian Noichl, Pavlin G. Poličar, Bastian Rieck, Guy Wolf, Gal Mishne, and Dmitry Kobak. Low-dimensional embeddings of high-dimensional data. arXiv preprint arXiv:2508.15929, 2025.arxiv.org/abs/2508.15929
  12. [12]Jan de Leeuw. Application of convex analysis to multidimensional scaling. In Recent Developments in Statistics, pp. 133–145. North-Holland, 1977.
  13. [13]Jan de Leeuw and Patrick Mair. Multidimensional scaling using majorization: SMACOF in R. Journal of Statistical Software, 31:1–30, 2009.
  14. [14]Chengyuan Deng, Jie Gao, Kevin Lu, Feng Luo, Hongbin Sun, and Cheng Xin. Neuc-MDS: Non-Euclidean multidimensional scaling through bilinear forms. Advances in Neural Information Processing Systems, 37:121539–121569, 2024.arxiv.org/abs/2411.10889
  15. [15]Zhongxi Fang, Xun Su, Tomohisa Tabuchi, Jianming Huang, and Hiroyuki Kasai. StableMDS: A novel gradient descent-based method for stabilizing and accelerating weighted multidimensional scaling. In The 28th International Conference on Artificial Intelligence and Statistics, 2025.
  16. [16]Nikhil Ghosh, Yuxin Chen, and Yisong Yue. Landmark ordinal embedding. Advances in Neural Information Processing Systems, 32, 2019.arxiv.org/abs/1910.12379
  17. [17]John C Gower. Some distance properties of latent root and vector methods used in multivariate analysis. Biometrika, 53(3-4):325–338, 1966.DOI
  18. [18]Peter Hall, James Stephen Marron, and Amon Neeman. Geometric representation of high dimension, low sample size data. Journal of the Royal Statistical Society Series B: Statistical Methodology, 67 (3):427–444, 2005.
  19. [19]Daniel Hangan, Stephen Kobourov, and Jacob Miller. Bridging graph drawing and dimensionality reduction with stochastic stress optimization, 2026. URL https://arxiv.org/abs/2605.00641.
  20. [20]Yasuaki Hiraoka, Yusuke Imoto, Shu Kanazawa, and Enhao Liu. Curse of dimensionality on persistence diagrams. Foundations of Data Science, 8:236–286, 2026.DOI
  21. [21]Haiyang Huang, Yingfan Wang, Cynthia Rudin, and Edward P Browne. Towards a comprehensive evaluation of dimension reduction methods for transcriptomic data visualization. Communications biology, 5(1):719, 2022.DOI
  22. [22]Guillaume Huguet, Alexander Tong, Edward De Brouwer, Yanlei Zhang, Guy Wolf, Ian Adelstein, and Smita Krishnaswamy. A heat diffusion perspective on geodesic preserving dimensionality reduction. Advances in Neural Information Processing Systems, 36:6986–7016, 2023.
  23. [23]Dmitry Kobak and Philipp Berens. The art of using t-SNE for single-cell transcriptomics. Nature Communications, 10(1):5416, 2019.DOI
  24. [24]Alexey Kroshnin, Eugene Stepanov, and Dario Trevisan. Infinite multidimensional scaling for metric measure spaces. ESAIM: Control, Optimisation and Calculus of Variations, 28(58), 2022.arxiv.org/abs/2201.05885
  25. [25]Joseph B Kruskal. Multidimensional scaling by optimizing goodness of fit to a nonmetric hypothesis. Psychometrika, 29(1):1–27, 1964a.DOI
  26. [27]Noël Kury, Dmitry Kobak, and Sebastian Damrich. DREAMS: Preserving both local and global structure in dimensionality reduction. Transactions on Machine Learning Research, 2026.arxiv.org/abs/2508.13747
  27. [28]Pierre Lambert, Cyril de Bodt, Michel Verleysen, and John A Lee. SQuadMDS: a lean stochastic quartet MDS improving global structure preservation in neighbor embedding like t-SNE and UMAP. Neurocomputing, 503:17–27, 2022.arxiv.org/abs/2202.12087
  28. [29]Naum S Landkof. Foundations of modern potential theory, volume 180. Springer, 1972.
  29. [30]John A Lee and Michel Verleysen. Nonlinear dimensionality reduction. Springer, 2007.
  30. [31]Keyi Li, Yuval Kluger, and Boris Landa. Euclidean distance deflation under high-dimensional heteroskedastic noise. arXiv, 2025.
  31. [32]Sunhyuk Lim and Facundo Mémoli. Classical multidimensional scaling on metric measure spaces. Information and Inference: A Journal of the IMA, 13(2):iaae007, 2024.arxiv.org/abs/2201.09385
  32. [33]Patrick Mair, Patrick JF Groenen, and Jan de Leeuw. More on multidimensional scaling and unfolding in R: smacof version 2. Journal of Statistical Software, 102:1–47, 2022.
  33. [34]L Mattner. Extremal problems for probability distributions: a general method and some examples. Lecture Notes-Monograph Series, pp. 274–283, 1992.DOI
  34. [35]Lutz Mattner. Behandlung einiger extremalprobleme für wahrscheinlichkeitsverteilungen. (No Title), 1990.
  35. [36]Leland McInnes, John Healy, and James Melville. UMAP: Uniform manifold approximation and projection for dimension reduction. arXiv preprint arXiv:1802.03426, 2018.arxiv.org/abs/1802.03426
  36. [37]Kevin R Moon, David Van Dijk, Zheng Wang, Scott Gigante, Daniel B Burkhardt, William S Chen, Kristina Yim, Antonia van den Elzen, Matthew J Hirn, Ronald R Coifman, et al. Visualizing structure and transitions in high-dimensional biological data. Nature Biotechnology, 37(12): 1482–1492, 2019.
  37. [38]Fabian Pedregosa, Gaël Varoquaux, Alexandre Gramfort, Vincent Michel, Bertrand Thirion, Olivier Grisel, Mathieu Blondel, Peter Prettenhofer, Ron Weiss, Vincent Dubourg, Jake Vanderplas, Alexandre Passos, David Cournapeau, Matthieu Brucher, Matthieu Perrot, and Édouard Duchesnay. Scikit-learn: Machine learning in Python. Journal of Machine Learning Research, 12:2825–2830, 2011.arxiv.org/abs/1201.0490
  38. [39]Marcel Riesz. Intégrales de Riemann–Liouville et potentiels. In Collected Papers, pp. 482–526. Springer, 1938.
  39. [40]Isaac J Schoenberg. Remarks to Maurice Frechet’s article “Sur la définition axiomatique d’une classe d’espace distances vectoriellement applicable sur l’espace de Hilbert”. Annals of Mathematics, 36(3):724–732, 1935.
  40. [41]Isaac J Schoenberg. Metric spaces and positive definite functions. Transactions of the American Mathematical Society, 44(3):522–536, 1938.
  41. [42]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.DOI
  42. [45]Rishi Sonthalia, Greg Van Buskirk, Benjamin Raichel, and Anna Gilbert. How can classical multidimensional scaling go wrong? Advances in Neural Information Processing Systems, 34: 12304–12315, 2021.arxiv.org/abs/2110.11430
  43. [46]Gábor J Székely and Maria L Rizzo. Energy statistics: A class of statistics based on distances. Journal of Statistical Planning and Inference, 143(8):1249–1272, 2013.DOI
  44. [47]Bosiljka Tasic, Zizhen Yao, Lucas T. Graybuck, Kimberly A. Smith, Thuc Nghı Nguyen, Darren Bertagnolli, Jeff Goldy, Emma Garren, Michael N. Economo, Sarada Viswanathan, Osnat Penn, Trygve Bakken, Vilas Menon, Jeremy Miller, Olivia Fong, Karla E. Hırokawa, Kanan Lathia, Christine Rimorin, Michael Tieu, Rachael Larsen, Tamara Casper, Eliza Barkan, Matthew Kroll, Sheana Parry, Nadiya V. Shapovalova, Daniel Hirschstein, Julie Pendergraft, Heather A. Sullivan, Tae Kyung Kim, Aaron Szafer, Nick Dee, Peter Groblewski, Ian Wickersham, Ali Cetin, Julie A. Harris, Boaz P. Levi, Susan M. Sunkin, Linda Madisen, Tanya L. Daigle, Loren Looger, Amy Bernard, John Phillips, Ed Lein, Michael Hawrylycz, Karel Svoboda, Allan R. Jones, Christof Koch, and Hongkui Zeng. Shared and distinct transcriptomic cell types across neocortical areas. Nature, 563(7729):72–78, 2018.DOI
  45. [48]The 1000 Genomes Project Consortium. A global reference for human genetic variation. Nature, 526 (7571):68–74, 2015.DOI
  46. [49]Warren S Torgerson. Multidimensional scaling: I. Theory and method. Psychometrika, 17(4):401–419, 1952.DOI
  47. [50]Laurens van der Maaten and Geoffrey Hinton. Visualizing data using t-SNE. Journal of Machine Learning Research, 9(Nov):2579–2605, 2008.
  48. [51]Yingfan Wang, Haiyang Huang, Cynthia Rudin, and Yaron Shaposhnik. Understanding how dimension reduction tools work: an empirical approach to deciphering t-SNE, UMAP, TriMAP, and PaCMAP for data visualization. Journal of Machine Learning Research, 22(201):1–73, 2021.arxiv.org/abs/2012.04456
  49. [52]Jonathan X Zheng, Samraat Pawar, and Dan FM Goodman. Graph drawing by stochastic gradient descent. IEEE Transactions on Visualization and Computer Graphics, 25(9):2738–2748, 2018.arxiv.org/abs/1710.04626

Paper details

vlnc:W_y65jkt4f
Version
v1 · latest
Published
Fresh — added to the Hub within the last 30 days
Added
License
CC BY 4.0
Usage

views · 0

downloads · 0

A view counts once per browser per day, a download each time the PDF is requested.

  • Computer Science

Claude 4.7, GPT-5.5 (bare), Claude Sonnet 5.5 (bare), Claude Opus 5.5 (bare)

View statement
Looking for related papers…
Contents