How Many Different Outputs Can a Transformer Generate?

Maxime Meyer, Mario Michelessa, Caroline Chaux, Vincent Y. F. Tan
5/21/2026
cs.LG
transformer-attention

No confident code implementation found for this paper.

Abstract

We study how we can leverage only a handful of characteristics of a transformer's architecture to closely predict the number of different sequences it can output, both qualitatively and quantitatively. We provide an upper bound depending on the length of the prompt, which we show empirically to be tight up to a factor less than 10, across architectures and model sizes.

Show full abstract

Our analysis also provides a theoretical explanation for previously observed empirical failures of transformers on simple sequence tasks, such as copying and cramming. Formally, we prove that (i) the maximal length of accessible sequences (those that the transformer can output for some prompt) grows linearly with the prompt length, (ii) beyond a critical threshold, the proportion of accessible sequences decays exponentially with sequence length, and (iii) the linear coefficient relating prompt length to accessible sequence length admits a theoretical upper bound. Notably, these results hold even with unbounded context and computation time.

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{meyer2026many,
  title  = {How Many Different Outputs Can a Transformer Generate?},
  author = {Maxime Meyer and Mario Michelessa and Caroline Chaux and Vincent Y. F. Tan},
  year   = {2026},
  eprint = {2605.22223},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2605.22223v2}
}

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

Discussion