Reasoning Large Language Models (LLMs) learn to think by extending standard text generation into multi-step problem-solving using specialized training methods and test-time computation.
Models start with standard next-token prediction on massive datasets of text, code, and mathematics. This builds a foundational understanding of:
Models can be trained on data containing explicit step-by-step rationales, or chain-of-thought (CoT), that map a complex problem to a correct final answer.
This encourages the model to break a problem down into sequential reasoning steps rather than attempting a single-shot answer.
Reasoning models can generate long reasoning trajectories and receive rewards based on the correctness of their outputs.
For tasks such as mathematics, programming, and formal reasoning, the answer can often be checked automatically.
DeepSeek-R1-Zero demonstrated that reasoning behaviours can emerge when reinforcement learning is applied directly to a base model using primarily rule-based rewards.
The model does not initially require a large collection of human-written reasoning traces.
Reported emergent behaviours include:
GRPO evaluates multiple generated reasoning paths for the same problem and compares their rewards relative to one another.
A simplified picture is:
Problem
β
βββββββββββΌββββββββββ
βΌ βΌ βΌ
Path A Path B Path C
β β β
Score Score Score
βββββββββββΌββββββββββ
βΌ
Relative comparison
β
βΌ
Policy update
Rather than requiring an independent value model for every trajectory, GRPO can use the relative performance of a group of sampled solutions to guide learning.
Reasoning can be supervised at different levels.
An Outcome Reward Model evaluates the final answer.
Problem β Reasoning β Final Answer β Reward
β
Correct?
The main question is:
Did the model arrive at the correct answer?
A Process Reward Model evaluates individual reasoning steps.
Problem
β
βΌ
Step 1 β β
β
βΌ
Step 2 β β
β
βΌ
Step 3 β β
β
βΌ
Final Answer
This allows training to distinguish between a reasoning process that is correct throughout and one that happens to arrive at a correct answer despite flawed intermediate reasoning.
Large reasoning models can generate large datasets containing reasoning trajectories.
These datasets can then be used to train smaller student models.
Large reasoning model
β
βΌ
Millions of reasoning
examples
β
βΌ
Student model
β
βΌ
Smaller + cheaper model
The goal is to transfer some of the reasoning capabilities of a large, computationally expensive model into a smaller and more efficient model.
The major difference is that reasoning models can use additional computation at inference time, rather than doing all of their computation during training.
This is often called test-time compute or test-time scaling.
Instead of immediately producing an answer, a reasoning model can generate a long internal reasoning trajectory.
It can use this additional computation to:
Conceptually:
Standard LLM
Prompt ββββββββββββββββΊ Answer
Reasoning LLM
Prompt
β
βΌ
Think
β
ββββΊ Try approach A
β
ββββΊ Detect problem
β
ββββΊ Try approach B
β
ββββΊ Verify
β
ββββΊ Correct answer
The internal reasoning tokens are sometimes described as a scratchpad.
Important: The internal reasoning process of modern reasoning models should not necessarily be equated with the modelβs complete or literal βthought process.β What is exposed to a user may be a summary or selected representation rather than the modelβs underlying computation.
A reasoning model can often be given a larger thinking budget at runtime.
For example:
Low effort
β
Small compute budget
β
Fast response
Medium effort
β
More computation
β
More extensive reasoning
High effort
β
Large compute budget
β
More extensive search / verification
This is particularly useful for problems involving:
The central idea is:
Instead of making the model substantially larger, give it more computation when solving a difficult problem.
Reasoning LLMs can therefore be viewed as combining several components:
PRE-TRAINING
β
βΌ
Foundational model
β
βΌ
Reasoning-oriented
fine-tuning
β
βββββββββββββ΄ββββββββββββ
βΌ βΌ
SFT RL
CoT examples Verifiable rewards
β β
βββββββββββββ¬ββββββββββββ
βΌ
Reasoning model
β
βΌ
TEST-TIME COMPUTE
β
βββββββββββββΌββββββββββββ
βΌ βΌ βΌ
Search Verify Backtrack
β β β
βββββββββββββΌββββββββββββ
βΌ
Answer
The key conceptual shift is from:
βPredict the next token.β
towards:
βUse computation to search for a good solution before producing the answer.β
This does not mean that the underlying architecture necessarily changes dramatically. Much of the capability can arise from training the model to use its existing generative machinery as a reasoning process and allocating additional computation at inference time.
in-context learning examples
Concept π§© π

output = reasoning + answer
more tokens, so LLMs use more tokens and more compute
compute budget
complete chain of thought not shown (too long, can train another model that can mimic this model)

Math: problem (prompt) -> solution (words + LaTeX)
AIME dataset: math Olympiad problems
GSM8K: grade school math problems
what is the metric? pass@k Probability that at least one of k generated attempts succeeds
can afford to generate more than one answer
best of n
take n attempts and c successes
pass@k vs. T (temperature)
formula for pass@k in terms of c and n
cons@k (majority voting)
reasoning chain is hard to write from scratch
human written reasoning maybe different to how model reasons
try Reinforcement Learning
Concept π§© π incentivize model to reason before answering
GRPO: [G]roup [R]elative [P]olicy [O]ptimization

advantage = compare to completions (average)
Reinforcement learning developed before LLMs
sample multiple times and see how good this is
GRPO explained
policy model is the LLM
KL divergence so model does not deviate too much from base model
How GRPO Works: A prompt is given. The student LLM generates multiple answers. A fixed teacher and evaluator score these answers, and a KL penalty is applied to keep the student close to the teacher. The use scores are then normalized into relative advantage scores that identify which answers were relatively good and bad. This advantage signal is used to update the student model, completing the training loop.

π Rewards =
control thinking: as thinking tokens increase, performance increases
dynamic budget, context length, budget forcing (introduce tokens midway to force reasoning and force it to think more before generating answer)
wait, wait, wait, I see β¦.

π€ β is this really thought/thinking/reasoning?
how can we be sure that model is thinking?
Concept π§© π
models might think in some other space, which may not be human-like reasoning or may not be language-space !


in the reasoming case, there is no reward model since there is a verifiable output
in GRPO we only train the policy model
in PPO we train the policy model + value model
GRPO vs PPO math

ratio of probability of current policy to the old policy
clip to ensure updates are not too big
KL divergence term is used to penalize the model if it strays too far from the original model
summation over all groups and you are sampling multiple completions
first summation is over group, second summation is over indices of tokens
1/length(Output) means the contribution of a token depends on the length of the output

Note that this may be leading to output length becoming bigger and bigger (see Increasing output length section below)
Concept π§© π PPO is used to tune a model and align it to human preferences
Concept π§© π GRPO is used to train a model to reason
Concept π§© π GRPO does not have a value function


adjustment for level of difficulty of math problems: most complettions will be failures. so adjust standard deviation
encourage diversity by tuning epsilon in clip function (so that polcuy changes even if a unlikely token appears)

start with pretrained model
multi-head latent attention

small scale SFT with reasoning data (data source is chain of thought from R1 model rewritten by humans)
GRPO with reward = formatting + accuracy + language consistency
final SFT on reasoning and non-reasoning data (helpful + harmless)
deepseek recipe is:

reasoning behaviour emerges naturally such as self-verification, backtracking.