Interpret and Control Dense Retrieval with Sparse Latent Features (2025)

Abstract: Dense embeddings deliver strong retrieval performance but often lack interpretability and controllability. This paper introduces a novel approach using sparse autoencoders (SAE) to interpret and control dense embeddings via the learned latent sparse features. Our key contribution is the development of a retrieval-oriented contrastive loss, which ensures the sparse latent features remain effective for retrieval tasks and thus meaningful to interpret. Experimental results demonstrate that both the learned latent sparse features and their reconstructed embeddings retain nearly the same retrieval accuracy as the original dense vectors, affirming their faithfulness. Our further examination of the sparse latent space reveals interesting features underlying the dense embeddings and we can control the retrieval behaviors via manipulating the latent sparse features, for example, prioritizing documents from specific perspectives in the retrieval results.

## introduction in the realm of information retrieval, dense embeddings derived from large language models (llms) have achieved state-of-the-art performances @xcite . while these representations offer remarkable accuracy in matching queries to documents, their "black-box" nature poses challenges in applications that demand transparency and control, such as retrieval in biassensitive tasks, where users may need to understand the rationale behind the retrieved results and adjust the process to ensure fairness. in contrast, in bag-of-word base sparse retrieval, each dimension is a meaningful word, allowing users to see why certain documents are retrieved, and making it intuitive for users to revise their query keywords to control the retrieval results. interpretability and controllability are important for building trust with users and facilitate the wide adoption of search technologies @xcite . in this paper, we present a novel approach that leverages sparse autoencoders (sae) to interpret and control dense retrieval systems. sparse autoencoders have recently been used to improve the interpretability of llms by transforming neuron activation patterns into sparse dictionaries @xcite . we upgrade this approach to dense embeddings, incorporating a retrieval-oriented recovery loss which ensures the extracted sparse features remain faithful for retrieval, forming the basis of our interpretability analysis. our experiments demonstrate the success of this approach. retrieval using the learned latent sparse features and their reconstructed embeddings both recover the majority of the original dense retrieval accuracy on the msmarco and beir benchmarks, ensuring that these features offer genuine interpretability rather than an illusion. then we explore the interpretability of these sparse features with neuron to graph (n2g) approach @xcite , and discover that various fine-grained concepts have been captured in the latent sparse space. to understand controllability through latent features, we conduct quantitative studies by amplifying query-relevant features, which successfully improved retrieval accuracy on the manipulated embeddings, both on the query side and the document side. then, we perform case studies on multi-perspective queries and confirm that selectively manipulating sparse features from a specific perspective causes the reconstructed embeddings to prioritize documents from that perspective during retrieval. our source code and extracted features are available at github foot_0 . ## methodology in this section, we describe the methodology used to train the sparse autoencoder with our retrieval-decoder encoder ## experiments this section outlines the training procedures for the k-sparse autoencoder and our experiments on interpretability and controllability. training procedures. we train the autoencoder on top of the base-sized bge model foot_1 , which was trained on diverse tasks such as retrieval, classification, and semantic similarity @xcite . embeddings are generated from the msmarco dataset, containing 8.8m passages for retrieval tasks @xcite . details of the training hyperparameters are available in appendix a. for evaluation, we first calculate mse on the validation queries and their relevant documents. we then perform dense retrieval on the reconstructed embeddings and sparse dot product retrieval on the latent features. reported metrics include mean reciprocal rank (mrr), precision at rank 10 (p@10), and recall at rank 10 (r@10). for generalizability on diverse retrieval tasks, we additionally evalute the sparse autoencoder on datasets from the beir benchmark, such as trec-covid, naturalquestions, and dbpediaen-tity @xcite @xcite . additionally, we investigate the impact of the base embedding by applying our approach to an alternative embedding model, minicpm foot_2 @xcite . interpretability study. to assess interpretability, we generate n2g explanations @xcite . n2g provides an automated approach to interpret the behavior of individual neurons by converting their activations into graph-based representations. it identifies the most relevant tokens that strongly activate a neuron and focuses on them by pruning the surrounding, less relevant context. this process isolates the essential patterns that contribute to the neuron's activation. additionally, n2g enriches the dataset by replacing key tokens with high-probability substitutes, generating variations that maintain high activation levels. by doing so, the method captures a broader and more nuanced understanding of the neuron's behavior, revealing how it responds to different inputs while maintaining its core functionality. this combination of pruning and augmentation ensures that the interpretability of each neuron is both concise and comprehensive @xcite . for each feature, we create a training set of 512 samples by selecting the highest-activating documents. we then perform forward passes on prefix sequences to extract activation sequences, which are input into n2g to construct trie representations for each feature. gpt-4o-mini is used to interpret each trie's semantic meaning. ## evaluation in this section, we present the evaluated results for each experiment in section 3 and discuss the underlying insights that are critical for our findings. ## conclusion in this paper, we presented a novel method that applies sparse autoencoder to enhance the interpretability and controllability of dense embedding spaces in information retrieval. our approach, which utilizes a retrieval-oriented contrastive loss function, ensures that the sparse features extracted remain faithful for interpretation. the experimental results demonstrate that our reconstructed embeddings maintain competitive retrieval accuracy, with sparse latent features proving to be both interpretable and controllably influential on retrieval outcomes. by enabling explicit manipulation of these sparse features, we provide a means to directly influence retrieval behaviors, offering a significant advantage for applications requiring transparent and adjustable retrieval mechanisms.