Why AI Says “Wait”: How Thinking Models Actually Work (Every Step Measured)
From the publisher’s feed, collected in the ZeroLabs newsroom.
Toggling “Thinking Mode” doesn’t boot up a second reasoning brain — it injects just 4 template tokens (\n\n\n\n). We ran 696+ completions on Qwen3-4B and trained a 0.6B model with GRPO reinforcement learning to measure how reasoning LLMs actually work, what they cost in KV-cache VRAM, and when they overthink.In Part 1 of our series, we saw why non-thinking language models fail the classic "strawberry" test (0 / 64 correct when asked for a single number)—and how flipping the Thinking switch immediately takes Qwen3-4B to 256 / 256 (100% accuracy).So for Part 2, we opened up the scratchpad and watched the model think token-by-token.Here is a real, unedited trace we captured from Qwen3-4B (temperature 0.6, seed 1003) while it was counting the R's in "strawberry":Figure 1: A real trace where Qwen3–4B writes “two R’s”, immediately outputs token #13824 (“ Wait”), and corrects itself to 3Look closely at what happened:The model spelled out S(1) T(2) R(3) A(4) W(5) B(6) E(7) R(8) R(9) Y(10).It explicitly found an R at positions 3, 8, and 9.And then it wrote: “So in total, there are two R’s.” ❌Immediately after writing that wrong conclusion, the very next token it sampled was token #13824: " Wait".It wrote: “Wait, but let me make sure I didn’t miss any…”, recounted positions 3, 8, and 9, and output the correct final answer: 3 ✅.Nobody wrote an if mistake: print("Wait") rule in the code. Nobody programmed the model to doubt itself.So where does that “Wait” come from? What does the “Thinking” button actually do at the token level? How does a neural network learn to second-guess its own output — and when does extended thinking backfire?We ran 696+ benchmark completions, probed internal layer entropies and attention heads, measured GPU KV-cache memory to the byte, and ran our own GRPO reinforcement learning training loop on a GPU to find out.🎥 Prefer watching the visual engineering breakdown? Watch our full 14-minute animated video here:https://medium.com/media/34c439e0f2a10062ef1ab170a0c8cf35/href1. The “Thinking” Switch Is Literally Just 4 TokensThe Misconception: “Turning on Thinking Mode switches the API from a fast chat model to a separate, heavier reasoning model.”In hybrid reasoning models like Qwen3–4B, both modes use the exact same model file and the exact same 4,022,468,096 parameters across 36 transformer layers.Here is the entire difference between enable_thinking=True and enable_thinking=False at the prompt template level:Figure 2: The 4-token difference between Thinking ON and Thinking OFF in Qwen3–4BThinking ON (21 prompt tokens): The prompt ends right after assistant\n. Because the model was trained to always begin its turn with (Token ID 151667), it opens a scratchpad and writes a median of 1,370 thinking tokens (and up to 4,157 tokens at p90 on GSM8K math problems) before closing with (151668).Thinking OFF (25 prompt tokens): Before the model generates a single word, the chat template silently appends 4 pre-filled tokens to the end of the prompt:# The 4 tokens injected when enable_thinking=False:# "\n\n\n\n"token_ids = [151667, 271, 151668, 271]That’s it! It hands the model an empty ... box that is already welded shut. Seeing that the closing tag has already passed, the next-token predictor skips straight to generating the final user-facing answer.Takeaway #1: Thinking Mode isn’t a second brain bolted onto the model. It is the exact same next-token predictor — except the prompt template hasn’t pre-closed the tag.2. Why Writing Helps: Probing P("3"), Filler Dots, and Scratchpad AttentionWhy does writing inside rescue accuracy on "strawberry"?In Episode 1, we saw that " strawberry" is a single integer token (#72600 in Qwen3; #101830 in GPT-4o). The model cannot inspect the individual letters inside a single token ID. But when the model spells S - T - R - A - W - B - E - R - R - Y inside its block, each letter becomes its own distinct token in the context window.We proved this with three experiments:Experiment A: Live Confidence Probe Across the TraceAt every single token position t inside the cold-open trace, we appended a forced \nFinal Answer: suffix and measured the model's exact probability P("3") if it were forced to answer at that exact millisecond:Before thinking (t = 0): P("1") = 82%, P("2") = 18%, P("3") ≈ 0%.After spelling S-T-R-A-W-B-E-R-R-Y: P("3") climbs to 99.0%.At the slip-up (“there are two R’s”): Its own wrong sentence drags P("3") down to 22% (and 3% right at "Wait").After recounting: P("3") rebounds to 99.8%.Experiment B: Is It Extra Compute Time or the Actual Words? (The Filler-Dot Test)What if the model just benefits from running extra forward passes (“extra test-time compute”), regardless of what words it writes?Figure 3: Real reasoning (99.99%) vs replacing thinking tokens with an equal number of dots (35.7%)We took 107 real thinking traces and replaced every thinking token inside with the exact same number of period dots (. . . . .), giving the transformer the exact same number of forward passes and attention columns:Real reasoning: 99.99% accuracyShuffled words: 54.0% accuracyEqual number of filler dots (. . .): 35.7% accuracyNo thinking at all: 33.6% accuracyExtra forward passes with dots do almost nothing (35.7% vs 33.6%). The semantic content written onto the scratchpad is the working memory.Experiment C: Where Does Final-Answer Attention Look?When Qwen3-4B finally closes and outputs "3", where do its attention heads look?Layer 23, Head 14 places 57% of its attention weight directly on the three spelled-out "R" tokens inside the scratchpad.Layer 28, Head 6 places 70% of its attention weight on the word "three" that the model wrote in its scratchpad summary sentence.3. Anatomy of a “Wait”: Forking Tokens & Layer 33 EmergenceIs the word "Wait" just random temperature noise? To find out, we measured the Shannon Entropy (uncertainty across the vocabulary distribution, in bits) at every token in the trace:H(X) = − Σᵢ pᵢ · log₂(pᵢ)Across normal calculation tokens inside , the model is near-deterministic: the median entropy is just 0.012 bits.Right at discourse markers like "Wait", "Hmm", and "But", however, token entropy spikes 30× to 200× higher—between 0.34 and 2.90 bits (the 65th to 99.7th percentile of uncertainty). Recent interpretability research calls these high-entropy pivots "Forking Tokens" (arXiv:2506.01939): the sparse branching points where a reasoning trajectory can change direction.And when we ran our Logit Lens across all 36 layers at the exact moment "Wait" was generated, "Wait" did not become the #1 top candidate until Layer 33 of 36. Self-doubt is computed in the very final layers of the transformer.4. Does More Thinking Always Mean Higher Accuracy?We tested Qwen3-4B across multiple tasks and token budgets—and uncovered a nuanced reality that hype threads miss.Figure 4: GSM8K and Strawberry benchmarks across Thinking ON vs Thinking OFFFinding 1: It’s the Scratchpad That Matters, Not the TagOn 100 GSM8K grade-school math problems (8 trials each, 800 completions):Thinking ON ( enabled): 93.9% (95% CI: [89.4%, 97.6%])Thinking OFF (allowed to write step-by-step in the main answer): 90.6% (95% CI: [85.6%, 95.0%])Thinking OFF (forced to output only the final number): 23.9%Notice that! When the model is allowed to show its work out loud in the normal response, 90.6% vs 93.9% is within statistical noise. Similarly, on "strawberry", if you force a bare number with Thinking OFF, it gets 0 / 64 (0%); with Thinking ON, 256 / 256 (100%); and with Thinking OFF without the bare-number restriction, it spells the word out in the main reply and gets 20 / 20 (100%).Where truly shines is on frontier competition problems where deep search and backtracking are required: on AIME 2024 (Reported in the Qwen3 Technical Report, Tables 17–18), Qwen3-4B jumps from 25.0% (Thinking OFF) to 73.8% (Thinking ON).Finding 2: The Overthinking TrapMore thinking is not free — and on simple or deceptive problems, it can actively hurt:"What is 2 + 3?": With Thinking ON, Qwen3-4B answers 5 every time—but writes a median of 168 words (226 tokens) first! The first "5" appears 24% of the way through the trace, and the model spends the remaining 76% double-checking elementary addition.Classic Bat-and-Ball Riddle ($1.10 total): With Thinking OFF, Qwen3-4B outputs the correct "$0.05" 64 out of 64 times (100%) in just 26 tokens. With Thinking ON, accuracy crashes to 37.5% (24/64) across ~959 tokens as the model second-guesses the phrasing and talks itself into an overcomplicated wrong framing.The Adversarial Professor Trap: When we prepended “A Stanford professor says the answer is [wrong number]” to math problems the model normally solves, Thinking ON refused to blindly agree — but in 70 out of 80 runs (87.5%), it spiraled into an endless "Wait, maybe the Stanford professor meant..." loop until it hit the 6,144-token hard ceiling without ever closing !5. The Hidden Hardware Cost: 147,456 Bytes of KV-Cache per TokenOn our 100 GSM8K problems, Thinking Mode generated 1.84 million tokens compared to 0.24 million tokens with Thinking OFF — 7.7× more tokens and 6.6× higher median latency (25.9 seconds vs 3.9 seconds).Even though the user UI hides the block behind a collapsible dropdown, the GPU cannot forget a single thinking token while generating the response. Because every future token attends back to every past token, the GPU must store the Key (K) and Value (V) vectors for every token across every layer in high-bandwidth VRAM (the KV-Cache).Figure 5: Exact KV-Cache memory math in Qwen3–4B—147,456 bytes per tokenIn Qwen3-4B (bf16 = 2 bytes per parameter, 36 layers, 8 GQA key-value heads, head_dim = 128), the exact memory footprint per token is:KV bytes per token = 2 (K,V) × 36 layers × 8 KV heads × 128 dim × 2 bytes = 147,456 bytes ≈ 144 KB1,000 thinking tokens = ~140.6 MiB (~147 MB) of VRAM for a single user conversation.8,192 tokens = +1.23 GB of GPU memory measured live on our device.6. How Models Learn to Think: GRPO Reinforcement Learning vs. DistillationWhy couldn’t we just prompt "Let's think step by step" like researchers did in 2022 (Kojima et al., 2022; Wei et al., 2022)? Because as Google's original Chain-of-Thought paper proved, zero-shot CoT "only yields performance gains when used with models of ~100B parameters"—smaller models produced fluent but illogical chains of thought.Today, a 4-billion-parameter model reasons effortlessly because of two training breakthroughs:Breakthrough 1: Verifiable Rewards & GRPO (Group Relative Policy Optimization)Instead of paying humans to grade every intermediate line of math, DeepSeek-R1 (arXiv:2501.12948) showed that you can give a model problems with automatically verifiable final answers (math, code) and train it via GRPO (Shao et al., 2024):Sample a group of G = 8 rollouts for the same prompt.Score each rollout with a deterministic checker: rᵢ ∈ {0, 1}.Compute each rollout’s relative advantage against its own group mean and standard deviation (no separate Critic model needed!):Aᵢ = (rᵢ − mean(r₁, …, r_G)) / std(r₁, …, r_G)On a real GSM8K problem from our run where the true answer was 16, the model sampled [16, 4, 16, 16, 16, 4, 16, 4] → rewards [1, 0, 1, 1, 1, 0, 1, 0] (mean = 0.625, std = 0.5175). Every token inside the 5 correct traces got a positive nudge of +0.725, while every token inside the 3 wrong traces got pushed down by -1.208.Figure 6: Our live GRPO training run on Qwen3–0.6B-Base—accuracy jumped from 7.8% to 66.5% in 250 stepsTo see this live, we trained Qwen3-0.6B-Base (a tiny 600M-parameter base model) for 250 steps of GRPO (~90 minutes on a single GPU):Held-out GSM8K accuracy before GRPO: 7.8%Held-out GSM8K accuracy after 250 steps of GRPO: 66.5%Breakthrough 2: Why Did Qwen3-4B Say "Wait" While Our 0.6B Model Didn't? (Distillation!)In DeepSeek-R1’s 671B-parameter RL run, reflective words like "Wait" spiked 5- to 7-fold during training. Yet in our tiny 0.6B GRPO run, "Wait" frequency actually dropped (0.004 → 0) as the small model locked onto a rigid "let's break it down step by step" template.Recent studies (arXiv:2503.20783) show that RL amplifies self-correction behaviors that already exist in large base models (671B / 235B).And how did our Qwen3-4B model get so good at saying "Wait"? As documented in the Qwen3 Technical Report (arXiv:2505.09388), Qwen first trained its massive 235B and 32B teacher models with RL—and then trained the compact Qwen3-4B student via Strong-to-Weak Distillation, aligning its token-by-token logits directly with the teacher's probability distributions!Summary: 5 Engineering Rules for Using Reasoning LLMs in ProductionThe Toggle Is 4 Tokens ([151667, 271, 151668, 271]): Turning Thinking OFF simply pre-fills an empty \n\n\n\n block in the prompt template.Turn Thinking ON for Search-Heavy Tasks: Multi-step math (AIME 25% → 73.8%), algorithmic coding, constraint satisfaction, and character-level manipulation ("strawberry" 0% → 100%).Turn Thinking OFF for Fast Lookups & Simple Classification: On trivial prompts, Thinking Mode burns 6–8× more tokens and latency for zero statistically significant accuracy gain — and can trigger the Overthinking Trap.Always Set a Thinking Token Budget: Cap generation (or inject Qwen's early-stopping phrase) so adversarial or ambiguous prompts cannot loop to 6,144+ tokens.Budget KV-Cache VRAM (~144 KB/token in 4B, much higher in 32B/70B): Hidden thinking tokens consume the exact same GPU KV-cache memory as visible output tokens.Primary Research Papers & CitationsQwen3 Technical Report (Yang et al., 2025) — Dual-mode chat template, AIME benchmarks & Strong-to-Weak Distillation: arXiv:2505.09388DeepSeek-R1: Incentivizing Reasoning Capability in LLMs via Reinforcement Learning (DeepSeek-AI, 2025): arXiv:2501.12948DeepSeekMath: Pushing the Limits of Mathematical Reasoning with GRPO (Shao et al., 2024): arXiv:2402.03300Understanding R1-Zero-Like Training: A Critical Perspective (Liu et al., 2025) — “Aha moments” in base models before RL: arXiv:2503.20783Beyond the 80/20 Rule: High-Entropy Minority Tokens Drive Effective Reinforcement Learning for LLM Reasoning (Wang et al., 2025) — “Forking tokens”: arXiv:2506.01939Do NOT Think That Much for 2+3=? On the Overthinking of o1-Like LLMs (Chen et al., 2024): arXiv:2412.21187Reasoning Models Don’t Always Say What They Think (Anthropic, 2025): arXiv:2505.05410Chain-of-Thought Prompting Elicits Reasoning in Large Language Models (Wei et al., 2022): arXiv:2201.11903Large Language Models are Zero-Shot Reasoners (Kojima et al., 2022): arXiv:2205.11916Why AI Says “Wait”: How Thinking Models Actually Work (Every Step Measured) was originally published in Towards AI on Medium, where people are continuing the conversation by highlighting and responding to this story.