Evaluating Unsupervised Dimensionality Reduction Methods for Pretrained Sentence Embeddings
Gaifan Zhang, Yi Zhou, Danushka Bollegala
TL;DR
Addressing the practicality of PLM sentence embeddings, this paper studies unsupervised post-hoc dimensionality reduction from dimension $d$ to $d'<d$ to enable memory- and compute-constrained deployments. It systematically compares PCA, SVD, Kernel PCA, Gaussian Random Projection, and Autoencoders, across six encoders and three evaluation tasks in both inductive and transductive settings. The key finding is that PCA achieves about a $50 ext{%}$ reduction in dimensionality with around a $1 ext{%}$ loss in task performance, and can even improve accuracy for some encoders; results on other methods vary by encoder and task. These findings provide practical guidance for compressing sentence embeddings in retrieval and NLU pipelines, enabling broader deployment of PLM-based representations with modest accuracy trade-offs.
Abstract
Sentence embeddings produced by Pretrained Language Models (PLMs) have received wide attention from the NLP community due to their superior performance when representing texts in numerous downstream applications. However, the high dimensionality of the sentence embeddings produced by PLMs is problematic when representing large numbers of sentences in memory- or compute-constrained devices. As a solution, we evaluate unsupervised dimensionality reduction methods to reduce the dimensionality of sentence embeddings produced by PLMs. Our experimental results show that simple methods such as Principal Component Analysis (PCA) can reduce the dimensionality of sentence embeddings by almost $50\%$, without incurring a significant loss in performance in multiple downstream tasks. Surprisingly, reducing the dimensionality further improves performance over the original high-dimensional versions for the sentence embeddings produced by some PLMs in some tasks.
