TRELM: Towards Robust and Efficient Pre-training for Knowledge-Enhanced Language Models

Junbing Yan, Chengyu Wang, Taolin Zhang, Xiaofeng He, Jun Huang, Wei Zhang, Longtao Huang, Hui Xue

Abstract

Knowledge-Enhanced Pre-trained Language Models (KEPLMs) utilize external knowledge to enhance language understanding. Previous models facilitated knowledge acquisition by incorporating pre-training tasks learned from relation triples in knowledge graphs. However, these models often fail to prioritize learning embeddings for entity-related tokens, and updating all parameters in KEPLMs is computationally demanding. This paper introduces TRELM, a Robust and Efficient Pre-training framework for KEPLMs. We observe that text corpora contain entities following a long-tail distribution, where rare entities are suboptimally optimized and hinder pre-training. To tackle this, we employ a robust approach to inject knowledge triples and a knowledge-augmented memory bank to capture valuable information. Moreover, we demonstrate that updating a small subset of neurons in the feed-forward networks (FFNs) that store factual knowledge is both sufficient and efficient. Specifically, we utilize dynamic knowledge routing to identify knowledge paths in FFNs and selectively update parameters. Experimental results show that TRELM achieves at least a 50% reduction in pre-training time and outperforms other KEPLMs in knowledge probing and language understanding tasks.

Introduction

Standard Pre-trained Language Models (PLMs) like BERT and RoBERTa demonstrate exceptional linguistic capabilities but often lack the structured "world knowledge" found in Knowledge Graphs (KGs). While KEPLMs attempt to bridge this gap by injecting KG triples, they face two primary challenges: Knowledge Noise and Training Inefficiency. Indiscriminate knowledge injection can lead to redundancy or the introduction of irrelevant facts, while updating every model parameter for sparse factual updates is computationally wasteful. TRELM addresses these issues through a "surgical" approach to knowledge injection and parameter updates.

Methods

TRELM introduces three core innovations to improve both the robustness and efficiency of knowledge enhancement:

  1. Noise-aware Knowledge Injection: Instead of uniform injection, TRELM utilizes a Semantic Importance (SI) score to prioritize entities critical to a sentence's meaning. A Contrastive Knowledge Assessing (CKA) loss ensures the model distinguishes correct factual relations from distractors.
  2. Knowledge-augmented Memory Bank (KMB): To address the "long-tail" distribution of entities, the KMB stores local (context-specific) and global (corpus-wide) representations. This stabilizes the learning of rare entities and accelerates convergence.
  3. Dynamic Knowledge Routing (DKR): Based on the premise that factual knowledge resides in Feed-Forward Networks (FFNs), TRELM identifies specific "knowledge paths" using attribution methods. During pre-training, only these paths are updated, significantly reducing computational overhead.
The TRELM framework architecture, highlighting its three main modules: Important Entity Detection, Knowledge-augmented Memory Bank, and Dynamic Knowledge Routing.

Experimental Setup

The model was pre-trained on English Wikipedia aligned with Wikidata5M (3M+ entities, 822 relations). Evaluation spanned several benchmarks:

  • Knowledge Probing: LAMA and LAMA-UHN (Google-RE, T-REx).
  • Knowledge-aware Tasks: Open Entity (Entity Typing) and TACRED (Relation Extraction).
  • General Understanding: GLUE benchmark.

Results and Discussion

TRELM demonstrates that sparse, targeted updates are not only sufficient but superior for factual injection.

Efficiency and Convergence

TRELM achieves a 50% reduction in pre-training time, reaching convergence in approximately one day compared to two days for previous state-of-the-art models like DKPLM. This efficiency stems from the DKR mechanism and the stabilizing effect of the Memory Bank.

Performance on Knowledge Tasks

TRELM consistently outperforms both standard PLMs and existing KEPLMs on knowledge probing tasks. On the LAMA benchmark, TRELM achieved an average improvement of +4.2% over standard BERT.

Comparison of TRELM against various PLMs and KEPLMs on knowledge probing tasks. TRELM achieves state-of-the-art accuracy across Google-RE and T-REx datasets.

In downstream tasks, TRELM set new state-of-the-art marks with an F1 score of 73.36% on TACRED and 78.0% on Open Entity. These results confirm that filtering for "important" entities and using a dual-memory approach effectively mitigates noise while enhancing factual recall.

Conclusion

TRELM provides a robust and efficient framework for building knowledge-enhanced models. By focusing on "quality over quantity" in knowledge injection and utilizing dynamic routing for parameter updates, it breaks the typical trade-off between training efficiency and model performance. Future work will explore scaling these mechanisms to larger model architectures and optimizing the initial overhead of attribution calculations.

Summary updated

BibTeX
@inproceedings{yan2024trelm,
  author = {Junbing Yan and Chengyu Wang and Taolin Zhang and Xiaofeng He and Jun Huang and Wei Zhang and Longtao Huang and Hui Xue},
  title = {{TRELM: Towards Robust and Efficient Pre-training for Knowledge-Enhanced Language Models}},
  booktitle = {International Conference on Computational Linguistics},
  year = {2024},
  url = {https://openreview.net/forum?id=y60Ii2QX74},
}
Figure