Analogs of Linguistic Structure in Deep Representations

Jacob Andreas, Dan Klein

TL;DR

This paper demonstrates that deep neural networks trained on communication games spontaneously develop internal vector representations with "language-like" compositional structure, even without exposure to natural language data. By using human language as a semantic probe, the authors discover that simple linear transformations in the network's message space closely correspond to logical operations like negation, conjunction, and disjunction.

What Problem Does This Paper Address?

When deep neural networks are trained to communicate with one another to solve a task (e.g., an encoder sending a vector message to a decoder), they invent their own artificial "protocols." A long-standing question in AI is whether these emergent protocols develop structural properties akin to human language—specifically compositionality (the ability to combine simple concepts using operations like negation or conjunction to form complex meanings).

Understanding the internal structure of these representation spaces is notoriously difficult. The authors tackle this challenge by asking: Can we use human natural language not as a training signal, but as a post-hoc probe to decode and find geometric regularities within a neural network's private communication space?

Methods

The authors train a standard RNN encoder-decoder model on a reference game. The encoder (the "speaker") observes a world $W$ containing various geometric shapes with different attributes and a target subset of objects $X$. It generates a 64-dimensional message vector $f(W)$. The decoder (the "listener") receives this vector and attempts to reconstruct the target set $X$.

To evaluate whether the network's vectors share meaning with human language, the authors adopt a truth-conditional account of meaning from formal semantics:

  1. Tabular Meaning Representations (Denotations): Instead of comparing a human utterance and a model vector in just the original context, they evaluate both across a collection of alternative worlds. If a human expression (e.g., "everything but the blue squares") and a model's decoder output pick out the exact same objects across many different scenarios, they are considered semantically equivalent.
Figure 1: Overview of our task. Given a dataset of referring expression games, example human expressions, and their as- sociated logical forms, we compute explicit denotations both for the original task and in other possible tasks—giving rise to a truth-conditional representation of the natural language. We train a recurrent encoder–decoder model to solve the same tasks directly, and use the decoder to generate comparable truth-conditional representations of neural encodings.
  1. Probing for Vector Space Syntax: Once they align vector-utterance pairs with identical meanings, they test if logical operations correspond to simple geometric transformations. They use a least-squares regression to find linear operators (matrices) that transform a vector $f$ into a new vector $f'$ such that the decoder interprets the transformed vector as the logical negation ($\neg$), conjunction ($\wedge$), or disjunction ($\vee$) of the original.
Figure 2: Evaluating theories of model behavior. First, the encoder is run on an initial world (a), producing a represen- tation whose meaning we would like to understand (see Fig- ure 1). We then observe the behavior of the decoder holding this representation fixed but replacing the underlying world representation with alternatives like (b). We compare the true decoder output to a number of theories of its behavior. The random theory (d) outputs a random decision for every object. The literal theory (e) predicts that the decoder will output a positive label only on those objects that exactly match some object in the initial observation. The human theory (f) assigns labels according to the logical semantics of the utterance pro- duced by a human presented with the initial observation.

Datasets

The model is evaluated using the GENX dataset (FitzGerald et al., 2013). This dataset contains:

  • 273 instances of the communication game.
  • 4,170 human-generated natural-language referring expressions (e.g., "all green objects that are not a triangle").
  • Pre-annotated logical forms for each human expression.

The neural network itself is trained strictly on randomly generated scenes and target sets of the same format, completely isolated from the human language data.

Key Insights and Ideas

  • Language as a Post-Hoc Probe: Instead of using language to supervise the network, human language acts as a tool to map out and understand an independently learned representation space.
  • Spontaneous Syntax: Neural networks naturally optimize their internal spaces to support compositional concepts because it is an efficient way to solve coordinate communication tasks.
  • Linearity of Negation: Remarkably, logical negation behaves almost linearly in the representation space. Applying the learned negation matrix visually mirrors the vectors across a central point in the principal component space, effectively acting as a geometric "flip" switch for meaning.

Key Results

  • Human-RNN Alignment: A "human theory" (predicting RNN behavior based on the most common human logical form for a given scene) predicts the network's object-level decisions with 92% accuracy and matches the full multi-world table exactly 35% of the time (Table 1).
  • Negation Operator: The learned linear negation operator $\hat{N}$ achieves 97% agreement with true logical negation at the individual object level and 45% agreement across entire multi-world representations (Table 2).
  • Binary Operations: Conjunction and disjunction operators also show strong structural alignment, with disjunction achieving 92% object-level accuracy. However, their full-table agreement is lower (19% for disjunction, 37% for conjunction), indicating these binary operations are functional but not perfectly linear across the entire space.

Limitations and Future Work

  • Non-linearity of Coordination: While negation maps beautifully to a linear transformation, binary operations (conjunction and disjunction) are less tightly captured by purely linear transformations, suggesting the network implements them via more complex, non-linear functions.
  • Hierarchical Recursion: The paper only tests single operations in isolation. The authors note that a major open question is how the network handles nested, hierarchical transformations (e.g., evaluating the vector equivalent of $\neg(A \wedge B)$), which is a crucial next step for verifying true recursive syntax.

Summary updated

BibTeX
@inproceedings{andreas2017analogs,
  author = {Jacob Andreas and Dan Klein},
  title = {{Analogs of Linguistic Structure in Deep Representations}},
  booktitle = {Conference on Empirical Methods in Natural Language Processing},
  year = {2017},
  url = {https://openreview.net/forum?id=HyWsIMzOWS},
}
Figure