Skip to main content
QUICK REVIEW

[Paper Review] Characterizing Intrinsic Compositionality in Transformers with Tree Projections

Shikhar Murty, Pratyusha Sharma|arXiv (Cornell University)|Nov 2, 2022
Natural Language Processing TechniquesComputer Science13 citations
TL;DR

This paper proposes a parameter-free, unsupervised method to project any transformer's behavior into the space of tree-structured computations by measuring span contextual invariance (SCI), which identifies how invariant a span's representation is to its context. The method induces a binary tree structure and a tree-structuredness score that upper-bounds the fit between the transformer and any tree-structured model, showing that transformers become more tree-like during training and that higher tree-likeliness predicts better compositional generalization.

ABSTRACT

When trained on language data, do transformers learn some arbitrary computation that utilizes the full capacity of the architecture or do they learn a simpler, tree-like computation, hypothesized to underlie compositional meaning systems like human languages? There is an apparent tension between compositional accounts of human language understanding, which are based on a restricted bottom-up computational process, and the enormous success of neural models like transformers, which can route information arbitrarily between different parts of their input. One possibility is that these models, while extremely flexible in principle, in practice learn to interpret language hierarchically, ultimately building sentence representations close to those predictable by a bottom-up, tree-structured model. To evaluate this possibility, we describe an unsupervised and parameter-free method to \emph{functionally project} the behavior of any transformer into the space of tree-structured networks. Given an input sentence, we produce a binary tree that approximates the transformer's representation-building process and a score that captures how "tree-like" the transformer's behavior is on the input. While calculation of this score does not require training any additional models, it provably upper-bounds the fit between a transformer and any tree-structured approximation. Using this method, we show that transformers for three different tasks become more tree-like over the course of training, in some cases unsupervisedly recovering the same trees as supervised parsers. These trees, in turn, are predictive of model behavior, with more tree-like models generalizing better on tests of compositional generalization.

Motivation & Objective

  • To determine whether transformers trained on language data learn a tree-structured, compositional computation akin to human language processing.
  • To develop a method that assesses intrinsic compositionality without relying on gold syntax trees or training additional models.
  • To evaluate whether tree-structuredness in transformers correlates with better compositional generalization on out-of-distribution examples.
  • To uncover training dynamics of transformers that are invisible to standard supervision-based probes.

Proposed method

  • The method introduces span contextual invariance (SCI), measuring the distance between contextual and context-free representations of all sentence spans to quantify how invariant a span’s representation is to its context.
  • It uses a chart parsing algorithm to induce a binary tree structure from SCI scores, where each internal node corresponds to a span whose representation is most context-invariant.
  • The tree score is derived from the sum of SCI scores along the induced tree, serving as a functional projection of the transformer into the space of tree-structured models.
  • The approach is provably optimal under mild assumptions, upper-bounding the fit between the transformer and any tree-structured approximation.
  • The method is unsupervised and parameter-free, requiring no additional training or gold syntax, and operates solely on attention-based representations.

Experimental results

Research questions

  • RQ1Do transformers trained on language data learn a computation that is functionally equivalent to a bottom-up, tree-structured process?
  • RQ2Can we measure the degree to which a transformer’s internal computation is tree-like without relying on gold syntax trees?
  • RQ3Does increased tree-likeliness during training correlate with improved compositional generalization?
  • RQ4Can tree projections and tree-structuredness scores predict model behavior better than in-domain accuracy?

Key findings

  • Transformers for three sequence transduction tasks become progressively more tree-like during training, with tree projections aligning increasingly with gold syntax on two of the three datasets.
  • The induced trees reliably reflect the contextual dependence structure implemented by the transformer encoders, as validated by probing experiments.
  • Both the tree score and parsing F1 of the induced trees correlate more strongly with compositional generalization performance than in-domain accuracy, with all correlations being statistically significant (p < 10^-3).
  • On models with similar in-domain accuracy, the one with higher tree-structuredness score generalizes better to compositionally novel test configurations.
  • The method successfully recovers syntactic structures in an unsupervised manner, even without gold syntax, and reveals training dynamics invisible to standard supervised probes.

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.