# Autoregressive model

> Canonical: https://skillalmanac.com/glossary/autoregressive-model | Last verified: 2026-11-25 | Index status: index-eligible

An autoregressive model predicts the next value using earlier values in a sequence. For text generation, it models each next token given the preceding tokens and can repeat this process to extend a reply.

Also called: autoregressive, auto-regressive model, autoregressive models.

## In plain language

Think of continuing a sentence one small piece at a time. An autoregressive language model estimates which token could come next from the tokens already available, including your prompt and the reply so far. A generation procedure selects a token, adds it to the sequence, and repeats until a stopping condition. Earlier mistakes can influence later text, so check important claims rather than trusting a confident start. Sequential generation makes incremental delivery possible; it does not by itself tell you how a product will display the answer. More output means more generated tokens; the effect on waiting time and your bill depends on the model, serving system and pricing plan.

## Technical definition

For an autoregressive language model, the probability of a token sequence is expressed as a product of conditional next-token probabilities given preceding tokens. During generation, a selection rule chooses from a next-token distribution and the chosen token extends the conditioning sequence. Earlier tokens can be observed data or generated output; autoregression does not mean every earlier value was predicted by the model. Transformer describes an architecture, not this factorization: the BERT paper describes bidirectional conditioning on left and right context, providing a counterexample to treating all Transformer language models as autoregressive generators. In causal Transformer inference, a key-value cache can reuse prior attention states rather than recomputing the entire prefix. Classical autoregressive time-series models likewise use lagged values, although their parameterization and application differ from token language models.

## How it shows up when you use agents

An autoregressive language model can produce a reply by selecting one [token](/glossary/token) after another, conditioned on the available prompt and preceding output. This is a conceptual generation loop, not a claim that the entire prefix is recomputed at each step: a [KV cache](/glossary/kv-cache) can reuse previous attention states. An API can send a completed response or stream incremental events. Visible chunks therefore need not correspond one-to-one with the underlying model tokens.

Three practical checks follow. First, requesting a concise answer can reduce output-token count; [caveman](/skills/juliusbrussee/caveman) is an adjacent example of a brevity instruction, not a guarantee of monetary savings. Second, earlier generated tokens can influence what follows. A basic append-only decoding pass does not revise its prefix. To correct earlier text, use an explicit revision step rather than assuming that streaming will change earlier tokens. Third, an agent may retain prior output in later inputs, but it can also truncate or summarize that history. Its [context window](/glossary/context-window) is a capacity limit, not a counter that necessarily grows forever.

What breaks when this is misunderstood: people expect the model to plan a whole answer before writing, or they ask for one huge output in a single pass and cannot see where it went wrong. The safer habit is to break big jobs into steps, check each step, and ask for a plan first so later tokens have something sound to build on. To see where tokens went in a real run, use [agent-session-cost-review](/skills/skill-almanac/agent-session-cost-review).

## Common confusions

- **Autoregressive versus transformer.** A transformer is an architecture. Autoregressive describes conditional modeling using earlier sequence values. A bidirectional model such as [BERT](/glossary/bert) also uses Transformers, so the architecture alone does not imply autoregressive text generation.
- **Autoregressive versus time-series forecasting.** The same statistical idea, predicting from earlier values, is used to forecast things like sales. A language model applies it to tokens.
- **Autoregressive versus the context window.** The context window is how much text the model can take in. Autoregression is the way it adds new text, one token after another.
- **Generation versus display.** Autoregressive decoding can deliver tokens incrementally. An interface may buffer, edit or combine outputs, so a stream on screen does not establish the exact internal generation procedure.

## Worked examples in this catalogue

### [What Is an LLM? The Facts Agent Users Need](https://skillalmanac.com/learn/what-is-an-llm-for-agent-users)

Status: illustrative example from the item's own documentation, not executed for this page.

What you see: The guide describes an LLM as a model that reads a sequence of tokens and predicts the next one, repeating until it produces a complete reply, and explains that output tokens are priced and count toward the context window.

Why it exercises the concept: That predict-append-repeat loop is the autoregressive process, and the guide shows its consequences for cost and for stopping early.

### [caveman](https://skillalmanac.com/skills/juliusbrussee/caveman)

Status: illustrative example from the item's own documentation, not executed for this page.

What you see: The agent answers in very short, stripped-down language to cut output tokens.

Why it exercises the concept: For an autoregressive text-generation task, a shorter reply contains fewer output tokens. Whether that reduces a charge depends on the product and pricing plan.

### [agent-session-cost-review](https://skillalmanac.com/skills/skill-almanac/agent-session-cost-review)

Status: illustrative example from the item's own documentation, not executed for this page.

What you see: A report of where a coding-agent session spent its tokens, built by a script that parses the saved session transcript.

Why it exercises the concept: Inspect recorded token usage across an agent session instead of assuming every step uses the same amount. Logs may omit usage, and product billing can differ from a token-based estimate.

## Related terms

- [Large language model (LLM)](https://skillalmanac.com/glossary/large-language-model.md)
- [Transformer](https://skillalmanac.com/glossary/transformer.md)
- [Token](https://skillalmanac.com/glossary/token.md)
- [Inference](https://skillalmanac.com/glossary/inference.md)
- [GPT (generative pre-trained transformer)](https://skillalmanac.com/glossary/gpt.md)
- [Context window](https://skillalmanac.com/glossary/context-window.md)

## Sources

- [Streaming API responses](https://developers.openai.com/api/docs/guides/streaming-responses), OpenAI (accessed 2026-11-25)
- [BERT: Pre-training of Deep Bidirectional Transformers for Language Understanding](https://arxiv.org/abs/1810.04805), Devlin et al., arXiv (accessed 2026-11-25)
- [How caching works](https://huggingface.co/docs/transformers/en/cache_explanation), Hugging Face (accessed 2026-11-25)
- [Machine Learning Glossary: auto-regressive model](https://developers.google.com/machine-learning/glossary), Google for Developers (accessed 2026-11-24)
- [What is an autoregressive model?](https://www.ibm.com/think/topics/autoregressive-model), IBM (accessed 2026-11-24)
- [Speech and Language Processing (3rd edition draft), Volume I: Large Language Models](https://web.stanford.edu/~jurafsky/slp3/), Stanford University (Jurafsky and Martin) (accessed 2026-11-24)

Definitions are written by Skill Almanac from the sources above and checked against them on 2026-11-25. [Glossary index](https://skillalmanac.com/glossary.md).
