Few-shot prompting guides a language model with a small set of successful input-output demonstrations. The model learns the task by analogy and applies the demonstrated pattern to a new input. section 6.2 section 6.2.1
From sentiment labels to a consistent writing style
A sentiment prompt can show labeled examples before requesting a classification. For content generation, users can supply high-performing LinkedIn announcements so the model imitates their style and structure while producing a new webinar announcement. section 6.2.1
Use few-shot prompting deliberately:
- Choose a small, high-quality, diverse set of relevant examples rather than trying to cover every scenario. section 6.2.2
- Retrieve examples that resemble the new input; semantic overlap can provide a stronger learning signal than superficial variety. section 6.2.2
- Treat scalability and cost as design constraints: manual construction takes effort, examples consume tokens, and long prompts may exceed context limits. section 6.2.1
- Preserve the intended label space and output format when automating example creation; experimental shortcuts such as random labels require care. section 6.2.2
Figure 6.3 Example of a few-shot prompt for sentiment analysis
A concrete sentiment-analysis prompt makes the instruction, demonstrations, current input, and requested output easy to compare. section 6.2.1

















