What is generative AI? How one idea writes text, draws images and codes
Generative AI makes new text, images, code, audio and video by learning the patterns in huge amounts of data. Here is how it works and where it fails.
Generative AI is software that creates new content, such as text, images, code, audio or video, instead of only sorting or labelling what already exists. It does this by learning the statistical patterns in a very large amount of training data and then producing new output that follows those patterns.
The US standards body NIST uses a definition from a US executive order: models that copy the structure and characteristics of the data they learned from in order to generate new, synthetic content. In plain terms, a model sees enough examples of something and learns to make more of it.
The core idea: predict the next piece
Most generative models work by guessing one piece at a time.
A language model splits text into tokens, small chunks of words. Given the tokens so far, it predicts which token is most likely to come next, adds it, and repeats. NIST's generative AI profile describes large language models the same way, as systems that predict the next token or word. A long answer is thousands of these small predictions in a row.
Many of these models are built on the Transformer, a design introduced in the 2017 paper "Attention Is All You Need". Its key part, called self-attention, lets the model relate every position in a sequence to every other, so each new token is chosen with the whole context in view. The paper's model generated output step by step, using the symbols it had already produced as input for the next one. That loop is still how a chatbot writes a reply.
Images and video: start from noise
Pictures are usually made a different way, by a method called diffusion. The 2020 paper on denoising diffusion models set out the approach:
The two ideas now overlap. A 2022 paper on diffusion transformers replaced the usual image network with a Transformer that works on patches, small squares of a compressed image, much as a language model works on tokens.
| Next-token models | Diffusion models | |
|---|---|---|
| Typical output | Text and code | Images |
| How it generates | One token at a time, left to right | Whole output at once, refined from noise over many steps |
| Unit it works on | Tokens | Pixels or patches of a compressed image |
What it can make
Many products now combine these. A chat assistant may call an image model, or run code it has just written. When a model is given tools and allowed to take several steps on its own, it becomes an AI agent.
Where it fails
Making things up. NIST calls this confabulation: content that is "confidently stated but erroneous or false". The term most people use is hallucination. NIST says it follows from the design itself: a model that produces statistically likely output can produce likely-sounding output that is wrong. A 2025 paper by Adam Tauman Kalai and colleagues adds a second cause: training and benchmark scoring tend to reward a confident guess over admitting uncertainty, so models learn to guess.
Bias. NIST lists harmful bias and homogenisation as a core risk. Models can amplify biases in their training data, perform worse for some groups or languages, and produce samey output that skews decisions.
Copyright. Models learn from huge collections of text and images, and who owns that material is being fought over in court. On 20 July 2026 a US court gave final approval to a $1.5 billion settlement between Anthropic and authors, Bloomberg Law reported. The class action was over the company downloading millions of pirated books, and the deal covers more than 480,000 works. NIST separately lists the easy copying of copyrighted or licensed content as a risk of generative AI.
Our take: the settlement turned on how the books were obtained. It does not settle the wider question of when training on someone's work is allowed, and other cases on that are still open.
How to judge a generative AI claim
Sources
Read next
All explainersWhat is an AI agent?
A language model that can take steps on its own, check what happened and try again. Here is what that means and where it breaks.
Read · 5 min 02Money · ExplainerWhat is capex, and why AI needs so much of it
Capital expenditure is money spent on things that last. For Big Tech right now, that mostly means data centres full of AI chips.
Read · 4 min 03Chips · ExplainerWhy GPUs cost so much
The chips that train AI models are scarce, hard to make and wrapped in software nobody else has. Here is where the price comes from.
Read · 5 min