Reproduce “Grokking of Hierarchical Structure in Vanilla Transformers” on OpenResearch
Run Claude Code, Codex or any coding agent as a research agent: literature, hypotheses and experiments on your laptop, cluster or cloud GPUs.
Universal app for Apple silicon and Intel. Requires macOS 11 or later.
About this paper
Shikhar Murty, Pratyusha Sharma, Jacob Andreas, Christopher D. Manning
Vanilla transformer language models exhibit "structural grokking," a delayed emergence of robust generalization to hierarchical linguistic structures on out-of-distribution inputs, long after in-domain accuracy has saturated. By extending training, models achieved near-perfect generalization on synthetic tasks requiring structural understanding, challenging prior assumptions about their limitations.
Key insights
- Transformers undergo "structural grokking," where deep hierarchical generalization on out-of-distribution data emerges gradually and significantly after in-domain validation accuracy has plateaued.
- Early stopping based on in-domain metrics can severely underestimate a transformer's true capacity for hierarchical generalization, as extended training unlocks this ability.
- An inverted U-shaped scaling was observed between model depth and the ability to grok hierarchical structure, indicating optimal performance at intermediate depths (e.g., 4-6 layers) rather than increasing depth.
- Functional tree-structuredness (t_score) is a strong predictor of optimal grokking depth and correlates with the emergence of robust hierarchical generalization, suggesting it reflects the underlying structural computations.
Summary by alphaXiv.
Tip: change arxiv.org to autoarxiv.org in any arXiv abstract link to open the paper here.