Sub topic 10
Prompting Reasoning Models
This chapter assumes you can call an LLM API from Python, know what tokens and max output tokens are, and have written basic prompts. It covers how to prompt a model that already reasons before it answers.
Why prompts change for reasoning models
A standard chat model often needs help to reason well. You add "think step by step" or show worked examples so it writes out its intermediate steps. A reasoning model does this on its own. It produces reasoning tokens before the final answer, so your prompt does not need to ask for them.
Repeating that instruction is not harmful in a dramatic way, but it has costs:
- It can push the model to write long visible explanations you did not need.
- It can conflict with the model's own reasoning process.
- It adds tokens to every request.
The practical rule is to describe the problem clearly and let the model decide how to work through it.
What to put in the prompt
Good prompts for reasoning models are short, direct, and complete. Focus on these parts:
- The goal. State what a correct answer looks like.
- The inputs. Give all the data the model needs. It cannot reason its way to facts it was never given.
- The constraints. List rules, limits, and edge cases that matter.
- The output format. Say exactly how the final answer should look.
Use delimiters, such as headings or tags, to separate instructions from data. This keeps a long input from being confused with the task.
Before and after
Here is a prompt written for a standard model, followed by a version for a reasoning model.
| Style | Prompt |
|---|---|
| Standard model | "You are a careful math tutor. Think step by step. First list what you know, then plan, then compute, then double-check. Is 3599 prime?" |
| Reasoning model | "Is 3599 prime? Answer with `prime` or `not prime`, then give the smallest factor if there is one." |
The second prompt states the task and the output format. It leaves out the process.
Example: a request with a clear contract
The code below sends a prompt with delimited data and a strict output format. It uses the Responses API call from earlier chapters.
from openai import OpenAI
client = OpenAI()
prompt = """Decide whether each order should be refunded.
Rules:
- Refund if the item arrived damaged.
- Refund if delivery was more than 14 days late.
- Otherwise do not refund.
Orders:
<orders>
1. Arrived on time, box dented, item works.
2. Arrived 20 days late, item fine.
3. Arrived damaged, 2 days late.
</orders>
Output one line per order in the form: <number>: refund or no refund"""
response = client.responses.create(
model="o4-mini",
reasoning={"effort": "low"},
input=prompt,
)
print(response.output_text)The prompt gives rules, delimited data, and a format. It does not tell the model how to work through the orders. Note that order 1 is ambiguous: a dented box is not a damaged item under the rules. A clear rule set lets the model resolve that case by itself.
Few-shot examples and role prompts
Few-shot examples are sample inputs paired with desired outputs. They help a standard model learn a pattern. With reasoning models, start with none. Add examples only if the output format or style is still wrong, and keep them few and short. Long worked solutions can pull the model toward copying their method instead of solving your problem.
Role prompts such as "You are a world-class mathematician" add little. A specific task description does more.
Prompting and effort work together
Prompt wording does not replace the effort level or thinking budget from earlier chapters. If answers are shallow on a hard task, raise the effort setting first. Rewrite the prompt when the answer is correct in substance but wrong in format, scope, or tone.
A common mistake: asking for the reasoning
Some developers ask the model to "show your reasoning" so they can inspect it. Hidden reasoning tokens are not the same as visible text you request. Asking for an explanation makes the model write a second account of its work in the answer, and you pay for those output tokens. If you need an explanation for users, ask for a short justification. If you want to see the model's thinking, use the summary or thinking block features covered earlier.
Summary of habits
- Keep the prompt short and direct.
- Skip "think step by step".
- Delimit data and state the output format.
- Add few-shot examples only when needed.
- Tune effort for depth and tune wording for form.
Exercise
A teammate's prompt for a reasoning model begins "Think step by step and show all your work", and the answers are long and expensive. What two changes would you make, and why?
Show answer
Remove the step-by-step instruction, because the model already reasons internally and the instruction mostly adds visible output tokens. Replace it with a clear statement of the goal and the exact output format, such as a one-line answer plus a short justification. If accuracy drops on hard cases, raise the effort level instead of adding process instructions.