Introduction
Human language is fundamentally hierarchical rather than a simple linear sequence. For example, transforming a sentence into a question requires identifying the main verb based on structural hierarchy rather than mere word order. While linguists have long argued for an innate human bias toward these hierarchical rules, the inductive biases of modern AI architectures remain a subject of intense scrutiny. This paper investigates whether Transformers, the current state-of-the-art in natural language processing, possess the hierarchical bias necessary for human-like linguistic generalization.
Methodology: The Stress Test for Inductive Bias
To evaluate inductive bias, researchers trained various sequence-to-sequence models on four grammatical tasks where the training data was intentionally ambiguous. In these scenarios, both a linear rule (e.g., "move the first verb") and a hierarchical rule (e.g., "move the main verb") could correctly explain the training examples.
The study compared:
- Transformers: 3-layer, 4-headed models.
- RNNs: LSTMs and GRUs, including variants with additive (+) and multiplicative (×) attention.
Models were evaluated on a Generalization (GEN) set—a collection of "trick" sentences where linear and hierarchical rules yield different outputs. Success on this set indicates a hierarchical bias, while specific errors reveal a linear preference.
Results: The Linear Preference of Transformers
The experiments revealed that Transformers are "linearity extremists." Despite their sophisticated attention mechanisms, they almost exclusively learned position-based, linear rules. In the Question Formation task, Transformers achieved a median hierarchical accuracy of just 0.03%.
In contrast, older architectures like GRUs with multiplicative attention reached approximately 33% hierarchical accuracy. This suggests that Transformers actually possess less hierarchical bias than the RNNs they replaced. While all models performed excellently (95%–100%) on standard in-distribution tests, their failure to generalize hierarchically suggests that the success of large-scale models like GPT-4 likely stems from massive data disambiguation rather than inherent architectural understanding.
Case Study: Reflexive Anaphora
The reflexive anaphora task—identifying the antecedent of words like "himself"—provided a notable exception to the general trend. In this task, models must decide whether to link a pronoun to a noun based on linear proximity or structural hierarchy.
As shown in the figure above, LSTMs without attention performed the best, achieving a median hierarchical score of 65.8%. Transformers, however, remained committed to a "reflexive-linear" strategy, consistently linking pronouns to the most recent noun regardless of structural relevance.
Discussion and Future Work
The findings indicate that Transformers use their attention mechanisms to reinforce linear patterns rather than to build tree structures naturally. This raises questions about the scalability of these biases. While the models in this study were relatively small (3 layers), it remains unclear if massive scaling eventually forces a hierarchical bias to emerge or if it simply provides enough edge-case data to mimic such behavior. Future research into alternative positional encoding schemes or entirely new architectures may be required to bridge the gap between artificial and human-like linguistic intuition.
Summary updated