Papers
Topics
Authors
Recent
Search
2000 character limit reached

Fine-Grained Analysis of Shared Syntactic Mechanisms in Language Models

Published 24 Apr 2026 in cs.CL | (2604.22166v1)

Abstract: While LLMs demonstrate sophisticated syntactic capabilities, the extent to which their internal mechanisms align with cross-constructional principles studied in linguistics remains poorly understood. This study investigates whether models employ shared neural mechanisms across different syntactic constructions by applying causal interpretability methods at a granular level. Focusing on filler-gap dependencies and negative polarity item (NPI) licensing, we utilize activation patching to identify the functional roles of specific attention heads and MLP blocks. Our results reveal a highly localized and shared mechanism for filler-gap dependencies located in the early to middle layers, whereas NPI processing exhibits no such unified mechanism. Furthermore, we find that these mechanisms identified by activation patching generalize to out-of-distribution, while distributed alignment search, a supervised interpretability method, is susceptible to overfitting on narrow linguistic distributions. Finally, we validate our findings by demonstrating that the manipulation of the identified components improves model performance on acceptability judgment benchmarks.

Authors (2)

Summary

  • The paper demonstrates that filler-gap dependencies are processed by a sparsely localized set of attention heads, confirming a shared syntactic mechanism.
  • Activation patching is used to causally intervene at various network levels, yielding robust out-of-distribution insights compared to supervised methods.
  • The study finds that while filler-gap mechanisms are unified, NPI licensing relies on distinct, construction-specific contributions, informing downstream applications.

Fine-Grained Analysis of Shared Syntactic Mechanisms in LLMs

Introduction and Motivation

Understanding the extent to which autoregressive LLMs internalize and share syntactic mechanisms across diverse linguistic constructions is essential for both advancing mechanistic interpretability and theoretical linguistics. While prior work has established that LMs represent certain syntactic dependencies, the degree to which these mechanisms are implemented in a localized, shared fashion—particularly across disparate syntactic phenomena—remains ambiguous. This paper addresses these gaps with a causal interpretability analysis focusing on two major syntactic domains: filler-gap dependencies (FGDs) and negative polarity item (NPI) licensing, utilizing activation patching to dissect contributions of attention heads and MLP blocks.

Methodology

The analytical framework employs activation patching, a training-free causal intervention technique. For each syntactic construction, minimal sentence pairs are constructed, differing only in the presence or absence of a critical syntactic mechanism (such as a filler or licensor). Patching is performed at a variety of network granularity levels—attention heads, MLP blocks, layers, and full residual streams. The causal effect on model outputs (specifically, the prediction of syntactically licensed/unlicensed forms) is quantified via odds-ratio-based metrics that track the changes in output probabilities under patched activations.

Contrasted with supervised causal localization methods such as distributed alignment search (DAS), activation patching avoids dataset-specific overfitting and provides OOD-robust insights. Evaluations are performed across synthetic minimal-pair datasets, out-of-distribution splits, and naturally occurring sentences. Figure 1

Figure 1

Figure 1

Figure 1

Figure 1: Visual depiction of the localization of causal contributions in the residual stream for a filler-gap construction, indicating sharp increases at early-middle layers and focusing around specific attention heads.

Experimental Results

Shared Mechanisms in Filler-Gap Dependencies

Across all FGD constructions, the model exhibits highly localized and shared causal contributions, consistently mediated by a sparse subset of attention heads concentrated in early to middle layers (notably heads 7.5, 7.6, and 9.2 in Pythia 1B). Odds score distributions in the residual stream show abrupt increases exactly at these layers, suggesting a routing bottleneck for critical dependency propagation. Figure 2

Figure 2

Figure 2

Figure 2

Figure 2: Odds ratios for the EWhK (embedded wh-question, "know") construction residual stream, demonstrating sharply tuned contributions around the mid-layer bottleneck.

Critically, the same set of attention heads and layers are engaged across all FGD patterns, irrespective of surface variation, affirming the existence of a shared, construction-agnostic syntactic processing mechanism. The information flow analysis supports a scenario where fillers (e.g., “who”) are registered in early layers via MLP processing and then relayed to the relevant gap through mid-layer attention heads.

Lack of Shared Mechanisms in NPI Licensing

By contrast, NPI licensing does not exhibit an equally unified mechanism. The distribution of causal contributions is construction-specific—different NPI licensor environments (conditionals, quantifiers, scope items, etc.) yield odds score peaks in distinct sets of heads and layers. This heterogeneity suggests that the model’s handling of NPIs is tailored per construction, likely reflecting the additional complexity of integrating syntactic and semantic constraints for licensing.

Training Dynamics and Model Scaling

Analysis of training dynamics reveals that frequent FGD constructions are encoded earlier during model training, while rare ones (e.g., pseudo-cleft) converge more slowly. All converge on the same localized mid-layer mechanism, suggesting the shared circuit develops incrementally in response to data frequency.

Scaling to larger models (Pythia 2.8B, 6.9B; Gemma 3 1B, 12B) indicates the relative localization of causally central heads is preserved, while their layer positions shift earlier with increased model depth. The dimensionality (hidden size) does not notably alter the mechanism for FGDs.

Out-of-Distribution Generalization and Method Comparison

Supervised methods such as DAS fail to generalize: directions learned in-distribution lack efficacy OOD, confirming overfitting to specific lexical items or distributional artifacts. In contrast, training-free activation patching maintains causal localization and effect sizes with OOD data, demonstrating its utility for mechanistic discovery. Figure 3

Figure 3

Figure 3

Figure 3: Comparison of OOD generalization between activation patching and DAS for residual stream interventions, highlighting the superior faithfulness of training-free methods.

Steering Interventions and Syntactic Evaluation

Manipulating the discovered mid-layer attention heads (by scaling activation values upwards) results in systematic gains on BLiMP acceptability judgments for FGD-involving categories. The improvement is monotonic with increased activation scaling up to saturation. Notably, broader syntactic evaluations (e.g., general hierarchical dependencies) also benefit, implicating these heads as central to a wider range of syntax-sensitive model behaviors. Figure 4

Figure 4

Figure 4: BLiMP evaluation results (filler-gap category) as a function of activation scaling factor, showing monotonic accuracy improvement with increased scaling at critical heads.

Similar patterns hold on SyntaxGym and the HANS NLI challenge, underscoring the practical relevance of these heads for downstream tasks entailing long-distance dependencies and complex hierarchical reasoning.

Implications and Theoretical Impact

The evidence of a shared, sparsely localized mechanism for FGDs but not for NPIs refines our understanding of architectural specialization within decoder-based LMs. The results underline a principled architecture-dependent bottleneck for long-distance syntactic dependencies, reminiscent of hypotheses in psycholinguistics about limited-capacity routing mechanisms in human sentence processing.

Practically, these findings suggest that model editing or interpretability techniques targeting only a small set of attention heads can substantially modulate syntactic generalization, with potential applications in efficient model adaptation, debiasing, or capability enhancement. The contrast with NPIs indicates future research may need to address the distributed, context-specific nature of semantic-syntactic integration separately from pure syntax.

Conclusion

This work provides strong evidence that decoder-based LMs consolidate filler-gap dependencies within a compact set of shared attention heads situated in early to middle layers, with robust OOD validity and cross-constructional generality. In contrast, mechanisms for NPI licensing remain construction-specific and distributed. These insights sharpen our mechanistic understanding of LMs’ internal syntax representations, and offer concrete targets for future interpretability, control, and architecture-design studies.

Paper to Video (Beta)

No one has generated a video about this paper yet.

Whiteboard

No one has generated a whiteboard explanation for this paper yet.

Open Problems

We haven't generated a list of open problems mentioned in this paper yet.

Collections

Sign up for free to add this paper to one or more collections.

Tweets

Sign up for free to view the 1 tweet with 3 likes about this paper.