Module 02 · Lesson 3

Making the model think before it answers

Six tricky questions, five runs each. Answering directly gets 21 right, writing out the reasoning first gets 29, and thinking mode gets them all. Why thinking before answering helps, and what it costs.

  • About 35 min
  • Level: Beginner
  • Tested: 2026-09-14 deepseek-flash

Code and program output are shown exactly as they ran, so comments and printed output are in Chinese.

"Which is bigger, 9.11 or 9.9?" Any schoolchild gets that right, yet large language models often get it wrong. In the last module's experiment, deepseek-flash with thinking off answered 9.11.

The same model gets it right if you ask differently: have it write out its reasoning first, then give the answer. This lesson uses experiments to see how much this trick helps, what it costs, and how it relates to "thinking mode".

Why writing out the working helps

Recall lesson 2 of module 01: the model generates one token at a time, and each token builds on everything before it.

If you ask for "the answer only", the model has to commit to a conclusion in its very first token. Comparing 9.11 and 9.9, it has nowhere to "work it out" and can only go on instinct. And its instinct may be skewed by the many version numbers in its training data: in software versions, 9.11 really is newer than 9.9.

If you have it write out the working first, something like "9.9 can be written as 9.90; compare the first digit after the decimal point, 9 is greater than 1…", those reasoning steps become input for the tokens that follow. By the time it writes the conclusion, it's drawing it from the reasoning already on the page rather than guessing out of thin air.

So having the model think before it answers essentially gives it somewhere to draft. How much it can "think" depends on how much it writes.

Experiment: three approaches compared

I picked 6 tricky questions: the decimal comparison, character counting, square area and letter counting seen before, plus two new ones:

  • A rope is folded in half three times, then cut once through the exact middle. How many pieces is it now? (The answer is 9: three folds make 8 layers, one cut through the middle makes 16 cut ends, and together with the two original ends they form 9 pieces.)
  • I have 3 apples, eat 1, buy 2 more, then give half to a friend. How many are left? (The answer is 2.)

Three approaches, all with deepseek-flash:

DIRECT = "只回答最终答案,一个数,不要任何解释。"
STEP_BY_STEP = "先一步一步写出推理过程,最后单独一行写“答案:”加上一个数。"

METHODS = [
    ("直接回答", DIRECT, False),        # 关掉思考
    ("先推理再回答", STEP_BY_STEP, False),  # 关掉思考,但要求在回答里写推理过程
    ("开启思考", DIRECT, True),         # 打开思考模式,回答里只要答案
]

Each question was run 5 times with each approach, the number after "答案:" (Answer:) was taken from the reply and compared with the right answer (the complete code is in code/02-prompting/reasoning.py). What I got:

直接回答:21/30 正确,平均输出 1 词元,共 0.0003 美元
    9.11 和 9.9 哪个大?(正确答案 9.9)→ ['9.11', '9.11', '9.11', '9.9', '9.9']
    “秋天的叶子一片片落下”这句话有几个字?(正确答案 10)→ ['11', '11', '11', '11', '12']
    单词 raspberry 里有几个字母 r?(正确答案 3)→ ['3', '2', '3', '3', '3']
先推理再回答:29/30 正确,平均输出 244 词元,共 0.0091 美元
    9.11 和 9.9 哪个大?(正确答案 9.9)→ ['9.11', '9.9', '9.9', '9.9', '9.9']
开启思考:30/30 正确,平均输出 431 词元,共 0.0160 美元

Reading the results

Answering directly got 9 wrong. The character-counting question was wrong all 5 times, and wrong in different ways, sometimes 11 and sometimes 12. The decimal question was wrong 3 times out of 5. Interestingly, the rope and apple questions, which look more complicated, were all answered correctly directly, possibly because questions like these are common in the training data.

Writing out the reasoning cut the mistakes from 9 to 1. All it took was adding "先一步一步写出推理过程" (first write out the reasoning step by step) to the prompt. The one remaining mistake was the 9.11 question again, which shows that writing out the working isn't foolproof: if the very first step of the reasoning goes astray (say, deciding from the start that "11 is bigger than 9"), the rest of the reasoning just follows the mistake.

Thinking mode got everything right. Thinking mode actually does the same thing, only more thoroughly: the model thinks first in reasoning_content, a part that's been specially trained to check itself and to go back and start again when it notices a contradiction. The final content holds only the answer, which is also easier for us to process.

The cost is tokens. Answering directly output an average of 1 token, writing out the reasoning 244, and thinking mode 431. The cost of the 30 questions rose from US$0.0003 to US$0.016, more than 50 times as much. Response times grew accordingly.

Written-out reasoning or thinking mode?

As of September 2026, DeepSeek's main models all support thinking mode, so in most cases just turn it on; there's no need to ask for "step by step" in the prompt.

Asking for written-out reasoning is still useful when:

  • The model you're using doesn't support thinking mode.
  • You want users to see the reasoning, for example in tutoring or when giving the grounds for a judgement. Thinking mode's reasoning_content is a draft meant for developers; you control neither its content nor its format, and it's generally not shown to users directly.
  • You want to control how it reasons, for example "first list the known facts, then the quantity asked for, then calculate step by step".

With the written-out approach, one thing matters: have the model write the working first and the answer last. If the prompt asks for "the answer first, then the reasons", the model gives an answer on instinct and then invents a set of reasons for it, and the reasoning is wasted.

When it's worth making the model think

Thinking before answering isn't free. In this experiment, thinking multiplied the cost by more than 50.

Worth it: multi-step calculation, logical reasoning, tasks that need careful comparison, writing code, complex planning. Getting these wrong usually costs far more than the extra money.

Not worth it: simple classification, translation, rewriting, extracting one field from text, chit-chat. The model does these well on "instinct", and thinking only adds latency and cost. The message classification in the last lesson scored 20/20 with thinking off.

When you're not sure, use the method from lesson 6 of module 01: run your real task both ways and compare accuracy and cost.

Exercises

  1. Add 3 questions you think models get wrong to reasoning.py (such as "what day of the week is it a week from now" or "how many minutes apart are two times") and see which of the three approaches does best.
  2. Change STEP_BY_STEP to "先给出答案,再解释你的理由" (give the answer first, then explain your reasons), keeping "答案:" on the last line. Run it; how does accuracy compare with before?
  3. With thinking on, print out reasoning_content and see how the model thinks through the 9.11 question. Does it change its mind partway?

Self-check

1. Why does asking the model to "write out the reasoning first, then answer" improve accuracy?

The model generates one token at a time, and what comes later builds on what's already been written. Asked for the answer directly, it has to commit to a conclusion in its first token and can only go on instinct. With the reasoning written first, those steps become input for what follows, and the conclusion is drawn from the reasoning. It's like giving the model somewhere to draft.

2. What's wrong with a prompt asking for "the answer first, then the reasons"?

The model writes an answer on instinct first, and the "reasons" afterwards only look for support for that answer; they don't correct it. The reasoning has to come before the answer to help produce it.

3. Your application sorts user reviews into "positive" and "negative", 100,000 a day. Should you turn thinking mode on?

Usually not. Sentiment classification is a simple task that usually goes well without thinking; with thinking on, the cost multiplies and latency grows. Test a small batch of real reviews both ways first, and if accuracy barely differs, turn thinking off.