Dimension Reduction for Efficient Dense Retrieval via Conditional Autoencoder

Zhenghao Liu, Han Zhang, Chenyan Xiong, Zhiyuan Liu, Yu Gu, Xiaohua Li · DOI

Introduction

Modern information retrieval systems increasingly rely on Dense Retrieval (DR), where pre-trained language models encode queries and documents into high-dimensional vectors. While effective, the standard 768-dimensional embeddings used by models like BERT create significant production bottlenecks. Storing millions of these vectors requires substantial RAM, and searching through high-dimensional spaces increases retrieval latency.

To address these challenges, we introduce ConAE (Conditional Autoencoder), a framework designed to compress high-dimensional embeddings into much smaller vectors (e.g., 128-d or 64-d) with minimal impact on search accuracy. ConAE reduces index storage by approximately 6x and retrieval latency by 4x compared to standard high-dimensional models.

Methodology: The Conditional Autoencoder

Unlike standard autoencoders that focus solely on input reconstruction, ConAE is optimized to preserve the "ranking signals" essential for retrieval. The architecture consists of two primary components:

  1. Encoder: A linear layer that compresses the original $K$-dimensional embedding into a lower-dimensional space $L$.
  2. Decoder: A linear layer that projects the compressed vector back to the original $K$-dimensional space.

The training process utilizes a specialized dual-loss function:

  • KL Divergence Loss: This "conditional" loss ensures the low-dimensional space mimics the probability distribution of the original "teacher" model. It maintains document distinguishability by preventing the compressed space from becoming cluttered.
  • Max Margin Ranking Loss: Applied to the decoder, this loss ensures that reconstructed vectors preserve the correct ranking order between relevant and irrelevant documents, rather than just minimizing mean squared error.

Experimental Evaluation

ConAE was evaluated across several major benchmarks, including MS MARCO (Passage Ranking), Natural Questions (NQ), and zero-shot transfer tasks on TREC DL and TREC-COVID.

Key Results

ConAE demonstrates superior performance compared to traditional reduction methods like PCA:

  • Efficiency: On MS MARCO, compressing from 768-d to 128-d reduced latency from 17.15ms to 3.94ms and storage from 26.0GB to 4.3GB.
  • Accuracy: ConAE-128 achieved an MRR@10 of 0.3245, nearly matching the teacher model's 0.3302, while PCA-128 performance dropped significantly to 0.2348.
  • Generalization: The model maintained high performance on TREC-COVID (0.6381 NDCG@10) despite being trained only on MS MARCO, indicating it captures robust, transferable features.

Results and Analysis

Visual analysis suggests that ConAE does more than just compress; it may also denoise the representation. As shown in the t-SNE visualizations below, the ConAE-128 space (Figure 1b) displays a more structured distribution where the query is clearly surrounded by relevant documents, often appearing more distinct than in the original teacher space (Figure 1a).

t-SNE visualizations of embedding spaces for the teacher model and ConAE variants.

The effectiveness of ConAE stems from its ability to strip away the inherent redundancy in 768-dimensional embeddings. By forcing the model to mimic the teacher's distribution, the compressed space retains the critical features necessary for accurate matching.

Conclusion and Future Work

ConAE provides a highly efficient solution for deploying dense retrieval models in resource-constrained environments. Future research could explore jointly training the query and document encoders with the dimension reduction module or utilizing non-linear projections to further optimize the accuracy-efficiency trade-off. Currently, the model's capacity is limited by the linear constraints of its projection layers, which remains an area for potential expansion.

Summary updated

BibTeX
@inproceedings{liu2022dimension,
  author = {Zhenghao Liu and Han Zhang and Chenyan Xiong and Zhiyuan Liu and Yu Gu and Xiaohua Li},
  title = {{Dimension Reduction for Efficient Dense Retrieval via Conditional Autoencoder}},
  booktitle = {Conference on Empirical Methods in Natural Language Processing},
  year = {2022},
  doi = {10.18653/v1/2022.emnlp-main.384},
}
Figure