A Sharper Picture of Generalization in Transformers

Paul Lintilhac, Sair Shaikh
5/20/2026
cs.LGcs.AI
transformer-attention

No confident code implementation found for this paper.

Abstract

We study transformers' generalization behavior on boolean domains from the perspective of the Fourier Spectra of their target functions. In contrast to prior work (Edelman et al., 2022; Trauger and Tewari, 2024), which derived generalization bounds from Rademacher complexity, we investigate the feasibility of obtaining generalization bounds via PAC-Bayes theory.

Show full abstract

We show that sparse spectra concentrated on low-degree components enable low-sharpness constructions with good generalization properties. Our idea is to show the existence of flat minima implementing any boolean function of sparsity no greater than the context length, and then apply a PAC-Bayes bound to an idealized low-sharpness learner, resulting in a non-vacuous generalization bound. We evaluate predictions empirically and conduct a mechanistic interpretability study to support the realism of our theoretical construction in real transformers.

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{lintilhac2026sharper,
  title  = {A Sharper Picture of Generalization in Transformers},
  author = {Paul Lintilhac and Sair Shaikh},
  year   = {2026},
  eprint = {2605.20988},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2605.20988v1}
}

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/2605.20988.svg)](https://codeofpaper.com/paper/2605.20988)

Discussion