P

Autoregressive Model: Definition and Examples

An autoregressive model is a type of artificial intelligence model that generates sequences (text, code, audio) by predicting each next element based on the previously generated elements.

Full definition

An autoregressive model works on a simple but powerful principle: it generates a sequence element by element, using each already produced element to predict the next. In the case of large language models (LLMs) like GPT or Claude, this means the model predicts the next token (word or subword) based on all previous tokens.

Concretely, when you ask an AI chatbot a question, the model does not generate its answer all at once. It produces a first word, then uses that word (and your question) to choose the second word, then uses the first two words to choose the third, and so on. This is why you often see the text appear progressively, word by word.

This sequential approach has important implications. On one hand, it allows the model to produce coherent and contextually relevant texts, because each new token takes into account everything that precedes it. On the other hand, it introduces latency proportional to the length of the response, since each token requires a full pass through the neural network.

Autoregressive models are opposed to so-called 'non-autoregressive' models that attempt to generate all elements simultaneously, often sacrificing quality for speed. Almost all current LLMs (GPT-4, Claude, Gemini, LLaMA) are autoregressive, making them the dominant architecture in generative text AI.

Etymology

The term 'autoregressive' comes from statistics and econometrics. 'Auto' means 'self' and 'regressive' refers to regression, a statistical prediction method. An autoregressive model is therefore literally a model that 'regresses on itself' — it uses its own past outputs as inputs to predict the next. The concept has existed since the 1920s with AR models in time series, long before its adoption in artificial intelligence.

Concrete examples

Understanding why an LLM can lose track over very long responses

Explain to me in 3 short paragraphs how photosynthesis works. Note: if the response drifts, it's because the autoregressive model accumulates small prediction errors over the course of tokens.

Exploiting the autoregressive nature to guide generation step by step

Solve this math problem step by step. Show your reasoning before giving the final answer. (Chain-of-thought works precisely because the reasoning tokens influence the answer tokens in an autoregressive model.)

Understanding temperature and sampling limits in generation

Generate 3 creative slogans for an artisan coffee brand. (At each token, the autoregressive model chooses from a probability distribution — temperature controls how random this choice is.)

Practical usage

Understanding the autoregressive nature of LLMs helps to write better prompts. Since the model generates its response sequentially, placing important instructions at the beginning of the prompt and asking for step-by-step reasoning (chain-of-thought) significantly improves the quality of the results. This also explains why few-shot examples are so effective: they condition the first generated tokens, which influence everything that follows.

Related concepts

TokenLarge Language Model (LLM)TransformerTemperature

FAQ

Why do autoregressive models generate text word by word?
By design, an autoregressive model predicts one token at a time based on all previous tokens. This sequential approach is what allows it to produce coherent and contextually relevant text, because each new word takes into account everything that was written before.
Are all AI models autoregressive?
No. Autoregressive models dominate text generation (GPT, Claude, Gemini), but other architectures exist. Diffusion models (Stable Diffusion, DALL-E) used for image generation are not autoregressive. Similarly, BERT is a bidirectional language model, non-autoregressive, designed to understand text rather than generate it.
How does the autoregressive nature impact my prompts?
The model cannot 'go back' to correct what it has already generated. This is why asking it to think before answering (chain-of-thought) is so effective: the reasoning tokens positively influence the final answer tokens. Similarly, a clear and structured prompt from the start yields better results than an ambiguous one, because the first tokens generated condition everything that follows.

See also

How to use this prompt

  1. Copy the prompt with the button above.
  2. Paste it into ChatGPT, Claude or your favorite AI assistant.
  3. Replace the bracketed variables with your details, then refine the result.

About Prompt Guide

Prompt Guide is a free library of 2500+ ready-to-use prompts for ChatGPT, Claude and other AIs, with guides to learn prompting and tools to build and optimize your own prompts.

More definitions

Get new prompts every week

Join our newsletter.