A Complexity-Based Theory of Compositionality

Eric Elmoznino, Thomas Jiralerspong, Yoshua Bengio, Guillaume Lajoie · DOI

Abstract

Compositionality is a fundamental trait of human cognition and a prerequisite for robust AI generalization. However, existing definitions are often binary or lack mathematical rigor. This paper introduces Representational Compositionality ($C(Z)$), a formal metric grounded in algorithmic information theory. By defining compositionality as the ratio between a representation's expressivity and the simplicity of its underlying grammar, the authors provide a quantitative framework applicable to both symbolic systems and high-dimensional neural representations.

Introduction

Compositionality—the principle that the meaning of a complex expression is determined by the meanings of its constituent parts and the rules for combining them—is widely regarded as essential for intelligence. Despite its importance, the field lacks a formal, measurable definition. Traditional "colloquial" definitions fail to account for degrees of compositionality, lack constraints against trivial lookup tables, and are difficult to apply to the continuous activation vectors of deep neural networks (DNNs). This paper aims to bridge this gap by providing a formal definition that is quantitative, grounded in information theory, and applicable to any representation.

The Representational Compositionality Framework

The core of the proposed theory is the definition of Representational Compositionality ($C(Z)$), expressed as a ratio of Kolmogorov complexities:

$$C(Z) = \frac{K(Z)}{K(Z|W)}$$

In this formulation, $K(Z)$ (Expressivity) is the length of the shortest program that outputs the representation $Z$. A more complex, expressive representation has a higher $K(Z)$. Conversely, $K(Z|W)$ (Simplicity of Description) is the length of the shortest program that reconstructs $Z$ from a sequence of discrete symbolic parts ($W$). This term accounts for the complexity of the "semantics" function $f$ and any reconstruction error.

The Representational Compositionality framework defines $C(Z)$ as a ratio of complexities, balancing expressivity against the simplicity of the mapping from symbolic parts.

Methods and Estimation

Since Kolmogorov complexity is theoretically uncomputable, the authors use practical deep learning tools to estimate these values. They employ Discrete Auto-encoders (such as VQ-VAEs) to find the "intrinsic language" ($W$) of a representation. To estimate description length, they use Prequential Coding, a method that calculates the description length of a model by incrementally training on data and summing the negative log-likelihood of each new point. This serves as a tractable proxy for $K(Z|W)$.

Key Insights: Compositionality as a Trade-off

A central finding is that high compositionality requires a representation to be both highly expressive (complex $Z$) and easily describable by simple rules (low $K(f)$). If a representation is simple but lacks structure, or complex but requires a massive "lookup table" to explain, its compositionality score remains low. This metric naturally rewards properties like modularity, disentanglement, and equivariance.

Example of how structured mappings (e.g., using word embeddings) lead to higher compositionality scores $C(Z)$ by organizing representations more efficiently.

The authors also demonstrate the failure of "topological similarity"—a common heuristic that correlates distances in symbol-space and representation-space. They show that this heuristic can incorrectly suggest that increasing vocabulary size or representation dimensionality makes a system less compositional, whereas $C(Z)$ remains robust.

Experimental Results

The theory was validated across three distinct settings:

  1. Synthetic Representations: In Context-Free Grammar (CFG) experiments, $C(Z)$ correctly decreased as the grammar's width and depth increased, matching the intuition that more complex grammars are less compositional.
  2. Emergent Languages: Language systems evolved through iterated learning (where models learn from the previous generation's output) achieved significantly higher $C(Z)$ scores than those trained normally, confirming that generational bottlenecks select for compositional structures.
  3. Natural Languages: Analysis of multilingual sentence embeddings for MS-COCO captions showed that French, Spanish, German, and Japanese are roughly equal in their expressive and compositional power, though Japanese showed a slightly higher relative score in this specific setup.

Conclusion and Future Work

By grounding compositionality in algorithmic information theory, this work provides a rigorous foundation for evaluating AI systems. While estimation sensitivity and computational costs remain challenges, the framework offers a path toward using $C(Z)$ as a regularizer during training. This could explicitly bias models toward learning more compositional, and thus more generalizable, representations.

Summary updated

BibTeX
@misc{elmoznino2024complexity,
  author = {Eric Elmoznino and Thomas Jiralerspong and Yoshua Bengio and Guillaume Lajoie},
  title = {{A Complexity-Based Theory of Compositionality}},
  year = {2024},
  eprint = {2410.14817},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2410.14817},
}
Figure