Path--Cocycle Geometry for Transformers: Lyapunov Exponents, Fisher Pullbacks, Curvature Transport, Group Operations, and In-Context Optimization

Transformer theory uses several precise but disconnected mathematical objects: attention flows, residual Jacobian products, Fisher metrics, curvature, in-context optimization, and test-time memory. We unify them through a path--cocycleframework in which a depth-indexed transformer is a nonautonomous differentiable dynamical system. Its Jacobian products form a first-order cocycle, while a block-triangular lift on symmetric tensors transports second variations. For the architecture itself, we derive the exact single-head attention differential, the sharp row-softmax factor $1/2$, the LayerNorm derivative and shift-gauge kernel, and an explicit local certificate for a sequential pre-norm transformer block. Under stated stationarity, ergodicity, and integrability assumptions, multiplicative ergodic theory yields Lyapunov exponents; the lifted spectrum combines first-order exponents with their pairwise sums. The cocycle induces output-relative observable exponents and Fisher pullback metrics. A terminal-loss Hessian separates into a positive Gauss--Newton/Fisher term and residual curvature governed by the second-order cocycle. Its endpoint-anchored integral gives an exact finite-displacement identity. We also prove a criticality--intermittency theorem for independentscalar gains, derive the exact exponent of linear-gradient-descent in-context learning, and compute a scalar gated-memory exponent within a common augmented-state model for transformers, xLSTMs, Titans, and self-adaptive architectures. For modular addition, Fourier characters turn additive paths into multiplicative cocycles, the Chinese remainder theorem supplies an exact product decomposition, finite Cayley-path neighborhoods formalize approximate cosets, and disc features are linear projections of torus features. This connects approximate-CRT and representation-manifold accounts while separating exact algebra from empirical claims about learned circuits. An accompanying Lean~4 project contains 58 machine-checked theorem declarations for the indexed finite proof kernels and conditional reductions, including softmax and centering gauges, curvature,gated memory, cyclic transport, CRT, approximate cosets, and torus--disc factorization. Deep ergodic, probabilistic, architectural, and empirical inputs remain explicitly conditional or external. Thus the framework connects these theories without identifying Lyapunov stability with generalization, causality, memory capacity, universality, or global optimality.

Authors

Institutions

Publication Details

Journal
Zenodo (CERN European Organization for Nuclear Research)
Published
2026-08-20
DOI
https://doi.org/10.5281/zenodo.22018371
Primary Topic
Stochastic Gradient Optimization Techniques
Type
preprint
Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
preprint

Path--Cocycle Geometry for Transformers: Lyapunov Exponents, Fisher Pullbacks, Curvature Transport, Group Operations, and In-Context Optimization

Miquel Noguer Alonso
Zenodo (CERN European Organization for Nuclear Research)
Stochastic Gradient Optimization Techniques
preprint

Path--Cocycle Geometry for Transformers: Lyapunov Exponents, Fisher Pullbacks, Curvature Transport, Group Operations, and In-Context Optimization

Miquel Noguer Alonso
preprint en

Abstract

Transformer theory uses several precise but disconnected mathematical objects: attention flows, residual Jacobian products, Fisher metrics, curvature, in-context optimization, and test-time memory. We unify them through a path--cocycleframework in which a depth-indexed transformer is a nonautonomous differentiable dynamical system. Its Jacobian products form a first-order cocycle, while a block-triangular lift on symmetric tensors transports second variations. For the architecture itself, we derive the exact single-head attention differential, the sharp row-softmax factor $1/2$, the LayerNorm derivative and shift-gauge kernel, and an explicit local certificate for a sequential pre-norm transformer block. Under stated stationarity, ergodicity, and integrability assumptions, multiplicative ergodic theory yields Lyapunov exponents; the lifted spectrum combines first-order exponents with their pairwise sums. The cocycle induces output-relative observable exponents and Fisher pullback metrics. A terminal-loss Hessian separates into a positive Gauss--Newton/Fisher term and residual curvature governed by the second-order cocycle. Its endpoint-anchored integral gives an exact finite-displacement identity. We also prove a criticality--intermittency theorem for independentscalar gains, derive the exact exponent of linear-gradient-descent in-context learning, and compute a scalar gated-memory exponent within a common augmented-state model for transformers, xLSTMs, Titans, and self-adaptive architectures. For modular addition, Fourier characters turn additive paths into multiplicative cocycles, the Chinese remainder theorem supplies an exact product decomposition, finite Cayley-path neighborhoods formalize approximate cosets, and disc features are linear projections of torus features. This connects approximate-CRT and representation-manifold accounts while separating exact algebra from empirical claims about learned circuits. An accompanying Lean~4 project contains 58 machine-checked theorem declarations for the indexed finite proof kernels and conditional reductions, including softmax and centering gauges, curvature,gated memory, cyclic transport, CRT, approximate cosets, and torus--disc factorization. Deep ergodic, probabilistic, architectural, and empirical inputs remain explicitly conditional or external. Thus the framework connects these theories without identifying Lyapunov stability with generalization, causality, memory capacity, universality, or global optimality.

Zenodo (CERN European Organization for Nuclear Research)
Allen Institute for Artificial Intelligence (US)
Stochastic Gradient Optimization Techniques
AI Navigator

Ask Laika to Summarize, Analyze, and Connect papers live on the map.

Summarize Papers & Methodologies

Extract key findings, datasets, and comparative methods across publications.

Benchmark Rankings & Visual Analytics

Rank top research institutions, authors, funders, topics, and journals by Field-Weighted Citation Impact (FWCI) and paper volume with instant charts.

Connect Distant Disciplines

Bridge topological clusters on the map to find hidden collaborative intersections.