Lyapunov Exponents for Attention Composition

AI ResearchJanuary 9, 2026

First Lyapunov exponent framework for analyzing eigenvalue dynamics in composed attention layers, bridging transformer theory with dynamical systems.

Python
Deep Learning
Transformers
Dynamical Systems
Research Paper

Key Features

  • First computation of full Lyapunov spectrum for attention products
  • Proof that Lambda_1 = 0 exactly and Lambda_k < 0 for k > 1
  • Temperature-spectral gap relationship quantification
  • Refined closed-form formula for rank collapse prediction
  • Residual connection mechanism analysis (2.4x contraction reduction)
  • All theoretical results experimentally verified

Abstract

I develop the first Lyapunov exponent framework for analyzing eigenvalue dynamics in composed attention layers. Building on foundational rank collapse results, I provide novel tools connecting transformer theory to dynamical systems.

Theoretical Framework

For a sequence of attention matrices , the -th Lyapunov exponent is defined as:

where denotes the -th singular value of the product .

Key Results

Theorem 1: Dominant Lyapunov Exponent

For any sequence of row-stochastic attention matrices:

Proof: The all-ones vector satisfies for any stochastic , so .

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:

where is dimension and is the second eigenvalue magnitude.

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

Lower temperature leads to sharper attention and faster collapse:

  • T = 0.5: , (Slowest)
  • T = 1.0: , (Moderate)
  • T = 2.0: , (Fast)

Residual Connection Analysis

Residual connections reduce by factor , slowing information loss through layers.

With residual connections, gradients at layer 1 improve from to — a improvement.

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}
}