From Tokens to Lattices: Emergent Lattice Structures in Language Models

Bo Xiong, Steffen Staab · DOI

Introduction

Recent advancements in Natural Language Processing have shown that Masked Language Models (MLMs) like BERT encode vast amounts of world knowledge. However, the internal organization of this knowledge remains largely opaque. This paper demonstrates that MLMs do not merely learn token associations; they implicitly construct complex, hierarchical "concept lattices." By applying the mathematical framework of Formal Concept Analysis (FCA), the authors show how to extract these latent structures—including concepts that humans haven't even named—directly from a model's internal probability distributions.

The Problem: Beyond Human-Centric Ontologies

While we know that language models encode knowledge, the mechanism by which they organize this information into concepts remains a "black box." Most existing research focuses on checking if a model can identify human-defined categories like those in WordNet. This approach has two major flaws:

  1. It ignores "latent" concepts that exist in the data but aren't explicitly named by humans (e.g., "animals that both swim and hunt").
  2. It doesn't explain how the pretraining objective (predicting masked tokens) leads to this structured conceptualization.

The authors tackle these gaps by moving away from human-centric ontologies toward a purely mathematical definition of a concept: an abstraction of objects that share common attributes.

Methodology: Bridging Deep Learning and Formal Concept Analysis

The researchers bridge the gap between deep learning and Formal Concept Analysis (FCA). FCA is a mathematical theory that takes a "formal context" (a table of objects and their attributes) and derives a "concept lattice" (a hierarchy showing how these groups relate).

Key components of their approach, dubbed BertLattice, include:

  • The Distributional Hypothesis: They argue that MLMs learn concepts not from explicit definitions, but by observing shared linguistic contexts (attributes).
  • Cloze Probing: They use patterns like "[MASK] is an animal that can [MASK]" to query the model. By filling these masks with specific objects (e.g., "eagle") and attributes (e.g., "fly"), they estimate the conditional probability that an object possesses a certain attribute.
  • Probabilistic Triadic Context: Instead of a simple True/False table, they create a 3D tensor of probabilities (Object × Attribute × Pattern).
  • Lattice Reconstruction: They binarize these probabilities using a normalization threshold and apply FCA algorithms to build the final hierarchy.
A comparison of the Definitional vs. Distributional hypotheses. The authors follow the Distributional approach, where concepts are learned from shared attributes.

Datasets and Benchmarks

The authors introduced three new benchmarks to evaluate how well MLMs recover formal contexts across different domains:

  1. Region-language: Maps 165 administrative regions to 45 official languages (extracted from Wiki44k).
  2. Animal-behavior: A human-curated dataset of 354 animals and 25 distinct behaviors (e.g., "live on land," "lay eggs").
  3. Disease-symptom: Links 122 diseases to 33 symptoms (sourced from Kaggle).

These datasets are unique because they include both single-token and multi-token entities, providing a more realistic test for modern LLMs.

Key Insights: Interpretable Latent Structures

  • Implicit FCA: The paper mathematically argues that the MLM pretraining objective is essentially a form of latent structure learning. By minimizing the loss of predicting masked tokens, the model is forced to learn the "formal context" of the world described in its training data.
  • Discovery of Latent Concepts: The extracted lattices revealed concepts that aren't in standard dictionaries. For example, the model identified a "German and French speaking regions" concept (including Switzerland, Luxembourg, and Belgium) as a distinct parent class in the hierarchy.
  • Interpretable Embeddings: Unlike standard "black box" embeddings, the rows of the probability matrix used in this framework are dimensionally interpretable—each dimension corresponds to a specific, human-understandable attribute like "flyable" or "swimmable."
The probability matrix extracted from BERT shows interpretable associations between objects (animals) and behavioral attributes.

Key Results

  • Superior Reconstruction: The BertLattice method significantly outperformed a baseline that used standard hidden state distances (BertEmb). On the Region-language task, BertLattice achieved a Mean Reciprocal Rank (MRR) of ~0.84, compared to just ~0.34 for the baseline.
  • Domain Expertise Matters: While general BERT performed well on common knowledge, domain-specific models like BioBERT and PharmBERT were much more accurate at reconstructing the complex hierarchies of the Disease-symptom dataset.
  • Robustness: The authors found that min-max normalization was highly robust; even as the threshold for "truth" increased, the model's ability to classify concepts correctly remained stable.

Limitations and Future Work

Currently, the framework only handles one type of relationship at a time (e.g., "X has symptom Y"). The authors suggest extending this to multi-relational FCA to handle more complex scenarios, like a "Pizza lattice" involving both toppings and sauces. Additionally, while this study focused on Masked Language Models (like BERT), adapting this to causal/autoregressive models (like GPT-4) remains a challenge because they are designed to predict the next token rather than filling a gap in a fixed pattern. Finally, the quality of the extracted lattice depends heavily on the "cloze prompt" used; automating the discovery of informative patterns is a promising direction for future research.

Summary updated

BibTeX
@inproceedings{xiong2025from,
  author = {Bo Xiong and Steffen Staab},
  title = {{From Tokens to Lattices: Emergent Lattice Structures in Language Models}},
  booktitle = {International Conference on Learning Representations},
  year = {2025},
  url = {https://openreview.net/forum?id=md9qolJwLl},
}
Figure