Stagewise and interpretable emergence of inside-outside computation in Transformer-based language models
TL;DR - This paper analytically traces how Transformers learn inside-outside-style parsing on synthetic context-free grammars. It links distinct training stages to increasingly abstract latent-tree representations, offering an interpretable model of syntactic computation emerging in LLMs.
- Early training relies on local bigram and trigram information in initial layers.
- Later stages encode latent tree variables that resolve ambiguity using wider context.
- Probing reveals an encoder-decoder-like structure: abstract syntax forms in middle layers, then later layers refine token predictions.
- The controlled synthetic setting enables analytical calculation of loss stages and data statistics.