An Experimental Study on Pretraining Transformers from Scratch for IR

Carlos Lassance, Hervé Déjean, Stéphane Clinchant

Abstract

The prevailing paradigm in neural Information Retrieval (IR) involves finetuning large-scale Pretrained Language Models (PLMs) like BERT, which are trained on massive, general-purpose corpora. This study challenges the necessity of such "foundation models" for IR tasks. By pretraining Transformer architectures from scratch directly on target retrieval collections, we demonstrate that specialized models can match or exceed the performance of general-purpose models, particularly in first-stage ranking. Our findings suggest that collection-specific statistics are often more critical than broad "world knowledge," offering a path toward more efficient and transparent search systems.

Introduction

In recent years, the standard approach to building neural search engines has relied on the transfer learning "recipe": take a model pretrained on the entire internet (e.g., Wikipedia, BookCorpus) and finetune it for a specific retrieval task. The underlying assumption is that a model must first acquire a broad understanding of human language and general knowledge to be effective at searching.

However, Information Retrieval has unique requirements that differ from general natural language understanding. Effective retrieval depends heavily on understanding term importance, document statistics, and the specific vocabulary of a collection. This paper investigates whether the "bigger is always better" philosophy of foundation models is truly necessary for IR, or if smaller, specialized models trained on a fraction of the data can achieve superior results.

Methodology

The researchers compared standard PLMs, such as BERT and DistilBERT, against Transformer models pretrained from scratch using only the documents within the target retrieval collections.

Architectures and Training

The study evaluated 6-layer (MLM 6L) and 12-layer (MLM 12L) Transformer architectures. The primary pretraining objective was standard Masked Language Modeling (MLM). For sparse retrieval models (specifically SPLADE), the authors introduced a "middle-training" step called MLM+FLOPS. This approach adds a regularization term during the pretraining phase to encourage the model to produce sparse, computationally efficient representations from the outset.

Ranking Paradigms

The evaluation covered three dominant neural IR paradigms:

  1. Dense Retrieval (DPR): Bi-encoders that map queries and documents into a shared dense vector space.
  2. Sparse Retrieval (SPLADE): Models that learn to expand queries and documents into a high-dimensional sparse vocabulary space.
  3. Reranking (Cross-Encoders): High-precision models that process query-document pairs simultaneously to determine relevance.

Experimental Results

The models were tested across a diverse set of benchmarks to evaluate general performance, domain specificity, and multilingual capabilities.

General Retrieval: MSMARCO

On the MSMARCO passage retrieval task, a 6-layer model pretrained solely on the MSMARCO collection (MLM+FLOPS 6L) achieved an MRR@10 of 38.2. This significantly outperformed the standard DistilBERT-based SPLADE model, which reached 37.3, despite the latter having the benefit of massive external pretraining.

Domain Specificity: TripClick

To test performance in specialized domains, the researchers used the TripClick health/medical dataset. The "from scratch" sparse retrieval models outperformed established domain-specific models like SciBERT and PubMedBERT, suggesting that local collection statistics are more valuable than broad domain knowledge for first-stage retrieval.

Multilingual Performance: Mr-TyDi

In multilingual settings (Arabic, Russian, and Japanese), local monolingual models trained from scratch outperformed MContriever, a state-of-the-art model trained on a massive multilingual corpus. For example, on the Russian subset, the local model achieved 65.0 MRR@100 compared to MContriever's 59.7.

Zero-Shot Generalization: BEIR

Surprisingly, sparse models (SPLADE) pretrained from scratch showed robust generalization to new, unseen domains. In several instances on the BEIR benchmark, these specialized models outperformed their BERT-based counterparts, challenging the notion that general pretraining is required for robustness.

Discussion

The "World Knowledge" Myth

The results suggest that for first-stage ranking—the process of identifying an initial set of candidate documents—the co-occurrence statistics and term distributions of the specific collection are more impactful than the "world knowledge" embedded in foundation models.

Efficiency and Transparency

Pretraining these specialized models is remarkably efficient. Training took between 6 hours and 1 day on 8 NVIDIA A100 GPUs. This is a tiny fraction of the computational cost required to train a foundation model from scratch. Furthermore, using local data provides better transparency and control over potential biases compared to "black box" models trained on the open web.

The Reranking Gap

A notable exception to the success of local pretraining was found in Cross-Encoders. For the final reranking stage, models still benefit from the deep linguistic understanding provided by large-scale general pretraining. Bridging this performance gap for rerankers using only local data remains a challenge for future research.

Conclusion

This study demonstrates that for many IR applications, particularly first-stage retrieval, massive foundation models are not a prerequisite for high performance. By pretraining smaller Transformers directly on target collections, researchers and practitioners can build search engines that are more efficient, more specialized, and often more effective than those relying on general-purpose PLMs. This shift encourages a move toward data-centric IR, where the specific characteristics of the search collection take center stage.

Summary updated

BibTeX
@inproceedings{lassance2023experimental,
  author = {Carlos Lassance and Hervé Déjean and Stéphane Clinchant},
  title = {{An Experimental Study on Pretraining Transformers from Scratch for IR}},
  booktitle = {ECIR},
  year = {2023},
  url = {https://openreview.net/forum?id=z9tpH4J3ml},
}
Figure