Skip to main content
QUICK REVIEW

[Paper Review] Measuring Compositionality in Representation Learning

Jacob Andreas|arXiv (Cornell University)|Feb 19, 2019
Natural Language Processing TechniquesComputer Science47 references24 citations
TL;DR

This paper introduces tre, a differentiable, automated method for measuring compositionality in learned representations by optimizing over inferred primitives to reconstruct observed representations. It finds that while higher compositionality correlates with better generalization, it also correlates with lower overall performance, indicating trade-offs in representational design.

ABSTRACT

Many machine learning algorithms represent input data with vector embeddings or discrete codes. When inputs exhibit compositional structure (e.g. objects built from parts or procedures from subroutines), it is natural to ask whether this compositional structure is reflected in the the inputs' learned representations. While the assessment of compositionality in languages has received significant attention in linguistics and adjacent fields, the machine learning literature lacks general-purpose tools for producing graded measurements of compositional structure in more general (e.g. vector-valued) representation spaces. We describe a procedure for evaluating compositionality by measuring how well the true representation-producing model can be approximated by a model that explicitly composes a collection of inferred representational primitives. We use the procedure to provide formal and empirical characterizations of compositional structure in a variety of settings, exploring the relationship between compositionality and learning dynamics, human judgments, representational similarity, and generalization.

Motivation & Objective

  • To develop a general-purpose, automated, and quantitative method for measuring compositionality in learned representations, especially in vector or discrete code spaces.
  • To evaluate how compositionality evolves during training and relates to other model properties like generalization and representational similarity.
  • To assess whether compositional representations are necessary for out-of-distribution generalization.
  • To provide a formal, scalable, and reproducible framework for evaluating compositional structure without relying on manual or domain-specific analysis.

Proposed method

  • tre measures compositionality by treating primitive meaning representations as hidden variables and optimizing them to reconstruct observed representations via a differentiable, compositional model.
  • The method uses gradient descent to optimize over a set of primitive vectors and composition operations (e.g., sum, binding) to minimize reconstruction error.
  • It generalizes to continuous representations by allowing fractional token counts in the input string, enabling backpropagation through discrete operations.
  • The framework supports various composition types, including simple conjunctions, sparse (attribute, value) pairs, and non-commutative string generation.
  • It enables automatic mining of training runs to identify models with high or low compositionality and good generalization.

Experimental results

Research questions

  • RQ1How does compositionality in representations evolve during the training process, and how does it relate to other measurable model dynamics?
  • RQ2To what extent does model compositionality align with human judgments of compositional structure in inputs?
  • RQ3How does compositionality constrain representational similarity, and how does tre compare to other similarity-based analysis methods?
  • RQ4Is compositional representation necessary for effective generalization to out-of-distribution inputs?

Key findings

  • Compositionality, as measured by tre, is significantly correlated with lower generalization error (p < 1e-6), indicating better robustness to distribution shift.
  • Higher tre values are also strongly correlated with lower absolute performance (p < 1e-9), suggesting that compositional models often emerge from suboptimal communication strategies.
  • Even when restricting to successful training runs (reward > 0.5), the correlation between tre and generalization error remains significant (p < 1e-3), and between tre and performance (p < 0.05).
  • The method successfully identifies languages with both high compositionality and strong generalization, as shown in Figure 6, where tre values of 4.30 and 2.96 co-occur with similar train/test rewards (0.78/0.61 and 0.75/0.59 respectively).
  • Low-tre models often correspond to trivial strategies (e.g., fixed output regardless of input), which explains their poor performance despite possible structural simplicity.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.