返回提示词目录第 1457 页

从示例归纳可复用提示词

分析输入输出样例中的转换规则,生成结构化提示词,并用留出样例检查结果匹配程度

完整提示词

<context>
People often know what they want only by example: "turn this into that". Pasting the examples into a prompt and writing "do the same" works on the cases that look like the examples and fails on the rest, because the real rules stay implicit: what gets kept, dropped, normalised or reordered, how long the output is, what happens with missing or odd input, and which differences between examples are deliberate. A good prompt states those rules explicitly, uses a few examples only to show what words cannot, and is checked against examples it has not seen.

Target use: {{target_use}}
Hold out examples for testing: {{holdout}}

<examples>
{{examples}}
</examples>
</context>

<task>
1. Parse the pairs. If there are fewer than three, or inputs and outputs cannot be told apart, say what you need and stop.
2. If holding out is on and there are at least five pairs, set aside about one in five and do not use them while inferring rules. Choose typical pairs plus, where possible, one that varies a rule already shown elsewhere; never hold out the only pair that shows a rule (such as the only out-of-stock or refusal case), because the prompt could not learn it.
3. Infer the transformation from the remaining pairs and name every rule you can see:
   - content rules: what is extracted, kept, dropped, added or normalised (names, dates, numbers, casing, units);
   - format rules: structure, order, length range, punctuation, labels;
   - tone and register;
   - edge handling visible in the pairs: empty or missing fields, ambiguous input, input that should be refused or flagged.
   For each rule, cite the example numbers that show it and rate your confidence (high when several pairs agree, low when one pair suggests it).
4. List conflicts, where pairs imply different rules, and gaps, where likely real inputs are not covered. Do not average conflicting examples; state the reading you used and ask which is intended.
5. Write the prompt for the target use: context and purpose, the task, the rules as explicit instructions with brief reasons, what to do when information is missing or input is out of scope, the exact output format, and two or three of the most varied training pairs as examples, marked as illustrations of the rules rather than templates. Delimit the input with tags and use a clearly marked slot such as [INPUT] for it.
6. Dry-run the prompt: apply it, as written, to every pair, held-out pairs included, and compare the result with the desired output. Mark each Match, Partial or Mismatch with the reason. If a mismatch comes from a missing or wrong rule, fix the prompt once and say what changed; a held-out pair used to make a fix no longer counts as an unseen test, so say so and suggest fresh inputs to replace it.
</task>

<constraints>
- The dry run is your own simulation of following the prompt, not a measured model run. Say so, and recommend running it for real on the held-out pairs and new inputs.
- Do not invent rules the examples do not support; put guesses under gaps, labelled as assumptions.
- Keep the prompt free of model or vendor names and of features only one tool has.
- If the examples contain personal data, use placeholders in the prompt's examples.
- Keep the prompt as short as the rules allow.
</constraints>

<output_format>
## Inferred rules
Table: Rule | Evidence (example numbers) | Confidence.
## Conflicts and gaps
Bullets, each ending with the question to answer or the assumption made.
## The prompt
One fenced block, ready to paste.
## Dry run
Table: Example | Training or held out | Result (Match, Partial, Mismatch) | Why. Then one line on any fix made.
## Next tests
Three to five new inputs worth trying, each targeting a gap or a low-confidence rule.
</output_format>

可替换内容

  • {{target_use}}
  • {{holdout}}
  • {{examples}}
  • [INPUT]

分类与标签

办公效率、提示词工程、样例分析、工作流设计、结果校验

前往 AI 图片创作