Alternating Gradient Flows: A Theory of Feature Learning in Two-layer Neural Networks
Daniel Kunin, Giovanni Luca Marchetti, Feng Chen, Dhruva Karkada, James B. Simon, Michael R. DeWeese, Surya Ganguli, Nina Miolane
Abstract
What features neural networks learn, and how, remains an open question. In this paper, we introduce Alternating Gradient Flows (AGF), an algorithmic framework that describes the dynamics of feature learning in two-layer networks trained from small initialization. Prior works have shown that gradient flow in this regime exhibits a staircase-like loss curve, alternating between plateaus where neurons slowly align to useful directions and sharp drops where neurons rapidly grow in norm. AGF approximates this behavior as an alternating two-step process: maximizing a utility function over dormant neurons and minimizing a cost function over active ones. AGF begins with all neurons dormant. At each iteration, a dormant neuron activates, triggering the acquisition of a feature and a drop in the loss. AGF quantifies the order, timing, and magnitude of these drops, matching experiments across several commonly studied architectures. We show that AGF unifies and extends existing saddle-to-saddle analyses in fully connected linear networks and attention-only linear transformers, where the learned features are singular modes and principal components, respectively. In diagonal linear networks, we prove AGF converges to gradient flow in the limit of vanishing initialization. Applying AGF to quadratic networks trained to perform modular addition, we give the first complete characterization of the training dynamics, revealing that networks learn Fourier features in decreasing order of coefficient magnitude. Altogether, AGF offers a promising step towards understanding feature learning in neural networks.
Ask Lune
Know this paper in minutes, not an afternoon.
Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.
7 top-tier papers have cited it since. Know what they found before your reviewers do.
Lune can draw on
the full paper · the top-tier papers that cite it · related work
Free to start. No credit card required.
Lineage
- Transformers learn to implement preconditioned gradient descent for in-context learning cites Language Models are Few-Shot Learners
- Transformers learn to implement preconditioned gradient descent for in-context learning cites Transformers Learn In-Context by Gradient Descent
- Transformers learn to implement preconditioned gradient descent for in-context learning cites What Can Transformers Learn In-Context? A Case Study of Simple Function Classes
- Saddle-to-Saddle Dynamics Explains A Simplicity Bias Across Neural Network Architectures cites Closed-Form Training Dynamics Reveal Learned Features and Linear Structure in Word2Vec-like Models
- Saddle-to-Saddle Dynamics Explains A Simplicity Bias Across Neural Network Architectures cites Saddle-To-Saddle Dynamics in Deep ReLU Networks: Low-Rank Bias in the First Saddle Escape
- Saddle-to-Saddle Dynamics Explains A Simplicity Bias Across Neural Network Architectures cites What Can Transformers Learn In-Context? A Case Study of Simple Function Classes
- Sequential Group Composition: A Window into the Mechanics of Deep Learning cites Saddle-to-Saddle Dynamics Explains A Simplicity Bias Across Neural Network Architectures
- Transformers Learn In-Context by Gradient Descent cites Language Models are Few-Shot Learners
- Transformers Learn In-Context by Gradient Descent cites What Can Transformers Learn In-Context? A Case Study of Simple Function Classes
- What Can Transformers Learn In-Context? A Case Study of Simple Function Classes cites Language Models are Few-Shot Learners
Cited by top-tier papers7
- Saddle-to-Saddle Dynamics Explains A Simplicity Bias Across Neural Network ArchitecturesYedi Zhang, Andrew M. Saxe, Peter E. LathamICLR 2026 · 15 citations
- Closed-Form Training Dynamics Reveal Learned Features and Linear Structure in Word2Vec-like ModelsDhruva Karkada, James B. Simon, Yasaman Bahri, Michael R. DeWeeseNeurIPS 2025 · 9 citations
- Sequential Group Composition: A Window into the Mechanics of Deep LearningGiovanni Luca Marchetti, Daniel Kunin, Adele Myers, Francisco Acosta et al.ICML 2026 · 8 citations
- Saddle-To-Saddle Dynamics in Deep ReLU Networks: Low-Rank Bias in the First Saddle EscapeIoannis Bantzis, James B. Simon, Arthur JacotICLR 2026 · 4 citations
- Neural Collapse under Gradient Flow on Shallow ReLU Networks for Orthogonally Separable DataHancheng Min, Zhihui Zhu, René VidalNeurIPS 2025 · 3 citations
Builds on60
- Language Models are Few-Shot LearnersTom B. Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah et al.NeurIPS 2020 · 64,255 citations
- Sparse Autoencoders Find Highly Interpretable Features in Language ModelsRobert Huben, Hoagy Cunningham, Logan Riggs Smith, Aidan Ewart et al.ICLR 2024 · 1,072 citations
- What Can Transformers Learn In-Context? A Case Study of Simple Function ClassesShivam Garg, Dimitris Tsipras, Percy Liang, Gregory ValiantNeurIPS 2022 · 883 citations
- Transformers Learn In-Context by Gradient DescentJohannes von Oswald, Eyvind Niklasson, Ettore Randazzo, João Sacramento et al.ICML 2023 · 729 citations
- Transformers learn to implement preconditioned gradient descent for in-context learningKwangjun Ahn, Xiang Cheng, Hadi Daneshmand, Suvrit SraNeurIPS 2023 · 324 citations
Related papers
- On the spectral bias of two-layer linear networksAditya Vardhan Varre, Maria-Luiza Vladarean, Loucas Pillaud-Vivien, Nicolas FlammarionNeurIPS 2023 · 27 citations
- Gradient flow dynamics of shallow ReLU networks for square loss and orthogonal inputsEtienne Boursier, Loucas Pillaud-Vivien, Nicolas FlammarionNeurIPS 2022 · 92 citations
- Grokking as the transition from lazy to rich training dynamicsTanishq Kumar, Blake Bordelon, Samuel J. Gershman, Cengiz PehlevanICLR 2024 · 86 citations
- The staircase property: How hierarchical structure can guide deep learningEmmanuel Abbe, Enric Boix-Adserà, Matthew S. Brennan, Guy Bresler et al.NeurIPS 2021 · 74 citations
- Provable Guarantees for Neural Networks via Gradient Feature LearningZhenmei Shi, Junyi Wei, Yingyu LiangNeurIPS 2023 · 15 citations
