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
FAQ
Why do autoregressive models generate text word by word?
Are all AI models autoregressive?
How does the autoregressive nature impact my prompts?
See also
How to use this prompt
- Copy the prompt with the button above.
- Paste it into ChatGPT, Claude or your favorite AI assistant.
- 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
Batch Processing: Definition and Examples
Batch processing is a method that groups multiple queries or tasks to send them simultaneously to an AI model,
Beam Search: Definition and Examples
Beam Search is a decoding algorithm used by language models to generate text by simultaneously exploring multiple candidate sequences.
Benchmark: Definition and Examples
A benchmark is a standardized test that evaluates and compares the performance of an AI model on specific tasks, such as language understanding, ...
Beneficial AI: Definition and Examples
Beneficial AI refers to artificial intelligence designed and deployed in a way that produces positive effects for humanity, minimizing risks and
Chain-of-Thought (CoT): Definition and Examples
Chain-of-Thought pushes AI to reason step by step. Discover how this technique improves complex responses.
Chain Of Thought Reasoning: Definition and Examples
Chain of Thought Reasoning is a prompting technique that involves asking an AI model to break down its reasoning into intermediate steps.
Get new prompts every week
Join our newsletter.