← Latest papers
💻 computer science

How Many Different Outputs Can a Transformer Generate?

This paper establishes that a transformer's capacity to generate diverse output sequences is fundamentally limited by its prompt length, proving that the number of accessible sequences grows linearly with the prompt while the proportion of accessible sequences decays exponentially beyond a critical threshold, thereby explaining empirical failures on tasks like copying and cramming.

Original authors: Maxime Meyer, Mario Michelessa, Caroline Chaux, Vincent Y. F. Tan

Published 2026-05-22
📖 5 min read🧠 Deep dive

Original authors: Maxime Meyer, Mario Michelessa, Caroline Chaux, Vincent Y. F. Tan

Original paper licensed under CC BY 4.0 (http://creativecommons.org/licenses/by/4.0/). This is an AI-generated explanation of the paper below. It is not written or endorsed by the authors. For technical accuracy, refer to the original paper. Read full disclaimer

The Big Idea: The "Finite Library" of a Transformer

Imagine a Transformer (the AI model behind chatbots) not as an infinite, magical brain, but as a giant, high-tech library.

The paper asks a simple question: How many different books (sequences of words) can this library actually produce?

The authors discovered a surprising limit: No matter how big the library is, or how much time you give it, it can only write a finite number of unique stories. Most possible stories are fundamentally "inaccessible"—the library simply doesn't have the physical space or the "ink" to write them, even if you try to trick it with different prompts.

The Core Analogy: The Pixelated Map

To understand why this happens, imagine the Transformer's internal thinking process as a giant map (called the "embedding space").

  1. The Map is Pixelated: Because computers use numbers with limited precision (like a digital photo with a fixed number of pixels), this map isn't smooth and continuous. It's made of tiny, discrete "tiles" or "pixels."
  2. The Zones: On this map, different areas correspond to different next words. If the AI's internal "pointer" lands in Zone A, it writes "cat." If it lands in Zone B, it writes "dog."
  3. The Problem of Size: As you ask the AI to write a longer and longer story, the number of possible combinations of words explodes.
    • Imagine trying to fit every possible sentence of length 100 into this map.
    • Because the map is made of finite tiles, the "zones" for specific long sentences become incredibly tiny—smaller than a single pixel.
    • Once a zone is smaller than a pixel, the AI can't distinguish it from its neighbors. It literally cannot "see" the path to write that specific long sentence.

The Three Key Findings

The paper proves three main things about this "Pixelated Map":

1. The "Prompt" is the Key, but it has a Limit
Think of the "prompt" (the text you type) as a key that unlocks a specific door in the library.

  • The paper shows that the length of the story the AI can write grows linearly with the length of your key (the prompt).
  • Analogy: If you give the AI a 1-word prompt, it might only be able to write a 10-word story. If you give it a 10-word prompt, it might write a 100-word story. But you can't just keep adding words forever; eventually, the "key" runs out of unique combinations to unlock new, longer paths.

2. The "Cliff" of Failure
There is a specific length threshold.

  • Below the cliff: The AI works perfectly. It can copy or generate almost any short sequence you ask for.
  • Above the cliff: The number of stories it can write drops off a cliff. It doesn't get slightly worse; it suddenly becomes impossible to generate most long sequences.
  • Analogy: Imagine a staircase where the first 50 steps are solid. But step 51 is a trapdoor. Once you pass a certain length, the probability of the AI successfully writing a specific long string of words drops to near zero, exponentially fast.

3. The "Cramming" Experiment
The researchers tested this by trying to "cram" a specific long sequence into the AI's memory using a special, optimized prompt (like a master key).

  • Result: They found that for short sequences, the AI could be forced to output them. But once the sequence got too long, no amount of "cramming" worked. The AI simply couldn't generate the sequence, no matter how hard they tried to tune the prompt.
  • This explains why AI models sometimes fail at simple tasks like copying a long string of text perfectly, even if they were trained specifically to do it. It's not a training error; it's a structural limit of the architecture.

Why Does This Happen? (The "Rounding Error" Metaphor)

The paper argues this is due to finite precision.

  • The Metaphor: Imagine you are drawing a picture with a ruler that only has markings every millimeter. You can draw a straight line easily. But if you try to draw a very complex, long, winding path that requires you to turn at a point that is 0.0001 millimeters away from a mark, your ruler can't do it. You are forced to round to the nearest millimeter.
  • The Result: Over a long sequence, these tiny rounding errors accumulate. The AI's internal "pointer" drifts off the tiny, precise path required to write a specific long sentence, and it lands in a different zone, producing a different word.

Summary

  • Transformers are not infinite: They have a hard, mathematical limit on how many unique sequences they can generate.
  • It's a geometry problem: The limit comes from the shape and size of the "map" inside the AI and the fact that computers can't store infinite precision.
  • The "Cliff": Performance is great for short tasks but collapses abruptly for long tasks, not gradually.
  • It's fundamental: This isn't because the model is "dumb" or poorly trained. Even with infinite time and data, the architecture itself cannot generate most long sequences.

The paper concludes that this limitation is a fundamental property of the Transformer design, applying to all sizes of models, from small ones to the massive ones used today.

Drowning in papers in your field?

Get daily digests of the most novel papers matching your research keywords — with technical summaries, in your language.

Try Digest →