A Simple but Effective Pluggable Entity Lookup Table for Pre-trained Language Models

Deming Ye, Yankai Lin, Peng Li, Maosong Sun, Zhiyuan Liu

Abstract

Standard pre-trained language models (PLMs) like BERT and RoBERTa face significant challenges when representing rare entities due to their fixed subword vocabularies. While existing knowledge-enhancement techniques attempt to address this by aligning models with external Knowledge Graphs or through extensive extra pre-training, these methods are computationally prohibitive and lack domain flexibility. We introduce PELT (Pluggable Entity Lookup Table), a lightweight, "on-demand" framework that constructs entity embeddings by aggregating a model’s own output representations. PELT requires only a fraction of the computation time of previous methods—reducing pre-computation from thousands of hours to just seven—while delivering superior performance on knowledge-heavy tasks and seamless domain adaptation.

Introduction: The Rare Entity Problem

Modern NLP relies heavily on PLMs, yet these models often struggle with "rare entities"—specific terms like niche medical compounds or minor historical figures that are not well-represented by standard subword tokens. To overcome this, researchers have previously turned to "knowledge enhancement," which typically involves massive extra training cycles to teach the model new entity-specific tokens. These approaches are not only expensive (often requiring thousands of GPU hours) but also brittle; transitioning to a specialized domain like medicine often necessitates restarting the entire training process.

The PELT Framework: Recovering Knowledge

The core innovation of PELT lies in its "recovery" mechanism. Instead of training new embeddings from scratch, PELT leverages the insight that a PLM’s output representations already contain contextualized knowledge about entities.

The process follows three main steps:

  1. Aggregation: For a specific entity (e.g., "COVID-19"), the system identifies its occurrences in a large corpus. These occurrences are masked, and the model's output representations for these masked positions are collected.
  2. Lookup Table Construction: These representations are averaged to create a single, high-quality embedding for the entity.
  3. Pluggable Injection: When the model encounters the entity in a new context, PELT inserts this pre-computed embedding immediately after the entity's original subwords.
Overview of the PELT embedding construction process.

This "plug-and-play" architecture allows the model to access its own distilled knowledge as an additional input feature without requiring any changes to the underlying model parameters.

Efficiency and Domain Agility

One of PELT's most significant advantages is its extreme efficiency. Previous state-of-the-art models, such as KEPLER, require approximately 3,400 GPU hours to pre-compute entity information for a standard corpus. In contrast, PELT achieves comparable or superior results in just 7 hours.

Comparison of PELT with existing knowledge-enhanced models in terms of entity coverage and pre-computation time.

Furthermore, PELT offers unparalleled domain agility. Because the lookup tables are pluggable, they can be swapped based on the context. A user can plug in a Wikipedia-based table for general tasks or an S2ORC-based table for biomedical research, enabling rapid adaptation without retraining the core model.

Experimental Evaluation

The researchers evaluated PELT across several benchmarks, including Relation Classification (FewRel 1.0 and 2.0) and Knowledge Probing (LAMA).

  • Superior Accuracy: On the Wikipedia-based FewRel 1.0 task, RoBERTa equipped with PELT outperformed the vanilla model by +3.3% in the 10-way 1-shot setting.
  • Domain Adaptation: In the biomedical domain (FewRel 2.0), PELT demonstrated a massive +7.1% improvement over vanilla RoBERTa, significantly outperforming other knowledge-enhanced models that struggle with domain-specific vocabularies.
  • Rare Entity Performance: Analysis showed that PELT provides the most substantial gains for entities appearing fewer than 50 times in the training data—the specific area where standard PLMs typically underperform.

Conclusion and Future Work

PELT demonstrates that we do not necessarily need to teach PLMs new information to improve their handling of rare entities; rather, we need to help them organize the knowledge they already possess. By providing a lightweight, efficient, and pluggable way to inject entity embeddings, PELT offers a practical solution for knowledge-intensive NLP tasks.

Future research may focus on reducing the dependency on external Entity Linking tools and exploring dynamic embeddings that can adapt to the specific sentence context in real-time. Nevertheless, PELT stands as a major step toward more efficient and adaptable knowledge-enhanced language modeling.

Summary updated

BibTeX
@inproceedings{ye2022simple,
  author = {Deming Ye and Yankai Lin and Peng Li and Maosong Sun and Zhiyuan Liu},
  title = {{A Simple but Effective Pluggable Entity Lookup Table for Pre-trained Language Models}},
  booktitle = {Annual Meeting of the Association for Computational Linguistics},
  year = {2022},
  doi = {10.18653/v1/2022.acl-short.57},
}
Figure