Want a model to follow a pattern without writing a long rulebook? Few-shot prompting provides several examples before the actual task, letting the model infer the expected format, style, or classification pattern. section 3.2.2
Use few-shot prompting when:
- The required format is specific. section 3.2.2
- Classification rules are difficult to describe directly. section 3.2.2
- The desired style is easier to demonstrate than explain. section 3.2.2
- Consistency matters more than creativity. section 3.2.2
Sentiment classification
Example 1: Review: "The battery life is excellent." Sentiment: Positive. Example 2: Review: "Charging takes too long." Sentiment: Negative. Review: "The vehicle is comfortable and easy to drive." Sentiment: Positive. Several labeled examples establish the pattern more clearly than an instruction alone. section 3.2.2
Figure 3.4 Three common prompting approaches. In zero-shot prompting, the model receives only a task. In one-shot prompting, a single example is provided. In few-shot prompting, multiple examples are provided to establish a clearer pattern.

Compare the progression from zero-shot prompting, which gives only a task, to one-shot and few-shot prompting, which provide increasingly clear examples. section 3.2.2
Start with zero-shot prompting, add one example when results are inconsistent, and provide several examples when the task remains ambiguous. Examples guide output; they do not remove the need to evaluate it. section 3.2.2 section 3.5























