Abstract
Syntax is a latent hierarchical structure which underpins the robust and compositional nature of human language. In this work, we explore the hypothesis that syntactic dependencies can be represented in language model attention distributions and propose a new method to induce these structures theory-agnostically. Instead of modeling syntactic relations as defined by annotation schemata, we model a more general property implicit in the definition of dependency relations, syntactic substitutability. This property captures the fact that words at either end of a dependency can be substituted with words from the same category. Substitutions can be used to generate a set of syntactically invariant sentences whose representations are then used for parsing. We show that increasing the number of substitutions used improves parsing accuracy on natural data. On long-distance subject-verb agreement constructions, our method achieves 79.5% recall compared to 8.9% using a previous method. Our method also provides improvements when transferred to a different parsing setup, demonstrating that it generalizes.
Introduction
Large Language Models (LLMs) like BERT demonstrate a sophisticated grasp of syntax, yet extracting this knowledge into interpretable dependency trees remains a challenge. Existing approaches generally fall into two categories: supervised probing and zero-shot attention analysis. Supervised probes, while effective, risk confounding the model's inherent knowledge with the probe's own learning capacity. Conversely, direct attention analysis is often "noisy," as attention heads frequently prioritize lexical similarity or coreference over pure grammatical structure. This work introduces a method to distill a pure syntactic signal from internal attention distributions without additional training parameters.
Methods: Syntactic Substitutability (SSUD)
The proposed method, Syntactic Substitutability as Unsupervised Dependency Syntax (SSUD), is grounded in the "quasi-Kunze property." This principle suggests that if two words share a syntactic relationship, one can be replaced by another word of the same category without altering the underlying sentence structure.
The SSUD pipeline follows four primary steps:
- Target Sentence Selection: A base sentence is chosen for parsing.
- Substitution Generation: Using a Part-of-Speech (POS) tagger and BERT’s Masked Language Modeling (MLM) head, the system generates $k$ "syntactically invariant" sentences by swapping words for others in the same category.
- Attention Averaging: All generated sentences are processed by the model. The resulting attention distributions are averaged, which serves to "wash out" word-specific lexical noise and isolate the structural signal.
- Tree Induction: A Maximum Spanning Tree (MST) algorithm is applied to the averaged attention matrix to produce the final dependency parse.
Results and Discussion
Evaluation on standard benchmarks like WSJ10 and EN-PUD reveals significant improvements over baseline unsupervised methods.
Performance on Complex Structures
A key strength of SSUD is its handling of long-distance dependencies. On specialized datasets testing subject-verb agreement across intervening clauses, SSUD achieved a 79.5% recall, a substantial improvement over the 8.9% achieved by previous zero-shot attention methods. This suggests that averaging over substitutions effectively uncovers latent hierarchical structures that single-sentence attention misses.
The Effect of Substitutions
The researchers observed a monotonic improvement in parsing accuracy (Unlabeled Undirected Attachment Score, or UUAS) as the number of substitutions ($k$) increased. This trend holds across different model sizes (BERT-base and BERT-large), validating the hypothesis that substitutability is a robust proxy for syntactic structure.
Alignment with Linguistic Formalisms
Interestingly, the induced trees align more closely with Surface-Syntactic Universal Dependencies (SUD) than the standard Universal Dependencies (UD) format. In SUD, function words (like "to" or "that") are treated as heads, suggesting that LLMs may represent language in a way that emphasizes functional connectivity over purely semantic relations.
Conclusion
SSUD demonstrates that syntactic information can be effectively extracted from LLMs by leveraging the principle of substitutability. While currently reliant on POS tags and primarily tested on English, the method provides a powerful, parameter-free way to denoise attention and recover latent hierarchical structures. Future work may explore dynamic substitution strategies and applications to morphologically rich languages.
Summary updated