Are representations built from the ground up? An empirical examination of local composition in language models

Emmy Liu, Graham Neubig

Introduction

A hallmark of human intelligence is compositionality: the ability to understand complex ideas by combining simpler components. For example, we understand "the brown dog" because we know the meanings of "brown" and "dog" and the rules for combining them. However, language is also replete with non-compositional "glitches," such as idioms like "kicking the bucket," which bear no literal relation to pails.

While Large Language Models (LLMs) demonstrate remarkable performance across diverse tasks, the internal mechanisms by which they construct phrase representations remain poorly understood. Do these models follow a "localist" principle—building a phrase's meaning solely from its immediate syntactic parts—or is the process more holistic? This research investigates the gap between the mathematical structure of model embeddings and human-perceived semantic meaning.

Methodology: Tree Reconstruction Error

To investigate compositionality, the authors introduce a technique called Tree Reconstruction Error. The core logic is that if a model is truly compositional, it should be possible to predict the vector representation of a parent phrase (e.g., "the dog") by applying a mathematical operation to the vectors of its immediate children ("the" and "dog") within a syntax tree.

Figure 1: Illustration of the Tree Reconstruction Error method. A parent phrase representation (X) is predicted from its children (A and B) using various mathematical probes.

The study evaluated several "probes" (mathematical functions) to test this predictability:

  • Arithmetic Probes: Simple addition of child vectors.
  • Learned Probes: Linear transformations, Affine transformations (linear combination plus a bias term), and Multi-Layer Perceptrons (MLP).
  • Representation Types: The researchers tested both the CLS token (a sequence-level summary) and AVG (the average of all token embeddings in the phrase).

Datasets

The study utilized two primary benchmarks:

  1. Penn Treebank (PTB): A collection of 823,000 phrases with annotated syntactic structures, providing the ground truth for phrase decomposition.
  2. CHIP (Compositionality of Human-annotated Idiomatic Phrases): A new benchmark introduced in this paper. It contains 1,001 phrases, including idioms (e.g., "devil's advocate") paired with literal phrases of identical syntactic structure (e.g., "baker's town"). Human annotators rated these on a scale of 1 (non-compositional) to 3 (fully compositional).

Key Results and Insights

The Affine "Sweet Spot"

The researchers found that an affine transformation is remarkably effective at predicting parent representations. As shown in the results for RoBERTa, these probes can reconstruct parent vectors with extremely high accuracy, often exceeding 0.99 cosine similarity.

Figure 3: Cosine similarity scores for different probes in RoBERTa. The top panel shows results for CLS representations, while the bottom shows AVG. Affine (aff) and MLP probes consistently achieve the highest predictability.

Right-Child Bias and Named Entities

Models exhibit a distinct right-child bias, where the representation of a phrase is influenced more heavily by the second child than the first (visible in the performance of the w2 probe vs w1 in Figure 3). Additionally, models correctly assign lower compositionality scores to named entities like "New York," recognizing them as single concepts rather than the simple sum of their parts.

The Human-Model Disconnect

The most significant finding is that mathematical predictability does not align with human semantic intuition. While a model's internal logic for combining vectors is highly consistent (and thus predictable by an affine probe), this predictability does not correlate well with human judgments of compositionality. For instance, the Spearman’s $\rho$ correlation between model predictability and human scores was weak (0.13–0.19 for RoBERTa). A phrase that a human considers highly idiomatic might be just as mathematically predictable to the model as a literal one.

Conclusion and Future Work

The study concludes that while LLMs build representations with a clear, almost mechanical internal logic, that logic is fundamentally different from the "ground up" semantic construction used by humans. While the paper identifies this misalignment, it does not propose a new training objective to bridge the gap. Future research may investigate how these compositional structures emerge during the training process or how they vary across different model layers. Ultimately, the high predictability of these models suggests they are "doing math" to combine words without necessarily capturing the nuance of literal versus idiomatic meaning.

Summary updated

BibTeX
@inproceedings{liu2022are,
  author = {Emmy Liu and Graham Neubig},
  title = {{Are representations built from the ground up? An empirical examination of local composition in language models}},
  booktitle = {Conference on Empirical Methods in Natural Language Processing},
  year = {2022},
  doi = {10.18653/v1/2022.emnlp-main.617},
}
Figure