Sharper Generalization Bounds for Transformer

Yawen Li, Tao Hu, Zhouhui Lian, Wan Tian, Yijie Peng +2 more
3/23/2026
cs.LGcs.AI
transformer-attention

No confident code implementation found for this paper.

Abstract

This paper studies generalization error bounds for Transformer models. Based on the offset Rademacher complexity, we derive sharper generalization bounds for different Transformer architectures, including single-layer single-head, single-layer multi-head, and multi-layer Transformers.

Show full abstract

We first express the excess risk of Transformers in terms of the offset Rademacher complexity. By exploiting its connection with the empirical covering numbers of the corresponding hypothesis spaces, we obtain excess risk bounds that achieve optimal convergence rates up to constant factors. We then derive refined excess risk bounds by upper bounding the covering numbers of Transformer hypothesis spaces using matrix ranks and matrix norms, leading to precise, architecture-dependent generalization bounds. Finally, we relax the boundedness assumption on feature mappings and extend our theoretical results to settings with unbounded (sub-Gaussian) features and heavy-tailed distributions.

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. Any repos shown below are weak matches — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Similar Papers

Cite this paper

@article{li2026sharper,
  title  = {Sharper Generalization Bounds for Transformer},
  author = {Yawen Li and Tao Hu and Zhouhui Lian and Wan Tian and Yijie Peng and Huiming Zhang and Zhongyi Li},
  year   = {2026},
  eprint = {2603.21541},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2603.21541v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2603.21541.svg)](https://codeofpaper.com/paper/2603.21541)

Discussion