Prompt word engineering nanny-level tutorial: from structured template to stable output
🛒 For knowledge workers and developers, master the method of writing structured prompt words and iterative evaluation from scratch.
Tutorial objectives and applicable readers
This tutorial teaches you to master the core methods and practical steps of prompt word engineering: writing prompt words in a structured manner, evaluating iterations with examples, and establishing a personal template library. No programming knowledge is required, and it is suitable for any knowledge workers, operations, product and developers who want to use large models stably. It takes about 90 minutes to learn and get started.
1. Preparation Checklist
- [ ] Register an available large model account (choose from ChatGPT / Claude / DeepSeek, the tutorial uses DeepSeek as an example, it is free and Chinese-friendly)
- [ ] Prepare a note-taking tool (Notion / Feishu / local Markdown) for recording templates
- [ ] Prepare a real repetitive task (such as: writing weekly reports, writing product copy, organizing meeting minutes, writing SQL)
- [ ] Prepare 3-5 "input samples" and "expected output samples" (acceptance samples) of the task
2. Understand the four elements of prompt words
A stable output prompt word usually contains four parts:
- Role: Let the model enter the state with a specific identity (such as "You are a senior product manager")
- Task: Clarify what to do (such as "organize requirements into a PRD outline")
- Requirements: Acceptability constraints (format, length, tone, taboos)
- Example: Give 1-3 input and output demonstrations (few-shot), and constrain the output form
Rule of thumb: When the rule description doesn’t work, add examples; when there are too many examples, reduce it to the most typical 1-3.
3. Use the five-paragraph template to write the first prompt word
Copy the template below and replace the content in brackets to get the first version of the prompt:
# role
You are {identity description} and good at {ability}.
# Task
Please complete: {specific task description}
# input
{task input or original text}
# Requirements
1. Output format: {JSON/table/list/paragraph}
2. Length: {Number of words or paragraphs}
3. Tone: {formal/friendly/concise}
4. Taboo: {Things not to do, such as "Don't make up data"}
5. If there is any uncertain information, please mark [to be verified]
# Example
Input: {example input}
Output: {example output}
Paste and run in DeepSeek and observe whether the output meets the acceptance criteria.
4. Use examples to evaluate iteration prompt words
Good prompt words are "tested", not written correctly in one go:
- Create acceptance sample: Prepare 3-5 groups of "input → expected output".
- Running Test: Run each set of inputs through the current prompt words.
- Remember the failure mode: Which category does the statistical failure belong to - wrong format/wrong content/omission/digression.
- Targeted revision: If the format is wrong, add examples and format constraints; if the content is wrong, add restrictions such as "only based on input, no supplementary external knowledge"; if there are any omissions, add a checklist.
Example iteration: The prompt word requires a table to be output, but the model outputs a list. Just add "Markdown table must be output, column names include: X, Y, Z" in the "requirements" and give an example of the table.
5. Control randomness and stability
- Most dialogue products are random by default, and the results of the same prompt word will fluctuate.
- When strict consistency is required (such as batch generation of templates), set
temperatureto 0 or close to 0 in the API. - For business conclusion tasks, "multiple sampling + majority/manual ruling" can be used to reduce occasional errors.
- Important instructions are placed at the beginning and end of the prompt word (head-to-tail effect) to avoid long context diluting attention.
6. Establish a personal template library
- Create a "Prompt Word Template" page in the note-taking tool. Each template has a card. The fields are: task, full text of the prompt word, input example, output example, applicable boundary, and failure handling.
- Create stable templates for high-frequency tasks according to task classification (writing/organizing/analysis/coding/customer service).
- Template versioning: Every major change is saved as a new version, and the reason and date of the modification are marked.
- Review failure cases every week and precipitate common experiences into templates.
7. Verification method
- Success rate: The same prompt word reaches the standard at one time on 5 sets of acceptance samples ≥ 4 sets
- Stability: the same input is run three times, and the key output content is consistent
- Clear boundaries: Can clearly explain the situations in which the template "does not apply"
- Transferable: hand the template to your colleagues, and you can produce up to standard results without your explanation.
- Once the standard is met, the template is deemed ready for production use.
8. Frequently Asked Questions and Troubleshooting (FAQ)
- Why are my prompt words output in detail but still messy? Check for missing examples; few-shot examples are most effective for format class constraints.
- The results of the same prompt word are sometimes good and sometimes bad? Lower the temperature or sample multiple times; put key constraints at the beginning and end.
- The model is always compiling data? Make it clear that "only rely on the input content, do not add external facts", and require the mark [to be verified].
- Is the second half of the long text task off topic? Split into multiple subtasks and process them step by step, or repeat key instructions in the middle.
- The template becomes invalid after the model version is upgraded? Establish a retest mechanism and rerun the acceptance sample after the model is updated.
- Is there a big difference in the performance of different models? Prompt word and model binding: Save a fine-tuned version of each main model and mark compatible models.
9. Advanced expansion
- API engineering: Encapsulate stable templates into functions/interfaces, and use code to batch call and evaluate
- Automated Evaluation: Use scripts to run acceptance samples in batches to quantify the effect of prompt word revisions
- Thinking Chains and Advanced Techniques: Use step-by-step instructions of "analyze first, then answer" for complex reasoning tasks to improve the quality of reasoning
- Prompt words → Fine-tuning: When prompt words have diminishing returns, use high-frequency scene data sets for model fine-tuning to achieve higher-order customization
10. Practical example: turning "writing a weekly report" into a stable template
Take the "weekly report generation" task as an example to demonstrate a complete prompt word iteration:
v1 (naked writing): Help me write a weekly report - the output is very scattered, the format is wrong and cannot be used.
v2 (plus structure): Supplement roles, tasks, requirements and examples according to the five-stage template:
# role
You are a conscientious and meticulous project assistant.
# Task
Generate a weekly report based on the work records I provide.
# Requirements
1. Divided into three parts: progress this week/problems and risks/plan for next week
2. List each part with key points, and mark the person in charge of the progress.
3. Only rely on the content I provided and do not add anything to it.
4. Output Markdown format
# input
{Paste this week’s work record}
The structure of v2 is correct, but the "head of annotation in the progress department" often misses the mark.
v3 (examples added): Add a set of input and output examples to let the model follow the output form. At the same time, "only based on input, no supplement" was mentioned at the beginning to strengthen the constraints.
v4 (Added Boundary): Added "Do not include matters not mentioned in the work record into next week's plan" to avoid the model making its own decisions.
After each modification, run the test with 3-5 different sets of records to calculate the success rate. When 5 consecutive groups meet the standards, v4 will be stored in the template library, with acceptance samples and failure handling instructions attached. This path of "naked writing → adding structure → adding examples → adding boundaries → running tests to meet standards" is suitable for almost all repetitive tasks.
11. Common command word quick lookup table
| Intent | Available command words |
|---|---|
| Constraint output format | "Markdown table must be output, column names include: X, Y, Z" |
| Constrain information sources | "Only rely on the input I provide, do not add external knowledge" |
| Constrained length | "The full text should be within 500 words and divided into 5 main points" |
| Constrained tone | "Use a concise, professional, and non-marketing tone" |
| Guide thinking | "First analyze the problem, then give conclusions, and finally give suggestions" |
| Let the model self-examine | "Please review as a critical reader and point out 3 points for improvement" |
| Uncertain processing | "Uncertain information marked [to be verified]" |
| Multiple rounds of refinement | "Keep the previous structure and only rewrite the second paragraph to be more specific" |
Combining these instruction words into a five-paragraph template can cover most writing, organizing, and analysis tasks.
12. Summary: Turn prompt words into habits
The prompt word project is not "memorizing a template", but a process of "expressing clear thinking". Steady progress can be achieved by adhering to three principles: first, there are acceptance criteria (use examples to speak, not rely on feelings); second, structure first (five-step formula of role-task-requirement-example-input); third, continuous iteration (every failure is converted into template improvement). Precipitate mature prompt words into the team template library so that everyone can stand on the shoulders of their predecessors and produce stably. This is the long-term value of the prompt word project.
User Reviews