TTRL: Test-Time Reinforcement Learning

A model with no answer key can still grade itself: let it vote, call the winning answer correct, and reward the rest. On AIME 2024 that took Qwen2.5-Math-7B from 12.9 to 40.2.

Learn how a reasoning model improves on questions that have no labels, why a noisy vote is a good enough teacher, and where the idea breaks.

Press Train one step a few times. The model writes eight answers, votes, and rewards the winners. Then switch to Top answer is wrong and watch what a bad vote does. Then we build, piece by piece, the vote, the reward, the loop, the results and the limits.

You need a rough idea of what a probability is (a number from 0 to 1 for how likely something is) and a little Python for the code. We build the rest from zero.

Based on TTRL: Test-Time Reinforcement Learning by Yuxin Zuo, Kaiyan Zhang, Li Sheng, Shang Qu, Ganqu Cui, Xuekai Zhu, Haozhan Li, Yuchen Zhang, Xinwei Long, Ermo Hua, Biqing Qi, Youbang Sun, Zhiyuan Ma, Lifan Yuan, Ning Ding and Bowen Zhou (Tsinghua University and Shanghai AI Lab, 2025). Code: PRIME-RL/TTRL. A reading for MIT MAS.S62, How to AI an AI for (Almost) Anything, from Lecture 6, Model Evolution. Every idea is re-taught here in our own words and devices.

Vote, reward, learn

Illustrative toy, not the paper's model: one question whose true answer is 24, and a model that chooses among five answers with the chances shown. Each step samples 8 answers, takes the most common one as the label, gives reward 1 to samples that match it, and nudges the chances with a GRPO-style update (Chapter 3). The random draws are seeded, so Start over replays a new but repeatable run.

Chapter 0

Learning With No Answer Key

See why labels are the bottleneck for reasoning models, and what it means to learn from the test questions themselves

Picture a study group before a hard maths contest. The teacher hands out thirty problems and keeps the answer key. You cannot check anything. You can still get better at these exact problems, and here is how.

Each student solves every problem many times, a fresh attempt each time. Then you compare. On problem 7, six of your eight attempts land on 24. Two land on other numbers. Nobody knows that 24 is right. But six matching attempts is a strong hint. So you study the attempts that reached 24, and you ignore the rest. The next time you meet a problem like it, you reach 24 more often.

That is the whole idea of this paper. The rest of the lesson builds it piece by piece, with the numbers the authors measured.

The label bottleneck

A reasoning model is a language model that writes out its thinking, step by step, before it gives an answer. Models such as DeepSeek-R1 and OpenAI’s o1 reached a new level of skill this way. The paper’s opening says what made it work: reinforcement learning (RL). RL is learning by trial and reward. The model tries something, gets a score, and shifts toward what scored well. Chapter 1 builds this from zero.

RL needs a score. For a maths problem, the score usually comes from a label: the known right answer, written by a person. The model’s answer is compared with the label. A match earns a reward. A miss earns nothing. Labels are expensive, because people must write and check them.

New problems keep arriving without labels. The paper gives an example from its own introduction. OpenAI’s o3 solves 75.7% of ARC-AGI-1, a benchmark of visual reasoning puzzles. On the newer ARC-AGI-2 it solves only 4%. A harder set of problems appears, and no one has a label for any of them yet.

What “test time” means

A model lives in two phases. Training time is when its numbers, the weights, are set by learning from data. Test time is when it meets the real questions it must answer. In the usual setup the weights are frozen at test time. The model only answers.

Researchers found two ways to use test time better. The first is test-time inference (TTI): spend more compute while answering, for example by writing many answers and keeping the most common one. This is test-time scaling in its simplest form, and Chapter 2 covers it. The weights never change.

The second is test-time training (TTT): let the weights change while the model works on the test questions. Earlier TTT methods used a self-supervised side task as the training signal, one that needs no labels. Nobody had used RL for it, because RL needs a reward and test questions have no labels.

TTRL, test-time reinforcement learning, joins the two. It uses test-time inference (the vote) to make a reward, and test-time training (RL) to learn from that reward. Choose each method below and compare what it has.

Compare four ways to use test time

Each column is a method. Each row asks one question about it. Choose a method to light its column and read what it can and cannot do.

The grid follows the paper’s introduction, Section 2 and Appendix C: standard RL methods rely on labeled training data; test-time training adapts weights with a label-free side loss; majority voting and best-of-N are test-time inference; TTRL turns a vote into a reward for RL. “Standard RL” stands for rule-based RL such as GRPO on a labeled training set.

Only the last column has all three good properties at once. It trains on the test questions, it changes the weights, and it needs no labels. The price is that its reward is a guess. The next four chapters show how the guess is made and why it can still teach.

What the paper reports

The headline result is on AIME 2024, a set of hard maths contest problems. Qwen2.5-Math-7B, a 7-billion-weight maths model, scores 12.9% before TTRL. After TTRL it scores 40.2%. That is a gain of 27.3 points, or 211.6%. Across four benchmarks (AIME 2024, AMC, MATH-500 and GPQA) the same model gains 76.5% on average, from 31.1 to 54.9. No labels were used. The paper also reports that the trained model passes the ceiling of the very vote that taught it. Chapter 7 explains that claim.

The authors list three takeaways. Majority voting gives a useful reward. TTRL can beat its own training signal and come close to training on the test data with the real answers. And stable, label-free RL is possible.

Where each part of the instrument is taught

The toy at the top of this page runs the loop on a single question. Its bars are the model’s answer chances. Its eight boxes are the samples. The purple frame is the vote. The yellow boxes are the rewards. The road below says which chapter explains each piece.

  1. How a model learns from a reward: the chances, the samples and the update, plus pass@1 and maj@n.
  2. Turning many answers into one label: the purple vote.
  3. From votes to rewards and a gradient: the yellow boxes and the GRPO step.
  4. One round of TTRL, with shapes: 64 samples in, 32 kept, one weight update out.
  5. What the tables and figures show: the paper’s main numbers.
  6. Why wrong labels still give good rewards: the lucky hit, and the red switch in the toy.
  7. Beating the vote that trained it: the two ceilings.
  8. When TTRL fails: temperature, episodes and difficulty.
  9. The field guide: numbers, checklist, code, credit.
What problem does TTRL solve that standard RL on reasoning problems cannot?

Chapter 1

How a Model Learns From a Reward

Follow one question through sampling, reward and update, and learn the words pass@1 and maj@n

You are practising free throws. Each shot is a small experiment. Some go in, some miss. After a hundred shots you do not recalculate physics. You just lean toward the way you stood when the ball went in. That is reinforcement learning: try, score, lean toward what scored.

A language model solving a maths problem works the same way. It has a habit of writing certain answers. A reward tells it which habit to strengthen. This chapter names the parts, so the rest of the paper reads easily.

The model as a policy

Ask a model a question, call it x. The model does not know one answer. It holds a chance for each thing it might write. It writes its reasoning, then a final answer, one word at a time, drawing each word from its chances. Run it twice and you may get two different answers. Our LLMs for Builders lesson shows that draw in detail.

RL calls this chance table a policy: a rule for choosing what to do, given the situation. Here the situation is the question and the choice is the whole written answer. The paper writes it as

x
The prompt: the question, such as a maths problem.
y
One output the model writes: its reasoning and its final answer. Also called a rollout or a sample.
πθ(y | x)
The chance the model writes y when it is asked x.
θ
All the model’s weights. Changing θ changes the chances. Learning means changing θ.

The tilde means “is drawn from”. So y is a random draw. Drawing again gives a new y.

Reward, and one learning step

A reward is a number the world hands back for a sample. In RL on maths, the usual reward is a rule-based reward: a small piece of code checks the final answer against a label and returns 1 for a match, 0 for a miss. The paper uses exactly this style and, in Chapter 3, swaps the label for something the model can make itself.

Now one learning step, by hand. The model faces a question. We use the toy from the top of this page. It can write five answers, and the true answer is 24. Its chances are 38% for 24, 20% for 28, 17% for 18, 15% for 20 and 10% for 12.

Inside the model, each answer has a logit: a raw score. The chance of answer k is its score turned into a share, called the softmax: pk = ezk / Σj ezj. Raise one score and its share grows while every other share shrinks. A reward for 24 means: raise the score of 24.

Raise z24 by 0.5: e0.5 = 1.649, so the weight of 24 goes from 0.38 to 0.627. The others still sum to 0.62. New chance of 24 = 0.627 / (0.627 + 0.62) = 50.3%.

One reward moved the chance of 24 from 38% to about 50%. Repeat that over many samples and the model settles on what earns rewards. The exact size of each nudge is the job of the training algorithm. Chapter 3 derives the one TTRL uses.

Two ways to score a model

The paper reports accuracy in two ways, and you must keep them apart. pass@1 asks: if the model writes one answer, how often is it right? The paper estimates it by writing k answers per question and averaging, so it is also called avg@k. With k answers, of which pi is 1 when answer i is right and 0 when wrong:

pass@1
The share of single answers that are right.
1/k
Divide by the number of answers, to get an average.
Σ
Add up over answers 1 to k.
pi
1 if answer i matches the true answer, 0 if not.

The paper uses k = 16 answers at temperature 0.6 and top-p 0.95 for its main tables (4 answers for the 32k-token reasoning-model runs). maj@n asks a different question: if the model writes n answers and we keep the most common one, how often is that one right? A vote needs n samples for every question, so it costs n times as much compute. Play with the difference.

Compare one sample with a vote

The dashed line is pass@1: one sample. The warm curve is maj@n: the vote of n samples. Set how often the model writes the right answer, and how many different wrong answers share the rest.

30%

Illustrative simulation, not the paper’s data: each sample is the right answer with the chance you set, or one of the wrong answers with equal shares; a tie goes to a random tied answer. Each point averages 3,000 seeded trials, so the curve is the same on every visit.

Look at the 8-wrong and 20-wrong settings. The model writes the right answer only 30% of the time. Yet a vote of 16 is right far more often than that. The wrong answers split their 70% among many numbers, so no wrong number gets near 30%. The right answer wins the plurality. Now pick 1 wrong answer. The single wrong answer holds 70% and the vote is almost always wrong. Everything in this paper depends on this contrast: a vote is only a good teacher when the mistakes are scattered. Chapter 6 comes back to it with the paper’s own measurements.

Why this matters for TTRL

TTRL trains on the vote. So the vote’s accuracy sets how good the teaching signal is. maj@n is the quality of the teacher. pass@1 is the quality of the student. The paper’s surprise is that the student ends up better than the teacher was at the start.

A model writes the right answer 25% of the time, and its wrong answers are spread over 20 different numbers. What do you expect from a vote of 16 samples?

Chapter 2

Turning Many Answers Into One Label

Count a model's own answers and let the most common one stand in for the truth

Eight students solve the same problem on their own. They write down their final answers: 24, 24, 28, 24, 18, 24, 24, 20. The class has no key. Which answer does it hand in? Most people say 24, because five of eight agree. You just ran a majority vote: count the answers and keep the most common one.

A model can be its own class. Ask it the same question eight times and you get eight different pieces of reasoning and, often, eight different final answers. This chapter turns that pile into one answer that TTRL calls the estimated label. It is the model’s best guess at the key.

Why many samples help: test-time scaling

The paper places TTRL inside test-time scaling (TTS): spending more compute when the model answers, instead of making the model bigger. It names two families. Sequential methods make one answer longer, with more reflection and a longer chain of thought. Parallel methods write many candidate answers and then combine them. TTRL is parallel.

To combine candidates you need a rule for picking one. The paper writes it in Appendix C as

y*
The one candidate you keep: the consensus.
arg max
“The argument that gives the largest value”: look at every candidate and return the one whose score is biggest.
s(yi, x)
A scoring function. It takes candidate i and the question x, and returns a number: higher means better.

Different scoring functions give different methods. The paper lists three. In majority voting, s is how many candidates share this answer. In best-of-N, s is the score a separate reward model gives. In weighted best-of-N, s mixes the two. TTRL picks majority voting. It needs no second model and no labels.

Vote on answers, not on essays

There is a catch. Two correct solutions never read the same. One writes five lines, another writes fifteen. You cannot compare them as text. So the vote works on a small piece pulled from each: the final answer. An answer extractor is a short piece of code that reads one output and returns just its final answer. Math answers are usually marked in a fixed place, so the extractor finds them by rule.

The data flow, with shapes, for one question:

  1. One question in. A text prompt x.
  2. N outputs. N strings, each up to 3,072 tokens (32,768 for the long-thinking models the paper tests).
  3. N extracted answers. N short values, such as 24 or 28.
  4. A tally. Each distinct answer with its count.
  5. One estimated label. The answer with the biggest count.

The paper gives the code in its Listing 1. Here it is, explained line by line.

pythonfrom collections import Counter

def majority_voting_reward_fn(outputs):
    # 1. pull the final answer out of every long output
    answers = [extract_answer(o) for o in outputs]

    # 2. count how many outputs gave each answer
    counts = Counter(answers)
    majority_answer, _ = counts.most_common(1)[0]   # the most common answer

    # 3. reward 1 for each output that matches it, else 0
    rewards = [1 if ans == majority_answer else 0 for ans in answers]
    return rewards

outputs = llm.generate(problem, n=N)        # N samples of one problem
rewards = majority_voting_reward_fn(outputs)

Step 3 is the next chapter’s subject. This chapter stops at the label. Step through the vote with the device below. The first example is the paper’s own toy case from its Figure 10.

Step through a vote

Choose a case, then press Next step four times: sample, extract, count, label. The last step reveals the hidden true answer.

The first case is the paper’s Figure 10: samples 1 1 2 2 2 4 5 6, estimated label 2, true label 3. The other three cases are made-up illustrations of a strong majority, a scattered vote and a tie; in a tie the pseudo-code lets the answer counted first win.

The first case is the most important one in the paper. The true answer, 3, is not among the eight samples at all. The vote picks 2 with 3 votes out of 8, which is 37.5%. The estimated label is wrong. A wrong label sounds fatal. Chapter 6 shows why it is not.

The fraction of samples that agree with the winner has a name in the paper’s Appendix B: the majority ratio. It measures how decisive the vote was. A ratio near 1 means the model is confident. A ratio near 1/N means the answers are scattered. In the paper’s AIME 2024 run the ratio starts low and rises steadily as training goes on (its Figure 9).

What the vote is, and is not

The vote is a guess, made by the model about itself. It has no access to the truth. If the model is systematically wrong in the same way, the vote will be wrong in that way too. This is the main risk of the method, and the reason Chapter 8 exists.

Still, the vote has two things going for it. First, it comes from the model itself, so it needs no human, no second model and no label. Second, as Chapter 1 showed, it is usually more accurate than a single sample whenever mistakes are scattered. The paper notes this is also why it “mitigates reward hacking”: the model cannot easily trick a vote that it also casts.

Eight samples give the answers 1, 1, 2, 2, 2, 4, 5, 6, and the true answer is 3. What is the estimated label, and what is the majority ratio?

Chapter 3

From Votes to Rewards and a Gradient

Derive the reward, the objective and the GRPO update that TTRL runs

A coach watches eight of your free throws. She has no scoreboard. So she uses one rule: “I give a point to every shot that looks like what you do most often.” Odd, but it is a signal. Over time you do more of what you do most. If your most common habit is a good one, you improve.

TTRL gives the model exactly this coach. The vote from Chapter 2 becomes a rule for handing out rewards. This chapter writes the rule, states the learning goal, and derives the update the paper runs.

The reward rule

Call the estimated label y*, the winner of the vote. Call the final answer extracted from sample i ŷi. The paper’s reward, its Equation 3, is a plain comparison.

R(ŷi, y*)
The reward for sample i, given the estimated label y*.
1 or 0
Reward 1 when the sample’s final answer equals the label. Reward 0 when it does not. Nothing in between.

This is the same kind of rule-based reward used to train DeepSeek-R1. The only change is where y* comes from. In standard RL a person wrote it. In TTRL the model’s own vote wrote it.

The goal, in two lines

Now the goal. Pick the weights θ so the model’s samples earn a high reward on average. The paper’s Equation 1 says so.

maxθ
Search over all settings of the weights for the one that makes the rest as large as possible.
Ey ~ πθ
The expected value: the average of what follows, over a huge number of samples y drawn from the model.
r(y, y*)
The reward from the rule above. It is 1 when the sample’s answer matches the label.

Because the reward is 1 or 0, the expected reward is simply the chance the model writes the labelled answer. So the goal says: make the model write the winner of its own vote more often.

The paper then climbs toward the goal by gradient ascent: step each weight a little in the direction that raises the expected reward. Its Equation 2:

θ ←
Replace the weights with the new, better weights.
η
The learning rate: how big each step is. The paper uses a peak of 5 × 10−7 on a cosine schedule (Chapter 4).
∇θ
The gradient: for every weight, how much the expected reward changes if you nudge that weight.

How to compute that gradient from samples

There is a problem. The expected reward is an average over every possible written answer, which is far too many to enumerate. We only have eight samples. A short derivation fixes this. Write the expectation as a sum over answers y, each weighted by its chance.

∇θ E[r] = ∇θ Σy πθ(y) r(y) = Σy r(y) ∇θ πθ(y)

The reward r does not depend on θ, so only π is differentiated. Now use one identity: ∇π = π · ∇ log π. It holds because the derivative of log π is ∇π / π.

Σy r(y) πθ(y) ∇θ log πθ(y) = Ey ~ πθ [ r(y) ∇θ log πθ(y) ]

The sum has turned back into an expectation, and an expectation can be estimated by averaging samples. So the gradient estimate from N samples is (1/N) Σi ri ∇ log π(yi). In words: for each sample, raise its log-chance, and raise it more when its reward is high. This is the policy gradient. Our policy gradients lesson builds it in more detail.

GRPO: reward relative to the group

Raw rewards of 1 and 0 make a noisy signal. If every sample earns 1, all of them get pushed up, which says nothing about which was better. The fix is to judge each sample against its siblings. TTRL uses GRPO, group relative policy optimization, from the DeepSeekMath paper. For one question with N samples, each sample gets an advantage: how much better its reward is than the group average, in units of the group’s spread.

Ai = ( ri − mean(r) ) / std(r)

Here is the paper’s Figure 10 case. Eight samples, estimated label 2, rewards 0 0 1 1 1 0 0 0. Three of eight earned reward 1.

mean = 3/8 = 0.375. std = √(0.375 × 0.625) = 0.484. A for a reward of 1 = (1 − 0.375) / 0.484 = +1.29. A for a reward of 0 = (0 − 0.375) / 0.484 = −0.77.

Check: 3 × 1.29 − 5 × 0.77 = 0. Advantages in a group always sum to zero, so GRPO pushes some answers up exactly as much as it pushes others down. Try it below.

Turn rewards into advantages

Eight samples. Choose how many of them match the vote. Bars above the line are pushed up, bars below are pushed down.

3 of 8

Exact arithmetic for the group advantage A = (r − mean) / std with eight 0/1 rewards. The standard GRPO objective also clips each update and keeps the model near its starting point; the paper uses GRPO as published and does not change those parts.

Slide to 8 of 8. Every advantage is zero. The model agrees with itself, so there is nothing to compare, and the question teaches nothing. Slide to 0 of 8 and the same happens, though that cannot occur in a real vote, because the winner always matches itself. The strongest signal comes when the vote is split.

Our toy at the top uses the same step. For a sample that wrote answer k, the logit of k moves by η/N times the advantage. Samples with positive advantage raise their answer. Samples with negative advantage lower theirs. That is all that happens, once per question per step.

Five of eight samples match the vote. Which statement about the GRPO advantages is correct?

Chapter 4

One Round of TTRL, With Shapes

Trace a batch of questions through vote-then-sample and out as a weight update

You now have every part. A vote makes a label. The label makes rewards. GRPO turns rewards into an update. This chapter puts the parts in order and follows one batch of questions through the machine, with the shapes of the data at each stop. A reader who finishes it can write the loop.

The setting

TTRL has no separate training set. The test questions are the training data. The authors run TTRL on each benchmark by itself: one run on AIME 2024, one on AMC, one on MATH-500. Each run trains on that benchmark’s own questions, with no labels, and is then evaluated on the same questions. This sounds like cheating until you remember that the labels never enter. The model only ever sees the questions and its own answers. The paper also tests on benchmarks the run never trained on (Chapter 5).

The training goes in episodes. An episode is one pass over the question set. The authors set 10 episodes for MATH-500, 30 for AMC and 80 for AIME 2024, because smaller and harder sets need more passes to explore well. All runs fit on eight NVIDIA A100 80 GB GPUs.

One round, stage by stage

A round is one weight update. It takes a batch of B questions and goes through six stages. Use the slider to walk through them. Notice the two sample counts. N is how many answers the model writes per question for the vote. K is how many of those it keeps for the update.

Follow one batch through a round

Move Stage from 1 to 6. Then change N and K and watch the shapes and the token cost change. B is the number of questions in the batch, and L is the longest answer in tokens.

1 of 6
64
32

The paper’s setting is N = 64, K = 32 and L = 3,072 for non-reasoning models (32,768 for the long-thinking models). The token counts are upper bounds: N × L generated tokens and K × L trained tokens per question. Other N and K values are for you to explore, not results from the paper.

Read the stages as a story. In stage 1 the current model writes N answers to every question. In stage 2 the extractor pulls the final answer from each, and the vote picks one label per question. In stage 3 each sample earns reward 1 or 0 against its question’s label. In stage 4 the loop keeps only K of the N samples. In stage 5 GRPO computes an advantage per kept sample. In stage 6 the policy gradient and the AdamW optimizer change the weights. Then the loop returns to stage 1, and the new model writes the next batch.

Vote-then-sample

The paper calls the stage-4 trick vote-then-sample. The vote uses many samples, because more samples give a more reliable label. The update uses fewer, because each trained sample costs a forward and backward pass through a long answer. With N = 64 and K = 32, half the samples vote and are then dropped. The authors note the strategy “effectively reduces computational costs while still achieving strong performance”. They do not say how the 32 are chosen; the usual way is a random draw.

One more detail matters. The label is recomputed every round from the current model. A model that has improved votes better, so its labels improve, so its rewards improve. Chapter 7 shows why this makes TTRL different from older self-training methods that label once and stop.

The recipe in numbers

SettingValue in the paper
RL algorithmGRPO, applied on each benchmark independently
Optimizer and scheduleAdamW, cosine schedule, peak learning rate 5 × 10−7
Samples for the vote64 per question
Samples kept for training32 per question
Rollout temperature0.6; 1.0 for Qwen2.5-Math and the long-thinking models
Longest answer3,072 tokens; 32,768 for the long-thinking models
Episodes10 (MATH-500), 30 (AMC), 80 (AIME 2024)
Evaluationpass@1 from 16 samples (4 at 32k) at temperature 0.6, top-p 0.95; greedy decoding for the analysis runs
Hardware8 × NVIDIA A100 80 GB

The loop as code

Here is one round as a sketch. It follows the paper’s description. It is not the authors’ repository code, and the helper names are ours.

pythonfor episode in range(EPISODES):                     # one pass over the test questions
    for batch in batches(questions, B):                # B prompts, no labels anywhere
        outs = policy.generate(batch, n=64, temperature=T)   # (B, 64) strings, each up to L tokens
        answers = [[extract_answer(o) for o in row] for row in outs]   # (B, 64) short answers
        labels = [Counter(row).most_common(1)[0][0] for row in answers]   # (B,) estimated labels y*
        rewards = [[1.0 if a == y else 0.0 for a in row] for row, y in zip(answers, labels)]
        keep = random_subset(64, k=32)                  # vote-then-sample: train on 32 of the 64
        adv = group_advantage(rewards, keep)             # (B, 32), zero where all samples agree
        loss = -mean(adv * policy.log_prob(outs, keep))   # policy gradient, GRPO-style
        loss.backward(); optimizer.step()               # AdamW changes the weights theta

Watching a run with no answer key

There is a practical puzzle. During a run you cannot compute accuracy, because you have no labels. How do you know whether training is working? The paper’s Appendix B lists three signals you can read without any labels. Entropy measures how uncertain the model’s writing is. Majority voting reward is the average reward the vote hands out. Majority ratio is how often the most common answer appears in a rollout, which Chapter 2 introduced.

The authors also track three signals that need the true answers, for analysis only. Label accuracy asks whether the vote equals the truth. Reward accuracy asks how many of the vote-based rewards equal the rewards the true label would have given. Ground-truth ratio is how often the true answer appears in a rollout. Chapter 6 uses the first two to explain why TTRL works. In a real deployment you would watch only the first three.

Why does TTRL vote with 64 samples but train on only 32 of them?

Chapter 5

What the Tables and Figures Show

Read the paper's main numbers and see how far they travel

You have built the method. Now ask the scientist’s question: does it work, and how would we know? A good results section answers four things. What did they run? Against what baseline? On which tests? And what did not work? This chapter reads the paper’s tables and figures with those four questions.

What they ran, and against what

The authors tried TTRL on models from four families: Qwen, LLaMA, Mistral and DeepSeek. They used base models (a model trained only to continue text), instruct models (a base model tuned to follow requests), maths-specialised models, and large reasoning models (LRMs, the long-thinking kind). Sizes run from 1.5 to 32 billion weights.

The baseline is simple. Nobody had done test-time training with RL for reasoning, so there was nothing to compare against. The paper compares each model with itself: the same model before TTRL and after. The score is pass@1 from Chapter 1, averaged over 16 samples at temperature 0.6.

The tests are four benchmarks. AIME 2024 and AMC are maths contest problems, and AIME is the harder. MATH-500 is a 500-problem maths set graded in five difficulty levels. GPQA-Diamond is a set of graduate-level science questions, not maths.

The main table

Table 1 is the paper’s centre. Explore it below. Choose a benchmark and compare the before bar with the after bar for each model.

Explore Table 1

Each row is a model. The grey bar is its pass@1 before TTRL. The warm bar is after. Choose a benchmark.

All numbers are the paper’s Table 1 (pass@1, temperature 0.6, top-p 0.95, 16 samples). The Qwen3-8B row is the non-thinking mode within a 3k-token context. Avg is the paper’s average over the four benchmarks.

Four things stand out. First, on the three maths tests every model improves, and often by a lot. Qwen2.5-Math-7B goes from 12.9 to 40.2 on AIME 2024, from 35.6 to 68.1 on AMC and from 46.7 to 83.4 on MATH-500. The small Qwen2.5-Math-1.5B roughly doubles on MATH-500, from 32.7 to 73.0.

Second, GPQA barely moves. The maths models change by +1.2 and −1.4 points. The two general models gain 1.8 and 4.5. The paper does not explain this. A reasonable reading, ours and not the authors’, is that GPQA is not maths, so a maths-trained model has less prior knowledge to sharpen. Chapter 8 returns to that dependence on prior knowledge.

Third, gains grow with scale. Moving from Qwen2.5-7B to 32B raises the average gain from 14.7 to 18.7 points. The authors say that larger models produce more accurate votes, so the reward is cleaner. This fits Chapter 1: a better model has a better teacher.

Fourth, a caution about the text. The paper says the AIME gain is at least 105% for every model. The table’s Qwen3-8B row shows 73.6%. We quote the table.

Beyond the table

Strong models still gain. Table 2 and Figure 3 apply TTRL to models that already had costly RL training. DeepSeek-R1-LLaMA-8B rises from 51.7 to 69.2 on AIME, from 81.6 to 88.9 on AMC, and from 89.6 to 90.9 on MATH-500. In Figure 3, two long-thinking models gain about 10 points on AIME 2024 each. The same table shows weak models gaining little on the hardest set: Mistral-Nemo-Instruct goes from 0.8 to 0 on AIME.

It helps weaker models too. Table 2 lists more families. LLaMA-3.2-3B-Instruct goes from 6.0 to 13.3 on AIME, from 19.4 to 31.3 on AMC and from 43.9 to 61.6 on MATH-500. Ministral-8B-Instruct goes from 52.4 to 57.8 on MATH-500. The pattern holds across Qwen, LLaMA, Mistral and DeepSeek models, though the gains are smallest where the starting score is close to zero.

It transfers. Figure 4 trains on one benchmark and tests on the others, with Qwen2.5-Math-7B and greedy decoding. Accuracy improves on all of them. The authors read this as evidence that TTRL is not just memorising its own questions.

It is not tied to one algorithm. Figure 5 swaps GRPO for PPO and for PRIME on MATH-500 with Qwen2.5-Math-1.5B. The accuracy curves lie close together. Entropy, a measure of how uncertain the model is, falls as training goes on in all three.

It rivals big labeled runs. The appendix’s Table 4 uses greedy decoding. TTRL takes Qwen2.5-Math-7B from 16.7 to 43.3 on AIME 2024, an improvement of 159.3%, and the paper reports that this passes every model it lists that was trained on large labeled sets. The authors add that the setups differ, which “makes the comparison seem unfair”. The comparison shows reach, not a fair contest.

What these numbers do not show

Read the results with care. Each run trains and tests on the same questions. That is the point of test-time training, but it means the numbers say how well the model adapts to a known set of questions, not how it will do on questions it never sees. The paper’s own limitations section says the study is an initial exploration, and promises deeper analysis of prior knowledge and hyperparameters in later versions.

TTRL lifts Qwen2.5-Math-7B on AIME 2024 from 12.9 to 40.2, but changes its GPQA score from 29.1 to 27.7. What is the most careful conclusion?

Chapter 6

Why Wrong Labels Still Give Good Rewards

Measure the lucky hit and see why weak models give cleaner rewards than their labels suggest

Suppose a class of eight votes on a hard problem. Seven of them are wrong, in seven different ways. One is right. The vote has a plurality, but the plurality answer is wrong, and so is the label. You would expect any training on that label to go badly.

Now look at who gets credit. The student with the winning wrong answer gets a point he does not deserve. But six other students wrote six other wrong answers. They all get zero, and zero is exactly what the true key would have given them. Only two students got the wrong mark. Six of eight got the right mark, for the wrong reason. That is the idea of this chapter, and the paper calls it the lucky hit.

Two accuracies, kept apart

The paper tracks two numbers that sound alike. Label accuracy asks one thing per question: is the voted label the true answer? It is a yes or no. Reward accuracy asks one thing per sample: does the reward it got from the voted label equal the reward it would have got from the true label? It is a share of the samples, so it can be high while the label is wrong. Appendix B defines both. They need the true answer, so they are for analysis only.

The paper’s measurements on AIME 2024 with Qwen2.5-Math-7B show the gap. The label accuracy starts at 37% and rarely climbs above 50%. Yet the reward accuracy starts at 92% and stays above 75% (its Figure 9). So most rewards are right even when most labels are wrong.

Why the lucky hit happens

Take the paper’s Figure 10 again. The samples are 1 1 2 2 2 4 5 6. The vote picks 2, but the truth is 3. Write the rewards both ways.

sample: 1 1 2 2 2 4 5 6  |  reward from the vote (y* = 2): 0 0 1 1 1 0 0 0  |  reward from the truth (y = 3): 0 0 0 0 0 0 0 0

The two rows agree on five of eight samples. The reward accuracy is 5/8, or 62.5%. The three samples that wrote 2 got a reward they did not deserve. Everyone else got the reward they would have got from the real key.

There is a short rule behind this. When the label is right, every reward is right. When the label is wrong, a sample gets the wrong reward in only two cases: it wrote the wrong label (reward 1 instead of 0), or it wrote the true answer (reward 0 instead of 1). Let slabel be the share of samples that wrote the label, and struth the share that wrote the truth.

reward accuracy, when the label is wrong = 1 − slabel − struth

For Figure 10: 1 − 3/8 − 0 = 0.625. Now see what scatter does. If the model’s mistakes are spread thin, the winning wrong answer holds a small share, and so does the truth. Both subtracted shares are small, and the reward accuracy stays high. If instead the model has one tempting wrong answer that holds, say, 70% of the samples, the subtraction is huge and the rewards are wrong almost everywhere. Try it.

Measure the lucky hit

Each round votes over 64 samples. Set how often the model writes the right answer and how many different wrong answers it spreads its mistakes over. The marks show the paper’s numbers for the start of its AIME 2024 run.

10%
30

Illustrative simulation, not the paper’s data: the right answer has the chance you set, wrong answers share the rest with each one 0.92 times as likely as the one before, ties go to a random tied answer, and each value averages 1,500 seeded rounds. The marks are the paper’s Figure 9 and text for AIME 2024 with Qwen2.5-Math-7B: label accuracy 37%, reward accuracy 92%, base-model majority ratio 16.6%.

Choose Weak, scattered. The model writes the right answer only 10% of the time. The vote finds it in about four rounds out of ten. Yet about 88% of rewards are correct. Now choose One tempting wrong answer. The model is better, 30%, but its mistakes all go to one place. The vote is never right and neither are the rewards. The worry from Chapter 1 returns: scatter is what makes a weak vote safe.

The paper’s two reasons, and a third

The authors give two reasons TTRL works on AIME 2024 despite poor labels. First, rewards are denser than labels. A label is one answer per question, but a rollout has many samples, each with its own reward. Even when the label is wrong, many of those rewards are still right. A method that wrote only one answer per question would get no such cushion.

Second, a weaker model can give more accurate rewards. This sounds backwards. A weak model scatters its mistakes, so the lucky hit protects most samples. The paper measures it. For the base model, the most frequent answer accounts for only 16.6% of all predictions.

The third factor is not about labels but about time. TTRL is online: it recomputes the vote every round with the updated model. As training goes on, the majority ratio rises in Figure 9, from near 0.17 (the base model’s 16.6%) toward 0.5. The vote gets sharper, so the signal improves while it trains. Chapter 7 explains why that matters.

The paper also leans on two outside findings. RL is said to tolerate some reward noise, because rewards act as directions for exploration, not as exact targets. And a perfectly accurate reward model is not always the best teacher. These are cited arguments, not experiments of this paper.

What the lucky hit does not fix

The lucky hit only protects the zeros. A sample that wrote the winning wrong answer still gets a reward of 1. The model is pushed toward a wrong answer, a little. Whether training works depends on whether the correct pushes outweigh the wrong ones. When the model is strong enough that its vote is often right, they do. When the model’s errors are concentrated, they do not, and TTRL can collapse. The toy at the top of this page, with Top answer is wrong, shows that collapse in miniature.

In the paper’s Figure 10 the vote picks 2 and the truth is 3, among samples 1 1 2 2 2 4 5 6. Why is the reward accuracy 62.5% and not 0%?

Chapter 7

Beating the Vote That Trained It

Compare TTRL with the two ceilings it is measured against, and see why it climbs past one

A student studies from a class answer sheet made by voting. Everyone expects the student to end up as good as the class vote, and no better. The vote is the teacher, and a student does not usually beat the teacher. The paper reports something that looks like a break in that rule: the trained model scores higher than the vote that trained it. This chapter checks the claim against the numbers and then looks for the reason.

The two ceilings

The paper measures TTRL against two upper bounds. They are the natural limits you would expect it to hit.

The first is maj@n of the initial model. TTRL trains on the vote, so the vote’s accuracy looks like the best it can do. The same limit binds older self-training methods. Those pick the majority-voted chain of thought for each question, once, and then fine-tune the model on those answers by ordinary supervised learning. A student who copies the class answer sheet cannot score above the sheet.

The second is direct RL on the test data with the true labels. The paper calls it RL with leakage, because the labels leak information about the test set into training. It is rarely used, since it spoils the test. Here it serves as the best you could hope for on that benchmark: the same loop, with a perfect teacher.

Where TTRL lands

Figure 7 uses Qwen2.5-Math-7B with 64 samples per question. It compares the original model with the TTRL model, scoring both single samples (avg@64) and votes (maj@64). Look at the ceiling line, which is the original model’s maj@64.

Compare the student with its teacher

Choose a benchmark. The dashed line is the ceiling: how good the original model’s own vote was. See where the TTRL model’s single answers land.

All numbers are the paper’s Figure 7 (Qwen2.5-Math-7B, 64 samples per question): AIME 2024 11.7, 30.0, 32.3, 40.0; AMC 33.0, 56.6, 63.9, 66.3; MATH-500 44.6, 66.4, 84.2, 85.2, in the order original avg@64, original maj@64, TTRL avg@64, TTRL maj@64.

On all three benchmarks the TTRL model’s single samples beat the original model’s vote. On AIME 2024 that is 32.3 against 30.0. On AMC it is 63.9 against 56.6. On MATH-500 it is 84.2 against 66.4, a gap of 17.8 points. Voting again after TTRL adds a little more: 40.0, 66.3 and 85.2.

The same thing shows up over time in Figure 6, a run on AMC with the 1.5B maths model. Both the single-sample score and the vote score rise through training. The final single-sample score ends more than 20 points above the starting vote score. The paper’s phrase is that the model “lifts itself up by its own bootstraps”.

Now the second ceiling. Figure 8 trains Qwen2.5-Math-7B on MATH-500 twice: once with TTRL and once with the true labels. The two accuracy curves climb together and stay almost on top of each other. A perfect teacher gives little more than the voting teacher on this task. The paper adds that the 1.5B model, starting from 32.7 on MATH-500, reaches 73.0.

How can a student beat its teacher?

Here is the paper’s answer, with our gloss on it. There are two parts.

The first part is that the teacher gets better. TTRL is online: it recomputes the vote every round from the current model. Old self-training labels once, from the starting model, and then stops. The label is frozen at the starting quality. TTRL’s label tracks the model. As the model improves, the vote improves, and the next round’s rewards are cleaner. The ceiling is not fixed. It rises with the student.

The second part is about how a model stores what it learns. Every question shares the same weights. A round of training does not fix one question. It changes habits: checking steps, finishing in the right format, avoiding a common slip. Those habits carry over to questions where the first vote was wrong. Once the model has the habits, its single answers on those questions get better too, and then the vote on them turns right. The paper’s transfer result (Figure 4, Chapter 5) fits this reading. It is our interpretation, not a tested claim of the paper.

Chapter 6 supplies the third ingredient. Even when the vote is wrong on a question, most of its rewards are right (the lucky hit). So the model is not pushed far in the wrong direction while it learns the habits.

A toy cannot show the shared habits, because our hero model has a separate set of chances for each question. That is why, in the hero, the right answer never rises past what the vote can find. A real model has one set of weights for all questions. The gap between the hero and the paper’s result is exactly that gap.

A note on honesty

Each of these comparisons is made on the same questions that were used for training, and one run per setting. The paper does not report error bars, and it flags a formal convergence analysis as future work. Treat the picture as strong evidence for a pattern, not a proof that TTRL always beats its vote.

Which feature of TTRL lets its trained model score above the starting model’s vote, the signal that trained it?

Chapter 8

When TTRL Fails

Name the two ways the paper saw it break and read the difficulty table

A good engineer asks where a method breaks before using it. TTRL has no safety net: it trains on its own guesses. Section 4.3 of the paper names two ways it failed in early experiments. This chapter reads them, adds what the toy at the top of the page shows, and lists what the paper has not tested.

The authors start with a fair warning. TTRL is an ordinary RL method underneath. So it inherits the usual problems of RL: sensitivity to how hard the data is, a strong dependence on what the model already knows, and the risk of collapse. Here a collapse means training stops improving or gets worse. The test-time setting makes each problem sharper, because the questions are few, new and unlabeled.

Failure one: the wrong hyperparameters

A hyperparameter is a setting you choose before training: the learning rate, the batch size, the temperature. In a normal RL run a bad choice slows learning. In TTRL a bad choice is worse, because the reward is already noisy, and noise on noise stops learning.

The paper’s Figure 11 shows two failed attempts on AIME 2024. Both keep a high entropy that never falls. Entropy is how spread out the model’s writing is. A healthy run starts uncertain and becomes more decisive as it learns. A failed run stays uncertain, and its test accuracy stays flat. The two failed settings were a rollout temperature of 0.6 and a training batch of 256. The successful run used neither.

The authors name two settings that matter most. Temperature. Setting it to 1.0 instead of 0.6 raises the entropy of the samples. More varied samples mean more exploration, and the paper says this helps the model use what it knows on hard benchmarks. That is why the main recipe in Chapter 4 uses 1.0 for Qwen2.5-Math and the long-thinking models. Episodes. Small and difficult sets need more passes. That is why AIME 2024 gets 80 and MATH-500 gets 10.

The paper does not give a full sweep of these settings. It says it will add more analysis in later versions. Treat the two settings as warnings, not a tuned recipe.

Failure two: too little prior knowledge

The second failure is about the model, not the settings. Prior knowledge is what the model already knows before TTRL starts. TTRL only sharpens it. It cannot add a skill from nothing, because the vote can only choose among answers the model already writes. The paper also notes that TTRL has no data filtering and no curriculum: it takes the questions as they come, easy and hard together.

To test this, the authors split MATH-500 into its five difficulty levels, level 1 the easiest and level 5 the hardest. They ran TTRL on each level alone with Qwen2.5-Math-1.5B. Explore their Table 3.

Run TTRL on harder questions

Choose a difficulty level. The top panel shows accuracy before (grey) and after (warm) for every level. The bottom panel shows the answer length in tokens.

All numbers are the paper’s Table 3 (Qwen2.5-Math-1.5B, TTRL run on each difficulty level of MATH-500 separately). Accuracy before and after: level 1 25.9 to 71.2, level 2 33.0 to 76.2, level 3 36.3 to 76.3, level 4 32.5 to 58.7, level 5 22.3 to 39.2. Response length before and after: 2,339.2 to 624.3, 2,125.1 to 614.4, 2,120.6 to 672.3, 1,775.1 to 783.5, 1,751.3 to 985.3.

Read the top panel left to right. The gain falls with difficulty: +45.4 points on level 1, then +43.2, +40.0, +26.2 and +16.8 on level 5. The relative gain falls too, from 175.3% to 75.3%. The model still improves on the hardest level, so this is not a failure to learn. It is a smaller return, and the paper reads it as the model’s prior knowledge running out.

The bottom panel shows a second effect. After TTRL the answers are much shorter, by 73.3% on level 1 and 43.7% on level 5. The paper does not stop to explain this. One reading is that majority agreement favours answers that finish cleanly within the length limit, so rollouts that ramble lose reward. That is our guess, not a claim of the paper. Note too that the shortening shrinks as difficulty rises, matching the smaller accuracy gains.

What the toy adds

The hero shows a third way to fail, the one Chapter 6 explained. When the model’s mistakes pile onto one tempting wrong answer, the vote picks it and every reward pushes the model toward it. Press Top answer is wrong in the hero a few times and then reveal the key. The chance of the right answer falls toward zero. A real model has shared weights and is more forgiving, but the direction of the risk is the same. The paper does not test it directly.

What the paper has not tested

The authors say plainly that this is an initial exploration. They list future work: a convergence theory, streaming data that arrives one question at a time, training at large scale without labels, and open-ended tasks such as agents and scientific discovery. We can add three limits that follow from the method itself. The vote needs answers that can be compared exactly, which fits a number or a multiple-choice letter but not an essay. The vote costs N generations per question, so it is expensive. And a run needs a model that already solves some problems some of the time.

In the paper’s Table 3, TTRL on MATH-500 gains +45.4 points on level 1 and +16.8 on level 5 with the same model. What is the paper’s explanation?

Chapter 9

The Field Guide

Keep the numbers, terms, checklist and core code on one page

Here is the whole paper in one paragraph. Labels are the bottleneck for RL on reasoning. TTRL removes them. For each test question the model writes many answers, and the most common answer becomes the label. Samples that match it get reward 1, the rest get 0. GRPO turns those rewards into an update, and the loop repeats with the improved model. The label is often wrong, but because mistakes are scattered, most rewards are still right (the lucky hit). On AIME 2024 the method lifts Qwen2.5-Math-7B from 12.9 to 40.2. The trained model beats the vote that trained it, because the vote improves as the model does. It fails when settings are poor, or when the model knows too little.

The numbers to remember

QuantityValueWhere
Qwen2.5-Math-7B on AIME 202412.9 to 40.2 (+211.6%)Table 1
Same model on AMC and MATH-50035.6 to 68.1; 46.7 to 83.4Table 1
Same model, average of four benchmarks31.1 to 54.9 (+76.5%)Table 1
Qwen2.5-Math-1.5B on MATH-50032.7 to 73.0 (+123.2%)Table 1, Section 4.1
DeepSeek-R1-LLaMA-8B on AIME51.7 to 69.2Table 2
Vote and training samples64 voted, 32 trainedSection 3.1
Learning rate, optimizer5 × 10−7 peak, cosine, AdamWSection 3.1
Episodes10 (MATH-500), 30 (AMC), 80 (AIME 2024)Section 3.1
Label vs reward accuracy, AIME 2024 start37% vs 92%Section 4.2, Figure 9
Top answer share, base model16.6%Section 4.2
TTRL avg@64 vs original maj@6432.3 vs 30.0; 63.9 vs 56.6; 84.2 vs 66.4Figure 7
Gain by difficulty, MATH-500 levels 1 to 5+45.4, +43.2, +40.0, +26.2, +16.8Table 3

The terms, in plain words

TermPlain meaning
Test-time trainingChanging the model’s weights while it works on the test questions.
Estimated label y*The most common final answer among N samples.
Majority voting rewardReward 1 for a sample that matches y*, otherwise 0.
GRPO advantageA sample’s reward minus the group mean, divided by the group spread.
Vote-then-sampleVote with 64 samples, train on 32 of them.
Lucky hitA sample that differs from a wrong label still gets the right reward, 0.
Label accuracy, reward accuracyHow often the vote is right, and how often the rewards are right. Needs the true answers.
maj@n, pass@1 (avg@k)Accuracy of a vote of n samples, and of single samples.
OnlineThe label is recomputed every round from the current model.

The core as code

This is the heart of the method: the vote, the reward, the advantage and the lucky-hit measure. It runs as written. The helper names are ours, and a full training run adds a model, a sampler and an optimizer around it.

pythonfrom collections import Counter
import math

def vote_reward(answers):
    # the paper's majority-voting reward: label = most common answer
    label = Counter(answers).most_common(1)[0][0]       # a tie goes to the answer seen first
    return label, [1.0 if a == label else 0.0 for a in answers]

def group_advantage(rewards):
    # GRPO: how far each reward is from the group mean, in units of the group's spread
    n = len(rewards); mean = sum(rewards) / n
    std = math.sqrt(sum((r - mean) ** 2 for r in rewards) / n)
    return [0.0 if std == 0 else (r - mean) / std for r in rewards]

def reward_accuracy(answers, truth):
    # analysis only: needs the true answer. Share of rewards the true label would also give.
    label, r = vote_reward(answers)
    r_true = [1.0 if a == truth else 0.0 for a in answers]
    return sum(x == y for x, y in zip(r, r_true)) / len(answers)

answers = ['1', '1', '2', '2', '2', '4', '5', '6']         # the paper's Figure 10
label, rewards = vote_reward(answers)       # '2', [0, 0, 1, 1, 1, 0, 0, 0]
adv = group_advantage(rewards)              # +1.29 for matches, -0.77 for the rest (sums to 0)
print(label, [round(a, 2) for a in adv], reward_accuracy(answers, '3'))   # ... 0.625

Check before you use it

Use this list, drawn from the paper’s findings, before you try the idea on a new task. Switch each check on if it holds for your task.

Would TTRL fit your task?

Switch on each statement that is true for your task. The row of lights fills as you go.

This checklist is ours. It turns the paper’s findings (Chapters 4 to 8) into questions. It is not a score from the paper, and the thresholds are a rule of thumb.

Where it sits in the field

TTRL is one of several 2025 papers that train reasoning models without human labels. The authors name concurrent work that uses self-supervised or semi-supervised signals: Genius, “Right question is already half the answer” and Absolute Zero. They say TTRL differs in its reward: a majority vote taken from the model itself, which they argue mitigates reward hacking. They also cite one-example RL as a sign that very little supervision can be enough. The idea of a vote comes from self-consistency, and the update comes from GRPO.

The paper frames all this as a step toward the “era of experience”, in which models learn from a stream of their own experience, not from human-written data. In the course, it is the reading for Lecture 6, Model Evolution.

Keep going

The takeaway. A model’s own majority vote is a noisy but useful teacher. It is wrong often, yet its rewards are right far more often, because mistakes are scattered. Recompute the vote each round and the student can pass the teacher. It still needs a model that knows enough to start and a task where answers can be compared.
You want to try TTRL on a new set of 300 unlabeled problems with numeric answers. Which plan follows the paper?

Now press Teach and explain TTRL from memory: why a vote can stand in for a label, how the reward and the GRPO advantage are computed, why wrong labels still give mostly right rewards, how the trained model passes the vote that taught it, and when the method fails. Then go back to the toy at the top, reveal the key, and explain why Top answer is wrong behaves so differently from Top answer is right.

TTRL: Test-Time Reinforcement Learning, by Zuo, Zhang, Sheng, Qu, Cui, Zhu, Li, Zhang, Long, Hua, Qi, Sun, Ma, Yuan, Ding and Zhou
Read the paper · Code · Lecture 6: Model Evolution · Back to Gleams