TPRF: A Transformer-based Pseudo-Relevance Feedback Model for Efficient and Effective Retrieval

Hang Li, Chuting Yu, Ahmed Mourad, Bevan Koopman, Guido ZucconarXiv 2024

TL;DR

TPRF (Transformer-based Pseudo-Relevance Feedback) is a lightweight retrieval method designed to run on resource-constrained hardware like CPUs and mobile devices. By processing dense vectors instead of raw text, it achieves massive speedups (up to 100x) and a significantly smaller memory footprint compared to state-of-the-art PRF models, with only a marginal loss in retrieval effectiveness.

What Problem Does This Paper Address?

In modern Information Retrieval, Dense Retrieval (using bi-encoders) has become a standard for efficiency. However, to get the best results, researchers often use Pseudo-Relevance Feedback (PRF)—a technique where the system takes the top-ranked results from an initial search and uses them to "refine" the original query for a second, more accurate search.

The problem is that current state-of-the-art PRF methods for dense retrievers (like ANCE-PRF) are computationally heavy. They typically concatenate the text of the query with the text of the top-$k$ passages and feed them into a large, pre-trained language model (like BERT or RoBERTa) at query time. This creates two major bottlenecks:

  1. Latency: Running BERT-scale inference on text at query time is slow, especially on CPUs.
  2. Memory: These models are large (500MB+), making them unsuitable for "edge" environments like smartphones, smartwatches, or cheap cloud instances without GPUs.

Methods

The authors propose TPRF, which shifts the PRF process from the "text domain" to the "vector domain."

Instead of re-encoding passage text, TPRF takes the dense embeddings (vectors) already produced by the initial retriever. The core of the model is a "vanilla" (non-pretrained) Transformer encoder.

Key technical steps include:

  • Vector Stacking: The dense representation of the query is stacked with the dense representations of the top-$k$ feedback passages to form an input matrix.
  • Positional Encoding: The authors apply standard positional encodings to the passage vectors to help the model understand their initial rank (e.g., the 1st result is likely more relevant than the 10th).
  • Lightweight Architecture: Because the model isn't processing raw text, it can be much smaller. The authors experimented with configurations as small as 6 transformer layers and 4 attention heads.
  • Training: The model is trained using a supervised cross-entropy loss with hard negative sampling, teaching the transformer how to aggregate feedback signals to produce a new, optimized query vector.

Datasets

The researchers evaluated TPRF using standard IR benchmarks:

  • TREC Deep Learning 2019 & 2020: These datasets provide graded relevance assessments for queries.
  • MS MARCO: A massive passage corpus (~8.8 million passages) used for both the retrieval pool and training the transformer.

Key Insights and Ideas

  • Text is the Bottleneck: The most expensive part of modern PRF isn't the feedback logic itself, but the act of turning text back into vectors. By staying in the vector space, TPRF bypasses the most costly inference steps.
  • Pre-training isn't Mandatory: Interestingly, TPRF does not use a pre-trained model. A small transformer trained from scratch on the specific task of "vector aggregation" is sufficient to improve retrieval results.
  • Superior Scalability: In text-based PRF, increasing the number of feedback passages ($k$) quickly hits the token limit of models like BERT (usually 512 tokens). TPRF scales much more gracefully; even with $k=100$ passages, the latency remains low because it is only processing a few extra vectors rather than hundreds of extra words.

As shown in Figure 2, the latency of text-based ANCE-PRF plateaus only because it hits an input limit, while TPRF remains significantly faster across all depths:

Figure 2: Query latency for the PRF models as a function of the PRF depth 𝑘.

Key Results

The authors compared TPRF against the base ANCE retriever and the heavy ANCE-PRF model.

  • Efficiency: TPRF is "blazing fast" on a commodity CPU. While ANCE-PRF takes roughly 100 seconds to process 100 queries, TPRF does it in a fraction of a second.
  • Model Size: The most effective TPRF models are around 300MB, with a ultra-light version reaching just 62.7MB—significantly smaller than the 503MB required for ANCE-PRF.
  • Effectiveness: While ANCE-PRF remains the "effectiveness king," TPRF consistently outperforms the base retriever (ANCE). In many cases, the gap between TPRF and the much heavier ANCE-PRF is not statistically significant (see Table 1).
Table 1: Effectiveness of dense PRF methods.

Figure 1 further illustrates this trade-off, showing TPRF models (open circles) clustered in the high-speed/low-latency zone compared to the high-effectiveness/high-latency ANCE-PRF (solid black dot):

Figure 1: Relationship between effectiveness (measured as nDCG@10 and R@1000), query latency and model size for PRF methods, across datasets. For ANCE-TPRF, we display different configurations (w.r.t. number of layers and attention heads).

Limitations and Future Work

  • The Effectiveness Gap: There is still a small performance penalty for choosing efficiency. For applications where every fraction of a percentage point in accuracy matters and hardware is no object, text-based PRF is still superior.
  • Hyperparameter Exploration: The authors noted that the effectiveness of TPRF can vary based on the feedback depth ($k$), and they suggest further investigation into optimizing this parameter.
  • Generalization: While the method is "retriever agnostic," this paper primarily tested it with ANCE. Future work could explore how well it pairs with other popular dense retrievers like ColBERT or DPR.

Summary updated

BibTeX
@misc{li2024tprf,
  author = {Hang Li and Chuting Yu and Ahmed Mourad and Bevan Koopman and Guido Zuccon},
  title = {{TPRF: A Transformer-based Pseudo-Relevance Feedback Model for Efficient and Effective Retrieval}},
  year = {2024},
  eprint = {2401.13509},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2401.13509},
}
Figure