SMEC: Rethinking Matryoshka Representation Learning for Retrieval Embedding Compression
Biao Zhang, Lixin Chen, Tong Liu, Bo Zheng
TL;DR
SMEC tackles the challenge of deploying high-dimensional LLM embeddings by introducing three components: Sequential Matryoshka Representation Learning (SMRL) to reduce gradient variance, Adaptive Dimension Selection (ADS) to minimize information loss, and Selectable Cross-Batch Memory (S-XBM) to improve unsupervised alignment between high- and low-dimensional embeddings. The analysis shows gradient variance in parallel MRL training scales with $∂L^d/∂w_i ∝ 1/δ(d)^2$, and SMRL mitigates this through staged transitions, while ADS and S-XBM preserve information and promote cross-batch learning. Empirically, SMEC achieves substantial dimensionality reduction with minimal performance loss across text, image, and multimodal retrieval tasks, notably boosting BEIR performance at moderate compression (e.g., 128-d embeddings). These results suggest SMEC as a practical solution for scalable, real-world retrieval systems that require compact, high-quality embeddings.
Abstract
Large language models (LLMs) generate high-dimensional embeddings that capture rich semantic and syntactic information. However, high-dimensional embeddings exacerbate computational complexity and storage requirements, thereby hindering practical deployment. To address these challenges, we propose a novel training framework named Sequential Matryoshka Embedding Compression (SMEC). This framework introduces the Sequential Matryoshka Representation Learning(SMRL) method to mitigate gradient variance during training, the Adaptive Dimension Selection (ADS) module to reduce information degradation during dimension pruning, and the Selectable Cross-batch Memory (S-XBM) module to enhance unsupervised learning between high- and low-dimensional embeddings. Experiments on image, text, and multimodal datasets demonstrate that SMEC achieves significant dimensionality reduction while maintaining performance. For instance, on the BEIR dataset, our approach improves the performance of compressed LLM2Vec embeddings (256 dimensions) by 1.1 points and 2.7 points compared to the Matryoshka-Adaptor and Search-Adaptor models, respectively.
