Abstract
t-distributed Stochastic Neighborhood Embedding (t-SNE) is a method for dimensionality reduction and visualization that has become widely popular in recent years. Efficient implementations of t-SNE are available, but they scale poorly to datasets with hundreds of thousands to millions of high dimensional data-points. We present Fast Fourier Transform-accelerated Interpolation-based t-SNE (FIt-SNE), which dramatically accelerates the computation of t-SNE. The most time-consuming step of t-SNE is a convolution that we accelerate by interpolating onto an equispaced grid and subsequently using the fast Fourier transform to perform the convolution. We also optimize the computation of input similarities in high dimensions using multi-threaded approximate nearest neighbors. We further present a modification to t-SNE called "late exaggeration," which allows for easier identification of clusters in t-SNE embeddings. Finally, for datasets that cannot be loaded into the memory, we present out-of-core randomized principal component analysis (oocPCA), so that the top principal components of a dataset can be computed without ever fully loading the matrix, hence allowing for t-SNE of large datasets to be computed on resource-limited machines.
Introduction
t-SNE has become the gold standard for visualizing complex, high-dimensional data, particularly in fields like single-cell genomics. However, the algorithm faces a significant "speed limit" when applied to modern datasets containing millions of points. The core computational challenge lies in calculating interactions between data points: similar points are pulled together by attractive forces, while all points are pushed apart by repulsive forces. Calculating these interactions for every pair of points is $O(N^2)$, and even the popular Barnes-Hut approximation ($O(N \log N)$) can take days to process massive datasets. Furthermore, these datasets often exceed a computer's RAM, complicating the initial Principal Component Analysis (PCA) step.
Methodology
FIt-SNE: FFT-Accelerated Interpolation
The primary bottleneck in t-SNE is the calculation of repulsive forces. FIt-SNE addresses this by projecting data points onto an equispaced grid using polynomial interpolation. Because the mathematical kernel used to calculate these forces is translationally invariant, the grid-based calculation becomes a convolution. This allows the use of the Fast Fourier Transform (FFT) to solve the interaction in near-linear time.
Optimization and Scalability
To accelerate the calculation of attractive forces, the authors utilize multi-threaded approximate nearest neighbors (via the ANNOY library). They also introduce "late exaggeration," a technique that increases the attractive force constant at the end of the optimization to squeeze clusters more tightly, making them easier to distinguish visually.
For memory-constrained environments, the authors developed out-of-core randomized PCA (oocPCA). This algorithm reads data from the disk in small blocks, allowing researchers to compute the primary axes of massive datasets without loading the entire matrix into RAM.
Results
Computational Performance
FIt-SNE demonstrates dramatic speedups over the previous state-of-the-art Barnes-Hut (BH) implementation. For a dataset of 1 million points, FIt-SNE was 15 times faster than BH in 1D and 30 times faster in 2D. This efficiency allows for the visualization of millions of points on a standard personal computer in a fraction of the time previously required.
Accuracy and Memory Efficiency
Despite the approximations used, FIt-SNE maintains high fidelity. Relative error remains extremely low, often below $10^{-4}$, ensuring that the resulting visualization is a faithful representation of the high-dimensional data. Additionally, the oocPCA algorithm successfully processed a 240GB matrix using only 1GB of RAM in just 16 minutes, achieving an accuracy of $10^{-9}$.
Conclusion
FIt-SNE represents a significant advancement in dimensionality reduction, making t-SNE viable for the massive datasets common in modern scientific research. By combining grid-based interpolation, FFT, and out-of-core processing, the authors have removed the primary computational barriers to large-scale data visualization.
Summary updated