Pre-training for Ad-hoc Retrieval: Hyperlink is Also You Need

Zhengyi Ma, Zhicheng Dou, Wei Xu, Xinyu Zhang, Hao Jiang, Zhao Cao, Ji-Rong Wen · DOI

Introduction

While pre-trained language models like BERT have set new standards across natural language processing, their application to ad-hoc retrieval remains challenging. Standard pre-training objectives, such as Masked Language Modeling (MLM), focus on local linguistic patterns rather than the global relevance matching required to rank a document against a short query. Previous attempts to bridge this gap often relied on synthetic "pseudo-queries" generated from random sentences, which frequently lack the intent and structure of real-world human searches.

This paper introduces HARP (Pre-training for ad-hoc Hetrieval with Anchor texts and Hyperlinks), a framework that leverages the inherent structure of the web. By treating anchor texts as human-curated queries and their target pages as relevant documents, HARP provides a high-quality, naturally occurring supervision signal for information retrieval (IR).

The HARP Framework

The core philosophy of HARP is that hyperlinks represent a "goldmine" of human-generated relevance data. When a user creates a link, the anchor text serves as a concise summary of the destination page, effectively acting as a pseudo-query.

The HARP framework consists of a two-stage process: offline pre-training using hyperlink-based tasks followed by fine-tuning on specific ranking data.

Pre-training Objectives

HARP introduces four novel self-supervised tasks designed to mimic real-world search scenarios:

  1. Representative Query Prediction (RQP): The model learns to distinguish between an anchor text (the "positive query") and random words sampled from the destination page (the "negative query").
  2. Query Disambiguation Modeling (QDM): This task requires the model to use the context surrounding an anchor text to identify the correct destination page, addressing the ambiguity inherent in short queries (e.g., distinguishing "Apple" the company from "Apple" the fruit).
  3. Representative Document Prediction (RDP): In sentences with multiple links, the model predicts which destination page is most central to the sentence's meaning based on the importance of the anchor text.
  4. Anchor Co-occurrence Modeling (ACM): This task leverages the semantic relationship between different anchors appearing in the same sentence, assuming they point to related topics.
Detailed view of the four hyperlink-based pre-training tasks: RQP, QDM, RDP, and ACM.

These tasks are trained jointly with standard MLM, allowing the model to develop IR-specific matching capabilities without losing general linguistic understanding.

Experimental Evaluation

Datasets and Setup

The model was pre-trained on a cleaned version of English Wikipedia, containing approximately 15.5 million articles and their internal linking structure. Evaluation was conducted on two major benchmarks:

  • MS MARCO Document Ranking: A large-scale dataset featuring 3.2 million documents and real-world user queries.
  • TREC 2019 Deep Learning Track: A benchmark with fine-grained relevance labels for complex retrieval evaluation.

Key Results

HARP demonstrated superior performance over traditional IR models (BM25) and existing pre-trained baselines like BERT and PROP. On the MS MARCO dataset, HARP achieved a 6.4% improvement in MRR@100 over PROP. Notably, HARP showed exceptional few-shot performance, significantly outperforming BERT when fine-tuned on as few as 5 to 20 queries. This suggests that the hyperlink-based pre-training provides a robust foundation for retrieval that generalizes well even with limited labeled data. An ensemble version of the model reached an MRR@100 of 0.4711 on the MS MARCO leaderboard.

Discussion and Future Work

The success of HARP highlights the value of "contextual semantics" in pseudo-query generation. By considering the entire source sentence rather than just the anchor text, the model captures the nuanced intent behind a link.

However, some limitations remain. The current model relies on the high-quality, structured environment of Wikipedia. Future research could explore methods to handle the noisier, potentially spammy hyperlinks found in the broader web. Additionally, scaling the architecture to larger model sizes and distinguishing between different types of links (e.g., navigational vs. informational) could further enhance performance.

Conclusion

HARP demonstrates that hyperlinks are a powerful, underutilized resource for pre-training retrieval models. By aligning pre-training tasks with the actual challenges of ad-hoc retrieval, HARP provides a more effective starting point for building state-of-the-art search systems.

Summary updated

BibTeX
@inproceedings{ma2021pre,
  author = {Zhengyi Ma and Zhicheng Dou and Wei Xu and Xinyu Zhang and Hao Jiang and Zhao Cao and Ji-Rong Wen},
  title = {{Pre-training for Ad-hoc Retrieval: Hyperlink is Also You Need}},
  booktitle = {ACM International Conference on Information and Knowledge Management},
  year = {2021},
  doi = {10.1145/3459637.3482286},
}
Figure