大模型网摘deepseek.wang

Prompt Optimization · 2026-11-27

DeepSeek for Math & Logic: Step-by-Step Prompts with Self-Checking

Many people use DeepSeek for math problems and end up with answers that jump straight to a conclusion (so mistakes can't be traced), or they trigger deep thinking for trivial mental arithmetic and wait forever. The core of a good prompt here comes down to two things: make the model write out steps, and make it self-check. Below are copy-ready patterns based on how DeepSeek actually behaves.

First, pick the right model: R series or V series

DeepSeek has two lines: the R series are reasoning models with deep thinking (switchable), suited for competition problems, multi-step logic, and proofs; the V series are general chat models, fine for everyday Q&A and simple calculations. On the same problem, the R series reasons internally before answering, while the V series follows whatever steps you specify.

A practical rule: if the problem needs more than three reasoning steps, has traps, or you don't fully trust the answer, use the R series or enable thinking mode. For arithmetic or unit conversions you can eyeball, plain mode is enough—don't burn waiting time. As for the prompt itself, R-series models don't respond to roleplay flourishes like "you are a distinguished math professor"—what they respond to is clear constraints and structured requirements. Stating the conditions, the goal, and the output format beats stacking personas.

Template 1: Step-by-step solving with explicit self-check (V series, or thinking off)

When deep thinking is off, write "step by step" and "self-check" into the prompt and use format constraints to slow the model down:

Solve the following math problem, strictly following this output format:

[Problem]
(paste the full problem here)

[Requirements]
1. First restate the given conditions and the goal in 1–2 sentences to confirm nothing is missing.
2. Outline your approach (which method and why).
3. Compute step by step, one action per step, showing intermediate results. No skipping steps.
4. Mark the answer as 【Final Answer】xxx.
5. Self-check: substitute your answer back into the problem's conditions and verify each one. If you find a contradiction, go back to the faulty step and fix it—don't rewrite everything from scratch.
6. Use Chinese throughout; keep fractions in fractional form and convert to decimals only at the last step.

Item 5 is the key. Most skipped-step errors happen because the model never looks back. Explicitly requiring substitution-based verification, plus "if a contradiction appears, return to the faulty step," noticeably reduces obviously-wrong answers. Item-style format constraints (keep fractions, convert only at the end) are worth building into a habit—the more specific the constraint, the more stable the output.

Template 2: Logic problems (best with R-series deep thinking)

For logic puzzles (who's lying, permutations, sufficiency/necessity judgments), the R series is more reliable. The prompt can be short—focus on structure and acceptance criteria:

Logic reasoning problem. Think deeply before answering.

[Problem]
(paste the problem, including all people, statements, and conditions, word for word)

[Output requirements]
1. Enumerate all possible hypothesis branches first.
2. Test each branch one by one; eliminate contradictions and state why each is eliminated.
3. Give the conclusion that satisfies all conditions, marked as 【Conclusion】.
4. After finishing, self-check: trace the conclusion back against every original condition and confirm all hold. If any fails, redo the reasoning.
5. If the problem is unsolvable or lacks conditions, say so directly—do not force an answer.

Item 5 matters: a common failure mode on logic problems is forcing an answer when conditions are insufficient. Explicitly permitting "no solution" or "not enough information" actually improves accuracy.

Pitfalls worth knowing

Still eyeball the final answer

However well-crafted the prompt, it lowers error rates rather than eliminating them. For anything going into an exam or report, manually spot-check the key steps—one minute, worth it. Save the two templates above, swap in the [Problem] section each time, and after a few uses you'll develop a feel for when deep thinking is actually worth turning on.