arXiv(opens in a new tab)cs.AIOct 2026Cited by 1 paper on PaperVantage

Manuscript Offprint

arXiv:2611.00290

Quantifying Local and Global Fidelity of Nonlinear Embeddings

Henry Han

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

HENRY HAN, Data Science and AI Innovation Laboratory, Baylor University, USA

Dimension reduction methods are chosen by a common claim: t-SNE and UMAP preserve local structure, and PCA preserves global structure. Checking it on given data takes local and global scores on one scale and a test that compares two maps. Both scores come from one curve. The locality profile is the chance-corrected share of each point's kk nearest neighbors that a map keeps, over all neighborhood sizes. Its value at k=10k=10 is the local fidelity LL, and its mean over 30 to 50 percent of the data is the global fidelity GG. We prove that at the midpoint the profile is the agreement on which half of the data is near each point, a rank correlation of the distances. Because LL and GG are one statistic, two maps can be tested against each other. The LG reversal test applies to any two dimension reduction methods. It decides, with a block-jackknife p-value, whether one map is more local and the other more global, and returns the scale at which to change maps. On 156 maps of twelve datasets with up to 1.38 million points, GG agrees with established global scores at 0.89 and 0.96, and 2,000 points estimate it. The test confirms the usual claim on seven datasets. On both retail datasets and both rolled-up manifolds, it finds the neighbor embeddings more global. In an agent memory of one million passages, the two maps cross at 150,000 passages (p=2.6×10−5p = 2.6 \times 10^{-5}). Applications span pathology, single cells, supply chains and AI agent memory.

Additional Key Words and Phrases: dimension reduction, t-SNE, UMAP, local structure, global structure, neighborhood preservation, embedding quality

1 Introduction

Embeddings are how people and machines look at large high-dimensional data. Analysts draw two-dimensional maps of single-cell atlases, pathology slides, customer records and text collections with t-SNE [42], UMAP [36], PHATE [37], TriMAP [1], PaCMAP [45] and PCA. AI agents keep their memories as embedding vectors and retrieve them by nearest-neighbor search [34]. Large memories are compressed, by truncation [30], by principal components, or by product quantization [23], so that they fit in memory and can be sent between agents. Both kinds of embedding are described in two words. A method preserves local structure if nearby points stay nearby, and global structure if the layout of clusters, branches and regions is kept. PCA is called global and t-SNE local, and UMAP is said to be more global than t-SNE. Raising t-SNE's perplexity or UMAP's number of neighbors is said to move a map toward global structure. A compressed memory is judged by the recall of its nearest neighbors [2], a local score. Agents also consolidate, delete and summarize memories by topic [12], and these tasks depend on global structure.

The problem. Two questions decide which map to use. How much local and how much global structure does a map keep? And on given data, is one map more local and another more global? The answers set the method, the parameter or the compression that an analyst or an agent designer picks. A pathologist who searches the right map for tiles like a tumor tile finds their true neighbors. An agent that groups topics on the right map keeps distant topics apart. Answering them takes two things. The first is a common scale. Local structure is scored by neighbor overlap or trustworthiness [43], and global structure by distance rank correlation, random-triplet accuracy [45] or centroid distances [25]. These scores have different ranges and chance levels. The second is a test that separates a real difference from chance. PCA's global lead over t-SNE is 0.056 both on one million text passages, at perplexity 200, and on a kidney single-cell atlas. A test shows it is real on the first (p=8.6×10−6p = 8.6 \times 10^{-6}) and within chance on the second (p=0.15p = 0.15). The questions are now pressing, because single-cell atlases and agent memories hold millions of points, and maps of that size are judged by numbers.

Author's Contact Information: Henry Han, Data Science and AI Innovation Laboratory, Baylor University, Waco, Texas, USA, Henry_Han@baylor.edu.

Henry Han

Our idea. We read both kinds of fidelity from the two ends of one chance-corrected curve, the locality profile, and we compare two maps point by point. The share of each point's kk nearest neighbors that a map keeps, corrected for chance, is a curve over kk. At k=10k=10 it gives the local fidelity LL. At neighborhoods of 30 to 50 percent of the data it gives the global fidelity GG. We prove that this upper end is the agreement on which half of the data is near each point, which converges to a rank correlation of the distances. LL and GG are one statistic at two scales, so they can be compared directly. Both are means over points, so two maps can be tested against each other. The idea is new in two ways. It gives the upper end of this profile a proven meaning, where earlier work used it to break ties. It also adds a test of whether two maps reverse their order between the two ends.

(a) k=10k=10: point ii keeps 6 of 10

Figure

(b) DLPkDLP_k rises to 1 by chance

(c) νk\nu_k: GG on 0.3–0.5

(d) Near and far halves, k∗k^*

Figure

(e) Halves vs. rank corr., r=0.94r=0.94

(f) (L,G)(L,G) plane, n=70,000n=70,000

Fig. 1. From the locality profile to LL and GG on MNIST (n=70,000n=70,000): t-SNE is more faithful below 20 percent of the data and PCA above it. (a) Point ii keeps 6 of its 10 nearest neighbors in the t-SNE map. (b)–(e) A subsample of m=2,000m=2,000 points. (b) DLPkDLP_k rises to 1, partly by chance (dashed). (c) After the chance correction the profiles cross at s×=0.20s^\times=0.20; the shaded band gives GG. (d) Ranks from point ii in the data and the map; h(i)h(i) is the share in the shaded quadrants. (e) 2h(i)−12h(i)-1 tracks 2πarcsin⁡γ(i)\frac{2}{\pi}\arcsin\gamma(i), where γ(i)\gamma(i) is the normal-scores correlation of the distances from point ii, a rank-based estimate of the Gaussian-copula correlation (Proposition 3.4). (f) Seven maps in the (L,G)(L,G) plane (NPCA: nonnegative PCA).

Figure 1 shows the idea on the 70,000 MNIST digits. The profile starts from the degree of locality preservation, DLPkDLP_k, the average fraction of each point's kk nearest neighbors that remain among its kk nearest in the map [18]. Read as a function of kk and corrected for chance, DLPkDLP_k is the rank-based quality curve RNX(K)R_{NX}(K), with K=kK=k the neighborhood size, of Lee et al. [32], Lee and Verleysen [33]. That curve has been summarized by its area on a logarithmic scale of KK, which weights small neighborhoods most. Lee and Verleysen [33] also averaged its upper part, beyond a split point chosen from the data, and advised using that average to break ties between methods ranked by the lower part. We read the upper end as a global score in its own right. In the t-SNE map, point ii keeps 6 of its 10 nearest neighbors (Figure 1a). Averaged over points and corrected for chance, this overlap becomes the locality profile over all neighborhood sizes (Figure 1b,c). At the upper end, each point's agreement with the data on its near and far halves tracks the rank correlation of its distances. The Pearson correlation is 0.94 over 400 points (Figure 1d,e). On the same profile, PCA overtakes t-SNE at 20 percent of the data; we call this size the crossover scale s×s^{\times}. Raising t-SNE's perplexity from 30 to 200 gains 0.21 of global fidelity for each unit of local fidelity traded, the exchange rate η\eta (Figure 1c,f).

What is new. LL and GG are new definitions. They are local and global fidelity scores defined as one chance-corrected statistic at two fixed scales. The global score is read on a fixed band of relative scale. Each of the closest methods differs from them in one respect. Lee and Verleysen [33] split the uncorrected neighbor curve at a data-dependent size and used the upper part to break ties; our GG is chance-corrected, on a fixed band, and the end of its band has a proven meaning. Lueks et al. [35] weight pairs of neighbor ranks by two user-set thresholds; GG needs no thresholds, and its band ends where the profile is a rank correlation of the distances. The area under RNXR_{NX} [32] weights small neighborhoods and agrees with the established global scores at 0.22 and 0.30 over our 156 maps, against 0.89 and 0.96 for GG. DREAMS [29] plots neighbor recall against distance rank correlation, two scores of different kinds; our (L,G)(L,G) plane adds a common scale, a crossover and an exchange rate. Random-triplet accuracy [45] and centroid-distance correlation [25] score global structure apart from local structure; we use them to validate GG. The LG reversal test is new to this paper. It combines a one-sided test at each end of the profile into one declaration with a stated level, through a block jackknife [13] and the intersection–union principle [5]. It also gives an interval for the crossover. GG is also defined on a scale relative to nn, so 2,000 points estimate it to within 0.01 on every dataset tested, up to 1.38 million points. Table 1 sets these features side by side.

Table 1. Earlier work supplies the curve and the global scores, and this paper adds five features to them. One statistic: the local and global scores are one statistic at two scales. Relative band: the global score uses a fixed range of k/nk/n. Proven meaning: a proof of what the global end of the score measures. Rate: a crossover or an exchange rate. Test: a test of whether one map is local and another global.

WorkLocal scoreGlobal scoreOne statisticRelative bandProven meaningRateTest
Lee and Verleysen [33]Qlocal,mean QNX,K≤KmaxQ_{local}, \text{mean } Q_{NX}, K \le K_{max}Qglobal,mean QNX,K>KmaxQ_{global}, \text{mean } Q_{NX}, K > K_{max}✓
Lee et al. [32]RNX(K)R_{NX}(K) over all KK, area on a log KK axis✓
DREAMS [29]kNN recall, k=10k = 10Spearman ρ\rho of distances
This paperL=v0L = v_{0}G,mean vk,0.3≤k/n≤0.5G, \text{mean } v_k, 0.3 \le k/n \le 0.5✓✓✓✓✓

A test of reversal. The LG reversal test decides with a stated error rate whether one map is local and another global. It is designed for any local and any global dimension reduction method, because it needs only the data and the two maps. It brings statistical robustness to dimension reduction. It tells a user which map to use for which question. It runs two one-sided tests on the scores of single points, one at each end of the profile. A block jackknife accounts for the dependence between neighboring points, and the intersection–union principle combines the two tests into one decision. The test returns whether the reversal holds at a stated level, the scale s×s^{\times} at which the other map becomes the more faithful one, and a 95% interval for that scale. Figure 2 applies the test to the memory of a retrieval agent: one million MS MARCO passages embedded with BGE-base [48]. SR-tSNE2, our rank refinement of t-SNE [19], is more local than PCA by 0.212 and PCA is more global by 0.062, and the test declares the reversal with p=2.6×10−5p = 2.6 \times 10^{-5}. The crossover lies at 150,200 passages, with 95% interval 78,900 to 221,500. The agent should therefore use the SR-tSNE2

Henry Han

map to find the passages nearest a question and to examine any subtopic of fewer than 79,000 passages. It should use the PCA map to see which of its eight topics lie far apart and which topics to merge or delete.

(a) crossover at 150,200 passages (78,900–221,500)

Figure

(c) which map to use

SR-tSNE2 the passages near a query

SR-tSNE2 a subtopic of under 79,000 passages

PCA which of the eight topics lie far apart

PCA merge or delete whole topics

both a group of 79,000 to 222,000 passages

Fig. 2. The LG reversal test tells which map to use to inspect the memory of an AI agent: SR-tSNE2 for the passages near a query and PCA for the layout of topics, with the crossover at 150,200 passages. (a) Profiles; purple line and band, the crossover and its 95% interval; gray band, the range that gives G. (b) The two one-sided tests with 95% intervals. (c) Which map answers each question.

Contributions. We apply the scores and the test to twelve datasets of 50,000 to 1.38 million points. Four come from applications: Pathology-100K, 100,000 pathology tiles; SEA-AD, 1.38 million single nuclei; Instacart, the purchases of 195,827 customers of a grocery supply chain; and MS MARCO, the one million passages above. The other eight are benchmarks of images, speech, text and single cells. Three smaller datasets complete the study, among them the Online Retail purchases. So do three synthetic manifolds, among them the rolled-up Swiss roll and S-curve. The contributions are listed by importance, and each rests on the one before it.

(1) A new test of whether one map is local and another global. The LG reversal test turns the usual claim, that t-SNE is local and PCA global, into a decision with a stated error rate. Its global test holds its level, with a mean rejection rate of 0.046 over 48 tests at level 0.05. It also gives the crossover size, with a 95% interval, at which a user should change maps. On the memory of a retrieval agent it gives that size in passages (Sections 4 and 9, Figure 2).

(2) New definitions of local and global fidelity on one scale, with a proven global end. The test is possible because L and G are one chance-corrected statistic at two scales. We prove that at k=(n−1)/2k = (n-1)/2 the profile is the agreement on which half of the data is near each point. It converges to a rank correlation of the distances for i.i.d. pairs with continuous margins, and to Kendall's τ\tau under a Gaussian copula (Propositions 3.3 and 3.4). The common scale defines two new quantities, the crossover scale and the exchange rate (Section 3).

(3) Validation on 156 maps of up to 1.38 million points. The propositions lead us to expect that G ranks maps as the established global scores do, and the data agree. G has rank correlation 0.89 with the distance rank correlation and 0.96 with random-triplet accuracy, against 0.22 and 0.30 for the logarithmic area. Its value changes little with the band, 2,000 points estimate it to within 0.01, and across runs its standard deviation is a median 34 times that of L (Section 6).

(4) Tests of the usual claims in four applications. With a validated G and the test, the usual claims can be checked. The test declares t-SNE local and PCA global on seven of the twelve datasets, with the crossover at 9 to 20 percent of the data. On Instacart, Online Retail and the rolled-up manifolds the test finds the neighbor embeddings more global. PCA has the highest G on six datasets and PaCMAP on four. The parameters said to add global structure have measured exchange rates and estimated energy costs. On the 60,000 MNIST digits PCA keeps the highest G and t-SNE the highest L across all 24 settings (Sections 7, 8 and 9).

(5) Our own methods on the same scale. The scale also measures design choices. SR-tSNE2 [19], an O(nlog⁡n)O(n \log n) rank refinement of t-SNE, has the highest L on all twelve datasets. It returns neighbors at their exact rank 18% to 76% more often than t-SNE, with G within 0.0005. Nonnegative PCA [20] names its axes by tissue, cell type or product, with G within 0.14 of PCA's (Section 8).

(6) Software. The Python package 1gfid returns L, G, the profile and the reversal test with its crossover interval for any data and one or two maps. It computes them exactly up to 5,000 points and from subsamples beyond.

Broader impact. Pathology, single-cell biology, supply chains and AI agent memory all read structure from embeddings. Each can now state how much local and global structure a map keeps. Each can also support its choice of map with a test. The same profile scores any compressed representation against its uncompressed reference, so a compressed agent memory can be judged at both ends, beyond the recall of its nearest neighbors.

References (29)