Causal Analysis of Syntactic Agreement Neurons in Multilingual Language Models

Aaron Mueller, Yu Xia, Tal Linzen · DOI

Introduction

Large Language Models (LLMs) demonstrate a sophisticated grasp of grammatical structures, yet the internal mechanisms driving this capability remain largely opaque. Traditional methods for investigating these mechanisms often rely on "probing classifiers"—auxiliary models trained to predict grammatical features from an LLM's internal representations. While useful, these methods are inherently correlational; they indicate that grammatical information is present, but they do not prove that the model actually utilizes that information to generate its output.

This research addresses this gap by applying causal mediation analysis to pinpoint the specific neurons responsible for subject-verb agreement in multilingual models. Furthermore, it explores how model architecture—specifically the difference between Autoregressive Language Models (ALMs) and Masked Language Models (MLMs)—influences the organization and cross-lingual sharing of these "syntax neurons."

Methodology

To move beyond correlation, the researchers employed Causal Mediation Analysis (CMA). This technique involves active manipulation of the model's internal state to observe the direct impact on its predictions.

Counterfactual Perturbations and NIE

The core of the approach involves "counterfactual perturbations." For a given sentence (e.g., "The doctor near the cars..."), the researchers identify the model's prediction for the singular verb. They then "flip" the activations of specific neurons to the values they would have held if the subject were plural ("The doctors..."). By measuring the Natural Indirect Effect (NIE), the study quantifies how much a specific neuron or set of neurons contributes to the model's final grammatical choice.

Structural Variations

The study tested three distinct syntactic structures to evaluate the robustness of these neurons:

  1. Simple Agreement: "The athlete investigates..."
  2. Prepositional Phrase (PP) Interference: "The manager behind the bikes observes..."
  3. Relative Clause (RC) Interference: "The farmers that the parent loves confuse..."

Experimental Setup

The researchers utilized a controlled set of synthetic stimuli translated into five languages: English, French, German, Dutch, and Finnish. These stimuli were designed to isolate subject-verb agreement and prevent the model from relying on simple word associations or semantic cues. To ensure the results were not artifacts of the tokenizer, the study also included "short-word" versions of the datasets where subjects and verbs were represented by single tokens.

Two primary model architectures were compared:

  • mBERT: A Masked Language Model (MLM).
  • XGLM: An Autoregressive Language Model (ALM).

Key Insights

The "Two-Pattern" Rule

A consistent finding across all tested languages and models was the existence of two distinct groups of neurons. One group specialized in "short-range" agreement, where the subject and verb are adjacent. A separate, distinct group handled "long-range" agreement, where intervening phrases (like PPs or RCs) separate the subject from the verb. This suggests that LLMs do not use a single monolithic mechanism for syntax but rather specialized circuits for different levels of structural complexity.

Architecture and Cross-Lingual Overlap

The study revealed a striking difference in how ALMs and MLMs organize multilingual knowledge.

  • ALMs (XGLM): These models showed significant neuron overlap across languages. A neuron identified as a "syntax neuron" for English was highly likely to serve the same function for French or German.
  • MLMs (mBERT): Conversely, mBERT showed almost no overlap. It appears to learn separate, language-specific "silos" for syntactic machinery, even when the underlying grammatical rules are similar across the languages.

Sparsity and Negative Interference

The research found that syntax neurons are significantly more "sparse" in MLMs. In mBERT, only approximately 1.0% of neurons are required to account for the model's total effect in simple agreement tasks. In contrast, GPT-2 (an ALM) required roughly 17.5% of its neurons to achieve the same effect.

Interestingly, while mBERT contains neurons that are highly sensitive to syntax, it often performs worse than ALMs in behavioral tests. The researchers discovered this is due to "negative interference": mBERT contains a large number of "noisy" neurons that provide signals contradicting the specialized syntax neurons, effectively drowning out the correct grammatical signal.

Conclusion and Future Work

This causal analysis demonstrates that model architecture fundamentally dictates how syntactic information is localized and shared across languages. While ALMs favor a more universal, cross-lingual representation of syntax, MLMs opt for specialized, language-specific circuits.

Future research is needed to expand these findings beyond Western European languages and to move from identifying individual neurons to mapping entire "circuits" or functional regions. Additionally, addressing the "single-token constraint" will be vital for understanding how these models handle the more complex morphology found in many of the world's languages.

Summary updated

BibTeX
@inproceedings{mueller2022causal,
  author = {Aaron Mueller and Yu Xia and Tal Linzen},
  title = {{Causal Analysis of Syntactic Agreement Neurons in Multilingual Language Models}},
  booktitle = {CoNLL},
  year = {2022},
  doi = {10.18653/v1/2022.conll-1.8},
}
Figure