TL;DR
Quiet-STaR is a training method that lets a language model learn to reason from ordinary web text, without any reasoning dataset. At every token the model writes a short hidden "thought" that explains what comes next, then uses that thought only if it makes the real next text more likely. The thoughts that help are reinforced, and the rest are dropped. On a 7-billion-parameter model, this raised zero-shot accuracy on CommonsenseQA from 36.3 to 47.2 percent and on GSM8K math word problems from 5.9 to 10.9 percent, with no fine-tuning on either task.
Builds on: STaR, REINFORCE, Teacher Forcing · Leads to: Chain-of-Thought Prompting
Why it mattered
Reasoning is often implicit in text: a proof skips steps, and a conversation depends on what each speaker believes. The earlier Self-Taught Reasoner (STaR) showed that a model can learn to reason by keeping its own rationales that lead to correct answers, but only on question answering datasets with known answers. Quiet-STaR asks whether the same idea works on the text itself, so that language modelling becomes the source of the reasoning signal. The paper's claim is that the model can learn to reason in general, rather than on curated tasks, and the reported gains on tasks it was never trained on support that claim. It also links to Chain-of-Thought Prompting: where chain-of-thought asks the model to think out loud when prompted, Quiet-STaR trains it to think quietly at every token.
The problem
A language model is trained to predict the next token. That objective already rewards understanding, but it does not reward thinking before the prediction. The paper states the goal this way: introduce an auxiliary rationale between each pair of observed tokens, and train the model so that the rationales help predict the rest of the sequence.
Three obstacles follow from that goal:
- Generating a rationale after every token is expensive. Done naively it needs a separate forward pass for each position in the text.
- A pretrained model does not know how to generate or use hidden thoughts. Its first thoughts are out of distribution and can make its predictions worse.
- Predicting just the next token gives a weak signal, because a thought often helps with the words after the next one rather than the next token itself.
Each obstacle corresponds to one part of the method: parallel sampling, a mixing head, and a non-myopic loss.
How it works
The paper's Figure 1 sums up the method as three steps: think, talk and learn. Each step is traced below on one tiny example. The numbers in this trace are illustrative, chosen to be easy to follow; they are not results from the paper.
flowchart LR T[Think: sample thoughts after every token] --> K[Talk: mix thought and no-thought predictions] K --> L[Learn: reinforce thoughts that raise the future-text likelihood] L --> T
Take the text "the person is run" with the next token "ing" in mind.
- Think: at the position after "run", the model samples a short hidden thought. Suppose the thought is "a continuous action, so a verb ending". The thought sits between a start-of-thought and an end-of-thought token.
- Talk: the model predicts the next token twice, once with the thought and once without. Suppose the base prediction gives "ing" a probability of 0.50, and the prediction after the thought gives it 0.80. A mixing head decides how much of the thought-based prediction to use.
- Repeat the first two steps with a second, less useful thought. Suppose it gives "ing" 0.50 after the thought. Now the average of the two thought-based probabilities is 0.65.
- Learn: score each thought by how much it beats the average. The first thought gets a reward of log 0.80 minus log 0.65, which is about 0.21. The second gets log 0.50 minus log 0.65, which is about -0.26.
- Reinforce the first thought, which made the real next token more likely. The second thought gets a negative reward, and the paper leaves it out of the update: it found that dropping negative rewards made training more stable, at the cost of some bias. So only the first thought changes the model.
- Repeat over the whole training text, with thoughts generated in parallel at every token position. Because of the parallel sampling, one forward pass produces a thought for each position.
Three parts make this work, each answering one obstacle from The problem:
- Parallel sampling (obstacle 1): the model's attention mask lets each thought attend to its own preceding thought tokens and to the preceding text, so thoughts for all positions can be generated in one pass.
- Mixing head (obstacle 2): a small network reads the two hidden states, with and without the thought, and outputs the weight. Thoughts start out of distribution and would hurt predictions if used directly, so the learned weight lets the model shift gradually from base predictions to thought-based ones.
- Non-myopic loss (obstacle 3): the model is also scored on tokens several steps ahead, using teacher forcing to supply the true tokens, so a thought is judged by the meaning it adds to a longer stretch of text.
The math
Objective. The model parameters θ are chosen to maximise the expected log-likelihood of the rest of the sequence, given the prefix and a rationale generated from the prefix:
Read in words: for each position i, the model writes a rationale from the prefix, then is scored on how well it predicts the rest of the text. The paper notes that for an optimal model this objective adds nothing, but in practice rationales help.
Step 2 in symbols (the talk mixture). The mixing head produces a weight, and the prediction is a weighted combination of the logits with and without the thought. The weight is learned, and its job is to let the model move from base predictions to thought-based ones gradually instead of all at once.
Step 3 in symbols (the reward). For a thought T_j at position j, let p^talk be the mixed probability of the next n true tokens X after the thought, and let the bar denote the average over all thoughts sampled at that position. The reward is
This is the same reward as in the trace above: a thought that beats the average is positive, and one that falls behind is negative.
Step 4 in symbols (the update). The reward multiplies the gradient of the thought's log-probability in a REINFORCE term. Following the paper, negative rewards are dropped:
A log-likelihood term on the mixed predictions is added so that the base head still learns to predict the next token.
Teacher forcing for later tokens. To score a thought on tokens several steps ahead, the model's probabilities for those later tokens are computed as if the true earlier tokens had been chosen, which is the standard Teacher Forcing assumption.
Results
The main numbers below are zero-shot, meaning the model answers each question directly with no examples and no fine-tuning on that task. All runs start from Mistral 7B, a 7-billion-parameter model (Mistral 7B).
| Training | CommonsenseQA | GSM8K |
|---|---|---|
| Base Mistral 7B | 36.3 | 5.9 |
| Quiet-STaR on OpenWebMath (main run) | 47.2 | 10.9 |
| Quiet-STaR on C4 (smaller run, 16 thought tokens) | 42.6 | 8.1 |
| Pause-token fine-tuning, as reported by its authors (CommonsenseQA) | 28.8 (from 26.9) | harms performance |
The paper's own reading of these numbers:
- Gains grow with the number of thought tokens used in training, and the curves in its Figure 2 show this for both tasks.
- The gain is 10.9 points on CommonsenseQA and 5.0 points on GSM8K for the main run.
- Training on OpenWebMath, a crawl of technical web pages, helped more than training on C4. The paper expected that density of reasoning-heavy tokens to be higher in technical text.
- The method beat the pause-token baseline, which the paper treats as a constrained version of the same idea. A single pause token per position is a weaker thought than a multi-token rationale.
- Quiet-STaR thoughts also helped the paper's chain-of-thought experiment: majority vote over eight samples (cot-maj@8) rose from 40.6 to 47.7 percent on 128 GSM8K test items, when the model was prompted with "Let's think step by step" and the hidden thoughts were available.
- Averaged over all tokens, the change in prediction is small. The benefit is concentrated in a small set of hard tokens, where thoughts help a lot.
Limitations, in the paper's words: the method was only tested on a 7-billion-parameter model, it adds a large compute overhead because many more tokens are generated, and the current version cannot decide when to start or stop a thought. Thoughts are not required to be human-readable, and the paper flags that the model's stated reasoning may not match its internal processing.
Reading guide
The paper's sections in order, with the lessons each one leans on:
- Section 1 and Section 3, introduction and problem: Language Model, Maximum Likelihood Estimation and the STaR idea in STaR: Bootstrapping Reasoning With Reasoning.
- Section 2, related work: Chain-of-Thought Prompting and Large Language Models are Zero-Shot Reasoners for the prompting background.
- Section 4.2, parallel generation: Transformer and Attention Mechanism, especially the attention mask.
- Sections 4.3 and 4.4, mixing head and optimisation: REINFORCE, Policy Gradient and Teacher Forcing.
- Section 5, experiments: Mistral 7B, Training Verifiers to Solve Math Word Problems for the math benchmark, and Perplexity for the language modelling measure.
- Appendix E, examples of rationales: read it after Section 5.3 to see what the thoughts look like in practice.
- Section 6, limitations: read it last; it is the paper's own list of caveats.
Check yourself
QuestionWhat is the difference between the think, talk and learn steps?Show answer
Think: the model samples a short hidden thought after every token. Talk: it mixes the prediction with the thought and without it, using a learned weight. Learn: it scores each thought by how much it raised the probability of the true future tokens relative to the average thought, and reinforces the thoughts with positive rewards.
QuestionAt a position, two thoughts give the next true token probabilities 0.60 and 0.90. What is the reward for each, rounded to two decimals, relative to their average?Show answer
The average is 0.75. The first thought's reward is log 0.60 minus log 0.75, which is about -0.22. The second's is log 0.90 minus log 0.75, which is about 0.18. The first is negative and would be excluded from the update, and the second would be reinforced.
QuestionWhy does the paper use a mixing head instead of simply adding the thought to the context?Show answer
A thought is out of distribution for a pretrained model at the start of training, so using it directly harms the model's predictions. The mixing head learns how much of the thought-based prediction to use, which lets the model adopt thoughts gradually. The paper also tried separate heads that could freely change the outputs with and without thoughts, and found that this instability prevented learning, so it kept the weighting approach.
QuestionOn the main run, CommonsenseQA rose from 36.3 to 47.2 percent. What is the gain in points, and how does it compare with the gain on GSM8K?Show answer
The CommonsenseQA gain is 47.2 minus 36.3, which is 10.9 points. The GSM8K gain is 10.9 minus 5.9, which is 5.0 points. The CommonsenseQA gain is about twice the GSM8K gain on this run.
Sources
- Zelikman, Harik, Shao, Jayasiri, Haber and Goodman. Quiet-STaR: Language Models Can Teach Themselves to Think Before Speaking. arXiv:2403.09629 (2024). https://arxiv.org/abs/2403.09629