Tight Sample Complexity of Transformers

Chenxiao Yang, Nathan Srebro, Zhiyuan Li
6/8/2026
cs.LG
transformer-attention

No confident code implementation found for this paper.

Abstract

We tightly characterize the VC dimension of depth-$L$ Transformers with a total of $W$ parameters, mapping an input sequence of length $T$ to a single output, establishing an upper bound of $O(L W \log (T W))$ and a nearly matching lower bound of $Ω(L W \log (T W / L))$. We further tightly characterize the sample complexity of chain-of-thought learning using such a Transformer, showing teacher forcing (i.e. selecting a predictor consistent with the entire chain-of-thought on training data) learns with sample complexity $O\left(L W \log \left(\left(T+T^{\prime}\right) W\right)\right)$ and that any learning rule that uses chain-of-thought data requires at least $Ω\left(L W \log \left(\left(T+T^{\prime}\right) W / L\right)\right)$ examples, where $T$ is the input length and $T^{\prime}$ is the number of autoregressive steps.

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{yang2026tight,
  title  = {Tight Sample Complexity of Transformers},
  author = {Chenxiao Yang and Nathan Srebro and Zhiyuan Li},
  year   = {2026},
  eprint = {2606.09731},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2606.09731v1}
}

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

Discussion