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 such that pairwise distances between them approximate some given pairwise distances . 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 should directly approximate given , 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 should approximate 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 . Indeed, simply storing the matrix of pairwise distances in memory can already be prohibitive for large . 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:
we establish a perturbation bound for the limiting solution of metric MDS;
we show that non-metric MDS is more robust and can tolerate higher-dimensional noise;
we develop a stochastic implementation of non-metric MDS in PyTorch;
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 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 , 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 . Hangan et al. [19] adopted this approach for dimensionality reduction and Fang et al. [15] used a similar approach with for their FastMDS. Lambert et al. [28] developed SQuadMDS (stochastic quartet MDS) that optimizes metric MDS using mini-batches of size (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 -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 .
Non-metric MDS is closely related to ordinal embeddings, which learn an embedding from a set of triplet comparisons such as “ is closer to than to ”. 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 vectors , forming an data matrix . Let be an pairwise distance matrix with being some distance (e.g. Euclidean, cosine, etc.) between and . Alternatively, we may be given (e.g. experimentally obtain) some distance matrix directly, without access to any underlying , and without knowing the value of .
The goal of any MDS algorithm is to construct low-dimensional embedding vectors such that their pairwise distances approximate pairwise distances . Typically 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 is a matrix of Euclidean distances. If so, it can be converted into the Gram matrix of centered vectors by double-centering the matrix of squared distances:
where denotes elementwise multiplication, and denotes the matrix of all ones. If is the eigendecomposition of , then gives the principal components of and the classical MDS of .
Note that if is not a matrix of Euclidean distances, then classical MDS is not equivalent to principal component analysis (PCA) of . If contains negative eigenvalues, then 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 and :
It is called (raw) stress. It is often more convenient to work with the raw stress divided by , 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 . 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 , but note that 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 of the input distances:
Here, to avoid a trivial solution with , the transformed values are usually constrained to have mean squared off-diagonal value equal to 1 ([13, 33]). Fixing 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 is fit by isotonic (monotonic) regression of the current values on values. The resulting 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]):
where is the identity in the case of metric MDS. For fixed and , stress-1 depends on the overall scale of . 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 by the optimal factor. The optimal factor can be computed analytically: with and , both flattened, it is , and the resulting stress-1 is .
If is a minimizer of raw stress (Eq. (2) or Eq. (3)), the stress-1 of the optimally rescaled can also be obtained from the stress-1 of itself (note that scikit-learn returns ): it equals , and the optimal factor is (Borg & Groenen, [8]).
Furthermore, at such a minimum, the rescaled stress-1 equals the square root of the raw stress divided by , the squared norm of the target distances (Borg & Groenen, [8]). If is normalized as in Eq. (3), this squared norm is simply the number of pairs, , 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 with . The dashed circle has radius . (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 points (e.g. sampled from a mixture of well-separated Gaussians, as we will do in § 6). To mimic high-dimensional noise, we append additional non-discriminative dimensions with i.i.d. values with mean 0, variance , and finite 4th moment, so that the resulting dataset has dimensionality . As increases, all pairwise distances will concentrate around as all vectors become close to orthogonal and each of them has squared norm close to [18, 20].
Dividing all distances by , we see that the distance matrix approaches with all off-diagonal elements equal to 1. The continuous limit of metric MDS, corresponding to , on this fully uninformative input was analyzed by Mattner [34] and Buja et al. [9].
Let denote the set of probability measures on . For and the average stress functional is
Theorem 1 (Limiting metric MDS embedding, Mattner [34]; Buja et al. [9]). The unique minimizer of over with is the Riesz equilibrium measure with density
with support on .
It achieves an average stress value of .
We include a detailed proof of this theorem in Appendix § 13. The main observation is that the Laplacian of the functional derivative of yields the Riesz potential. This is solved by the Riesz 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 [46], defined for two (possibly discrete) distributions as
we establish the following perturbation bound for this setting:
Proposition 2. Let be an , zero-diagonal, symmetric dissimilarity matrix, so that its root-mean-squared deviation from the fully uninformative is . Then for any global minimizer of metric MDS for dissimilarities , we have
Appendix D contains the proof, which relies on bounding the energy distance by the stress functional, taking finite samples from , and using a reverse triangle inequality.
The marginal distribution of the norm for is a rescaled Kumaraswamy (, ) distribution on with density (Corollary 6). Our simulation with (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 , where 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 points from 3 equisized classes, equidistant from each other with distance in . We then added noise dimensions with i.i.d. values with . 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 NN 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 before NN accuracy collapsed (Figure 2a).
We then asked what value of leads to the accuracy collapse. The pairwise distances between noise vectors concentrate around . Metric MDS considers absolute distances and gets strongly distorted when these distances become comparable to . This happens when .
For large , the pairwise distances between noisy observations can be approximated by . 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 -distribution and its standard deviation asymptotically equals . Equating the second term above to yields
To verify this experimentally, we ran our simulation for various values of and found the minimal value with the average NN accuracy below 0.7 (‘collapse’). In log-log coordinates, 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).

Figure 2. (a) Leave-one-out NN classification accuracy () in MDS embeddings of noisy three-class dataset. There are points from 3 equisized classes, equidistant from each other with distance in . We add noise dimensions with i.i.d. values. Metric and non-metric MDS are run with random initializations. Average over 10 runs. (b) Minimum that yields the average NN accuracy below 0.7 for .
For reference, classical MDS (equivalently, PCA) was similarly robust (Figure 2); random matrix theory suggests that the scaling for classical MDS is also (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 mini-batches of size . If the input data are given as X matrix, then for each mini-batch, we compute values of (in order to avoid storing the entire matrix D in memory, as this can be prohibitive for large ). Then we use the average stress (Eq. (2)) as the loss, with the sum only running over the terms in the mini-batch.
The 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 of the first component. For optimization we use SGD with learning rate (as in SMACOF) and cosine learning-rate decay over . 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 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 values. Fitting isotonic regression more often led to only very minor improvements in the final loss (Table S1).
| Blobs | MNIST | |||
| Time | Stress-1 | Time | Stress-1 | |
| Once every 100 epochs | s | — | — | |
| Once every 10 epochs | s | s | ||
| Once every epoch (default) | s | s | ||
| Once every 10 batches | s | s | ||
| Every batch | s | s |
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 which we found to work better than 1 on some of the datasets. For small datasets with , we use batch size for non-metric MDS, and in other cases we use . The default number of epochs is set to if and to otherwise. We found these parameters to work well across all considered datasets. We increased the number of epochs to 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 , and in the non-metric case, the isotonic regression also becomes slower with larger . We found 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 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 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 .
Figure 3. Classical, metric, and non-metric MDS embeddings of the noisy blobs dataset ( 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 , where 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-1 | Runtime | |||||||||
| Blobs | Gen. | Digits | Tasic | MNIST | Blobs | Gen. | Digits | Tasic | MNIST | |
| 5 000 | 3 450 | 1 797 | 23 822 | 70 000 | ||||||
| Metric | 0.40 | 0.41 | 0.33 | – | – | 359 s | 358 s | 15 s | – | – |
| with SGD | 0.40 | 0.41 | 0.33 | 0.25 | 0.36 | 21 s | 19 s | 5 s | 1 m | 2 m |
| Non-metric | 0.24 | 0.13 | 0.28 | – | – | 1086 s | 473 s | 152 s | – | – |
| with SGD | 0.24 | 0.13 | 0.28 | 0.06 | 0.30 | 18 s | 23 s | 8 s | 23 m | 3 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 (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 (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).
| Blobs | Gen. | Digits | Tasic | MNIST | |
| Classical | 0.76 | 0.83 | 0.59 | 0.92 | 0.52 |
| Metric | 0.67 | 0.70 | 0.73 | 0.90 | 0.62 |
| Non-metric | 0.85 | 0.91 | 0.74 | 0.87 | 0.76 |
| -SNE | 0.68 | 0.66 | 0.56 | 0.46 | 0.36 |
| UMAP | 0.69 | 0.71 | 0.43 | 0.50 | 0.34 |
| PaCMAP | 0.68 | 0.64 | 0.54 | 0.56 | 0.34 |
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).
| Blobs | Gen. | Digits | Tasic | MNIST | |
| Classical | 0.78 | 0.84 | 0.58 | 0.91 | 0.49 |
| Metric | 0.68 | 0.71 | 0.73 | 0.91 | 0.62 |
| Non-metric | 0.85 | 0.96 | 0.76 | 0.95 | 0.78 |
| -SNE | 0.61 | 0.62 | 0.51 | 0.55 | 0.33 |
| UMAP | 0.70 | 0.62 | 0.37 | 0.58 | 0.30 |
| PaCMAP | 0.69 | 0.62 | 0.49 | 0.67 | 0.30 |
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 (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 ( 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 .
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 ( 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 matrix in memory, which becomes prohibitive for . 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 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 ( 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 ( 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).
| Blobs | Gen. | Digits | Tasic | MNIST | |
| Classical | 0.90 ±.00 | 0.92 ±.00 | 0.80 ±.00 | 0.99 ±.00 | 0.72 ±.00 |
| Metric | 0.83 ±.00 | 0.86 ±.00 | 0.84 ±.00 | 0.94 ±.00 | 0.77 ±.00 |
| Non-metric | 0.92 ±.00 | 0.96 ±.00 | 0.85 ±.00 | 0.99 ±.00 | 0.82 ±.00 |
| t-SNE | 0.81 ±.04 | 0.79 ±.01 | 0.75 ±.00 | 0.79 ±.00 | 0.65 ±.01 |
| UMAP | 0.85 ±.02 | 0.82 ±.03 | 0.67 ±.01 | 0.82 ±.03 | 0.64 ±.00 |
| PaCMAP | 0.86 ±.00 | 0.80 ±.01 | 0.74 ±.00 | 0.86 ±.01 | 0.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: NN recall, that is the fraction of original nearest neighbors that are among the nearest neighbors in the embedding (evaluated on a subset of 5000 query points for datasets with ). 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).
| Blobs | Gen. | Digits | Tasic | MNIST | |
| Classical | 0.01 | 0.04 | 0.12 | ||
| Metric | 0.01 | 0.04 | 0.15 | ||
| Non-metric | 0.01 | 0.04 | 0.13 | ||
| t-SNE | |||||
| UMAP | |||||
| PaCMAP |
Table S4.
Table S5: NN accuracy () 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).
| Blobs | Gen. | Digits | Tasic | MNIST | |
| Classical | 1.00 | ||||
| Metric | 1.00 | ||||
| Non-metric | 1.00 | ||||
| t-SNE | |||||
| UMAP | |||||
| PaCMAP |
Table S5.
Table S6: Runtimes of all methods. Deterministic runs are shown without stds. openTSNE and UMAP are run single-threaded.
| Blobs | Gen. | Digits | Tasic | MNIST | |
| Classical | 2 s | 23 s | 0 s | 0 m | 0 m |
| Metric (SMACOF) | 359 s | 358 s | 15 s | – | – |
| Metric (SGD) | s | s | s | m | m |
| Non-metric (SMACOF) | 1086 s | 473 s | 152 s | – | – |
| Non-metric (SGD) | s | s | s | m | m |
| t-SNE | s | s | s | m | m |
| UMAP | s | s | s | m | m |
| PaCMAP | s | s | s | m | 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 -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 -SNE and metric MDS losses in its composite loss term. Similarly, DREAMS ([27]) regularized -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 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 equidistant points, obtained using the scikit-learn implementation. (a) For and 3 exact equidistance can be achieved. Starting with pairwise equidistance needs to be approximated. Empirically, for a regular polygon is optimal. At 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 . 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, and ;
made the total number of points random by sampling ;
made the sizes of the three clusters random, by sampling their sizes from ;
varied the pairwise distances between clusters in 10 geometric steps between and ;
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 ;
used different standard deviations per noise dimension of and ;
varied the type of noise in the additional noise dimension between Gaussian, uniform, and exponential (all with standard deviation );
increased the range of noise dimensions to .
All configurations are summarized in Table S7. We ran each 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 , where 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 and for non-metric MDS within in close alignment with our theoretical predictions of 2 and 4, respectively.
| Noise | Jitter | Size | Sampling | mMDS | nMDS | cMDS | |
| Gaussian | 1.0 | No | Fixed | 2.24 | 4.11 | 4.75 | |
| Gaussian | 1.0 | Yes | Random | 2.22 | 4.05 | 4.04 | |
| Uniform | 1.0 | Yes | Random | 2.22 | 3.98 | 4.07 | |
| Exponential | 1.0 | Yes | Random | 2.33 | 4.04 | 4.04 | |
| Gaussian | 2.0 | Yes | Random | 2.33 | 3.94 | 4.23 | |
| Gaussian | 1.0 | Yes | Random | 2.02 | 3.92 | 3.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 points placed on a regular -gon of circumradius , the stress-minimizing radius is
The corresponding optimal average stress is
Proof. Place the vertices at for . The chord length between vertices and is . For each there are exactly pairs , so the average per-pair stress is
Expanding and applying the identities and , we get
This convex quadratic in is minimized at . The corresponding minimal value of is
As , , so and .
Recall that denotes the set of probability measures on . For and , the average stress functional (corresponding to the raw stress divided by , not to the stress-1) was defined in (5) as
Lemma 4 (Optimal circle). For the uniform measure on a circle of radius , the stress-minimizing radius is , with optimal stress
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 , the angle between them is distributed according to and . Using that and , we get
Hence , which is minimized at with optimal stress . 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 over is the Riesz equilibrium measure with density
It achieves optimal stress
Proof. We proceed in eight steps.
Since depends only on pairwise distances , translating does not affect , so we can assume without loss of generality. We show in Step 1 that is strictly convex on the set of zero-centered probability distributions . As a result, any such satisfying the Karush–Kuhn–Tucker (KKT) conditions is the unique global minimizer; Steps 2–7 then confirm is that point. Note that we need KKT conditions because our optimization problem has both equality and inequality constraints: we optimize (9) over that has to be non-negative and integrate to one.
Step 1: Strict Convexity of S. To show that is convex, we consider two zero-centered probability measures . Denoting , we have
Strict convexity means that the functional increases faster than a local linear approximation. The second term is linear in (and the functional is the local linear approximation at ), so to demonstrate strict convexity we need to show that . We have
where we dropped terms not depending on both and at (a) because and used at (b). Inequality (c) follows because with and is a strictly conditionally negative definite kernel [41].
Thus, is strictly convex on the set of zero-centered probability distributions.
Step 2: Expand . Expanding the square in equation (9), we get
Note that this identity only holds if all terms on the right are finite. We will now show that this is true for any for which , and we are only interested in this case as we are looking for the minimum of . The pointwise bound , valid since , gives . We denote as . Conditioning on yields
where we used and . Taking the outer expectation, we get . The left part is finite, hence .
Thus,
Step 3: KKT conditions. We can now compute the functional derivative of with respect to . For
the functional is linear in (the integrand does not depend on ), so its functional derivative is simply the integrand:
For the interaction term
the functional is quadratic in with symmetric kernel . Thus by the product rule we get
Together we obtain the functional derivative
This agrees with the expression in Step 1 up to the additive constant , which is irrelevant since .
At the minimum, the local linear approximation to 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
for all such that for . In words, at the optimum, moving an infinitesimal bit of mass from any occupied point to any other occupied point must leave unchanged to first order. This is of course satisfied when , but not only then. As we are optimizing over the space of probability distributions, the constraint of them integrating to 1 implies that , so the condition is also satisfied when for any constant . This is effectively the Lagrange multiplier arising from the equality constraint.
Off the support, we cannot decrease further due to the inequality constraint . So can only place mass there, not take it away. To ensure that placing mass off the support with some perturbation that has for some does not decrease the functional, 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:
Rearranging the on-support condition gives
Step 4: Laplacian trick. Apply to both sides of equation ⋆. For the right-hand side, in . For the left-hand side, we use
To see this, note that we can assume by translation. Then for we have by the radial Laplacian formula in . Since is locally integrable in , distributionally with no delta correction at . Commuting with the integral (justified for with by regularizing , differentiating under the integral for fixed , then passing by dominated convergence) yields
Step 5: Riesz equilibrium measure. Equation equation ⋆⋆ is the condition that the Riesz potential
is constant (and equal to 2) on . This is satisfied by the Riesz equilibrium ((Riesz, 1938; Landkof, 1972, § II.3.13, pp. 163–164, and Appendix, pp. 399–400; Chafai et al., 2022, Lem. 1.2)
Step 6: Verifying the on-support KKT condition. The minimizer is radially symmetric on the disc , hence the functional derivative is also radially symmetric. The functional derivative is also harmonic because
Any radially symmetric harmonic function must be of the form . If we show that is finite at , it will follow that it must be constant. We denote and compute
where at (a) we substituted . Note that this implies .
Step 7: Verifying the off-support KKT condition.
Part A: on . By Step 5, we have for all , and by continuity on the boundary.
Part B: for . For (so for all ), differentiating under the integral and using yields
So is subharmonic on the unbounded domain , with on and as . By the maximum principle, on the entire exterior.
Part C: Boundary data at . Define
so that the off-support KKT condition is for . Since on the open disk, the on-support equality equation holds for all , i.e. on . The function is radial (since is) and globally : for
the integrand is dominated by the function (since ), so dominated convergence yields continuity of on . Writing for the radial profile, the interior identity on together with matching across gives
Part D: Radial ODE outside the disk. For , differentiating under the integral and using the 2D identity (Step 4) gives
where the inequality is Part B. For radial , , so
Part E: Two integrations. By equation 16, the function is non-decreasing on . For any , the fundamental theorem of calculus and the boundary data equation 15 give
hence for . A second integration from to yields
which is the off-support KKT condition.
Step 8: Optimal stress. We compute the terms and in equation 12. First,
where at (i) we substituted . Integrating equation against gives
Substituting everything into equation 12 and using from Step 6:
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 ). If , the radius has as rescaled Kumaraswamy density
Proof. The density is obtained by integrating over the circle of radius . This is the Kumaraswamy density
for , rescaled from to .
From the Continuum Minimizer to Finite Configurations
Theorem 1 identifies the continuum minimizer . We now quantify how close the empirical distribution of a finite stress-minimizing configuration is to , 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, , see Lemma 8.
Notation and standing assumptions. Throughout, with , we write for the number of ordered off-diagonal pairs. The finite MDS stress of the Problem Formulation is
a sum over ordered pairs only: there are no self-distances, equivalently the diagonal target distances are set to zero. Given a symmetric perturbation of the unit targets, , the perturbed stress and the root-mean-square perturbation are
Since depends only on the pairwise differences , it is invariant under a common translation of all points, so we restrict to centered configurations, i.e. the linear subspace . On both and are continuous and coercive, meaning the value tends to as on . 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
To a configuration we associate the centered empirical measure with ; centering changes neither pairwise distances nor the stress.
The energy distance and the stability identity
Definition 7 (Energy distance). For probability measures on with finite first moment, the squared energy distance is
Because the Euclidean-distance kernel is strictly conditionally negative definite [41], one has with equality if and only if . Thus, is a genuine metric on distributions [46, 42]. The first finite moment is no real restriction here. Both and 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 “” to an exact identity with as the leading term.
Lemma 8 (Quadratic stability). Let
be the KKT slack from the proof of Theorem 1 (Step 7), so that on and on . Then for every centered probability measure with finite second moment (equivalently , cf. Step 2),
with equality whenever is supported in the closed disk .
Proof. Write . Both and are centered probability measures, so
Since in equation (9) is a quadratic form, write
for the symmetric bilinear form with kernel , so that . Expanding and using the symmetry ,
To evaluate the linear coefficient , integrate the kernel against first. Using and (with from Step 8),
where the underbraced term is half the first variation from Step 3 evaluated at , equal to by the definition of . Therefore
and since the configuration-independent constant drops out, so equation 23 becomes
Linear term. Since , the constant in equation (26) integrates to zero, leaving . Because on we have , hence ; and because everywhere (Step 7) and is a nonnegative measure.
Quadratic term. Expand . The identity together with the moment conditions equation (24) makes the and the constant $1\eta\otimes\eta (exactly as at steps (a)--(b) of Step 1), leaving
where the second equality is the bilinear expansion of , matching equation (22).
Substituting both terms into equation (26) yields the identity equation (23); dropping gives the inequality. If then and equality holds.
Exact targets: finite minimizers converge to
We first record how the finite stress equation 17 sits inside the continuum functional equation 9. Evaluating at the empirical measure counts all ordered pairs, and the diagonal pairs each contribute :
The additive is the self-pair contribution. With the diagonal targets set to zero it is absent from , but the atomic measure places mass on each diagonal pair of . Crucially this term is independent of , so it neither affects which configuration minimizes nor survives in the leading order of the bounds below. Since the scalar map is strictly increasing, equation (27) gives if and only if for any two configurations ; hence and share the same minimizers, and in particular the finite minimizer of also minimizes over all -point configurations.
Proposition 9 (Finite minimizers under exact targets). For we have
and hence the empirical measure of the finite minimizer deviates from the continuum minimizer by
Moreover, the minimal off-diagonal stress is squeezed against the continuum optimizer,
Proof. Let . Since the summands of equation (19) are identically distributed with
we have
As a result, there must be some configuration that does not exceed this expectation, so that
which is the upper bound in equation (30). Applying the affine relation equation (27) and using that minimizes ,
Subtracting gives
and because is the global minimizer of over all probability measures (Theorem 1), so . This is equation (28). Lemma 8 then yields
which is equation (29). Finally, combined with equation (27) reads
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 write
so that and with .
Lemma 10 (Reverse triangle inequality for the stress). Let be dissimilarity matrices.
(i) For every configuration ,
(ii) If and minimize and , then
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 and collect the residuals into vectors in ,
so that
and
The triangle inequality gives and, interchanging and , , hence
which is equation 31.
For , apply equation 31 at , then optimality of for , then equation 31 at ,
The term arises because the perturbation is used twice. Squaring gives equation 32.
Taking and , so that , , , and as in equation 19, inequality equation 32 reads
Corollary 11 (Finite minimizers under noisy targets). The minimizer of the perturbed stress satisfies
In particular, perturbed finite minimizers remain close to whenever both and the RMS perturbation are small; the worst-case dependence on the noise is .
Proof. By Lemma 8, adding and subtracting the exact-target value ,
The second bracket is by equation 26. In the first bracket, we use the affine relation equation 25,
using equation 33. Bounding , from equation 28, and dividing by 2 gives equation 34, with numerical constants from and .
Remark 12 (Evaluating numerically). The quantity most aligned with the theory is , computable from equation 20 as
The self-interaction constant is (Step 8). For a point inside the support, , the on-support identity equation gives the closed form .
Remark 13. Note that if the mean of the over is zero, this 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 of to the equidistant part of the target distances and rescaling and the constants in the bound by .
References
- [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]Dimitris K Agrafiotis. Stochastic proximity embedding. Journal of Computational Chemistry, 24 (10):1215–1221, 2003.
- [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]Jesse Anderton and Javed Aslam. Scaling up ordinal embedding: A landmark approach. In International Conference on Machine Learning, pp. 282–290. PMLR, 2019.
- [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]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]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]Ingwer Borg and Patrick JF Groenen. Modern multidimensional scaling: Theory and applications. Springer, 2005.
- [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]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]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]Jan de Leeuw. Application of convex analysis to multidimensional scaling. In Recent Developments in Statistics, pp. 133–145. North-Holland, 1977.
- [13]Jan de Leeuw and Patrick Mair. Multidimensional scaling using majorization: SMACOF in R. Journal of Statistical Software, 31:1–30, 2009.
- [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]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]Nikhil Ghosh, Yuxin Chen, and Yisong Yue. Landmark ordinal embedding. Advances in Neural Information Processing Systems, 32, 2019.arxiv.org/abs/1910.12379
- [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]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]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]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]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]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]Dmitry Kobak and Philipp Berens. The art of using t-SNE for single-cell transcriptomics. Nature Communications, 10(1):5416, 2019.DOI
- [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]Joseph B Kruskal. Multidimensional scaling by optimizing goodness of fit to a nonmetric hypothesis. Psychometrika, 29(1):1–27, 1964a.DOI
- [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
- [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
- [29]Naum S Landkof. Foundations of modern potential theory, volume 180. Springer, 1972.
- [30]John A Lee and Michel Verleysen. Nonlinear dimensionality reduction. Springer, 2007.
- [31]Keyi Li, Yuval Kluger, and Boris Landa. Euclidean distance deflation under high-dimensional heteroskedastic noise. arXiv, 2025.
- [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
- [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.
- [34]L Mattner. Extremal problems for probability distributions: a general method and some examples. Lecture Notes-Monograph Series, pp. 274–283, 1992.DOI
- [35]Lutz Mattner. Behandlung einiger extremalprobleme für wahrscheinlichkeitsverteilungen. (No Title), 1990.
- [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
- [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.
- [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
- [39]Marcel Riesz. Intégrales de Riemann–Liouville et potentiels. In Collected Papers, pp. 482–526. Springer, 1938.
- [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.
- [41]Isaac J Schoenberg. Metric spaces and positive definite functions. Transactions of the American Mathematical Society, 44(3):522–536, 1938.
- [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
- [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
- [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
- [48]The 1000 Genomes Project Consortium. A global reference for human genetic variation. Nature, 526 (7571):68–74, 2015.DOI
- [49]Warren S Torgerson. Multidimensional scaling: I. Theory and method. Psychometrika, 17(4):401–419, 1952.DOI
- [50]Laurens van der Maaten and Geoffrey Hinton. Visualizing data using t-SNE. Journal of Machine Learning Research, 9(Nov):2579–2605, 2008.
- [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
- [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









