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 10× compression.
Introduction
Dimensionality reduction (DR) is a fundamental tool in machine learning, essential for data visualization and efficient storage in retrieval systems. Historically, Principal Component Analysis (PCA) has been the standard due to its speed and simplicity. However, PCA often fails to capture the intricate, non-linear structures of modern high-dimensional data. Conversely, manifold learning techniques like UMAP or t-SNE, while visually impressive, often struggle to scale to millions of data points or high-dimensional output spaces.
TLDR (Twin Learning for Dimensionality Reduction) bridges this gap by applying self-supervised learning (SSL) principles—specifically the Barlow Twins framework—to the task of feature compression. By treating a data point's nearest neighbors as "natural augmentations," TLDR learns a compact encoder that is as scalable as PCA but significantly more powerful.
Methodology: Neighborhood as Distortion
The core innovation of TLDR is the adaptation of the Barlow Twins SSL framework to generic feature vectors. In standard SSL, multiple "views" of an image are created via manual augmentations (e.g., cropping, flipping). For abstract feature vectors like BERT or DINO embeddings, such augmentations are not readily available.
TLDR solves this by using the k-nearest neighbors of a data point as its alternative views. If two points are neighbors in the original high-dimensional space, they should remain close in the reduced space.
As shown in the architecture above, the system uses an Encoder (often a simple linear layer) and a Projector (used only during training). The system optimizes the Barlow Twins loss, which targets the cross-correlation matrix of the twin outputs to achieve two goals:
- Invariance: Forces neighbor representations to be similar.
- Redundancy Reduction: Forces different dimensions to be uncorrelated, effectively whitening the data.
Experimental Setup and Insights
TLDR was evaluated across diverse domains, including visual retrieval (ROxford, RParis, ImageNet) and document retrieval (ArguAna). Features were extracted from state-of-the-art models like DINO (Vision Transformers) and BERT. Several key insights emerged from these experiments:
- Scalability: By utilizing approximate nearest neighbor search (e.g., FAISS), TLDR can process millions of samples in minutes, whereas traditional manifold methods like LLE might take hours for much smaller sets.
- The Projector's Role: Using a high-dimensional projector during training allows the lower-dimensional encoder bottleneck to capture richer information.
- Linear Efficiency: A simple linear TLDR encoder often outperforms complex non-linear methods, making it a viable drop-in replacement for PCA in production environments.
Results
TLDR demonstrates consistent improvements over traditional baselines across various tasks. Notably, on the ROxford landmark retrieval task, TLDR achieved a +4% mAP gain over whitened PCA at 128 dimensions.
Furthermore, TLDR enables extreme compression. For instance, it can compress DINO features on ImageNet by 10x (from 2048 to 256 dimensions) with negligible loss in k-NN accuracy. In unsupervised settings, training a linear TLDR layer on target domain data yielded state-of-the-art performance, improving DINO's base results on ROxford by +5.4 mAP.
Conclusion and Future Work
TLDR provides a simple, scalable, and effective framework for dimensionality reduction. While it is a "post-hoc" method requiring pre-extracted features, its ability to outperform PCA and scale to massive datasets makes it highly practical. Future research may explore integrating other SSL objectives, such as VICReg or SimCLR, into this neighborhood-based framework to further enhance performance across symmetric and asymmetric retrieval tasks.
Summary updated