Abstract
We present a method to represent input texts by contextualizing them jointly with dynamically retrieved textual encyclopedic background knowledge from multiple documents. We apply our method to reading comprehension tasks by encoding questions and passages together with background sentences about the entities they mention. We show that integrating background knowledge from text is effective for tasks focusing on factual reasoning and allows direct reuse of powerful pretrained BERT-style encoders. Moreover, knowledge integration can be further improved with suitable pretraining via a self-supervised masked language model objective over words in background-augmented input text. On TriviaQA, our approach obtains improvements of 1.6 to 3.1 F1 over comparable RoBERTa models which do not integrate background knowledge dynamically. On MRQA, a large collection of diverse QA datasets, we see consistent gains in-domain along with large improvements out-of-domain on BioASQ (2.1 to 4.2 F1), TextbookQA (1.6 to 2.0 F1), and DuoRC (1.1 to 2.0 F1).
Introduction
While large language models (LLMs) like BERT and RoBERTa excel at capturing linguistic patterns, they often struggle to retain the "long tail" of factual knowledge—specific details about obscure entities or niche events. Traditionally, researchers have addressed this by scaling up models to memorize more facts or by integrating structured Knowledge Graphs (KGs). However, KGs are difficult to maintain and require specialized architectures to fuse structured data with natural language.
This paper introduces TEK (Textual Encyclopedic Knowledge), a method that enhances Transformer-based models by dynamically retrieving and jointly encoding Wikipedia sentences related to entities mentioned in the input text. By treating background knowledge as raw text, the system leverages existing language understanding capabilities to bridge the knowledge gap.
Methodology
The TEK framework creates enriched representations through a multi-step process designed to turn the model into an "open-book" learner:
- Dynamic Retrieval: Given an input (a question and a passage), an entity linker identifies mentions of people, places, or concepts. It then pulls descriptive sentences from the corresponding Wikipedia pages.
- Relevance Ranking: To stay within the Transformer's token limit, retrieved sentences are ranked based on n-gram overlap with the input question.
- Joint Encoding: The input text and top-ranked background sentences are concatenated into a single sequence:
[CLS] Input Text [SEP] Entity: Background Sentence [SEP]. This allows the model to use self-attention to reason across the context and the facts simultaneously.
- TEK-Pretraining: To bridge the gap between standard single-document training and augmented multi-source input, the authors introduced a specialized pretraining stage using a Masked Language Model (MLM) objective on these augmented sequences.
Experimental Results
The model was evaluated on several challenging extractive Question Answering (QA) benchmarks, including TriviaQA and the MRQA Shared Task. The TEK-enriched models consistently outperformed standard RoBERTa baselines.
Key Insights
- Context Trade-off: The authors found a "sweet spot" for the input window, using 384 tokens for document context and 128 tokens for background knowledge. This suggests that a few well-chosen facts are more valuable than extra surrounding text.
- Out-of-Domain Generalization: Gains were most dramatic on datasets the model hadn't seen during training, such as BioASQ (biomedical). Wikipedia acts as a "bridge corpus," providing high-quality descriptions of medical entities that were not prevalent in the original training data.
- Qualitative Success: In 75% of cases where TEK outperformed the baseline, the answer was explicitly mentioned in the retrieved background text, proving the model successfully learned to extract and apply external information.
Conclusion
TEK demonstrates that textual background knowledge is a powerful, flexible alternative to structured databases. While effective, the system is currently limited by the retrieval bottleneck; its performance depends heavily on the quality of the entity linker. Future work may involve using more efficient retrieval or long-context Transformers to handle even larger volumes of background information.
Summary updated