Introduction
In modern Information Retrieval (IR), practitioners often face a stark trade-off between speed and accuracy.
- Dual Encoders (DE): These models encode queries and documents into separate vector spaces. Their primary advantage is efficiency; document vectors can be pre-computed and indexed for fast Maximum Inner Product Search (MIPS). However, they lack deep semantic interaction between the query and document during encoding.
- Cross Encoders (CE): These models process the query and document simultaneously (e.g., using BERT), allowing for word-level interactions. While highly accurate, they are computationally prohibitive for large-scale retrieval as they require a full model pass for every query-document pair.
To bridge this gap, we introduce the Dual Cross Encoder (DCE), a framework that achieves Cross-Encoder-level accuracy while maintaining the inference efficiency of a Dual Encoder.
The Dual Cross Encoder Architecture
The core innovation of the DCE is representing a document not as a single static vector, but through a set of "query-informed" representations. This is achieved through an offline indexing process:
- Pseudo-Query Generation: For every document, a fine-tuned T5 model generates multiple potential questions (pseudo-queries) that the document might answer.
- Pre-computed Interaction: A Cross Encoder then processes the concatenation of each pseudo-query with the document. This results in multiple representations that capture different semantic facets of the text.
- Asymmetric Search: At query time, the user's actual query is encoded once. The relevance score is determined by the maximum dot product between the query vector and the set of pre-computed document vectors.
Key Insights: Documents are Multi-faceted
A single passage often contains information relevant to diverse topics. A standard Dual Encoder "squashes" these facets into one vector, leading to information loss. By using multiple generated queries, the DCE creates a "multi-view" representation. This allows a single document to match different types of user intents effectively without requiring expensive online cross-encoding.
Performance and Scaling
The DCE was evaluated on industry-standard benchmarks, including MS MARCO and TREC Deep Learning. On MS MARCO, the model achieved an MRR@10 of 36.0, significantly outperforming the standard DPR baseline (31.4). On TREC DL 2020, it reached an nDCG@10 of 68.9, surpassing complex late-interaction models like ColBERT.
A critical factor in the model's success is the number of pseudo-queries ($k$) used to represent each document. As shown in the analysis, increasing $k$ leads to consistent improvements in retrieval performance (MRR@10), though the gains begin to diminish after approximately 10 queries.
Limitations and Trade-offs
While the DCE offers state-of-the-art accuracy and MIPS compatibility, it introduces a storage overhead. Because the model stores $k$ vectors per document instead of one, the index size in vector databases like FAISS increases proportionally. Furthermore, there remains a slight discrepancy between the "gold" human queries used during training and the "pseudo" machine-generated queries used for indexing, suggesting that improvements in query generation could further enhance performance.
Conclusion
The Dual Cross Encoder effectively moves the heavy computational bottleneck of deep interaction from the online search phase to the offline indexing phase. By embracing the multi-faceted nature of documents through pseudo-query generation, it provides a scalable path toward high-accuracy dense retrieval.
Summary updated