Lyapunov Exponents for Attention Composition
AI Research
First Lyapunov exponent framework for eigenvalue dynamics in composed attention layers. A bridge from transformer theory to dynamical systems.
Key Features
- First computation of full Lyapunov spectrum for attention products
- Proof that Lambda_1 = 0 exactly and Lambda_k < 0 for k > 1
- Quantified relationship between temperature and spectral gap
- Refined closed-form formula for rank collapse prediction
- Analysis of the residual connection mechanism (2.4x contraction reduction)
- All theoretical results experimentally verified
Abstract
I develop the first Lyapunov exponent framework for the analysis of eigenvalue dynamics in composed attention layers. The framework builds on foundational rank collapse results. It provides novel tools that connect transformer theory to dynamical systems.
Theoretical Framework
For a sequence of attention matrices , the -th Lyapunov exponent is:
Here, is the -th singular value of the product .
Key Results
Theorem 1: Dominant Lyapunov Exponent
For any sequence of row-stochastic attention matrices:
Proof: For any stochastic , the all-ones vector satisfies . As a result, .
Theorem 2: Contraction Exponents
For i.i.d. random attention matrices with spectral gap :
Theorem 3: Collapse Prediction Formula
The number of layers until effective rank drops below threshold is:
Here, is the dimension. is the magnitude of the second eigenvalue.
Experimental Results
Lyapunov Spectrum (d=50, T=1.0, L=100 layers):
- (std dev ), verified to machine precision
- (std dev )
- (std dev )
Temperature Effect on Spectral Collapse
A lower temperature causes sharper attention and faster collapse:
- T = 0.5: , (Slowest)
- T = 1.0: , (Moderate)
- T = 2.0: , (Fast)
Residual Connection Analysis
Residual connections reduce by a factor of . This reduction slows information loss through the layers.
With residual connections, the gradients at layer 1 improve from to . This is a improvement.
Links
- Paper DOI: 10.5281/zenodo.18202128
- Code: github.com/tylergibbs1/lyapunov-attention
Citation
@misc{gibbs2026lyapunov,
title={Lyapunov Exponents for Attention Composition: A Dynamical Systems Perspective on Deep Transformers},
author={Gibbs, Tyler},
year={2026},
publisher={Zenodo},
doi={10.5281/zenodo.18202128}
}