Entities as Experts: Sparse Memory Access with Entity Supervision

Thibault Févry, Livio Baldini Soares, Nicholas FitzGerald, Eunsol Choi, Tom Kwiatkowski

Introduction

Standard language models (LMs) like BERT or GPT store factual knowledge implicitly within their parameters. However, this knowledge is often "smeared" across the network, making it difficult for the model to distinguish between similar entities (e.g., "Charles Darwin" the scientist vs. "Charles River" the body of water). Previous attempts to address this usually involve injecting fixed, pre-trained embeddings from external knowledge bases.

The authors of Entities as Experts (EAE) argue that this approach is suboptimal. They propose a novel Transformer architecture that learns its own entity representations directly from text. By explicitly linking text to an internal "entity memory," EAE captures specific contexts while maintaining a sparse, efficient memory access pattern.

Methodology

The EAE architecture interleaves standard Transformer layers with a specialized Entity Memory Layer. The process consists of four main stages:

  1. Mention Detection: The model processes input text through initial Transformer layers. A BIO (Beginning, Inside, Outside) classifier identifies spans of text that likely refer to entities.
  2. Sparse Memory Retrieval: For each detected mention, the model generates a "pseudo-entity embedding" based on the span's context. This embedding queries a massive memory bank containing representations for 1 million unique entities, retrieving the top-$k$ most relevant matches.
  3. Integration: Retrieved entity representations are projected and summed back into the token-level representations, which then proceed through the remaining Transformer layers.
  4. Supervised Training: Unlike many memory-augmented models, EAE is explicitly supervised during pre-training to perform entity linking. It is trained on Wikipedia to ensure that mentions (e.g., "Charles Darwin") correctly trigger the retrieval of the corresponding memory slot.
The EAE architecture integrates a sparse entity memory layer between standard Transformer blocks to store and retrieve entity-specific knowledge.

Experimental Setup

EAE was pre-trained on English Wikipedia, covering 32 million contexts and 1 million unique entities. Evaluation was conducted across several benchmarks:

  • Knowledge Probing: LAMA (Language Model Analysis) for factual recall via cloze tasks.
  • Open-Domain QA: TriviaQA and WebQuestions.
  • Relation Extraction: A revisited version of TACRED.
  • Entity Typing: Ultra-fine entity typing dataset.

Results and Analysis

EAE demonstrates that specialized memory can outperform massive parameter scaling for factual knowledge tasks.

Performance on TriviaQA

EAE (367M parameters) achieved an Exact Match (EM) score of 43.2% on TriviaQA, outperforming the significantly larger T5-11B model (42.3%), which contains roughly 30 times more parameters. This efficiency highlights the benefits of sparse memory access over dense parameter storage.

Factual Recall and Scaling

On LAMA probes, EAE consistently outperformed BERT-base and BERT-large on entity-heavy tasks like T-REx and SQuAD. Analysis shows that EAE's performance is closely tied to entity frequency and mention density.

Performance analysis on TriviaQA: (a) Accuracy vs. answer frequency in Wikipedia; (b) Accuracy vs. number of mentions in the question; (c) Accuracy vs. question length.

As illustrated in the figure above, EAE's accuracy improves significantly as the frequency of an entity in the training set increases. Furthermore, EAE scales better than T5 as the number of mentions in a question grows, suggesting it effectively pools knowledge from multiple entities to arrive at an answer.

Discussion and Limitations

While EAE offers significant advantages in parameter efficiency and factual accuracy, several limitations remain:

  • Fixed Vocabulary: The model is restricted to a pre-defined vocabulary of 1 million entities and cannot handle "out-of-vocabulary" entities.
  • Non-Entity Knowledge: EAE struggles with facts not tied to specific entities, such as general concepts or dates, as seen in its lower performance on the ConceptNet sub-task of LAMA.
  • Mention Sensitivity: Performance is highly dependent on the accuracy of the mention detection and linking stages. Errors in these initial steps prevent the model from accessing its specialized "expert" memory.

Future work may explore methods for handling rare or unseen entities and integrating broader knowledge sources beyond Wikipedia entities.

Summary updated

BibTeX
@inproceedings{fevry2020entities,
  author = {Thibault Févry and Livio Baldini Soares and Nicholas FitzGerald and Eunsol Choi and Tom Kwiatkowski},
  title = {{Entities as Experts: Sparse Memory Access with Entity Supervision}},
  booktitle = {Conference on Empirical Methods in Natural Language Processing},
  year = {2020},
  doi = {10.18653/v1/2020.emnlp-main.400},
}
Figure