Abstract Neural retrieval models have superseded classic bag-of-words methods such as BM25 as the retrieval framework of choice. However, neural systems lack the interpretability of bag-of-words models; it is not trivial to connect a query change to a change in the latent space that ultimately determines the retrieval results. To shed light on this embedding space, we learn a “query decoder” that, given a latent representation of a neural search engine, generates the corresponding query. We show that it is possible to decode a meaningful query from its latent representation and, when moving in the right direction in latent space, to decode a query that retrieves the relevant paragraph. In particular, the query decoder can be useful to understand “what should have been asked” to retrieve a particular paragraph from the collection. We employ the query decoder to generate a large synthetic dataset of query reformulations for MSMarco, leading to improved retrieval performance. On this data, we train a pseudo-relevance feedback (PRF) T5 model for the application of query suggestion that outperforms both query reformulation and PRF information retrieval baselines.
Introduction
Modern search systems have shifted from keyword-based models like BM25 to neural retrievers such as GTR or DPR. While these neural models offer superior performance by mapping queries and documents into a high-dimensional latent space, they operate as "black boxes." Unlike keyword-based systems where adding or removing words has a predictable effect, the relationship between a query's text and its position in the latent space is opaque. This lack of interpretability makes it difficult to diagnose retrieval failures or understand how to reformulate a query to find specific information. This research addresses this gap by introducing a "query decoder" to invert the retrieval process, translating abstract vector embeddings back into human-readable text.
Methodology
The proposed framework consists of three main components:
- The Query Decoder (QD): A T5-base model is trained to act as the inverse of a fixed neural encoder (e.g., GTR). While the encoder maps text to a 768-dimensional vector, the QD reconstructs the original query string from this vector.
- Latent Space Traversal: To generate high-quality query suggestions, the authors leverage "gold" query-document pairs. By performing linear interpolation in the latent space—moving from the query embedding toward the document embedding—and decoding intermediate points, they create a synthetic dataset of "successful" query reformulations. These reformulations are semantically related to the original query but are mathematically "closer" to the target document.
- The qsT5 Model: A T5-large model is trained on this synthetic data. The most effective variant, qsT5, utilizes Pseudo-Relevance Feedback (PRF), incorporating both the original query and the top-5 initial search results as context to generate optimized suggestions.
Experimental Setup
The models were evaluated using several key datasets:
- PAQ (Probably Asked Questions): 3 million queries for training the initial Query Decoder.
- MSMarco: The primary benchmark for training query suggestion models and evaluating retrieval.
- Natural Questions (NQ): Used to test cross-dataset generalization.
- BEIR Benchmark: Employed for initial query reconstruction tasks.
Results and Analysis
The study demonstrates that latent inversion is a viable path for interpretability; the fixed embeddings of a retriever preserve enough semantic information to reconstruct fluent, meaningful queries. This allows researchers to understand "what should have been asked" to retrieve a specific paragraph.
A key finding is the effectiveness of the "Gold Path." Linear interpolation between a query and a document in latent space produces a sequence of queries that gradually shift in intent toward the target information. As shown in Figure 6, moving along this path significantly improves retrieval performance (nDCG@10) as the decoded representation approaches the gold paragraph embedding.
Quantitatively, the qsT5 model outperformed standard baselines like RM3 and MQR. On MSMarco, using the top suggestion from qsT5 improved the nDCG@10 from a baseline of 0.42 to 0.455. When considering the best of 10 suggestions, the performance reached 0.554. Furthermore, the model maintained high linguistic fluency and produced more diverse suggestions than previous methods.
Conclusion and Limitations
This work provides a novel method for interpreting and steering neural retrievers. However, some limitations remain. The approach depends on the availability of "gold" pairs for synthetic data generation. Additionally, as representations move extremely close to document embeddings, the decoded queries can lose fluency due to the distinct regions queries and documents occupy in the latent space. Future work could include user studies to evaluate the human-perceived utility of these mathematically optimized query suggestions.
Summary updated