← Home
AI 101
Updated 19 November 2026
Data, training, guardrails and the race towards AGI, in plain English

How AI Models Like Claude and GPT Are Trained

Nobody writes an AI model line by line. It is grown: shown a vast amount of text and adjusted, trillions of times, until it becomes good at predicting what comes next. This page explains how, what goes in, how it is kept in check and where the labs are trying to take it.

A model like Claude or GPT is really two things: a huge table of numbers (the parameters) and a recipe for using them. Training is the process of finding good numbers. Everything else, from the personality to the safety rules, is layered on top.

15 trilliontokens of training textMeta said its Llama 3 model (2024) was trained on more than 15 trillion tokens. Reading that at normal speed would take one person tens of thousands of lifetimes.
175 billionparameters in GPT-3Parameters are the adjustable settings where everything the model has learned is stored. GPT-3 (2020) was the last big OpenAI model to publish its count. Today's models are believed to be far larger.
5× a yeargrowth in training computeThe computing power used to train the leading models has grown about five times every year since 2020, according to the research group Epoch AI.

1. The training process, in six steps

1Gather the dataCollect an enormous amount of text, and often images, audio and code: web pages, books, articles, forums and software. The aim is to cover as much of human knowledge and language as possible.
2Clean it and cut it into tokensDuplicates, junk and harmful material are filtered out. The text is then chopped into tokens, pieces of about three-quarters of a word, and each token becomes a number the computer can work with.
3Pre-training: guess the next tokenThe model is shown a passage with the next token hidden and asked to guess it. Each wrong guess nudges billions of internal settings, called parameters, very slightly. Repeat this trillions of times and grammar, facts and reasoning emerge. This stage uses nearly all of the computing power.
4Fine-tuning: make it an assistantThe raw model can only continue text. Further training on example conversations, with people and other AI models rating the answers, teaches it to be helpful, to follow instructions and to refuse harmful requests.
5Test it and try to break itThe model sits hundreds of tests of knowledge, reasoning and coding. Specialist "red teams" then attack it to see whether it can be pushed into dangerous or dishonest behaviour before the public gets it.
6Release, watch and repeatThe finished model is frozen and released with usage rules and safety filters around it. It does not learn from your conversations as you type. Lessons from real use feed into training the next model.

The one trick: guess the next word

An illustration of what the model produces at every step: a probability for each possible next token.

The cat sat on the ?

  • mat62%
  • sofa14%
  • floor9%
  • bed6%
  • roof3%

Illustrative figures. In training, the guess is compared with the real next word and the parameters are adjusted to make the right answer a little more likely next time.

Why such a simple game works

To predict the next word of a physics textbook you need to know some physics. To predict the next line of a detective story you need to follow the plot. To predict the next line of a program you need to understand the code.

So a model that becomes very good at prediction has to build up, inside its parameters, a working knowledge of language, facts and reasoning. Nobody programs that in. It emerges from the training, which is also why even the people who build these models cannot fully explain how they reach an answer.

When you chat with Claude or ChatGPT, it is doing the same thing: predicting one token after another, very quickly, to build its reply.

2. The data: what goes in

The labs say little about exactly what their newest models are trained on, so the best public figures come from older models and from Meta, which publishes more.

What GPT-3 was trained on

Share of the training mix for OpenAI's GPT-3 (2020), by source

  • Web pages (Common Crawl)60%
  • Web pages linked from Reddit (WebText2)22%
  • Books, collection 18%
  • Books, collection 28%
  • Wikipedia3%

Source: OpenAI, GPT-3 research paper, 2020. The last time OpenAI published a breakdown like this.

How much text a model reads

Tokens of text used in training, in trillions

  • GPT-3 (2020)0.3 trillion
  • Llama 2 (2023)2 trillion
  • Llama 3 (2024)15 trillion+

Sources: OpenAI and Meta research papers and announcements. A token is about three-quarters of a word.

  • The public web. Still the largest source. Automated programs called crawlers copy billions of pages. Website owners can ask crawlers to stay away, and many news sites now do.
  • Licensed material. Labs increasingly pay for data: deals with news publishers, book publishers, stock-image libraries and sites such as Reddit.
  • Code. Public software from sites such as GitHub is why these models program so well.
  • People paid to write it. Thousands of contractors, including doctors, lawyers and programmers, write and grade example answers for fine-tuning.
  • Your conversations, sometimes. Policies differ by company and by product, and change. Check the privacy settings of the tool you use; business versions normally do not train on your data.
  • Synthetic data. Models now generate practice material for other models, especially for reasoning and coding.
  • It is contested. Authors, artists and newspapers have sued over the use of their work without permission. In 2025 Anthropic agreed to pay $1.5 billion to settle a case brought by authors, and other cases continue.

3. How many instructions does a model follow?

There is no single rulebook with a number of rules you can count. Instead, guidance reaches the model in four layers, and when they conflict, the higher layers win.

Layer 1 · built inTrainingNot instructions at all, but trillions of examples. The model absorbs how people write, argue, explain and behave. This is the deepest layer and the hardest to change afterwards.
Layer 2 · from the labCharacter and valuesDuring fine-tuning the lab teaches the model how it should behave. Anthropic publishes a long "constitution" for Claude, and OpenAI publishes a "Model Spec" for GPT, setting out priorities such as honesty, helpfulness and avoiding harm.
Layer 3 · from the appThe system promptHidden text placed before every conversation by whoever built the product, often running to thousands of words: who the assistant is, today's date, what tools it has and what it must not do.
Layer 4 · from youYour promptWhat you type. It has the most influence on the answer you get, but the least authority: it cannot override the layers above it.

This is the big difference from traditional software. A normal program follows exact instructions and does nothing else. An AI model is given broad guidance in ordinary language and has to use judgement about how to apply it, much as a new employee is given a handbook rather than a script for every situation. That makes it flexible. It also means its behaviour can never be fully guaranteed.

4. Guards and rails

No single safeguard is trusted on its own. The labs stack several, so that a failure in one is caught by another.

Values trained inThe first line of defence is the model's own judgement, taught during fine-tuning, so that it declines to help with things like weapons or fraud without needing to be told each time.
Filters on the way in and outSeparate, smaller AI models called classifiers scan requests and replies for banned content, and can block an answer even if the main model was tricked into writing it.
Red teamingStaff and outside experts spend weeks trying to "jailbreak" a model before release. What they find is used to retrain it and to tighten the filters.
Safety frameworksThe big labs publish rules for themselves: Anthropic's Responsible Scaling Policy, OpenAI's Preparedness Framework and Google DeepMind's Frontier Safety Framework. Each sets capability levels that trigger tighter security.
Outside testing and lawBodies such as the UK's AI Security Institute test major models, and the EU AI Act puts legal duties on the makers of the most capable ones.
Monitoring after launchUsage policies say what the model may be used for. Automated systems and human reviewers look for abuse, and accounts can be banned.
  • They are not perfect. Determined users still find jailbreaks, and models still state false things with confidence ("hallucinations"). Treat anything important as a draft to check.
  • They are set by companies. What counts as harmful is decided mostly by the labs themselves, which is why governments are now building their own testing bodies.

5. Why development keeps accelerating

Three things are growing at once: the computing power used in training, the amount of data, and the cleverness of the methods. The charts show what that looks like.

Models got bigger

Parameters, in billions

  • GPT-1 (2018)0.117 billion
  • GPT-2 (2019)1.5 billion
  • GPT-3 (2020)175 billion

Source: OpenAI research papers. A 1,500-fold increase in two years. Labs have mostly stopped publishing the figure since.

Training compute: what 5× a year adds up to

Computing power for the leading model, indexed to 2020 = 1

  • 20201
  • 20215
  • 202225
  • 2023125
  • 2024625
  • 20253,125

The trend, not exact measurements: Epoch AI estimates growth of about 5× a year since 2020 (range 4× to 6×).

The length of task an AI can finish on its own

How long the task would take a skilled person, for tasks the model completes half the time (minutes)

  • GPT-4 (March 2023)3.5 minutes
  • Claude 3.7 Sonnet (February 2025)1 hour
  • o3 (April 2025)2 hours
  • GPT-5 (August 2025)3.6 hours
  • Claude Opus 4.5 (November 2025)5.3 hours

Source: METR, Time Horizon 1.1 (January 2026), measured on software tasks. METR stresses that the margins of error are wide for the newest models. It found the figure doubling about every seven months since 2019, and about every four months since 2023.

  • More chips. Training now happens in data centres holding hundreds of thousands of specialist processors, most of them made by Nvidia.
  • Better methods. "Reasoning" models that think before they answer, and better training recipes, get more ability out of the same hardware.
  • More money. Each success attracts more investment, which pays for the next, larger training run.
  • AI helping to build AI. The newest ingredient, and the subject of the next section.

6. RSI: when AI starts improving AI

AI writes codeand runs testsBetter methodsbigger modelsA stronger AIis trainedResearcherswork fasterEach lap isfaster

Recursive self-improvement (RSI) means an AI system that helps to design its own successor, which is better at designing the one after that, and so on. Each turn of the loop is quicker than the last.

Where we are now. The loop is part-closed. AI already writes a large share of the software inside the labs; Anthropic has said Claude writes most of its own production code. But people still choose the research direction, design the experiments and decide what gets released.

Why it matters. If AI could do the whole job of an AI researcher, progress would no longer be limited by the number of human experts. Supporters see that as the fastest route to cures and scientific breakthroughs. Critics worry that things could move faster than anyone can check or control, which is why the labs' own safety frameworks treat automated AI research as a danger line.

Why it may be slower than feared. Ideas are not the only bottleneck. Each new model still needs chips, electricity and months of training, and none of those speed up just because the code was written faster.

7. The aim: AGI

Artificial general intelligence is the stated goal of the leading labs: an AI that can do most intellectual work as well as a capable person. There is no agreed test for it, and each lab describes it differently.

OpenAIIts charter defines AGI as "highly autonomous systems that outperform humans at most economically valuable work".
AnthropicPrefers the term "powerful AI". Its chief executive, Dario Amodei, has described it as "a country of geniuses in a datacenter".
Google DeepMindDescribes levels of AGI, from matching an unskilled person to exceeding every human, across a wide range of tasks.

The case that it is close

The trends on this page have held for years. Models have gone from finishing five-minute tasks to five-hour tasks in under three years. Leaders of the big labs have said publicly that they expect AGI within a few years, and they are spending hundreds of billions of dollars on that belief.

The case for caution

Today's models still make basic mistakes, cannot learn on the job the way people do, and struggle outside tasks that look like their training. Some senior researchers argue that predicting text will not be enough and that new ideas are needed. And the people forecasting AGI soonest are often the ones raising money to build it.

Keep reading

Sources and caveats: compute growth is from Epoch AI; task-length figures are from METR; GPT and Llama figures are from OpenAI's and Meta's own papers and announcements. This is a simplified account: the labs keep many details of their training private, and methods differ between companies and change with each model. Checked on 19 November 2026.