On Entity Identification in Language Models

Masaki Sakata, Benjamin Heinzerling, Sho Yokoi, Takumi Ito, Kentaro Inui

Abstract

Large Language Models (LLMs) demonstrate a remarkable ability to recall facts, yet the internal structure of their entity knowledge remains poorly understood. This paper investigates "Entity Identification"—the process by which models map diverse textual mentions to singular internal concepts. By analyzing several state-of-the-art LLMs, the researchers demonstrate that entities are represented in compact, linearly separable subspaces within early transformer layers. Furthermore, the study establishes a direct link between the quality of these internal representations and the model's factual consistency.

Introduction: The Problem of Entity Mapping

While LLMs can process vast amounts of text, they must navigate a complex "many-to-many" relationship between real-world entities and the language used to describe them. This research addresses two fundamental challenges:

  1. Mention Ambiguity: A single surface form (e.g., "Oxford") can refer to multiple distinct entities (a university, a city, or a location in the US).
  2. Mention Variability: A single entity (e.g., the "Māori All Blacks") can be referred to by numerous distinct strings ("NZ Maori," "New Zealand Maori Rugby," etc.).
Visualizing the core challenges of Mention Ambiguity and Mention Variability.

Without a mechanism to map these varied mentions to a unified internal "concept," a model's knowledge base remains fragmented, leading to inconsistencies in factual retrieval.

Methodology

The study evaluates five Transformer-based models: GPT-2, Llama-2 (7B/13B), Llama-3 (8B), and Mistral (7B). The researchers employed several analytical techniques:

  • Clustering Metrics: F1 scores derived from Purity and Inverse Purity were used to quantify how well mentions of the same entity cluster together.
  • Dimensionality Analysis: Linear Discriminant Analysis (LDA) was applied to identify the minimal subspace required for entity identification.
  • Linear Probing: Simple linear classifiers were trained to predict entity labels from internal hidden states.
  • Patchscopes: This technique involves "patching" an entity representation from one context into another to test the model's disambiguation capabilities.
  • Representational Similarity Analysis (RSA): Used to compare the geometric structure of entity representations across different model architectures.

The ZELDA-TRAIN dataset provided the ground truth, linking hundreds of thousands of sentences to specific Wikidata IDs.

Key Insights: The Geometry of Entities

The 20-Dimension Subspace

A striking finding of this research is the extreme compactness of entity information. While modern LLMs utilize hidden states with thousands of dimensions (e.g., 4,096), the researchers discovered that entity-identifying information is concentrated in a subspace of approximately 20 dimensions. Reducing the representation to this small fraction of the original space preserves nearly all identification performance.

Entity identification performance (F1 Score) as a function of representation dimensionality.

Temporal Dynamics: Early Identification

Entity identification is not a late-stage process. It typically peaks around layer 8 in a 32-layer model (the first 20-25% of the network). In later layers, the separation between entities often decreases slightly as the model transitions from abstract conceptualization to specific next-token prediction.

The Platonic Representation Hypothesis

The study suggests that different models may be converging toward a shared internal "map" of the world. Entity representations across models like Llama and Mistral were found to be highly correlated, indicating that as models scale and improve, they discover similar structural representations of real-world entities.

Results and Impact on Consistency

  • High Identification Performance: LLMs achieved high AUC scores (0.8-0.9 for ambiguity; 0.66-0.8 for variability), significantly outperforming non-contextual baselines.
  • Linear Separability: Linear probing achieved F1 scores near 0.9, suggesting that entity information is organized in a simple, "readable" linear fashion.
  • Factual Consistency: The quality of internal clustering directly predicts model reliability. When entity mentions exhibit high variability, word prediction consistency was observed to drop from 71% to 39%. This identifies poor entity organization as a root cause of model "hallucinations."

Limitations and Future Directions

The current study focuses exclusively on English-language models and data. Future research should investigate whether these entity clusters are language-agnostic (e.g., mapping "Tokyo" and "東京" to the same subspace). Additionally, the authors suggest exploring how these subspaces evolve in larger-scale models (70B+ parameters) and whether overlapping representations might be beneficial for encoding hierarchical relationships between entities.

Summary updated

BibTeX
@inproceedings{sakata2025entity,
  author = {Masaki Sakata and Benjamin Heinzerling and Sho Yokoi and Takumi Ito and Kentaro Inui},
  title = {{On Entity Identification in Language Models}},
  booktitle = {Annual Meeting of the Association for Computational Linguistics},
  year = {2025},
}
Figure