← 提示工程与结构化输出

明确标准 vs 模糊指令

约 9 分钟阅读

Explicit Criteria vs Vague Instructions

The single highest-leverage prompting skill is replacing vague intent with explicit, checkable criteria. Claude is highly capable, but it cannot read your mind. When you say "make this email better," you have a definition of "better" in your head — tone, length, audience, what to cut — that never reaches the model. The result is a guess. When you instead spell out the criteria, the output becomes predictable and, crucially, verifiable.

Why vague prompts fail

A vague prompt forces the model to silently fill gaps with priors. Those priors vary run to run, so output is inconsistent. Worse, you have no objective way to tell whether a given output is "correct," which makes evaluation and regression testing impossible. Explicit criteria turn a subjective task into one you can grade against a rubric.

Vague vs explicit

text

The explicit version specifies the audience, format, length, content per slot, and an escape hatch for missing information. Every one of those is something you can mechanically check.

A practical checklist

When writing a prompt, make these explicit:

  1. Audience & purpose — who reads this and what decision do they make?
  2. Format & length — exact structure (bullets, JSON, headers) and limits.
  3. Inclusion / exclusion rules — what to always include, what to never add.
  4. Edge-case handling — what to do when data is missing, ambiguous, or empty.
  5. Definition of "good" — the rubric you would use to grade the output.

Positive framing beats negation

Tell Claude what to do, not just what to avoid. "Respond in plain prose, no headers" is weaker than "Respond as a single paragraph of plain prose." Models follow concrete targets more reliably than prohibitions, and positive instructions reduce the chance of an over-corrected response.

Reducing hallucination with criteria

Explicit criteria are also a primary hallucination control. Instructing "Only use facts present in the provided document; if the answer is not stated, reply 'not found'" gives the model a sanctioned way to decline rather than fabricate. Pair this with a structured output slot (covered in Module 2) such as a confidence or source_quote field, and the model must ground each claim.

False positives and developer trust (the CI review case)

An automated reviewer that flags ten issues, seven of them noise, gets ignored within a week — and then the three real findings are ignored too. The exam's CI scenario treats false-positive rate as the primary quality metric for review prompts, and the fixes are all explicit-criteria fixes:

  • Categorical criteria beat "be conservative." "Only flag high-confidence issues" is vague — the model has no definition of confidence. "Flag only: (a) SQL built by string concatenation with user input, (b) secrets in source, (c) unhandled promise rejections in request handlers" is a rubric the model can apply and you can audit.
  • Temporarily disable high-FP categories. If "possible null dereference" produces mostly noise on this codebase, remove that category from the rubric now and re-enable it once you have examples that sharpen it. Shipping fewer, trusted findings beats shipping more.
  • Severity criteria with code examples. Define each severity with a one-line rule and a short code snippet that qualifies: critical = "credential exposure, e.g. api_key = 'sk-...'". Examples anchor the boundary far better than adjectives.

When a scenario reports "developers stopped reading the bot's comments", the most proportionate change is tightening the rubric to categorical criteria and pruning noisy categories — not switching models, not adding a second reviewer, not lowering the temperature. (Exam Guide v1.0 task statement 4.1;(CCAR-F Exam Guide v1.0, Jul 2026)

Exam focus

Expect a question contrasting a vague instruction with a precise rubric, asking which yields consistent, evaluable output — the explicit-criteria version wins. Remember the principles: state audience/format/length, give edge-case escape hatches ("unknown"/"not found"), prefer positive framing over prohibitions, and treat criteria as the rubric you grade against. Explicit criteria reduce variance AND hallucination.