NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Break It Down: Evidence for Structural Compositionality in Neural Networks

Michael A. Lepori, Thomas Serre, Ellie Pavlick

TL;DR

Researchers have long debated whether neural networks are just massive "template matchers" or if they actually decompose complex problems into modular subroutines. This paper provides compelling evidence for structural compositionality: using model pruning, the authors show that networks often isolate specific sub-tasks into distinct, modular subnetworks that can be removed without breaking the rest of the model's logic.

What Problem Does This Paper Address?

In the "Great Debate" of AI, one side argues that human-like reasoning requires explicit symbolic mechanisms (logic gates and discrete rules), while the other argues that neural networks can learn these patterns implicitly.

While neural networks excel at vision and language, they are often criticized as "black boxes" that solve tasks by matching new inputs to memorized templates rather than "understanding" the underlying structure. This paper shifts the focus from behavior (can the model generalize?) to mechanics (how is the solution implemented in the weights?). The authors ask: Does a neural network solve a task like identifying a blue circle by having a distinct "blue" module and a "circle" module, or does it just learn a single, entangled "blue-circle" template?

Conceptual overview of structural compositionality and the ablation approach.

Methods

The authors introduce the concept of structural compositionality and test it using a "mechanistic interpretability" approach.

The three-step experimental pipeline: training, subnetwork discovery, and ablation.

Their experimental pipeline consists of three main steps:

  1. Base Model Training: They train standard architectures (ResNet50, BERT) on tasks that require combining two subroutines (e.g., an "Inside-Contact" task where an object must be both inside another and in contact with it).
  2. Subnetwork Discovery: Using a technique called continuous sparsification (a form of differentiable pruning), they search for the smallest set of weights (a subnetwork) that can perform just one of the subroutines (e.g., just the "Inside" check).
  3. Double Dissociation (Ablation): To prove modularity, they perform a "causal intervention." They ablate (remove) the discovered subnetwork. If the model is truly compositional, removing the "Inside" subnetwork should destroy the model's ability to process "Inside" logic while leaving the "Contact" logic perfectly intact.

Datasets

The study spans both vision and language domains to ensure the findings are broadly applicable:

  • Vision: They extended the "odd-one-out" datasets from Zerroug et al. (2022). These involve identifying which of four images breaks a compositional rule based on three subroutines: contact, inside, and number.
  • Language: They used subsets of the Marvin & Linzen (2019) benchmarks to create odd-one-out tasks based on syntactic rules: Subject-Verb Agreement and Reflexive Anaphora. These require the model to track the "number" (singular vs. plural) of specific words across long distances in a sentence.

Key Insights and Results

  • Modularity is Emergent: Neural networks, despite having no explicit "symbolic" design, naturally tend to organize their weights into modular sub-units to solve sub-problems. Most models didn't exhibit perfect task decomposition, but the evidence for modularity was statistically significant across almost all tests.
  • Subnetwork Performance & Ablation Impact: Discovered subnetworks achieved high accuracy on their target subroutine while performing at near-chance levels on the "Other" subroutine. When a subnetwork was removed, the performance on the target task dropped sharply, while performance on the non-targeted subroutine remained high. Using a Generalized Linear Model (GLM), the authors confirmed this difference was highly significant ($p < .001$).
  • The Power of Pretraining: One of the most striking findings was that unsupervised pretraining (like BERT's masked language modeling) makes this modularity much more consistent. Pretrained models were significantly more likely to develop clean, ablatable subnetworks than models trained from scratch.
  • Architecture Matters: While ResNets and BERT showed strong modularity, the Vision Transformer (ViT) struggled. In these specific experiments, ViT failed to reach the performance threshold required for the subnetwork analysis, suggesting that different architectures might have different "inductive biases" toward compositionality.

Limitations and Future Work

  • Manual Subroutine Definition: A major limitation is that the researchers had to define the subroutines (like "Inside" or "Singular Subject") in advance. They suggest that future work should use unsupervised methods to "discover" what subroutines the model has invented on its own.
  • Causal Interpretation: While the ablations are causal, the authors note that more work is needed to ensure these subnetworks are necessarily the only way the model solves the task.
  • Scaling Up: The tasks used were relatively controlled and "toy-like." Whether this structural modularity holds up in massive models (like GPT-4) solving highly abstract reasoning problems remains an open question.

Summary updated

BibTeX
@inproceedings{lepori2023break,
  author = {Michael A. Lepori and Thomas Serre and Ellie Pavlick},
  title = {{Break It Down: Evidence for Structural Compositionality in Neural Networks}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2023},
  url = {https://openreview.net/forum?id=rwbzMiuFQl},
}
Figure