Spectrum-Adaptive Generalization Bounds for Trained Deep Transformers

Mana Sakai, Masaaki Imaizumi

TL;DR

Why do massive, deep Transformers generalize to new data instead of simply memorizing their training sets? Existing mathematical guarantees often blow up exponentially with network depth and force a rigid, one-size-fits-all complexity measure onto every weight matrix before training even begins. This paper introduces "spectrum-adaptive" bounds that let you inspect the singular values of each trained matrix after training—revealing much gentler scaling with depth and hidden dimension by tailoring the math to what the network actually learned.

What Problem Does This Paper Address?

In statistical learning theory, a generalization bound puts a mathematical ceiling on how much worse a model will perform on unseen real-world data compared to its training data. For massively overparameterized Transformers, getting bounds that don't explode into uselessness is notoriously tricky.

Recent norm-based bounds for Transformers successfully shrank the dependence on the hidden dimension ($N$) and token length ($T$). However, two major headaches remained when applying them to deep, trained models:

  1. The Depth Tax: Controlling layer-by-layer error propagation usually introduces a factor of $C^L$ (where $L$ is depth and $C$ relates to spectral norms and Lipschitz constants). For deep networks, exponential growth in $L$ quickly makes the bound loose.
  2. Rigid, Upfront Assumptions: Existing bounds rely on fixed matrix norms chosen a priori (before training) and applied globally. Yet empirical studies show that trained Transformers are internally diverse: attention matrices often learn compressible, low-rank structures, while feedforward matrices have flatter, denser singular-value spectra. Imposing one fixed norm across the whole network misses this learned structure.
Comparison of leading complexity factors across Transformer generalization bounds.

Methods

Instead of fixing a single norm in advance, Sakai and Imaizumi derive post hoc generalization bounds using Schatten $p$ (quasi) norms alongside spectral norm control.

If you take the singular values of a weight matrix—essentially measuring how much the matrix stretches space along different orthogonal directions—the Schatten index $p \in [0, 2]$ acts like a continuous tuning dial:

  • At $p = 0$, the Schatten quantity is simply the matrix rank (counting non-zero singular values).
  • At $p = 2$, it becomes the squared Frobenius norm (the sum of squared singular values).
  • Intermediate values ($0 < p < 2$) capture "soft-rank" decay.

To push this dial through a multi-layer Transformer, the authors extend a technique called parametric interpolation (previously used for vector-valued functions in standard neural nets) to matrix-valued function classes. They split every weight matrix $W$ at a threshold $\tau$: singular components above $\tau$ form a low-rank core, while smaller components form a Frobenius-controlled tail. By bounding the covering numbers of both pieces, propagating errors through softmax and rowwise normalizations, and applying a discretization-and-peeling argument, they make the high-probability guarantee hold uniformly across all choices of $p \in [0, 2]^{3L}$. That means you can pick the optimal $p$ separately for every query-key, value, and feedforward matrix after looking at the trained weights.

Datasets

Not discussed in the paper. Rather than training new models on datasets, the authors evaluate their theoretical complexity proxies directly on the weight matrices of publicly released BERT Miniatures checkpoints (spanning depths $L \in \{2, 4, 6, 8, 10, 12\}$ and hidden dimensions $N \in \{128, 256, 512, 768\}$).

Key Insights and Ideas

  • Post hoc, per-matrix adaptivity: You don't know a network's singular-value spectrum before training. Making the bound uniform over $p$ lets each sublayer choose its own sweet spot—trading off spectral complexity against penalties for depth ($L$) and width ($N$).
  • Taming exponential depth: Choosing smaller values of $p$ shrinks the nasty exponential propagation factor from $C^L$ down to $C^{Lp/(p+2)}$. At the rank-based endpoint ($p=0$), the $C^L$ factor vanishes entirely!
  • The surprise in BERT checkpoints: Even though the theory allows choosing any fractional $p \in (0, 2)$, when evaluated on actual BERT Miniatures checkpoints, the optimizer picked the pure rank endpoint ($p = 0$) for every single matrix. Because multi-head attention projections are naturally bottlenecked by head dimension ($d_h = 64$), and because the depth/width penalties for $p > 0$ are steep, rank-based counting beat soft-rank interpolation across the board in practice.

Key Results

  • Theoretical Depth & Width Wins: Under matched constraints, the new bounds substantially improve depth scaling over prior norm-based baselines (Edelman et al., 2022; Trauger and Tewari, 2024). Under rank constraints ($\text{rank}(W) \le r$), the leading complexity factor drops from $C^L L^{3/2} \sqrt{rN}$ to $\sqrt{rLN}$—eliminating $C^L$ and cutting polynomial depth dependence from $L^{3/2}$ to $\sqrt{L}$. Under spectral-norm-only constraints, scaling improves from $C^L L^{3/2} N$ to $\sqrt{L}N$.
Comparison of leading complexity factors under matched Frobenius, rank, and spectral norm constraints.
  • Geometric Trade-off on Token Length: Because Schatten norms rely on $\ell_2$-type covering arguments over token rows rather than $\ell_1$-type arguments, the bound retains a mild $\sqrt{\log(nT)}$ dependence on token length $T$ (where $n$ is sample size).
  • Empirical Proxy Scaling: Using BERT-adapted complexity proxies normalized at the smallest model size ($L=2$ or $N=128$), the authors' proxies grow by orders of magnitude more slowly than Edelman et al.'s norm-based proxies as depth increases from $2$ to $12$ or width grows from $128$ to $768$.

Limitations and Future Work

  • Simplified Architecture: The formal proofs analyze a streamlined single-head Transformer with rowwise unit-ball projections, omitting key modern components like residual connections, multi-head attention, and LayerNorm/RMSNorm.
  • Vacuous Absolute Numbers: Like most complexity-based deep learning bounds, the absolute numerical values remain vacuous (larger than 1) at realistic scales due to unspecified universal constants and accumulated Lipschitz/spectral factors. Furthermore, without access to empirical training losses for the checkpoints, true generalization gaps couldn't be compared directly.
  • Training- and Data-Agnostic: The analysis only inspects final static weights. Incorporating optimization dynamics, implicit regularization, or low-dimensional structure in intermediate data activations could yield sharper, more explanatory guarantees.

Summary updated

Abstract

Understanding why trained Transformers generalize well is a fundamental problem in modern machine learning theory, and complexity-based generalization bounds provide a principled way to study this question. While existing norm-based bounds for Transformers remove the explicit polynomial dependence on the hidden dimension, they typically impose fixed norm constraints specified a priori and can exhibit unfavorable exponential dependence on depth. In this paper, we derive spectrum-adaptive post hoc generalization bounds for multi-layer Transformers. Under layerwise spectral norm control, the bounds are expressed in terms of layerwise Schatten quantities of the query-key, value, and feedforward weight matrices. Since the Schatten indices need not be fixed a priori and can instead be selected after training, separately for each matrix type and layer, the bounds adaptively trade off spectral complexity against the dimension- and depth-dependent factors according to the learned singular-value profiles. Empirical comparisons of BERT-adapted proxies for the leading complexity factors suggest that the proxies induced by our bounds grow more slowly with depth and hidden dimension than the corresponding norm-based proxies. Overall, our results provide a complexity-based perspective on how the spectral structure of trained Transformers is reflected in generalization analyses.
BibTeX
@inproceedings{sakai2026spectrum,
  author = {Mana Sakai and Masaaki Imaizumi},
  title = {{Spectrum-Adaptive Generalization Bounds for Trained Deep Transformers}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2026},
  url = {https://openreview.net/forum?id=dmGgZmwSLW},
}
Figure