Abstract
Traditional language model pretraining typically treats text as a collection of independent documents, failing to capture the interconnected nature of human knowledge. We present LinkBERT, a novel pretraining approach that leverages the graph structure of a corpus—such as hyperlinks and citations—to bridge knowledge across document boundaries. By placing linked documents into the same training context and introducing a Document Relation Prediction (DRP) objective, LinkBERT achieves significant improvements in multi-hop reasoning and specialized domain tasks. Notably, in the biomedical field, BioLinkBERT-large outperforms significantly larger models, including GPT-3, on expert-level medical examinations.
Introduction
Most modern language models (LMs), such as BERT, are trained on individual documents or random pairs of sentences. While this approach is effective for capturing local context, it ignores a fundamental property of information: it is interconnected. Human knowledge is often fragmented across different sources; for example, a Wikipedia article on a specific historical event might link to separate articles explaining the biographies of the key figures involved.
Standard LMs often struggle with "multi-hop" reasoning because they rarely encounter these disparate but related pieces of information within the same context during training. This creates a gap in the model's ability to capture dependencies that span across documents. LinkBERT addresses this by viewing a text corpus as a document graph, where nodes represent documents and edges represent human-curated links.
Methodology
LinkBERT introduces three primary innovations to the standard pretraining pipeline to better capture cross-document relationships:
1. Linked Contexts
During pretraining, the model is fed input windows containing segments from different documents. Instead of choosing these segments randomly, LinkBERT specifically samples segments from documents that are linked via hyperlinks (in Wikipedia) or citations (in PubMed). This forces the model to process related but distinct information sources simultaneously.
2. Document Relation Prediction (DRP)
To replace the traditional Next Sentence Prediction (NSP) objective, the authors propose Document Relation Prediction. In this self-supervised task, the model must classify the relationship between two segments as one of three categories:
- Contiguous: The segments are from the same document.
- Linked: The segments are from two different documents that share a link.
- Random: The segments are from unrelated documents.
3. Diversity-Aware Sampling
To prevent the model from over-fitting to "hub" documents—pages like "United States" or "Science" that have thousands of incoming links—the researchers implemented a sampling strategy where the probability of selecting a linked document is inversely proportional to its in-degree. This ensures a more diverse exposure to the knowledge graph.
Experimental Setup
The researchers evaluated LinkBERT across two distinct domains to test its versatility:
- General Domain: Pretrained on Wikipedia and BookCorpus. Evaluation focused on the MRQA benchmark (including multi-hop datasets like HotpotQA) and the GLUE benchmark.
- Biomedical Domain: Pretrained on PubMed abstracts to create BioLinkBERT. Evaluation utilized the BLURB benchmark and the MedQA-USMLE (U.S. Medical Licensing Examination) questions.
Key Insights and Results
The Power of Human-Curated Salience
The study found that training on linked documents is significantly more effective than training on documents that are merely "lexically similar" (sharing keywords). Hyperlinks and citations represent human judgments of relevance, providing a high-quality signal that helps the model learn to "flow" attention across document boundaries.
Superior Multi-Hop Reasoning
LinkBERT demonstrated a marked improvement in complex reasoning tasks. It achieved a +5% absolute improvement in F1 score on HotpotQA and TriviaQA compared to standard BERT. Furthermore, LinkBERT showed greater robustness than vanilla BERT when distracting or irrelevant documents were introduced into a question-answering context.
Domain Expertise and Efficiency
One of the most significant findings was the performance of BioLinkBERT-large. Despite having only 340 million parameters, it set new state-of-the-art records on the BLURB benchmark and achieved 50.7% accuracy on the MMLU-professional medicine task. This outperformed much larger models, including GPT-3 (38.7%) and UnifiedQA (43.2%), demonstrating that domain-specific structural pretraining can be more effective than massive scale alone.
Few-Shot Performance
In data-constrained environments, LinkBERT proved highly efficient. With only 10% of training data, it showed a 15% relative error reduction over BERT, suggesting that the link-based pretraining allows the model to internalize more usable knowledge "out of the box."
Limitations and Future Directions
While LinkBERT shows great promise, its efficacy is dependent on the existence of a structured link graph. While common in academic and encyclopedic corpora, such links may be sparse in general web crawls or private enterprise data. Additionally, as with all models trained on public data, LinkBERT may reflect biases present in its source material.
Future research may explore using LinkBERT to enhance the "retriever" components in retrieval-augmented generation (RAG) systems, as the model's ability to recognize document relationships makes it an ideal candidate for identifying relevant context across large datasets.
Summary updated