A developer is looking for ways to address a task where output format is unstable. The developer wants to provide several input and output examples within the prompt to a foundation model and then run the actual task, stabilizing the accuracy and format of the output. What is this technique called?

1 / 1
Select an answer
CorrectD

Explanation

Select the name of the technique that provides examples before running the task.

  • 1provide several input and output examples within the promptProvide samples
  • 2run the actual taskGuide with examples before executing = few-shot
AIncorrect

Zero-shot prompting

This is incorrect. Zero-shot prompting is a technique that runs a task with only instructions and no examples at all. For example, it gives the actual task directly, such as 'Classify the following review as positive or negative: "The screen kept going dark and it was frustrating."' This is the opposite of the 'provide examples before executing' technique described in this question.

BIncorrect

Chain-of-thought prompting

This is incorrect. Chain-of-thought prompting is a technique that increases accuracy on complex problems by having the model write out intermediate reasoning steps, not just the final answer. For example, it prompts step-by-step thinking such as 'Answer the following word problem by writing out each step of your thinking before giving the final answer.' This is a different technique from providing examples to stabilize output.

CIncorrect

Using a prompt template

This is incorrect. Using a prompt template is a technique that standardizes instructions using a fixed-format template. For example, a template with placeholders is prepared such as 'You are a {role}. Summarize {input text} in {output format}.' While this helps with format consistency, it is not the technique of showing input/output examples for the model to learn from.

DCorrect

Few-shot prompting

This is correct. Few-shot prompting is a technique that provides several input and output examples within the prompt and then runs the actual task, making the accuracy and format of the output easier to stabilize. For example, provide 2–3 examples such as 'Great → positive / Terrible → negative / I guess it's okay →' before continuing with the actual input to classify.

Key Takeaway

Few-shot prompting:
- Provides several input and output examples within the prompt and then runs the actual task.
- Showing the desired format and pattern through examples makes the accuracy and format of the output easier to stabilize.
Zero-shot (no examples) is the opposite, and model distillation (training) and batch inference (execution method) are concepts separate from how to write prompts.