[Paper Review] The emergence of number and syntax units in LSTM language models
The paper analyzes an LSTM language model at the single-neuron level and identifies two dedicated long-range number units and a syntax unit, showing that LSTMs learn structure-sensitive mechanisms for subject–verb agreement beyond superficial heuristics.
Recent work has shown that LSTMs trained on a generic language modeling objective capture syntax-sensitive generalizations such as long-distance number agreement. We have however no mechanistic understanding of how they accomplish this remarkable feat. Some have conjectured it depends on heuristics that do not truly take hierarchical structure into account. We present here a detailed study of the inner mechanics of number tracking in LSTMs at the single neuron level. We discover that long-distance number information is largely managed by two `number units'. Importantly, the behaviour of these units is partially controlled by other units independently shown to track syntactic structure. We conclude that LSTMs are, to some extent, implementing genuinely syntactic processing mechanisms, paving the way to a more general understanding of grammatical encoding in LSTMs.
Motivation & Objective
- Investigate how LSTM language models track grammatical number and long-distance dependencies without explicit linguistic priors.
- Determine whether number information is stored locally, sparsely, or distributed across units.
- Identify syntax-related units and their interaction with number units to regulate agreement.
- Examine the connectivity between syntax and number units to understand how structure influences feature percolation.
Proposed method
- Use a pretrained 650-650-650 LSTM language model trained on Wikipedia data without number-specific fine-tuning.
- Probe long-distance number agreement tasks (NA-tasks) and syntactic depth prediction datasets to assess internal representations.
- Perform single-unit ablations to test necessity of candidate number units.
- Analyze gate and cell dynamics to characterize how proposed number units store and release number information across dependencies.
- Identify syntax units by decoding syntactic-depth from hidden states and test causal effects via ablations.
- Inspect afferent/efferent connectivity between syntax units and number units to infer control signals for memory gates.
Experimental results
Research questions
- RQ1Can LSTM language models induce structure-sensitive number agreement from unannotated corpus data?
- RQ2Do dedicated number-coding units exist for long-range dependencies, and how are they controlled?
- RQ3Are there syntax-related units that regulate the flow of number information across dependencies?
- RQ4How do syntax and number units interact through network connectivity to support grammatical encoding?
Key findings
- Two dedicated long-range number units emerge in the second layer that encode singular and plural subject number and preserve it across intervening material.
- A syntax-related unit encodes the subject–verb dependency and sends signals to the number units to control when to remember or update number information.
- A distributed, syntax-insensitive number code exists for easier tasks, but it cannot robustly carry number information across embedded structures, highlighting the importance of the LR-number units.
- Ablating the LR-number units significantly degrades performance in long-range (congruent/incongruent) NA-tasks, indicating their critical role in long-distance agreement.
- The syntax unit shows structured gate dynamics and exerts strong efferent influence on the number units, effectively providing remember/update flags for the dependency, suggesting genuine syntactic processing mechanisms in the LSTM.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.