Introduction
Knowledge-Enhanced Pre-trained Language Models (KEPLMs) represent a significant advancement in natural language processing, aiming to augment standard architectures like BERT or RoBERTa with structured factual information from Knowledge Graphs (KGs). By injecting triples such as <Steve Jobs, founder, Apple Inc.>, these models gain a deeper understanding of real-world entities. However, the process of knowledge injection is often hindered by two primary challenges: redundancy and knowledge noise.
Redundancy occurs when models repeatedly process facts about high-frequency entities they already understand well, neglecting the "long-tail" entities where external knowledge is most beneficial. Knowledge noise arises from polysemy; for instance, injecting facts about "Apple" the fruit into a sentence discussing "Apple" the technology company can degrade model performance. To address these issues, the KEHRL framework treats knowledge injection as a strategic, hierarchical decision-making process.
The KEHRL Framework
KEHRL (Knowledge-Enhanced language representations with Hierarchical Reinforcement Learning) introduces a two-tier reinforcement learning system designed to optimize which entities are selected for enhancement and which specific facts are integrated.
Hierarchical Reinforcement Learning Agents
The architecture utilizes two nested RL agents to manage the flow of information:
- High-Level RL (Reinforced Entity Position Detection): This agent evaluates a sentence to identify "essential" entity positions. By analyzing the model's internal state alongside prior knowledge (such as entity frequency), it prioritizes positions that offer the greatest potential for improving the model's contextual understanding.
- Low-Level RL (Reinforced Triple Semantic Refinement): Once an entity position is selected, the low-level agent examines candidate triples from the KG. It performs a binary "select or discard" action for each triple, ensuring that only contextually relevant facts—and not distracting noise—are integrated into the representation.
Reward Mechanism and Knowledge Combination
Both agents are trained using rewards derived from Masked Language Modeling (MLM). If the selected knowledge helps the model more accurately predict a masked token or entity, the agents receive a positive reward. Furthermore, the system employs a weighted combination strategy to balance "internal knowledge" (pre-existing model parameters) with "prior knowledge" (statistical corpus importance), effectively calibrating the learning trajectory.
Experimental Evaluation
The authors pre-trained KEHRL using English Wikipedia and WikiData5M. The model was evaluated across a diverse range of benchmarks, including knowledge probing and downstream NLP tasks.
Key Results
KEHRL demonstrated superior performance over existing state-of-the-art KEPLMs like KP-PLM and KALM. On the LAMA benchmark, it achieved an average improvement of 2.1 points across four datasets. In downstream applications, the gains were even more pronounced:
- Entity Linking: Surpassed the strongest baseline (KALM) by 3.8 F1 points.
- Relation Extraction (TACRED): Achieved a significant gain in Precision (+3.3) and F1 score (+1.8).
Ablation studies highlighted the necessity of the hierarchical structure. Removing the Triple Refinement module led to a performance drop of approximately 3.5 F1 points on the Open Entity task, confirming that filtering irrelevant triples is as critical as selecting the right entities.
Discussion and Insights
The success of KEHRL provides several key insights into the mechanics of knowledge injection:
- Selective Injection is Superior: Indiscriminate injection of all available triples can actually perform worse than no injection at all. Hard pruning via RL is more effective than "soft" attention mechanisms, which often fail to fully eliminate noise.
- The Long-Tail Advantage: The model benefits most from knowledge regarding rare entities. High-frequency entities are often already well-represented in the base model's parameters, making additional injection redundant.
- Hierarchical Synergy: The two-level approach mirrors natural language processing—identifying a relevant topic (high-level) before seeking specific details (low-level). This synergy allows the model to maintain cleaner semantic representations.
Limitations and Future Work
Despite its performance, KEHRL introduces computational complexity due to the simultaneous training of two RL agents alongside a transformer backbone. Additionally, the current implementation uses fixed hyperparameters for the number of entities and triples per sentence. Future research may explore more adaptive systems that adjust these parameters based on sentence complexity and the integration of unstructured textual descriptions to supplement structured KGs.
Summary updated