Introduction
Standard Large Language Models (LLMs) such as BERT and RoBERTa are frequently utilized as implicit knowledge bases, relying on the vast amounts of factual information memorized within their internal parameters during pre-training. However, this "black-box" approach to knowledge storage presents three significant challenges: inefficiency, staleness, and fragility.
First, storing billions of facts requires massive parameter counts, leading to high computational and environmental costs. Second, world knowledge is dynamic; updating a model's internal weights to reflect new information (e.g., a change in political leadership) typically requires expensive retraining. Finally, these models are often fragile, relying on linguistic patterns or "hunches"—such as associating a name with a specific nationality based on phonetics—rather than actual factual recall.
To address these issues, we present LM-CORE, a framework that decouples factual knowledge from the model's parameters by utilizing an external, searchable, and structured Knowledge Base (KB). By providing contextually relevant facts at inference time, LM-CORE creates a system that is more accurate, easier to update, and more robust to linguistic variations.
The LM-CORE Framework
LM-CORE functions by allowing the language model to "consult" a reference source before generating a response. The framework consists of three primary components:
1. Entity Span Masking
During the pre-training phase, rather than masking random tokens, LM-CORE utilizes Wikipedia hyperlinks to identify and mask specific entities (e.g., "DC Comics" or "Bob Kane"). This strategy forces the model to focus on learning and predicting factual relationships between entities rather than just linguistic syntax.
2. Contextual Knowledge Retrieval
When processing an input, the model employs a Named Entity Recognition (NER) tagger to identify key entities. It then queries an external structured Knowledge Base, such as Wikidata or YAGO, to fetch related "triples" (Subject-Relation-Object facts).
3. Fact Ranking and Integration
Because not all retrieved facts are relevant to the current context, LM-CORE ranks these triples based on their alignment with the input text's context and relationship types. The highest-ranked facts are converted into natural language sentences and appended to the original input text as a "cheat sheet," which the model uses to predict masked tokens.
Experimental Setup
LM-CORE was pre-trained on a December 2018 snapshot of English Wikipedia (~46.3M sentences) and evaluated against several benchmarks:
- Knowledge Bases: YAGO 4 (17M triples) and Wikidata5M (21M triples).
- Probing Tasks: The LAMA (Language Model Analysis) benchmark and LAMA-UHN (UnHelpful Names). LAMA-UHN is a more rigorous version of the benchmark that removes surface-level linguistic cues to test true factual recall.
- Downstream Tasks: Zero-Shot Relation Extraction (ZSRE) and Web Questions (WQ) for open-domain question answering.
Key Results and Insights
Superior Knowledge Recall
On the LAMA benchmark, LM-CORE achieved a Mean Precision (P@1) of 42.83%. This nearly doubles the performance of BERT-base (24.73%) and outperforms specialized knowledge-enhanced models like ERNIE and CoLAKE. Notably, LM-CORE (110M parameters) significantly outperformed much larger models like BERT-large (330M parameters), suggesting that efficient retrieval is more effective than increasing parameter scale.
Robustness to Linguistic Bias
Standard models are often misled by the "surface form" of names. In the LAMA-UHN subset, while competing models saw significant performance degradation, LM-CORE maintained and even slightly increased its relative performance. This confirms that the model relies on the provided structured facts rather than linguistic shortcuts.
Instant Updateability
One of the most significant advantages of LM-CORE is its ability to be updated without retraining. In an error analysis of 41 failed cases, researchers manually added the missing facts to the external KB. This allowed the model to correct its prediction in 36 out of 41 instances immediately. In a separate test, adding missing facts to the KB caused the model's accuracy to jump from 0% to 87.8% on those specific cases without any modifications to the model weights.
Downstream Performance
In Zero-Shot Relation Extraction, LM-CORE achieved an F1 score of 74.80, substantially outperforming the previous state-of-the-art RAG (Retrieval-Augmented Generation) model, which scored 49.95.
Limitations and Future Work
While LM-CORE represents a significant step forward, it remains dependent on the quality of its retriever. If the NER tagger fails to identify an entity or the KB lacks a specific fact, the model reverts to its internal weights. Additionally, the system currently struggles with polysemous entities (different entities sharing the same name) and commonsense reasoning (e.g., ConceptNet), as these relationships are more difficult to capture in simple triples than factual world knowledge.
Future research will focus on improving the retrieval module to handle complex, ambiguous queries and expanding the framework to incorporate more diverse types of external knowledge beyond entity-relation triples.
Summary updated