[Paper Review] Transformers learn through gradual rank increase
This paper demonstrates that Vision and Language Transformers exhibit incremental learning dynamics during training, where the rank of the difference between trained and initial weights increases gradually in discrete stages. Theoretically, under small initialization and diagonal weight assumptions, gradient flow training leads to stage-wise rank increases of at most one per stage; empirically, this phenomenon persists even without simplifying assumptions, observed in real-world vision and language models.
We identify incremental learning dynamics in transformers, where the difference between trained and initial weights progressively increases in rank. We rigorously prove this occurs under the simplifying assumptions of diagonal weight matrices and small initialization. Our experiments support the theory and also show that phenomenon can occur in practice without the simplifying assumptions.
Motivation & Objective
- To investigate whether Transformers exhibit incremental learning dynamics similar to those seen in simpler neural networks.
- To establish a theoretical foundation for incremental learning in Transformers under simplifying assumptions: small initialization and diagonal weight matrices.
- To validate the theoretical findings experimentally in realistic settings without the simplifying assumptions.
- To explore connections between the observed dynamics and efficient fine-tuning methods like LoRA.
Proposed method
- Theoretical analysis uses gradient flow on a simplified Transformer variant with diagonal attention head weights, reducing the problem to a network dependent on the elementwise product of two weight vectors.
- A general theorem is proven for networks of the form $ f_{\mathsf{NN}}(\mathbf{x};\mathbf{u},\mathbf{v}) = h(\mathbf{x}; \mathbf{u} \odot \mathbf{v}) $, showing that under small initialization, training proceeds in discrete stages with at most one new non-negligible entry in $ \mathbf{u} \odot \mathbf{v} $ per stage.
- Theoretical results are applied to attention heads by expressing the product $ \mathbf{W}_K \mathbf{W}_Q^\top $ as a diagonal matrix product, enabling analysis of rank increase in the effective weight matrix.
- Experiments compare the spectrum of $ \mathbf{W}_K \mathbf{W}_Q^\top $ at initialization and after training, measuring the rank of the weight difference to track incremental changes.
- Experiments are conducted on ViT models trained on CIFAR-10 and ImageNet, analyzing attention head weights without assuming diagonal or small-initialization conditions.
- The analysis includes visualization of normalized spectra of weight differences over training iterations to illustrate stage-wise rank growth.
Experimental results
Research questions
- RQ1Do Transformers exhibit incremental learning dynamics where the complexity of learned functions increases in stages?
- RQ2Can incremental learning dynamics in Transformers be rigorously proven under simplifying assumptions like small initialization and diagonal weight matrices?
- RQ3Does the incremental rank increase in weight differences persist in practice, even when theoretical assumptions are violated?
- RQ4What is the relationship between the observed incremental dynamics and efficient fine-tuning methods such as LoRA?
Key findings
- Under small initialization and diagonal weight assumptions, gradient flow training in Transformers proceeds in discrete stages, each lasting $ \Theta(\log(1/\alpha)) $ time, with at most one new non-negligible entry in the effective weight vector $ \mathbf{u} \odot \mathbf{v} $ per stage.
- The theoretical analysis proves that the rank of the difference between trained and initial weights increases gradually, by at most one per stage, due to saddle-point escape dynamics.
- In experiments on ViT models trained on ImageNet, the rank of the difference between trained and initial $ \mathbf{W}_K \mathbf{W}_Q^\top $ matrices increases gradually over training, with clear stage-like behavior visible in spectral plots.
- Even without the theoretical assumptions—such as in standard training with non-diagonal weights and larger initialization—incremental rank increase is still observed in both vision and language models.
- The phenomenon is more pronounced in larger datasets like ImageNet than in smaller ones like CIFAR-10, suggesting that data complexity influences the stage-like dynamics.
- The results suggest a connection to LoRA fine-tuning, as both involve low-rank updates, and the observed incremental dynamics may explain why such methods are effective.
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.