# Autoregressive Generation

- **Canonical URL:** https://getaimath.com/dictionary/autoregressive-generation/
- **Topics:** [LLM Inference: Prefill & Decode](https://getaimath.com/dictionary/category/llm-inference-prefill-and-decode/)
- **Last updated:** 2026-11-25

## What is Autoregressive Generation?

**In one sentence:** Autoregressive generation is creating output one step at a time, where every new token depends on all the tokens before it.

The model cannot write the whole answer at once, because each word depends on the last. That is why answers stream gradually and why generation is harder to speed up than prefill.

![How an AI Replies: 1. Read Your Question → 2. Type the Answer — Simple two-step cartoon: Step 1 (Prefill) shows the AI scanning your entire question in one flash (causing the brief pause before it starts talking); Step 2 (Decode) shows it typing out the reply one word at a time.](https://getaimath.com/diagrams/llm-inference-prefill-and-decode.png)
*Napkin Diagram (LLM Inference: Prefill & Decode): Every AI reply has two halves: gulping down your whole prompt at once, then speaking the answer one word at a time.*

## What is an example of Autoregressive Generation?

To write "I like cats," the model writes "I," then uses "I" to choose "like," then uses both to choose "cats."

## Why does Autoregressive Generation matter?

It explains why long answers take time and why tricks like speculative decoding exist.

## Related Concepts

- [Token Generation](https://getaimath.com/dictionary/token-generation/): Token generation is the model producing new tokens one after another to form its answer.
- [KV Cache](https://getaimath.com/dictionary/kv-cache/): The KV cache is the model's short-term memory of the keys and values it already computed for earlier tokens.
- [Prompt Processing](https://getaimath.com/dictionary/prompt-processing/): Prompt processing is the model reading and understanding your input before it starts writing an answer.
- [Key Cache](https://getaimath.com/dictionary/key-cache/): The key cache is the part of the KV cache that stores the keys for all previous tokens.
- [Tokens Per Second (TPS)](https://getaimath.com/dictionary/tokens-per-second-tps/): Tokens per second is how many tokens a model produces, or processes, every second.
- [Value Cache](https://getaimath.com/dictionary/value-cache/): The value cache is the part of the KV cache that stores the values for all previous tokens.

---
Source: The AI Math Dictionary (https://getaimath.com/dictionary/autoregressive-generation/)
