PromptDSI: Prompt-based Rehearsal-free Instance-wise Incremental Learning for Document Retrieval

Tuan-Luc Huynh, Thuy-Trang Vu, Weiqing Wang, Yinwei Wei, Trung Le, Dragan Gasevic, Yuan-Fang Li, Thanh-Toan Do

Abstract

Differentiable Search Index (DSI) utilizes Pre-trained Language Models (PLMs) for efficient document retrieval without relying on external indexes. However, DSIs need full re-training to handle updates in dynamic corpora, causing significant computational inefficiencies. We introduce PromptDSI, a rehearsal-free, prompt-based approach for instance-wise incremental learning in document retrieval. PromptDSI attaches prompts to the frozen PLM's encoder of DSI, leveraging its powerful representation to efficiently index new corpora while maintaining a balance between stability and plasticity. We eliminate the initial forward pass of prompt-based continual learning methods that doubles training and inference time. Moreover, we propose a topic-aware prompt pool that employs neural topic embeddings as fixed keys. This strategy ensures diverse and effective prompt usage, addressing the challenge of parameter underutilization caused by the collapse of the query-key matching mechanism. Our empirical evaluations demonstrate that PromptDSI matches IncDSI in managing forgetting while significantly enhancing recall by over 4% on new corpora.

Introduction

The Differentiable Search Index (DSI) represents a paradigm shift in document retrieval, replacing traditional components like inverted indices or vector databases with a single Transformer model that maps queries directly to document identifiers (DocIDs). However, DSI faces a significant "plasticity" challenge: when new documents arrive, the model typically requires full retraining to index them, which is computationally prohibitive in dynamic environments.

Existing Continual Learning (CL) solutions for retrieval often rely on "rehearsal" strategies—storing a buffer of old data or using generative models to replay old queries. These approaches are problematic due to privacy concerns regarding stored user data, the massive computational overhead of generative replay, and the "memory explosion" caused by caching embeddings for millions of documents. PromptDSI aims to enable rehearsal-free continual learning, allowing the model to learn new information while keeping original data strictly off-limits.

Methodology: PromptDSI

PromptDSI builds on Prompt-based Continual Learning (PCL), where a backbone model is frozen and small, learnable "prompts" are added to handle new tasks. The authors introduce three key innovations to adapt PCL for document retrieval:

Single-pass Prompt-based Continual Learning

Standard PCL typically requires two forward passes: one to extract a query embedding to select the appropriate prompt, and a second to perform the actual retrieval. PromptDSI eliminates the first pass by using average token embeddings from an intermediate layer (e.g., Layer 1) to select the prompt. This modification collapses the process into a single pass, significantly reducing latency during both training and inference.

Comparison between Naive-PromptDSI (two-pass) and the proposed PromptDSI (single-pass) architectures.

Topic-aware Prompt Keys

In retrieval, semantic overlap between document batches can cause "prompt collapse," where the model only utilizes a few prompts and ignores the rest. To solve this, the authors use BERTopic to mine neural topic embeddings from the initial corpus and use these as fixed "keys" for prompt selection. This stabilizes training, prevents the instability of optimizing keys and prompts simultaneously, and ensures prompts are mapped to distinct semantic concepts.

Layer-wise Prompting Strategy

Through extensive study, the authors found that "multi-layer" prompting is redundant for retrieval. They demonstrate that applying prompts only to Layer 2 of the encoder provides the optimal balance between indexing new documents (plasticity) and preventing the forgetting of old ones (stability).

Experimental Setup

The researchers evaluated PromptDSI on two standard benchmarks modified for incremental learning:

  • NQ320k (Natural Questions): A title-de-duplicated version containing ~108k documents.
  • MSMARCO 300k: A subset of the popular MS MARCO Document Ranking dataset.

In both cases, the data was split into an initial large corpus ($D_0$, 90% of documents) followed by five smaller incremental batches ($D_1$ through $D_5$, 2% each).

Key Results and Insights

  • Efficiency and Speed: The single-pass modification resulted in a 4.3x speedup in inference compared to the naive two-pass PCL approach.
  • Memory Advantage: PromptDSI has a tiny overhead. While a strong baseline like IncDSI might require 25 GiB of memory to scale to the full MS MARCO dataset, PromptDSI requires only about 12 MiB.
  • Performance: PromptDSI matched the performance of strong cache-based methods in mitigating "catastrophic forgetting" while significantly enhancing recall on new corpora by over 4%.
  • Shallow Embeddings are Sufficient: A surprising finding was that "shallow" query embeddings from early layers are enough for selecting the correct prompt, suggesting that the high-level topic of a query is captured early in the Transformer stack.

Conclusion and Future Work

PromptDSI provides a scalable, efficient, and privacy-preserving solution for incremental document retrieval. While highly effective, the method currently relies on mining topics from the initial corpus; future work is needed to address scenarios where new document batches contain entirely unrelated topics. Additionally, while tested on standard research benchmarks, scaling the topic-aware approach to billion-scale document collections remains an area for further exploration.

Summary updated

Abstract

Differentiable Search Index (DSI) utilizes Pre-trained Language Models (PLMs) for efficient document retrieval without relying on external indexes. However, DSIs need full re-training to handle updates in dynamic corpora, causing significant computational inefficiencies. We introduce PromptDSI, a rehearsal-free, prompt-based approach for instance-wise incremental learning in document retrieval. PromptDSI attaches prompts to the frozen PLM's encoder of DSI, leveraging its powerful representation to efficiently index new corpora while maintaining a balance between stability and plasticity. We eliminate the initial forward pass of prompt-based continual learning methods that doubles training and inference time. Moreover, we propose a topic-aware prompt pool that employs neural topic embeddings as fixed keys. This strategy ensures diverse and effective prompt usage, addressing the challenge of parameter underutilization caused by the collapse of the query-key matching mechanism. Our empirical evaluations demonstrate that PromptDSI matches IncDSI in managing forgetting while significantly enhancing recall by over 4% on new corpora.
BibTeX
@inproceedings{huynh2025promptdsi,
  author = {Tuan-Luc Huynh and Thuy-Trang Vu and Weiqing Wang and Yinwei Wei and Trung Le and Dragan Gasevic and Yuan-Fang Li and Thanh-Toan Do},
  title = {{PromptDSI: Prompt-based Rehearsal-free Instance-wise Incremental Learning for Document Retrieval}},
  booktitle = {ECML/PKDD},
  year = {2025},
  doi = {10.1007/978-3-032-06109-6\_22},
}
Figure