PromptDSI: Prompt-based Rehearsal-free Continual Learning for Document Retrieval

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

TL;DR

PromptDSI introduces a rehearsal-free, prompt-based continual learning framework for Differentiable Search Indexes (DSIs) in document retrieval. By eliminating the need to store past user queries or use heavy generative replay models, it protects data privacy and slashes memory overhead. Furthermore, it introduces a single-pass architecture for low latency and utilizes fixed neural topic embeddings to stabilize prompt selection.

What Problem Does This Paper Address?

Traditional document retrieval relies on a "retrieve-then-rank" pipeline using external inverted indices or vector databases. Differentiable Search Indexes (DSIs) flip this script by training a single Transformer model to map queries directly to document identifiers (docids) via end-to-end learning, effectively encoding the entire corpus into the model's parameters.

However, real-world document collections are dynamic. When new documents are added, standard DSIs suffer from catastrophic forgetting—they forget how to retrieve old documents unless they are fully retrained from scratch, which is computationally prohibitive. Existing continual learning (CL) fixes either require caching previous queries (raising serious data privacy concerns and high memory overhead) or using generative models to replay pseudo-queries (incurring massive training overhead).

While prompt-based continual learning (PCL) has emerged in the vision domain as a rehearsal-free alternative, adapting it to document retrieval introduces two major roadblocks:

  1. High Latency: Standard PCL requires two forward passes through the network (one to select the prompt, one to compute the prediction), which is too slow for real-time retrieval systems.
  2. Prompt Collapse: Text corpora often lack distinct semantic boundaries, causing learnable prompt selection mechanisms to destabilize and underutilize the available prompt pool.

Methods

The authors propose PromptDSI, which freezes the core DSI backbone and uses a pool of learnable prompts to index new documents incrementally. To make PCL viable for document retrieval, they introduce three key modifications:

  • Single-pass PCL: Instead of performing an initial forward pass to extract the final layer's [CLS] token for prompt selection, PromptDSI uses the average token embeddings ([AVG]) from an intermediate layer. This allows prompt selection and query processing to happen in a single streamlined forward pass.
  • Topic-aware Prompt Keys (PromptDSI<sub>Topic</sub>): To prevent prompt selection from collapsing into a tiny subset of prompts, the authors use BERTopic to mine fixed neural topic embeddings from the initial corpus. These embeddings serve as static keys in the prompt pool, stabilizing the query-key matching process and improving interpretability.
  • Layer-wise Prompting Optimization: Through a comprehensive stability-plasticity study, the authors determined that single-layer prefix-tuning at Layer 2 provides the optimal trade-off between efficiency and performance, challenging the multi-layer prompting standard used in vision PCL.
Fig. 1. Naive-PromptDSI (left) integrates PCL methods into DSI using two forward passes, causing increased training/inference time. PromptDSI (right) enhances effi- ciency by using intermediate layer representations (i.e. average of token embeddings [AVG]) for prompt selection, effectively removing an additional forward pass. In this example, prompts p are prefix tuning to layer 2 of the DSI’s encoder θe. At timestep t > 0, θl,<t refers to the frozen portion of the linear classifier, while θl,t represents the expanded portion used for training on corpus Dt.

Datasets

The approach was evaluated using BERT and SBERT backbones across two widely recognized document retrieval benchmarks, adapted into sequential continual learning setups (90% initial corpus $D_0$, followed by five sequential 2% increments $D_1$ to $D_5$):

  • NQ320k: A title-de-duplicated version of the Natural Questions dataset containing roughly 320k query-document pairs across 108k documents.
  • MSMARCO 300k: A subset of the MS MARCO Document Ranking dataset containing 300k documents.

Key Insights and Ideas

  • Text Queries are Semantically Simpler Than Images: The success of the single-pass architecture hinges on the realization that shallow, intermediate token representations are rich enough for prompt selection in text retrieval. This contrasts sharply with computer vision, where deep features are typically required.
  • Static Keys Beat Learnable Keys for Text: Because different text corpora share overlapping topics, optimizing prompt keys dynamically causes them to become highly similar, leading to parameter underutilization. Using fixed, pre-computed neural topic embeddings as keys bypasses this training instability entirely.
  • Enhanced Interpretability: By mapping prompts directly to neural topics (e.g., "Football", "Movies", "Human Biology"), the system provides clear visibility into why a specific prompt was selected during inference.

Key Results

  • Zero Forgetting & Superior Plasticity: PromptDSI variants consistently outperformed rehearsal-based baselines (like DSI++) and matched the performance of strong cache-based baselines (IncDSI) in mitigating forgetting, while significantly improving retrieval performance on newly added corpora ($A_5$).
  • Massive Speedups: The single-pass mechanism achieved up to a 4.3x speedup during inference compared to the naive two-pass PCL adaptation, with a negligible performance trade-off (less than 0.9% drop in MRR@10).
  • Minimal Memory Footprint: While cache-based methods scale linearly and require hundreds of megabytes (or gigabytes on full datasets) to store past query embeddings, PromptDSI's prompt pool requires only ~315 KiB—a reduction of three orders of magnitude.

Limitations and Future Work

  • Scaling Atomic Docids: This work focuses on classification-based DSI using atomic docids, where each document acts as a unique class. This paradigm faces inherent scaling challenges when moving to millions of documents.
  • Advanced Backbones: The experiments were restricted to standard BERT and SBERT models. The authors note that evaluating PromptDSI on state-of-the-art dense encoders (like BGE or NV-Embed) remains an open direction.
  • LLM-based Topic Modeling: While BERTopic proved effective, leveraging Large Language Models (LLMs) for generating more contextualized and robust neural topic keys could further enhance prompt utilization.

Summary updated

Abstract

Differentiable Search Index (DSI) utilizes pre-trained language models to perform indexing and document retrieval via end-to-end learning without relying on external indexes. However, DSI requires full re-training to index new documents, causing significant computational inefficiencies. Continual learning (CL) offers a solution by enabling the model to incrementally update without full re-training. Existing CL solutions in document retrieval rely on memory buffers or generative models for rehearsal, which is infeasible when accessing previous training data is restricted due to privacy concerns. To this end, we introduce PromptDSI, a prompt-based, rehearsal-free continual learning approach for document retrieval. PromptDSI follows the Prompt-based Continual Learning (PCL) framework, using learnable prompts to efficiently index new documents without accessing previous documents or queries. To improve retrieval latency, we remove the initial forward pass of PCL, which otherwise greatly increases training and inference time, with a negligible trade-off in performance. Additionally, we introduce a novel topic-aware prompt pool that employs neural topic embeddings as fixed keys, eliminating the instability of prompt key optimization while maintaining competitive performance with existing PCL prompt pools. In a challenging rehearsal-free continual learning setup, we demonstrate that PromptDSI variants outperform rehearsal-based baselines, match the strong cache-based baseline in mitigating forgetting, and significantly improving retrieval performance 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 Continual Learning for Document Retrieval}},
  booktitle = {ECML/PKDD},
  year = {2025},
  doi = {10.1007/978-3-032-06109-6\_22},
}
Figure