Starting from nothing
A new AI model starts as a huge network of numbers, called parameters or weights, set to random values. It knows nothing about language or the world. Training adjusts these numbers, a little at a time, so that the model gets better at a task. For large language models, training happens in several stages, each with a different purpose, and can take months and cost enormous sums for the largest models.
Gathering data
The first step is collecting training data, mostly text from public websites, books, scientific articles, code repositories and other sources, sometimes licensed from publishers. Developers filter out low-quality pages, duplicates, spam and some harmful content, and try to remove personal information. The quality and variety of data strongly affect how capable the model becomes. Questions about using copyrighted material for training are being debated in courts.
Pre-training
In pre-training, the model reads its training data and repeatedly tries to predict the next token, a word or piece of a word, in each passage. When it guesses wrong, its parameters are adjusted slightly to make the correct answer more likely. Repeated over trillions of tokens, this simple task forces the model to learn grammar, facts, reasoning patterns and styles of writing. Pre-training uses most of the computing power in building a model.
A base model
The result of pre-training is called a base model. It is knowledgeable but not yet a helpful assistant. If you ask it a question, it might continue writing in the style of a web page rather than answer, or produce something inappropriate, because it simply imitates the text it has seen. Base models are powerful starting points, but they need further training to become useful and safe chat assistants.
Learning to follow instructions
In supervised fine-tuning, the model is trained on many examples of instructions paired with high-quality responses, written by people or generated and checked carefully. These examples teach the model to answer questions directly, follow formatting requests, hold conversations and decline inappropriate requests. This stage requires far less computing than pre-training but has a big effect on how the model behaves.
Learning from feedback
Next, developers often use reinforcement learning. In reinforcement learning from human feedback, people compare different answers from the model and indicate which is better. A separate reward model learns these preferences, and the AI is trained to produce answers that score highly. Some developers also use AI feedback guided by written principles, such as Anthropic's Constitutional AI. This helps make models more helpful, honest and harmless.
Training to reason
Since 2024, developers have increasingly trained reasoning models using reinforcement learning on problems with checkable answers, such as maths and programming. The model generates long chains of reasoning and is rewarded when its final answer is correct, gradually learning effective strategies for working through hard problems. This approach, used in models from OpenAI, DeepSeek, Google, Anthropic and others, has greatly improved performance on difficult tasks.
Testing before release
Before release, models are evaluated on benchmarks for knowledge, reasoning and coding, and tested by internal and external teams for safety risks, such as whether they could help with dangerous activities, show bias or be tricked into ignoring their rules, a practice called red teaming. Some governments' AI safety institutes test leading models before launch. Developers may add further training or safeguards based on what they find.
Why chatbots behave as they do
Understanding training helps explain chatbots' strengths and weaknesses. Their broad knowledge comes from pre-training, but so does their tendency to sometimes make things up, since they learned to produce plausible text. Their knowledge stops at a training cutoff date unless they can search the web. Their politeness, refusals and style come largely from post-training, which is why different assistants feel different even with similar abilities.
Why it matters
Knowing how AI models are trained helps people use them wisely and take part in debates about AI. Questions about training data, copyright, bias, safety testing and the values taught in post-training are some of the most important issues in AI today. As training methods evolve, the balance between pre-training, post-training and reasoning training continues to shift, shaping the AI tools that millions of people use.
Sources & further reading
- OpenAI · Training language models to follow instructions with human feedback (InstructGPT, 2022) ↗
- Anthropic · Constitutional AI: Harmlessness from AI Feedback (2022) ↗
- DeepSeek · DeepSeek-R1: Incentivizing reasoning capability in LLMs via reinforcement learning (2025) ↗
A simplified explanation of a technical process. Photograph: original AI-generated illustration (Adobe Firefly). Reference organisations do not endorse this website.



