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

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

Abstract

Pre-trained language models (PLMs) like BERT and RoBERTa have revolutionized NLP but continue to struggle with rare entities due to subword tokenization. Existing knowledge-enhanced PLMs attempt to bridge this gap through massive extra pre-training or complex alignment with external Knowledge Graphs, which are computationally expensive and difficult to adapt across domains. We introduce PELT (Pluggable Entity Lookup Table), a lightweight, "plug-and-play" method that aggregates a model's own internal output representations into a lookup table. PELT achieves state-of-the-art results on relation classification and knowledge probes while requiring only 0.2%–5% of the pre-computation cost of previous methods.

Introduction

Standard pre-trained language models are surprisingly adept at "remembering" facts, but they possess a significant blind spot: rare entities. Because these models utilize a limited vocabulary of subwords (typically 30k–60k units), a rare entity—such as a specific chemical compound or a niche historical figure—is broken down into meaningless fragments. This fragmentation prevents the model from forming a coherent semantic representation of the entity.

Existing solutions, often termed "Knowledge-Enhanced PLMs," usually involve extensive extra pre-training to align external Knowledge Graphs (like Wikidata) with the model’s internal vector space. These methods are computationally intensive, often requiring thousands of GPU hours, and lack flexibility when moving between specialized domains, such as from general Wikipedia text to biomedical research papers.

Methodology: The PELT Workflow

The core innovation of PELT is a simple "revisit" to the Masked Language Modeling (MLM) objective. The authors observed that in models like BERT, the input word embeddings and the output representations reside in essentially the same vector space. PELT leverages this by extracting knowledge already latent within the model's deeper layers.

The PELT workflow: aggregating masked token output representations to form an entity embedding.

The process consists of three main steps: 1. Aggregation: To create an embedding for a specific entity (e.g., "COVID-19"), the system identifies sentences where that entity appears in a large corpus. The entity is masked, the sentences are processed by the PLM, and the model's output representations for those masked positions are collected. 2. Lookup Table Construction: These output representations are averaged to create a single, high-quality vector for that entity, which is then stored in the "Lookup Table." 3. Plugging In: During inference or fine-tuning, when the model encounters an entity, the corresponding PELT embedding is "plugged in" as a supplemental input. Specifically, the PELT embedding is inserted in brackets immediately following the original subwords (e.g., “Most people with COVID-19 (COVID-19_PELT_VECTOR) have a dry cough.”).

Because these vectors are derived from the model’s own internal logic, they are natively compatible without the massive "alignment" training required by previous methods.

Efficiency and Domain Adaptation

One of PELT's most significant advantages is its extreme efficiency. While competing models like LUKE or KEPLER require between 160 and 3,800 GPU hours of pre-computation, PELT achieves comparable or superior results in just 7 hours.

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

Furthermore, PELT offers unparalleled domain flexibility. Because the lookup table is pluggable, researchers can swap tables on the fly. For instance, a biomedical table can be used for medical research papers, while a Wikipedia-based table can be used for general news analysis, all without retraining the underlying language model.

Experimental Results

The researchers evaluated PELT across several demanding benchmarks, including FewRel 1.0 & 2.0 (few-shot relation classification), Wiki80, and LAMA (knowledge probes).

  • Relation Classification: On the FewRel 2.0 biomedical task, PELT improved RoBERTa’s accuracy by +7.1% in the 10-way 1-shot setting, consistently outperforming "heavier" models like ERNIE and KEPLER.
  • Knowledge Probing: In the LAMA benchmark, PELT significantly improved the model's ability to predict missing facts, proving that supplemental embeddings help the model navigate its own factual memory.
  • Rare Entity Performance: The largest gains were observed for rare entities (appearing fewer than 50 times in training), where PELT improved fact recall by nearly 3.8 points over vanilla RoBERTa.

Conclusion and Limitations

PELT demonstrates that PLMs already "know" about entities in their deeper layers; the method simply provides a way to extract that knowledge and feed it back into the input layer where it is most effective. While PELT is highly efficient and architecture-agnostic (working across BERT, RoBERTa, and BART), it does rely on the quality of an external "Entity Linker" to identify terms in text. Additionally, while computationally cheap, maintaining a lookup table for millions of entities requires more storage space than a standard PLM. Future work may explore more sophisticated aggregation methods or dynamic integration with entity linking systems.

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