Reproduce “Infinite Limits of Multi-head Transformer Dynamics” 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

Blake Bordelon, Hamza Tahir Chaudhry, Cengiz Pehlevan

This paper applies Dynamical Mean Field Theory to analyze the training dynamics of multi-head Transformers across infinite limits of key/query dimension, number of heads, and depth. It identifies specific parameterizations required for stable feature learning and reveals how attention heads behave distinctly at these scales, including a collapse to identical dynamics in the infinite-width limit.

Key insights

  • In the infinite key/query dimension limit, particularly with the muP parameterization, multi-head attention effectively collapses, with all heads learning identical attention matrices.
  • The infinite number of heads limit, conversely, preserves a distribution of diverse attention variables across heads, and head-averaged quantities exhibit deterministic training dynamics.
  • Scaling residual branches in infinitely deep networks presents a trade-off: $\alpha_L=1/2$ preserves initial kernel structure but freezes attention layer weights, while $\alpha_L=1$ enables active feature learning within attention layers.

Summary by alphaXiv.

Tip: change arxiv.org to autoarxiv.org in any arXiv abstract link to open the paper here.