Abstract Dimensionality reduction methods are unsupervised approaches which learn low-dimensional spaces where some properties of the initial space, typically the notion of "neighborhood", are preserved. Such methods usually require propagation on large k-NN graphs or complicated optimization solvers. On the other hand, self-supervised learning approaches, typically used to learn representations from scratch, rely on simple and more scalable frameworks for learning. In this paper, we propose TLDR, a dimensionality reduction method for generic input spaces that is porting the recent self-supervised learning framework of Zbontar et al. (2021) to the specific task of dimensionality reduction, over arbitrary representations. We propose to use nearest neighbors to build pairs from a training set and a redundancy reduction loss to learn an encoder that produces representations invariant across such pairs. TLDR is a method that is simple, easy to train, and of broad applicability; it consists of an offline nearest neighbor computation step that can be highly approximated, and a straightforward learning process. Aiming for scalability, we focus on improving linear dimensionality reduction, and show consistent gains on image and document retrieval tasks, e.g. gaining +4% mAP over PCA on ROxford for GeM-AP, improving the performance of DINO on ImageNet or retaining it with a 10x compression.
Introduction
In modern machine learning, high-dimensional embeddings are the standard for representing complex data like images and text. However, for real-time search, storage efficiency, or downstream tasks, these vectors often need to be compressed into lower-dimensional spaces. Historically, Principal Component Analysis (PCA) has been the preferred linear method due to its speed and simplicity, despite its inability to capture non-linear structures. Conversely, manifold learning techniques like UMAP or LLE capture complex structures but often fail to scale to massive datasets or handle out-of-sample data effectively. TLDR (Twin Learning for Dimensionality Reduction) bridges this gap by applying modern self-supervised learning (SSL) principles to create a dimensionality reduction tool that is as simple as PCA but as powerful as deep learning.
The TLDR Framework
TLDR treats "being a neighbor" as a form of data augmentation, leveraging the Barlow Twins framework for dimensionality reduction. The process involves three main steps:
- Neighbor Discovery: Pre-calculating $k$-nearest neighbors for every point in the training set.
- The Twin Setup: During training, a pair of neighbors is sampled. One vector passes through an Encoder (the final dimensionality reduction function), and both pass through a high-dimensional Projector.
- Barlow Twins Loss: A redundancy reduction loss is applied to the projector's output to ensure invariance (making neighbor representations similar) and minimize redundancy (decorrelating dimensions).
The encoder can be a simple linear layer or a small Multi-Layer Perceptron (MLP). By using mini-batch Stochastic Gradient Descent (SGD), TLDR is highly scalable and can be efficiently trained on GPUs.
Experimental Setup
The authors evaluated TLDR across diverse domains to demonstrate its general-purpose utility:
- Visual Landmarks: ROxford and RParis datasets using GeM-AP features.
- General Object Recognition: ImageNet using DINO features.
- Text/Document Retrieval: ArguAna (argument retrieval) and MSMarco.
- Baselines: Comparisons were made against PCA, UMAP, Isomap, and LLE.
Key Insights
- Neighbors as Distortions: While standard SSL uses crops or flips as distortions, TLDR recognizes that moving to a nearest neighbor in embedding space is a natural distortion that preserves semantic meaning.
- The Role of the Projector: Training with a high-dimensional projector (e.g., 8192 dimensions) is critical, even for low-dimensional targets like 128. It provides the "capacity" needed to properly decorrelate dimensions.
- Linearity and Scalability: A simple linear TLDR encoder often significantly outperforms PCA. Because it relies on SGD rather than solving massive eigenproblems, it scales to millions of vectors that traditional manifold methods cannot handle.
Results
TLDR consistently outperforms standard baselines across multiple benchmarks. On the ROxford landmark dataset, it achieved a +4.1% mAP improvement over whitened PCA. On ImageNet, TLDR maintained or even improved retrieval accuracy while achieving a 10x compression (from 2048 to 256 dimensions).
In document retrieval tasks like ArguAna, TLDR produced embeddings with only 4% of the original dimensions that performed on par with full-sized BERT-based embeddings. Furthermore, the method is robust to highly approximated nearest neighbor searches, making the offline step efficient.
Conclusion and Limitations
TLDR is a "post-hoc" method designed to refine already-learned features rather than learning from raw pixels. While it excels in the 32-512 dimension range, it is not intended as a direct replacement for 2D visualization tools like t-SNE. Future work may address observed performance gaps in symmetric text tasks, such as duplicate detection, compared to asymmetric retrieval tasks. Overall, TLDR provides a simple, scalable, and effective alternative to traditional dimensionality reduction.
Summary updated