The Core Mechanics of LLM Training: Comparing Pre-training, Fine-Tuning, and RLHF
A breakdown of the three-stage pipeline that transforms raw internet text into a conversational AI, revealing how models learn grammar, acquire knowledge, and develop a safe personality.
By Harper Lane
In short
- Modern conversational AI is built in three distinct stages: pre-training, supervised fine-tuning (SFT), and reinforcement learning from human feedback (RLHF).
- Pre-training consumes roughly 99% of the computational budget and builds the model's core knowledge by predicting text across trillions of documents.
- Supervised Fine-Tuning uses a few thousand high-quality human examples to teach the raw model how to format its output as a helpful assistant.
When Meta trained its Llama 3 model, the system ingested over 15 trillion tokens of data—a volume of text so massive it would take a human millions of years to read. Yet, if you were to interact with that model immediately after it finished processing those trillions of words, it would be entirely useless as a chatbot. It would not answer your questions; it would likely just generate more questions, or endlessly autocomplete a sentence until it ran out of memory.[1]
This counterintuitive reality highlights the core illusion of modern artificial intelligence: a conversational AI is not a single, monolithic brain. It is the product of a strict, three-stage manufacturing pipeline. To build a system like ChatGPT or Claude, developers must first forge the raw intelligence, then shape its behavior, and finally polish its judgment. These stages are known as pre-training, supervised fine-tuning (SFT), and reinforcement learning from human feedback (RLHF).[5]
The first stage, pre-training, is where the model acquires its knowledge of the world. The objective during this phase is deceptively simple: predict the next word in a sequence. Researchers feed the model vast swaths of the internet—Wikipedia, books, scientific papers, and code repositories—and mask the final word of every sentence. The model guesses the word, checks the actual answer, and minutely adjusts its internal mathematical weights to make a better guess next time.[1][5]
While "next-word prediction" sounds like a glorified autocomplete, doing it accurately across trillions of examples forces the model to build deep internal representations of logic, grammar, and facts. To correctly predict the next word in a complex physics paper, the model cannot just rely on statistical parroting; it must implicitly learn the rules of physics. This phase consumes roughly 99 percent of the total computational budget, requiring tens of thousands of specialized GPUs running continuously for months.[1]
The output of this massive computational effort is called a "base model." Base models are powerful but alien. Because they are trained simply to predict what comes next on the internet, prompting a base model with "Write a poem about the ocean" might result in it generating "Write a poem about the sky," because lists of writing prompts are common on the web.[5]
To transform this alien autocomplete engine into a helpful assistant, developers move to the second stage: Supervised Fine-Tuning (SFT). Here, the objective shifts from prediction to instruction-following. Instead of trillions of random internet documents, the model is fed a highly curated dataset of perfect prompt-and-response pairs written by human experts.[2][5]
During SFT, researchers discovered a principle known as "Less Is More for Alignment" (LIMA). The LIMA research demonstrated that you do not need massive volumes of data to teach a model how to behave. A mere 1,000 to 10,000 exceptionally high-quality, human-crafted examples are often enough to shift the model's entire posture from a passive text-predictor to an active, helpful assistant.[4]
However, SFT has a scaling problem. Writing thousands of perfect, multi-paragraph essays, code snippets, and mathematical proofs is incredibly expensive and slow. Furthermore, human experts often disagree on what constitutes a "perfect" answer to a complex or subjective query. This bottleneck led to the development of the third and most crucial stage for modern chatbots.[2][3]
Writing thousands of perfect, multi-paragraph essays, code snippets, and mathematical proofs is incredibly expensive and slow.
Reinforcement Learning from Human Feedback (RLHF) was the breakthrough that made systems like ChatGPT viable. Instead of asking humans to write perfect answers from scratch, RLHF asks humans to act as critics. The model is given a prompt and generates several different possible responses. A human grader reads them and ranks them from best to worst.[2][3]
These human rankings are not fed directly back into the main language model. Instead, they are used to train a second, smaller AI known as a "Reward Model." The Reward Model's only job is to look at a piece of text and predict how highly a human would score it. Once the Reward Model is trained, it acts as an automated, high-speed judge.[3]
In the final reinforcement loop, the main LLM practices answering millions of prompts. The Reward Model instantly scores each answer, and the main LLM updates its behavior to maximize that score using an algorithm called Proximal Policy Optimization (PPO). This automated loop allows the model to refine its conversational tone, learn to refuse dangerous requests, and adopt a helpful persona at a scale that human graders could never match.[3][5]
Some frontier labs have pushed this concept even further. Anthropic pioneered a variation called Constitutional AI, which replaces the human graders entirely. Instead of humans ranking responses to train the Reward Model, a separate AI evaluates the responses against a written "constitution" of principles (e.g., "choose the response that is least harmful"). This allows the alignment process to scale even faster without relying on massive human labor fleets.
Understanding this three-stage pipeline explains why AI models fail in the specific ways they do. If a model hallucinates a fake historical date, the failure likely stems from the pre-training stage—the fact simply wasn't absorbed into its internal weights. RLHF cannot magically teach a model new facts; it can only teach the model how to present the facts it already knows, or how to politely admit ignorance.[5]
Conversely, if a model refuses to answer a benign question because it overly cautiously flags it as dangerous, that is a failure of the RLHF stage. The Reward Model was trained too aggressively to penalize anything resembling controversy, resulting in a "lobotomized" base model.[3][5]
As the industry races toward more capable systems, the mechanics of training are evolving. Labs are increasingly using synthetic data generated by older models to train newer ones, attempting to bypass the limits of human-generated text. Yet, the fundamental architecture—forging the knowledge base, defining the format, and reinforcing the behavior—remains the bedrock of modern artificial intelligence.[1][5]
How we did this
- Method
- Normalising the computational and data requirements of the three primary phases of LLM development (pre-training, supervised fine-tuning, and RLHF) to a common baseline using published technical reports.
- What we found
- There is an extreme asymmetry in LLM development: while RLHF and fine-tuning dictate 100% of the model's behavioral alignment, safety profile, and conversational tone, they consume less than 1% of the total computational and data budget compared to pre-training.
- What we worked from
- Llama 3 pre-training data scale (15 trillion tokens): 15,000,000,000,000 tokens — Meta AI
- LIMA SFT alignment data scale (1,000 examples): ~1,000 curated examples — arXiv
- InstructGPT RLHF human data scale: Tens of thousands of ranked prompts — OpenAI Research
- Limits of this analysis
- Compute ratios vary by model size and proprietary lab techniques, and the exact financial cost of human labor fleets for RLHF is not publicly quantified by frontier labs.
Key terms
- Base Model
- The raw neural network produced after pre-training, capable of predicting text but not yet trained to act as a conversational assistant.
- Token
- The fundamental unit of data processed by an LLM, roughly equivalent to a word or a piece of a word.
- Supervised Fine-Tuning (SFT)
- The process of training a base model on a curated dataset of perfect prompt-and-response pairs to teach it how to follow instructions.
- Reward Model
- A secondary, smaller AI trained on human preferences to automatically score and guide the behavior of the primary language model.
- Proximal Policy Optimization (PPO)
- The specific reinforcement learning algorithm used to update the main model's weights based on the scores provided by the Reward Model.
Reader questions
Why do AI models hallucinate facts?
Hallucinations primarily stem from the pre-training stage. If a model did not absorb a specific fact from its training data, its core objective—predicting the most statistically likely next word—forces it to invent a plausible-sounding but incorrect answer.
Can RLHF teach a model new information?
No. RLHF is designed to shape behavior and tone, not to inject new facts. It teaches the model how to present the knowledge it already acquired during pre-training, or how to politely decline to answer when it doesn't know.
Why is pre-training so much more expensive than fine-tuning?
Pre-training requires processing trillions of words across tens of thousands of GPUs for months to build the foundational neural pathways. Fine-tuning only requires processing a few thousand examples to adjust the model's output format, which can often be done on a single server in hours.
What is Constitutional AI?
It is a variation of RLHF developed by Anthropic where a secondary AI, guided by a written set of rules (a constitution), replaces human graders to evaluate and score the main model's responses.
Where opinion splits
Scale Maximalists
The perspective that intelligence emerges primarily from massive data ingestion.
Proponents of the scale maximalist view argue that the pre-training phase is the only stage that truly matters for advancing artificial general intelligence. They point out that fine-tuning and RLHF do not add new capabilities or knowledge; they merely unlock or restrict what the model already learned during pre-training. From this viewpoint, the billions of dollars spent on massive GPU clusters to process trillions of tokens are the true engine of progress, while alignment techniques are just temporary scaffolding to make the raw intelligence palatable to consumers.
Alignment Researchers
The perspective that steering and safety are the hardest and most critical challenges.
Alignment researchers argue that raw intelligence is useless—and potentially dangerous—without rigorous behavioral conditioning. They view RLHF and Constitutional AI not as mere polish, but as the core technology that transforms a chaotic statistical engine into a reliable product. This camp emphasizes that as models grow more capable during pre-training, the difficulty of ensuring they remain helpful and harmless scales exponentially, making the reward models and reinforcement loops the true frontier of AI research.
Open-Weight Advocates
The perspective that high-quality fine-tuning democratizes AI development.
The open-source and open-weight community focuses heavily on the power of Supervised Fine-Tuning. Drawing on research like the LIMA paper, they argue that anyone with a consumer-grade GPU can take a pre-trained base model and perfectly tailor it to specific tasks using just a few thousand high-quality examples. This perspective champions the idea that while pre-training is monopolized by massive tech companies with billions in funding, fine-tuning is the great equalizer that allows startups and researchers to build specialized, highly capable tools.
- Scale Maximalists
- Argue that pre-training data volume and compute scale are the primary drivers of model intelligence, viewing fine-tuning as merely a cosmetic wrapper.
- Alignment Researchers
- Focus on RLHF and Constitutional AI as the critical components that make raw models safe, usable, and commercially viable.
- Open-Weight Advocates
- Emphasize the power of Supervised Fine-Tuning, arguing that high-quality, open datasets allow smaller models to punch above their weight class.
Perspectives this story doesn't cover
- Human data labelers
- Hardware manufacturers
Sources
[1]Meta AIScale MaximalistsIntroducing Meta Llama 3: The most capable openly available LLM to date
Read on Meta AI →
[2]OpenAI ResearchAlignment ResearchersAligning language models to follow instructions
Read on OpenAI Research →
[3]Hugging FaceOpen-Weight AdvocatesIllustrating Reinforcement Learning from Human Feedback (RLHF)
Read on Hugging Face →
[4]arXivOpen-Weight AdvocatesLIMA: Less Is More for Alignment
Read on arXiv →
[5]Factlen Editorial TeamSynthesis by Factlen editorial team
Read on Factlen Editorial Team →
More in Artificial Intelligence
See all →Model Architecture
How Mixture of Experts Routing Networks Decouple LLM Parameter Count From Compute Cost
5 sources
Structured Generation
How Constrained Decoding Forces Large Language Models to Output Valid JSON
6 sources
Neural Network Architecture
Translating Raw Scores Into Words: How the Softmax Layer Drives Large Language Models
6 sources
AI Infrastructure
How FlashAttention Bypasses the GPU Memory Bottleneck to Enable Long-Context AI
5 sources
Comments
Every angle. Every day.
Get Artificial Intelligence stories with full source coverage and perspective breakdowns, free every day.




