大模型网摘deepseek.wang

Prompt Tutorials · 2026-11-16

Prompt Iteration: One Change at a Time

The most common way prompt tuning fails is piling multiple problems into a single edit: swap the role setup, add constraints, change the format—then the result gets better or worse and you have no idea which change caused it. DeepSeek models (R-series deep-thinking reasoning plus V-series general chat) are quite sensitive to instruction structure, and changes interfere with each other, so it's worth iterating like a controlled experiment: change one thing at a time, keep everything else fixed. Here's a hands-on method with templates you can copy directly.

Fix Your Test Set First

Iterating without a fixed test set is guesswork. Start by preparing 5–10 representative inputs (covering typical cases and edge cases) and store them in a file. Every time you edit the prompt, run the same batch and compare outputs by eye.

A few points:

One Change at a Time: Keep a Variable Checklist

Break your prompt into independently editable variables: task description, output format, constraints, number of examples, thinking-mode toggle. Each experiment touches exactly one.

Here's an experiment log template, ready to copy:

[Prompt Iteration Experiment Log]

Date: ____
Baseline version: V1 (paste the full current prompt)

Single change this round: ____________
(e.g., only added to output requirements: "output as a JSON array, no extra explanation")

Test set: fixed 8 inputs (see test_inputs.txt, unchanged)

Comparison:
- Input 1: baseline ____ → after ____ (better / worse / same)
- Input 2: baseline ____ → after ____ (better / worse / same)
- ...

Conclusion: keep or roll back this change, because: ____
Next baseline: V2 (paste the new version if kept)

Keep logging consistently. After a handful of versions you'll have a clear feel for which kinds of changes work with this model, instead of guessing from scratch every time.

Structure the Prompt So Iteration Is Cheap

Iteration efficiency depends on how structured your baseline is. DeepSeek's deep-thinking models don't respond much to "you are a seasoned expert" style role-play flourishes—they respond to clear requirements and constraints. So your variables should be precisely describable things: format, boundary conditions, prohibitions, examples.

A structured baseline template suited to controlled experiments:

[TASK]
{one sentence, verb-first, describing what to do}

[INPUT]
{place the input here}

[OUTPUT REQUIREMENTS]
1. Format: {e.g., three bullet points, max 50 words each}
2. Must include: {key elements}
3. Must not: {e.g., don't restate the question, no off-topic content}

[EXAMPLE] (optional—add only when format is hard to describe)
Sample input: ____
Expected output: ____

When iterating, change exactly one sentence in exactly one block—[OUTPUT REQUIREMENTS], [EXAMPLE], or [TASK]. Constraint edits (items 2–3) usually pay off faster and cost less than adding examples. If constraint tweaks keep falling short, then try examples, or enable deep-thinking mode for complex tasks.

Common Pitfalls

When to Stop

Set a stopping rule: stop when your fixed test set reaches your acceptance threshold for correctness or usability, and two consecutive versions show no clear improvement. The goal of a prompt is "good enough and stable," not "perfect." Time saved is often better spent improving test-set quality than on ten more rounds of prompt edits.

Treat iteration as an experiment: fixed test set, one change at a time, logged conclusions, a hard stop. This process depends on no specific tool and runs fine with the DeepSeek API or a local deployment; for the exact way to toggle deep-thinking mode, refer to the official pages.