[Paper Review] On UMAP's true loss function
This paper reveals that UMAP's true loss function—derived analytically—differs significantly from its published formulation, revealing that UMAP optimizes for a binarized version of the shared k-nearest neighbor graph rather than the sophisticated high-dimensional similarities it claims to preserve. The key insight is that UMAP's success stems not from similarity preservation but from a balanced attraction-repulsion dynamic induced by its negative sampling scheme, which enables effective gradient descent optimization.
UMAP has supplanted t-SNE as state-of-the-art for visualizing high-dimensional datasets in many disciplines, but the reason for its success is not well understood. In this work, we investigate UMAP's sampling based optimization scheme in detail. We derive UMAP's effective loss function in closed form and find that it differs from the published one. As a consequence, we show that UMAP does not aim to reproduce its theoretically motivated high-dimensional UMAP similarities. Instead, it tries to reproduce similarities that only encode the shared $k$ nearest neighbor graph, thereby challenging the previous understanding of UMAP's effectiveness. Instead, we claim that the key to UMAP's success is its implicit balancing of attraction and repulsion resulting from negative sampling. This balancing in turn facilitates optimization via gradient descent. We corroborate our theoretical findings on toy and single cell RNA sequencing data.
Motivation & Objective
- To resolve the disconnect between UMAP’s theoretical motivation and its empirical success in visualizing high-dimensional data.
- To analyze UMAP’s sampling-based optimization scheme in detail, particularly its impact on the effective loss function.
- To determine whether UMAP truly reproduces high-dimensional similarities or instead approximates a simplified, binarized version of the data structure.
- To explain why UMAP produces high-quality visualizations despite not preserving the complex similarity measures it claims to use.
Proposed method
- Derive the closed-form effective loss function of UMAP’s optimization process using analytical computation of the sampling-based expectation.
- Compare the derived effective loss function with UMAP’s published loss function to identify discrepancies in the repulsive term weights.
- Analyze the target similarities (ν*ij) that UMAP actually seeks to reproduce, showing they are effectively binarized versions of the input similarities.
- Demonstrate that the effective loss function leads to a balance between attractive and repulsive forces, even though the original formulation would favor repulsion.
- Validate findings on synthetic data and single-cell RNA-seq data (C. elegans), showing alignment between predicted and observed visualizations.
- Use histograms of high-dimensional (μij), target (ν*ij), and low-dimensional (νij) similarities to confirm that UMAP reproduces target similarities, not input ones.
Experimental results
Research questions
- RQ1What is the true loss function that UMAP’s optimization procedure minimizes, given its sampling-based approach?
- RQ2How does the effective loss function differ from the one explicitly stated in UMAP’s original formulation?
- RQ3To what extent does UMAP preserve the high-dimensional UMAP similarities in the embedding space?
- RQ4Why does UMAP produce high-quality visualizations despite not reproducing the complex similarity structure it claims to model?
- RQ5What role does the balance between attraction and repulsion play in UMAP’s optimization success?
Key findings
- UMAP’s true loss function differs significantly from its published loss function, particularly in the weighting of the repulsive term.
- The effective loss function leads to a target similarity matrix that is effectively a binarized version of the shared k-nearest neighbor graph, not the full high-dimensional UMAP similarities.
- UMAP does not reproduce the sophisticated high-dimensional similarities; instead, it approximates a binary connectivity graph based on k-NN relationships.
- The total attractive and repulsive weights in the effective loss function are balanced—especially for default settings (m=5)—which facilitates stable gradient descent optimization.
- The observed visual artifacts, such as crisp, one-dimensional substructures, arise from the imbalance in force magnitudes in the original loss formulation, not from the true optimization objective.
- Empirical validation on toy and single-cell RNA-seq data confirms that UMAP embeddings align with target similarities ν*ij, not with the original high-dimensional similarities μij.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.