Probing for the Usage of Grammatical Number

Karim Lasri, Tiago Pimentel, Alessandro Lenci, Thierry Poibeau, Ryan Cotterell

TL;DR

Just because a probe can "read" linguistic information from a model's hidden states doesn't mean the model actually uses it. This paper introduces a "usage-based" probing framework that surgically erases specific encodings to prove they are functional, revealing that BERT uses distinct, disjoint linear subspaces to track grammatical number for nouns versus verbs and passes this information indirectly through intermediate tokens.

What Problem Does This Paper Address?

In the world of interpretability, "probing" is a standard tool used to see if a model like BERT "knows" something (e.g., part-of-speech or grammatical number). However, traditional diagnostic probing has a major flaw: it only shows that information is extractable, not that it is functional. A model might represent a property as a side effect of training without ever relying on it to make a prediction—a "spurious encoding."

The authors address this by combining diagnostic probing with causal interventions. They want to move beyond asking "Is the information there?" to "Does the model actually use this specific encoding to solve a task?" By identifying and then erasing these encodings, they can observe the direct impact on the model's behavior, effectively mapping the "functional" circuitry of the model.

Methods

The researchers propose a three-step usage-based probing setup:

  1. Select a Behavioral Task: They chose Subject-Verb Agreement (e.g., "The boy goes..." vs. "The boys go..."), a task that strictly requires knowledge of grammatical number.
  2. Identify Encodings: They use linear diagnostic probes to find the subspaces where number information is stored. They measure this using $\mathcal{V}$-information, a metric for extractable information.
  3. Causal Intervention (Amnesic Probing): This is the core innovation. They use Iterative Null-space Projection (INP) to "erase" the identified encoding from the model's representations during a forward pass. If the model's performance on the agreement task tanks after erasure, the encoding is confirmed as "functional."

Additionally, they used Attention Pruning to block information flow between specific tokens (like the subject and the verb) to see how the model moves data across layers.

Datasets

The study utilizes the Linzen et al. (2016) number agreement dataset, which consists of English sentences extracted from Wikipedia. Each sentence is labeled with the positions of the "cue" (the subject noun) and the "target" (the verb that must agree with it), along with their grammatical number.

Key Insights and Ideas

  • Functional vs. Spurious: The authors confirm that the linear encodings found by probes are indeed functional. Erasing them leads to a significant drop in task performance, aligning perfectly with the loss of extractable information.
  • Disjoint Encodings: Surprisingly, BERT does not use a single "number" concept. Nouns and verbs have disjoint functional encodings. As shown in Figure 1, the directions BERT uses to represent number for nouns are often orthogonal or even opposite to those used for verbs in the early layers.
Cosine similarities between learned parameter vectors. Nouns and verbs show very different encoding directions in early layers.
  • The "Number" Journey: Information about the subject's number is extractable from the very first layer for nouns, but for "masked" verbs (the target position), it only starts appearing around layer 4 and peaks by layer 7.
$\mathcal{V}$-information across layers. Masked verbs (green) gradually acquire number information as it flows from the subject.
  • Indirect Information Flow: The model doesn't just look directly from the verb to the noun. When the authors cut direct attention from the verb to the noun, performance only dropped by ~10%. However, cutting attention from all tokens to the noun caused a ~40% drop. This suggests the "number" signal is broadcast to intermediate tokens (like determiners or prepositions) before reaching the verb.

Key Results

  • Erasure Impact: Erasing number information at the subject position (the cue) is only harmful in the first 8 layers. Conversely, erasing it at the verb position (the target) only hurts performance after layer 9. This suggests a clear "hand-off" window where the information transfer is completed.
  • Linearity: The high success of linear interventions suggests that BERT's internal mechanism for handling grammatical number is remarkably linear, rather than relying on highly complex, non-linear manifolds.
  • Attention Dynamics: Figure 4 illustrates that the most critical layers for transferring number information are layers 2 through 8.
Performance drops after attention removal. Cutting all tokens to the cue (right) is far more damaging than just target-to-cue attention (left).

Limitations and Future Work

  • Scope: The study is limited to one linguistic property (grammatical number) and one model (BERT-base). It remains to be seen if these "disjoint encoding" patterns hold for more complex properties like semantic roles or in larger models like GPT-4.
  • Erasure Specificity: While the authors used control experiments with random directions (Table 1), there is always a risk that amnesic probing removes more information than intended, potentially damaging the model's general "health" rather than just the target property.
  • Future Directions: The authors suggest that more granular analysis of individual attention heads is needed to fully map the "circuitry" of how these linear encodings are moved and transformed across the transformer blocks.

Summary updated

Abstract

A central quest of probing is to uncover how pre-trained models encode a linguistic property within their representations. An encoding, however, might be spurious-i.e., the model might not rely on it when making predictions. In this paper, we try to find encodings that the model actually uses, introducing a usage-based probing setup. We first choose a behavioral task which cannot be solved without using the linguistic property. Then, we attempt to remove the property by intervening on the model's representations. We contend that, if an encoding is used by the model, its removal should harm the performance on the chosen behavioral task. As a case study, we focus on how BERT encodes grammatical number, and on how it uses this encoding to solve the number agreement task. Experimentally, we find that BERT relies on a linear encoding of grammatical number to produce the correct behavioral output. We also find that BERT uses a separate encoding of grammatical number for nouns and verbs. Finally, we identify in which layers information about grammatical number is transferred from a noun to its head verb.
BibTeX
@inproceedings{lasri2022probing,
  author = {Karim Lasri and Tiago Pimentel and Alessandro Lenci and Thierry Poibeau and Ryan Cotterell},
  title = {{Probing for the Usage of Grammatical Number}},
  booktitle = {Annual Meeting of the Association for Computational Linguistics},
  year = {2022},
  doi = {10.18653/v1/2022.acl-long.603},
}
Figure