# UMAP: Uniform Manifold Approximation and Projection for Dimension Reduction

UMAP reduces dimensions faster than t-SNE while keeping more global structure

Leland McInnes, John Healy, James Melville · arXiv · 2018-2-9

- **Problem** t-SNE sets the reference for visualisation quality, but its run time limits how large a dataset can be embedded. Many neighbourhood methods also choose objectives by experiment, so their design is hard to justify.
- **Method** UMAP builds a fuzzy neighbour graph from local distances, rescaling each point's distances by its own neighbourhood. It then fits a force-directed layout to match that graph, starting from a spectral layout.
- **Results** On COIL-20 at k = 160, UMAP scored 0.803 compared to 0.609 for t-SNE. Its run time is also far lower on large datasets.

## Why scaling and theory both matter

Dimension reduction serves both visualisation and pre-processing for machine learning, and the datasets it must handle keep growing. t-SNE sets the reference for visualisation quality, but its run time limits the data set sizes that are feasible to embed. Many neighbourhood methods pick their objective functions by experiment, so their design choices are hard to justify on principle.

The authors therefore aim for a method in which each design choice follows from a stated mathematical framework. Their answer, UMAP, combines Riemannian geometry with a category-theoretic treatment of fuzzy simplicial sets.

## Local distances and a fuzzy neighbour graph

The key idea is to give each point its own ruler, so that distances are rescaled by that point's neighbourhood and the data look roughly uniform under the rescaled metric. Under Lemma 1, geodesic distance inside a ball of fixed volume equals the ambient distance divided by the ball radius, which is why rescaling by the k-th neighbour distance is justified.

Each point's local views can disagree with those of its neighbours, so the authors convert each local metric space into a fuzzy simplicial set and merge them there.

For each point \\(x\_i\\), the k nearest neighbours are found, and the authors' implementation prefers nearest neighbor descent for this search. The distance \\(\\rho\_i\\) is the smallest positive distance from \\(x\_i\\) to its neighbours, which guarantees that \\(x\_i\\) has at least one edge of weight 1. \\\[ \\rho\_i = \\min\\{d(x\_i,x\_{ij}) \\mid 1 \\le j \\le k,\\ d(x\_i,x\_{ij}) \> 0\\} \\\]

Each directed edge gets the weight \\\[ w((x\_i,x\_{ij})) = \\exp\\left(-\\frac{\\max(0,\\, d(x\_i,x\_{ij}) - \\rho\_i)}{\\sigma\_i}\\right) \\\] which can be read as the probability that the edge exists. Since the directed graph is asymmetric, the authors combine \\(A\\) with its transpose through \\\[ B = A + A^\\top - A \\circ A^\\top \\\] so that an undirected edge exists when at least one direction does.

## Fitting the layout with attraction and repulsion

The second phase is a force directed layout, in which attractive forces act along edges and repulsive forces act between points. The problem is non-convex, so the forces are reduced slowly over time, much as in simulated annealing, to reach a local minimum. Because the symmetric Laplacian of the graph approximates the Laplace-Beltrami operator of the manifold, a spectral layout is used to start the embedding, which the authors report gives faster convergence and more stability.

The attractive force between two points depends on the edge weight \\(w((x\_i,x\_j))\\) and on the hyper-parameters a and b, and it pulls the two layout points together. Repulsion is estimated by sampling other vertices, because computing it for every pair would be too costly. The forces are gradients of an edge-wise cross entropy between the high-dimensional graph and a graph built from the layout points, and epsilon is 0.001 in the current implementation to avoid division by zero.

## kNN accuracy on small datasets

The authors trained a k-nearest neighbour classifier on each embedding and tracked its accuracy as k grew, using stratified 10-fold cross-validation on PenDigits and COIL-20. At small k the methods are close, and UMAP performs at least as well as t-SNE and LargeVis for k in the range 10 to 40 on these datasets. At k = 160 on COIL-20, UMAP scored 0.803 (± 0.138), compared to 0.609 (± 0.067) for t-SNE.

The gap appears only at larger neighbourhoods, which is where the authors claim UMAP keeps more non-local structure. So the evidence supports better behaviour at larger k on COIL-20 and only shows higher accuracy on PenDigits, not a large margin.

## Larger datasets and run time

On Statlog (Shuttle) at k = 3200, UMAP scored 0.957 (± 0.005), compared to 0.828 (± 0.004) for t-SNE. On Fashion-MNIST, UMAP notably underperforms for k from 100 to 400, and the authors report comparable performance only at k of 1600 and 3200.

Run time was compared on GoogleNews subsamples with FIt-SNE, MulticoreTSNE and LargeVis, with UMAP written in Python using numba. The full set of 3 million word vectors embedded in about 200 minutes, while MulticoreTSNE needed several days even with multiple cores. The text says MulticoreTSNE and LargeVis ran single-threaded, but the Figure 11 caption describes a Multicore t-SNE line using 8 cores, so the core count for that line is unclear.

To test very high dimensions, the authors embedded 30,000,000 integers with about 1.8 million ambient dimensions, which took roughly 2 weeks on a large memory SMP. This is shown as a visual demonstration of structure, and no accuracy score is reported for it.

## Where the method is weaker

UMAP's embedding dimensions have no specific meaning, unlike PCA, and it has no equivalent of factor loadings. Where interpretability is critical, the authors recommend linear techniques such as PCA, NMF or pLSA.

UMAP can find manifold structure in noise, and low values of n can turn random sampling noise into spurious fine-scale structure. This is less of a risk as more data is sampled, but small noisy samples need care.

UMAP is built around the axiom that local distance matters more than long-range distance, so it puts its effort into local structure. When global distances matter, MDS or PHATE may suit better, and the authors note that much of UMAP's global structure comes from its Laplacian eigenmaps initialization. A study they cite reports that t-SNE with similar initialization can perform equivalently on one global measure.

Approximate nearest neighbour search and negative sampling can produce suboptimal embeddings when the dataset has fewer than 500 samples.

## What the authors leave open

The authors say a systematic study of global-structure metrics is still needed, because current metrics are limited and often tied to particular tasks. They also propose extending the fuzzy simplicial set view to semi-supervised reduction and to mixed data types, by combining views with different metrics.

Adding new points to an existing embedding, and mapping embedded points back to the input space, are proposed as future work.

## Paper info

- **Authors**: Leland McInnes, John Healy, James Melville
- **Venue**: arXiv · Preprint
- **First published**: 2018-2-9
- **Added**: 2026-11-11
- **Updated**: 2020-9-18
- **Version**: v3
- **arXiv**: 1802.03426
- **Category**: stat.ML · cs.CG · cs.LG
- **Original paper terms**: [arXiv non-exclusive 1.0](https://arxiv.org/licenses/nonexclusive-distrib/1.0/)
- **What we show**: Paper info and commentary

[Original paper ↗](https://arxiv.org/abs/1802.03426v3) · [PDF ↗](https://arxiv.org/pdf/1802.03426v3)

AI commentary is a separate explanation from the original paper and may contain errors. The original paper and figures follow each source's terms of use and any rights noted separately.

## Quote from the paper

Leland McInnes, John Healy, James Melville (2018). UMAP: Uniform Manifold Approximation and Projection for Dimension Reduction. arXiv:1802.03426v3. https://arxiv.org/abs/1802.03426v3

**BibTeX**

```
@misc{mcinnes2018umap,
  title = {{UMAP: Uniform Manifold Approximation and Projection for Dimension Reduction}},
  author = {Leland McInnes and John Healy and James Melville},
  year = {2018},
  eprint = {1802.03426},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1802.03426v3}
}
```

## Related papers

- [Graph Embedding Techniques, Applications, and Performance: A Survey](https://refivu.com/en/papers/eeed1384-bf87-452c-b3b1-9ecc6ce7d43b-graph-embedding-techniques-applications-and-performance-a.md)
- [Representation Learning on Graphs: Methods and Applications](https://refivu.com/en/papers/3ca2c648-5d7e-46c2-be1e-357cc66ab085-representation-learning-on-graphs-methods-and-applications.md)
- [BERTopic: Neural topic modeling with a class-based TF-IDF procedure](https://refivu.com/en/papers/3eb59114-35a2-4294-982a-129e3bf9019b-bertopic-neural-topic-modeling-with-a-class-based.md)
- [On Hyperparameter Optimization of Machine Learning Algorithms: Theory and Practice](https://refivu.com/en/papers/e35d8e99-a32c-4e33-acef-50ee792021f2-on-hyperparameter-optimization-of-machine-learning.md)
- [LINE: Large-scale Information Network Embedding](https://refivu.com/en/papers/395ad92f-93c2-44fe-8480-bbf8df48c4cf-line-large-scale-information-network-embedding.md)
- [Optimal Transport Meets t-SNE: Integrated Visualization without Batch Effects in OT-tSNE](https://refivu.com/en/papers/d3dac575-8b8b-4708-aa8c-3d0db81121bd-optimal-transport-meets-t-sne-integrated-visualization.md)

## Other paper commentary

- [A Unified Approach to Interpreting Model Predictions](https://refivu.com/en/papers/f0be20fa-d9a3-4802-80ea-831a1c564ae5-a-unified-approach-to-interpreting-model-predictions.md)
- [XGBoost: A Scalable Tree Boosting System](https://refivu.com/en/papers/e3112070-6898-4fad-83b9-27d6d96c62be-xgboost-a-scalable-tree-boosting-system.md)
- [Deep Learning-Enabled Semantic Communication Systems with Task-Unaware Transmitter and Dynamic Data](https://refivu.com/en/papers/ebc873df-6d28-4b2d-ac6c-575f5c818afc-deep-learning-enabled-semantic-communication-systems-with.md)
- [Deep Partial Multi-View Learning](https://refivu.com/en/papers/b5d21a74-e2a9-402e-bdd6-20653bb21d8b-deep-partial-multi-view-learning.md)
- [FuXi: A cascade machine learning forecasting system for 15-day global weather forecast](https://refivu.com/en/papers/22238201-8e26-4b50-bb73-ade13aa387ac-fuxi-a-cascade-machine-learning-forecasting-system-for.md)
- [A Reduction of Imitation Learning and Structured Prediction to No-Regret Online Learning](https://refivu.com/en/papers/08306129-4598-48b6-baf3-9d1af09e03a6-a-reduction-of-imitation-learning-and-structured-prediction.md)
- [Representation Learning: A Review and New Perspectives](https://refivu.com/en/papers/b38149f8-9f53-4406-8d25-bb93c21c4bc9-representation-learning-a-review-and-new-perspectives.md)
- [Intriguing properties of neural networks](https://refivu.com/en/papers/5d9b1ffd-1b1d-4795-87df-32680ad74683-intriguing-properties-of-neural-networks.md)
- [Representation Learning with Contrastive Predictive Coding](https://refivu.com/en/papers/cd05bbc6-eff6-4b02-b9ef-45070ef6704a-representation-learning-with-contrastive-predictive-coding.md)
- [YOLOv7: Trainable bag-of-freebies sets new state-of-the-art for real-time object detectors](https://refivu.com/en/papers/c2cb4858-244f-407a-916b-4d41a9df7d4f-yolov7-trainable-bag-of-freebies-sets-new-state.md)
- [Communication-Efficient Learning of Deep Networks from Decentralized Data](https://refivu.com/en/papers/67777aca-9be4-4537-8568-875c944fceee-communication-efficient-learning-of-deep-networks-from.md)
- [Empirical Evaluation of Gated Recurrent Neural Networks on Sequence Modeling](https://refivu.com/en/papers/136a3b1f-3eb6-469b-8a8a-7536056851d5-empirical-evaluation-of-gated-recurrent-neural-networks-on.md)

## Terms in this paper

- [t-SNE](https://refivu.com/en/terms/488ecf7dbbcf-t-sne)
- [Negative sampling](https://refivu.com/en/terms/1dbdea971d8c-negative-sampling)
- [UMAP](https://refivu.com/en/terms/aeb869edc5de-umap)
- [k-nearest neighbor](https://refivu.com/en/terms/a3a4f600a64b-k-nearest-neighbor)
- [Laplacian eigenmaps](https://refivu.com/en/terms/de45f3ff5b8e-laplacian-eigenmaps)
- [dimension reduction](https://refivu.com/en/terms/24d3e21f2106-dimension-reduction)
- [Isomap](https://refivu.com/en/terms/a0e8828b6408-isomap)
- [KNN accuracy](https://refivu.com/en/terms/1340616b296b-knn-accuracy)
- [Riemannian metric](https://refivu.com/en/terms/1e4b2144f5c7-riemannian-metric)

---

AI-written text can contain mistakes. [Refivu](https://refivu.com/en/papers/44ccc549-6643-4369-889c-f60f3d61cbf4-umap-uniform-manifold-approximation-and-projection-for)
