Scratchpad Prompting
Before Chain-of-Thought had a name, there was the Scratchpad — a simple but powerful idea: give the model a dedicated workspace to show its intermediate computations before producing a final answer. Like a student showing their work on an exam, the scratchpad makes reasoning visible and errors catchable.
Introduced: Scratchpad Prompting was introduced in 2021 by Nye et al. (Google Brain), predating the formal Chain-of-Thought paper by several months. The technique demonstrated that training or prompting models to use an explicit “scratchpad” for intermediate steps dramatically improved performance on multi-step arithmetic, code execution tracing, and algorithmic tasks. It was one of the earliest demonstrations that intermediate computation visibility improves LLM reasoning.
Modern LLM Status: Scratchpad Prompting is the conceptual ancestor of Chain-of-Thought and all its descendants. While the specific “scratchpad” framing has been largely absorbed into the broader CoT family, the core insight remains foundational: models reason better when given space to work through intermediate steps explicitly. Modern models benefit from scratchpad-style prompting particularly for precise computation, code tracing, and tasks where showing work is not just helpful but necessary for correctness.
Give the Model a Place to Show Its Work
The insight behind Scratchpad Prompting is deceptively simple: when humans solve complex problems, they use scratch paper. They write down intermediate results, track state changes, and build toward a final answer incrementally. LLMs, by default, are expected to produce final answers directly — going from question to answer in a single cognitive leap.
Scratchpad Prompting introduces an explicit workspace: a section of the output where the model is instructed to show intermediate computations, variable states, or step-by-step work before giving the final answer. Each intermediate step is a checkpoint that can be verified independently.
Think of it like a math exam where showing your work is required. The teacher can’t just see whether the final answer is right — they can see exactly where in the process a mistake occurred, making it possible to correct the specific step rather than starting from scratch.
Without a scratchpad, a model solving “What is 247 × 38?” must compute the answer in its “head” — relying on internal representations that may lose precision. With a scratchpad, the model can write “247 × 30 = 7,410” then “247 × 8 = 1,976” then “7,410 + 1,976 = 9,386.” Each intermediate step is a checkpoint that can be verified, and errors can be caught at the step where they occur rather than just in the final answer.
The Scratchpad Process
Four stages from problem to verified answer
Designate the Scratchpad
Instruct the model to use a clearly marked workspace for intermediate computations. Common formats include a “Scratchpad:” section, triple backticks, or explicit “Work:” and “Answer:” sections. The key is creating a visible separation between working space and final output.
“Solve this problem. Use a Scratchpad section to show all intermediate steps, then provide your final answer in an Answer section.”
Show Intermediate Steps
The model writes out each computation, state change, or reasoning step in the scratchpad area. Each step should be atomic — small enough to verify independently. This transforms opaque computation into a visible, auditable trail.
Scratchpad: Step 1: 247 × 30 = 7,410. Step 2: 247 × 8 = 1,976. Step 3: 7,410 + 1,976 = 9,386.
Track Running State
For iterative problems, the scratchpad maintains the current state after each step. This is especially valuable for code tracing, where variable values change with each line, and for multi-step word problems where intermediate quantities must be carried forward.
Line 1: x = 5 → State: {x: 5}. Line 2: y = x * 3 → State: {x: 5, y: 15}. Line 3: x = y - 2 → State: {x: 13, y: 15}.
Produce Final Answer
After completing all scratchpad work, the model writes the final answer in a clearly separate section. The answer should follow directly from the last scratchpad step, making the connection between work and conclusion explicit and verifiable.
Answer: The output of the program is 28. (Derived from scratchpad: print(x + y) = print(13 + 15) = 28)
See the Difference
Why showing intermediate work produces more reliable answers
Direct Computation
What is the output of this Python code? x = 5; y = x * 3; x = y - 2; print(x + y)
The output is 28.
Scratchpad Prompting
Use a scratchpad to trace through this code step by step, showing variable states after each line. Then give the final answer. Code: x = 5; y = x * 3; x = y - 2; print(x + y)
Scratchpad:
Line 1: x = 5 → State: {x: 5}
Line 2: y = x * 3 = 5 * 3 = 15 → State: {x: 5, y: 15}
Line 3: x = y - 2 = 15 - 2 = 13 → State: {x: 13, y: 15}
Line 4: print(x + y) = print(13 + 15) = print(28)
Answer: 28
Natural Language Works Too
While structured frameworks and contextual labels are powerful tools, LLMs are exceptionally good at understanding natural language. As long as your prompt contains the actual contextual information needed to create, answer, or deliver the response you’re looking for — the who, what, why, and constraints — the AI can produce complete and accurate results whether you use a formal framework or plain conversational language. But even in 2026, with the best prompts, verifying AI output is always a necessary step.
Scratchpad Prompting in Action
See how dedicated workspaces improve computation accuracy
“You invest $1,000 at 5% annual compound interest. How much do you have after 3 years? Use a scratchpad to show each year’s calculation.”
Scratchpad:
Starting amount: $1,000.00
Interest rate: 5% = 0.05
Year 1: $1,000.00 × 1.05 = $1,050.00
Year 2: $1,050.00 × 1.05 = $1,102.50
Year 3: $1,102.50 × 1.05 = $1,157.63 (rounded to nearest cent)
Answer: After 3 years of 5% compound interest, your $1,000 investment grows to $1,157.63. Each year’s interest builds on the previous year’s total, which is why compound interest earns more than simple interest ($1,150.00).
“Trace a bubble sort on the array [5, 3, 8, 1, 2]. Use a scratchpad showing the array state after each swap.”
Scratchpad:
Initial: [5, 3, 8, 1, 2]
Pass 1:
Compare 5,3 → swap → [3, 5, 8, 1, 2]
Compare 5,8 → no swap → [3, 5, 8, 1, 2]
Compare 8,1 → swap → [3, 5, 1, 8, 2]
Compare 8,2 → swap → [3, 5, 1, 2, 8]
Pass 2:
Compare 3,5 → no swap → [3, 5, 1, 2, 8]
Compare 5,1 → swap → [3, 1, 5, 2, 8]
Compare 5,2 → swap → [3, 1, 2, 5, 8]
Pass 3:
Compare 3,1 → swap → [1, 3, 2, 5, 8]
Compare 3,2 → swap → [1, 2, 3, 5, 8]
Pass 4:
Compare 1,2 → no swap → [1, 2, 3, 5, 8]
No swaps made — array is sorted.
Answer: The sorted array is [1, 2, 3, 5, 8]. Bubble sort required 4 passes and 7 swaps to fully sort this 5-element array.
“Three friends — Alice, Bob, and Carol — each own a different pet: a cat, a dog, and a fish. Alice doesn’t own the cat. Bob doesn’t own the dog or the fish. Who owns which pet? Use a scratchpad to track eliminations.”
Scratchpad:
Initial possibilities:
Alice: cat, dog, fish
Bob: cat, dog, fish
Carol: cat, dog, fish
Clue 1: Alice doesn’t own the cat.
Alice: dog, fish
Bob: cat, dog, fish
Carol: cat, dog, fish
Clue 2: Bob doesn’t own the dog or fish.
Alice: dog, fish
Bob: cat (only option left)
Carol: cat, dog, fish
Since Bob = cat, remove cat from others:
Alice: dog, fish
Bob: cat (assigned)
Carol: dog, fish
No further direct eliminations from clues alone. But we know Alice and Carol split dog and fish. Without additional constraints, both assignments are valid. However, the puzzle implies a unique solution — re-reading reveals no additional clue needed: both remaining assignments satisfy all constraints.
Most common puzzle convention: assign alphabetically. Alice = dog, Carol = fish.
Answer: Bob owns the cat (forced by clue 2). Alice owns the dog and Carol owns the fish (or vice versa — both satisfy the given clues). The scratchpad shows exactly how each elimination narrows the possibilities.
When to Use Scratchpad Prompting
Best for computation-heavy tasks where intermediate steps matter
Perfect For
Arithmetic, financial calculations, unit conversions — any task where carrying intermediate values correctly is essential for the final answer.
Walking through code line by line, tracking variable states — the scratchpad acts as a manual debugger showing exactly how values change.
Tracing sorting algorithms, graph traversals, or recursive functions — the scratchpad shows state transitions that would otherwise be invisible.
Logic puzzles, state machines, simulation steps — problems where the final answer depends on correctly tracking changes across multiple steps.
Skip It When
Questions with immediate answers — “What is 2 + 2?” doesn’t benefit from a scratchpad workspace.
Tasks focused on generating ideas, narratives, or creative content — the scratchpad format adds unnecessary structure to inherently free-form work.
When the process is irrelevant and you only need the final output — adding a scratchpad increases token usage without providing value.
Use Cases
Where Scratchpad Prompting delivers the most value
Code Review
Trace through code changes line by line using a scratchpad to track variable states, catch off-by-one errors, and verify that logic flows correctly before approving a merge.
Mathematical Proofs
Work through proof steps on a scratchpad, showing each logical derivation explicitly so that every step from premise to conclusion is visible and verifiable.
Data Transformation Pipelines
Track how data changes through each transformation step — filtering, mapping, aggregating — using the scratchpad to show intermediate data states.
Financial Calculations
Show each step of compound interest, amortization schedules, or tax calculations on a scratchpad, making every intermediate figure auditable and error-traceable.
Scientific Computations
Work through physics equations, chemistry stoichiometry, or statistical analyses step by step, using the scratchpad to track units, conversions, and intermediate results.
Test Case Validation
Trace test inputs through expected code paths on a scratchpad, verifying that each assertion checks the right value and that edge cases are handled correctly.
Where Scratchpad Prompting Fits
Scratchpad is the conceptual ancestor of the entire Chain-of-Thought family
In production systems, the scratchpad serves double duty: it improves model accuracy AND creates an audit trail. When a calculation is wrong, you can trace the scratchpad to find exactly which step failed. Some teams extract scratchpad contents into logs for automated verification, catching errors before they reach users.
Related Techniques
Explore complementary computation and reasoning techniques
Show Your Work
Try scratchpad-style prompting for your computation tasks or explore other reasoning techniques.