Pattern Formation in Transformers

Erkan Turan, Gaspard Abel, Maks OvsjanikovarXiv 2026

TL;DR

This paper reveals that Transformers at initialization aren't just random; they possess a "dynamical prior" that naturally amplifies complex spatial patterns like traveling waves and feature rotations. By applying pattern-formation theory, the authors show how to engineer these architectural biases to significantly accelerate training and improve data efficiency on tasks ranging from synthetic sequences to CIFAR-10.

What Problem Does This Paper Address?

While we know Transformers are universal approximators, we have a poor understanding of their inductive biases—the structural preferences the architecture imposes before any learning occurs. Current theoretical work usually focuses on two extremes: "rank collapse" (where all tokens become identical) or "clustering" (where tokens group into discrete sets).

However, practitioners observe much richer representations in the wild. This paper fills the gap between simplified theory and complex practice by asking: When a Transformer avoids rank collapse, what specific structures does it naturally promote? The authors aim to turn these "spontaneous" patterns into a controllable tool for better model initialization.

Methods

The authors treat the Transformer as a dynamical system and apply pattern-formation theory (traditionally used to explain things like zebra stripes or fluid ripples). Their approach involves two main theoretical pillars:

  1. The Transformer Matrix Dispersion Relation: They derive a matrix-valued map that acts as a frequency-resolved gain filter. This tool allows them to predict which "modes" (joint token-feature structures) will be amplified as a signal passes through successive layers. They show that Positional Encoding (PE) selects the spatial frequency, while the Output-Value (OV) geometry and Feed-Forward Network (FFN) determine how those features evolve.
  2. Amplitude Equations: To understand what happens after the initial linear growth, they use nonlinear analysis to derive amplitude equations. These explain how patterns saturate (reach a stable size), drift (move across tokens), or compete (where one pattern might suppress another, or they might coexist).
Figure 1: Taxonomy of patterns in Transformers: 2D visualization of the propagation of the accessible modes, with their corresponding dispersion relation.

Datasets

The theory was validated using:

  • Controlled Sequence Tasks: Three synthetic task families (T1: periodic infilling, T2: transport/shift, T3: rotating-wave infilling) designed to require specific structural representations.
  • CIFAR-10: Used to test the theory in a practical image classification setting using the ConViT architecture (a Vision Transformer variant).

Key Insights and Ideas

  • Architecture as a Filter: The Transformer block isn't just a black box; it's a matrix-valued spectral filter. Multi-Head Attention (MHA) allows the model to combine different spatial filters and feature directions simultaneously.
  • New Pattern Catalog: Beyond simple clusters, the authors identify standing waves, traveling waves (emerging from directional PEs like ALiBi or RoPE), and feature rotations (emerging from non-symmetric OV matrices).
  • The Role of Nonlinearity: The FFN and attention softmax don't just add complexity; they act as the "brakes" that stabilize emerging patterns. The authors show that specific activations (like GELU vs. Tanh) can actually bias which structures survive.
  • Engineering the Prior: The most significant "aha moment" is that we can choose an initialization that amplifies the specific patterns a task requires. This "task-initialization alignment" acts as a powerful head start for gradient descent.
Visualizing how depth evolution descends an effective potential to reach stable patterns.

Key Results

  • Quantitative Gains: On CIFAR-10, combining a negative-identity OV initialization with a "sharpened" localized PE led to a final accuracy of 91.5%, outperforming standard initializations.
  • Optimization Speed: The engineered initialization reached 90% accuracy in 69 epochs, compared to 92 epochs for the default localized version.
  • Data Efficiency: The benefits of aligning the dynamical prior with the task were most pronounced in low-data regimes, where the model has less opportunity to learn the necessary structures from scratch.
  • Predictive Power: The theoretical "scaling laws" for pattern amplitude (growing as $\sqrt{\mu}$) were precisely matched by numerical simulations.

Limitations and Future Work

  • Translation Invariance: Much of the Fourier-based analysis assumes translation-invariant positional encodings. While the authors provide extensions for open boundaries, the theory is cleanest for periodic or "bulk" sequences.
  • LayerNorm Complexity: While the paper addresses LayerNorm, they note it can "flatten" the dispersion relation over depth, making the initial bias less persistent.
  • Scaling to LLMs: The experiments focus on smaller-scale vision and synthetic tasks. A natural next step is investigating how these dynamical priors behave in massive Language Models with billions of parameters and complex, non-uniform data distributions.
  • Design Levers: Future work could involve designing entirely new PE or initialization schemes tailored for specific modalities like audio or video, where specific wave-like priors are naturally expected.

Summary updated

BibTeX
@misc{turan2026pattern,
  author = {Erkan Turan and Gaspard Abel and Maks Ovsjanikov},
  title = {{Pattern Formation in Transformers}},
  year = {2026},
  eprint = {2609.37921},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2609.37921},
}
Figure