Few-shot Prompt

Definition

A prompting technique that extends the one-shot approach by providing multiple examples (typically 2-5) to the model before asking it to perform a similar task. This method gives the model more context and pattern recognition opportunities.

Characteristics

Example

Prompt:

Classify the emotion in the following statements:

Statement: "I just got promoted at work!"
Emotion: Joy

Statement: "I can't believe I lost my keys again."
Emotion: Frustration

Statement: "The movie made me cry."
Emotion: Sadness

Now classify this statement:
Statement: "I'm so excited for the weekend!"
Emotion:

Expected Response: "Joy" or "Excitement"

Use Cases

Benefits

Limitations

Best Practices

Example Selection Strategy

When to Use