Abstract
In the evolving landscape of Retrieval-Augmented Generation (RAG) and semantic search, fine-tuning embedding models on new data typically necessitates a complete re-indexing of existing document corpora—a computationally prohibitive task for large-scale systems. We present Query Drift Compensation (QDC), a novel approach that preserves compatibility between updated models and legacy indexes. By estimating the semantic drift between model iterations and applying a compensatory vector to new queries, QDC eliminates the need for re-indexing while maintaining retrieval performance on par with joint training.
Introduction
Modern dense retrieval systems rely on neural networks to map text into a shared vector space. As new domains and datasets emerge, these models must be updated to maintain accuracy. However, in a Continual Learning (CL) setting, updating a model (Task $t$) often shifts the embedding space, causing "embedding drift." This drift renders previously indexed documents (from Task $t-1$) incompatible with queries processed by the new model. Traditionally, the only solution has been "back-filling"—re-embedding the entire corpus—which is infeasible for production-scale databases.
Methodology: Query Drift Compensation (QDC)
To address the challenge of embedding drift without re-indexing, we propose a two-stage strategy:
1. Embedding Knowledge Distillation (KD)
During the fine-tuning phase for a new task, we employ a distillation loss. This encourages the updated model $f_t$ to produce embeddings that remain relatively close to those of the predecessor model $f_{t-1}$, providing a baseline of semantic stability.
2. Drift Estimation and Compensation
The core innovation, QDC, involves calculating a global drift vector $\Delta$ after training on a new task. This vector represents the average shift in the semantic space for a set of anchor queries.
- Estimation: Queries are passed through both the old and new models. The difference between these embedding sets defines the drift.
- Retrieval: When performing retrieval against an index created by an older model version, the system uses the latest model to embed the query and then subtracts the accumulated drift. This "projects" the query back into the original semantic space of the indexed documents.
Experimental Setup
We evaluated QDC using a new Continual Document Retrieval (CDR) benchmark comprising five diverse datasets from the BEIR suite: MS MARCO, NQ, HotpotQA, FEVER, and FiQA-2018. This sequence tests the model's ability to adapt across various domains and document structures.
Key Insights
- Asymmetric Drift: Analysis reveals that documents drift more significantly than queries due to their greater "information surface area." This asymmetry explains why naive re-indexing often fails to align query and document spaces perfectly.
- The Re-indexing Paradox: Surprisingly, QDC can outperform full re-indexing. By preserving the original "expert" embeddings for legacy documents and adjusting the query, the system maintains high-quality representations while leveraging the new model's updated query understanding.
- Efficiency: QDC introduces negligible overhead—a single vector subtraction at query time—and requires zero document re-processing.
Results
The combination of fine-tuning, KD, and QDC achieved an average nDCG@10 of 54.1, matching the performance of a "Joint Training" upper bound where the model is trained on all data simultaneously. Furthermore, QDC significantly mitigated catastrophic forgetting; the performance drop on the initial task (MS MARCO) was reduced from 5.4 points (standard fine-tuning) to just 0.9 points.
Conclusion and Future Work
Query Drift Compensation provides a scalable, efficient path for the continual evolution of retrieval models. While currently demonstrated in task-incremental settings, future research will explore Class-Incremental Learning (CIL), where the system must autonomously determine the appropriate drift compensation without explicit task identifiers.
Summary updated