ladderlore
请求新指南
  • 输入服务名称,例如 S3 或 IAM。

概念

Prompting techniques

Zero-shot, few-shot, chain-of-thought, negative prompts, templates, roles, chaining and ReAct, with one clue each.

本课尚未翻译,暂以英文显示。

  • Zero-shot

    What it is
    The task only.
    Clue
    Classify this review as positive or negative.
  • Single-shot

    What it is
    The task and one example.
    Clue
    Same task, plus one labeled review.
  • Few-shot

    What it is
    The task and several examples.
    Clue
    Same task, plus five labeled reviews.
  • Chain-of-thought

    What it is
    A request to reason in steps.
    Clue
    Think step by step, then give the total.
  • Negative prompt

    What it is
    A line that says what to avoid.
    Clue
    Do not mention prices.
  • Prompt template

    What it is
    A reusable prompt with blanks.
    Clue
    Summarize {document} for {audience}.
Examples, reasoning, exclusions and templates.

1 / 3

  • Zero-shot

    What it is
    The task only.
    Clue
    Classify this review as positive or negative.
  • Single-shot

    What it is
    The task and one example.
    Clue
    Same task, plus one labeled review.
  • Few-shot

    What it is
    The task and several examples.
    Clue
    Same task, plus five labeled reviews.

2 / 3

  • Chain-of-thought

    What it is
    A request to reason in steps.
    Clue
    Think step by step, then give the total.
  • Negative prompt

    What it is
    A line that says what to avoid.
    Clue
    Do not mention prices.

3 / 3

  • Prompt template

    What it is
    A reusable prompt with blanks.
    Clue
    Summarize {document} for {audience}.
Examples, reasoning, exclusions and templates.
  • Role (persona)

    What it is
    Tells the model who to act as.
    Clue
    You are a travel agent.
  • System and user prompts

    What it is
    System: standing rules. User: the request.
    Clue
    Always answer in English.
  • Prompt chaining

    What it is
    One answer feeds the next prompt.
    Clue
    Summarize first, then translate the summary.
  • ReAct

    What it is
    Reason, act with a tool, observe, repeat.
    Clue
    Think, search the web, read the result.
  • Self-consistency

    What it is
    Try several reasoning paths, keep the common answer.
    Clue
    Name only.
  • Tree-of-thought

    What it is
    Explore branches of reasoning.
    Clue
    Name only.
Roles, chaining and tool use.

1 / 2

  • Role (persona)

    What it is
    Tells the model who to act as.
    Clue
    You are a travel agent.
  • System and user prompts

    What it is
    System: standing rules. User: the request.
    Clue
    Always answer in English.
  • Prompt chaining

    What it is
    One answer feeds the next prompt.
    Clue
    Summarize first, then translate the summary.

2 / 2

  • ReAct

    What it is
    Reason, act with a tool, observe, repeat.
    Clue
    Think, search the web, read the result.
  • Self-consistency

    What it is
    Try several reasoning paths, keep the common answer.
    Clue
    Name only.
  • Tree-of-thought

    What it is
    Explore branches of reasoning.
    Clue
    Name only.
Roles, chaining and tool use.

是什么

Prompting techniques are standard ways to shape a prompt. The first three differ in how many examples you show the model.

Zero-shot gives only the task. Single-shot (one-shot) gives one example. Few-shot gives several, which helps most when the answer needs a special format or tone. Chain-of-thought asks the model to reason step by step, which helps with maths, logic and multi-step questions. A negative prompt says what to leave out. A prompt template is a reusable prompt with blanks that your application fills in.

是什么

Other techniques change who the model is or how prompts connect. Role (persona) prompting tells the model who to act as. A system prompt holds standing rules, and the user prompt holds the request. Prompt chaining feeds the answer of one prompt into the next. ReAct lets the model alternate between reasoning and using tools, and many agents work this way. Self-consistency and tree-of-thought are two more names to know: the first tries several reasoning paths and keeps the most common answer, and the second explores branches of reasoning.

More examples cost more tokens on every call, so use only as many as you need.

要记住

  • Zero-shot: the task only. Single-shot: one example. Few-shot: several examples, good for format and tone.
  • Chain-of-thought: ask for step-by-step reasoning; good for logic and multi-step problems.
  • Negative prompt: say what to avoid. Prompt template: a reusable prompt with placeholders. Tell it to treat user input as data, which resists prompt injection.

要记住

  • Role prompting sets who the model acts as. A system prompt sets standing rules.
  • Prompt chaining: the answer to one prompt becomes part of the next. ReAct: reasoning mixed with tool actions.
  • Self-consistency and tree-of-thought: know the names. Examples add tokens, so they add cost.

考试中

  • “Provide a few sample inputs and outputs in the prompt” points to few-shot prompting.
  • “Ask the model to think step by step” points to chain-of-thought.
  • “Reuse one prompt structure with different inputs” points to a prompt template.
  • “Split a big task into prompts where each answer feeds the next” points to prompt chaining.