Last week, my friend Jennifer K., a junior Product Manager for a Fintech company, called me in a bit of a panic. She was stuck trying to write an email announcing a new product update to customers for a B2B market in Asia.
“Every draft I write feels either too technical or just plain meh,” she told me. “I can’t figure out how to get the tone right.”
After a quick Teams call, I suggested we try few-shot prompts. I explained to her how giving ChatGPT an example could help it understand the tone she wanted. So, screen-sharing via Teams, we typed: “Technical: The system update reduces latency by 15%. Customer-friendly: This update means your app will load faster and feel smoother.”
Instantly, Google Gemini (which she prefers) rewrote the email in a clear, friendly tone that was perfect for her audience. Jennifer couldn’t believe how quickly it worked. “This is exactly what I needed!” she said.
Note: Most of the tutorials in this series can be applied to any LLM. For simplicity’s sake, we cover ChatGPT as this is the most widely known, but Gemini, Claude, and Copilot have their respective strengths. More on these in future courses.
Few-shot prompts are a lifesaver for situations like Jennifer’s. They’re perfect for teaching an LLM your style or tone, helping you craft messages that hit the mark without the frustration.
Why Use Few-Shot Prompts?
Few-shot prompts enable you to teach ChatGPT your preferred style, tone, or preferences. By providing examples within your prompt, you can guide ChatGPT to produce outputs that align more closely with your needs.
Think of it as setting the stage: you show ChatGPT the kind of performance you expect, and it adapts accordingly. Whether you’re crafting upbeat emails or maintaining a consistent tone across reports, few-shot prompts help you achieve tailored, professional results.
What Are Few-Shot Prompts?
Few-shot prompts supply examples of the desired style, tone, or format within the prompt itself. These examples act as a reference point, helping ChatGPT replicate your preferences in its responses.
Analogy: Imagine you’re working with a decorator for your home. Instead of just saying, “Make it cozy,” you’d show them pictures of spaces you like. Similarly, few-shot prompts let you provide “pictures” in the form of examples, making it easier for ChatGPT to deliver results you love.
Few-Shot Prompts: Key Characteristics Matrix
Characteristic | Description | Example |
---|---|---|
Teaching Style or Tone | Provides examples to guide ChatGPT in replicating a specific tone or style. | “Rewrite this text in a friendly tone. Example: ‘Formal: We regret to inform you. Friendly: We’re sorry to let you know.’” |
Customizing Outputs | Tailors the response to match your preferred format or approach. | “Summarize this report for a beginner audience. Example: ‘Advanced: Data indicates… Beginner: The data shows that…’” |
Replicating Preferences | Helps ChatGPT learn and adapt to specific nuances in tone, phrasing, or detail. | “Write a thank-you email. Example: ‘Generic: Thank you for your business. Personalized: We truly value your trust and loyalty.’” |
This matrix highlights how Few-Shot Prompts can be used to shape ChatGPT’s responses, ensuring outputs are more aligned with your unique needs and preferences.
Examples of Few-Shot Prompts
Few-shot prompts work by showing ChatGPT exactly what you need through clear examples. Here are some practical ways to use this technique to customize tone, style, and messaging.
1. Setting the Tone
- Prompt: “Rewrite this text in a friendly tone. Example: ‘Formal: We regret to inform you. Friendly: We’re sorry to let you know.’”
- Real-Life Win: Recently, I needed to write several progress report emails for a new client. By providing one example of my preferred tone, ChatGPT learned my style and helped me maintain consistency across all emails.
2. Customizing Responses
- Prompt: “Rephrase this paragraph in a professional yet approachable tone. Example: ‘Technical: This system utilizes advanced algorithms. Professional: This system uses cutting-edge algorithms for better results.’”
- Real-Life Win: Ideal for adapting technical or overly formal content to suit a broader audience.
3. Brainstorming
- Prompt: “Suggest 5 blog titles for a post about productivity. Example: ‘How to Kickstart Your Morning Routine with 5 A.M. Protocols.’”
- Real-Life Win: By sharing a sample title, ChatGPT generates ideas that are more aligned with your creative direction.
Use Cases for Few-Shot Prompts
You can apply few-shot prompts across various tasks where maintaining a specific tone, style, or level of detail is crucial. Here are some scenarios where they can make a significant difference.
1. Maintaining Consistent Tone
- Example Prompt: “Rewrite this policy document in plain English. Example: ‘Original: Employees are advised to adhere to the company’s travel guidelines. Revised: Please follow our travel guidelines when making arrangements.’”
- Benefit: Ensures uniformity in communication, especially in professional documents.
2. Crafting Personalized Messages
- Example Prompt: “Write a thank-you email for a client. Example: ‘Generic: Thank you for your business. Personalized: We’re so grateful for your trust and look forward to working together again.’”
- Benefit: Makes customer communication more engaging and genuine.
3. Adapting Writing for Different Audiences
- Example Prompt: “Explain this technical concept for a beginner. Example: ‘Advanced: The data is stored in a distributed ledger. Beginner: Think of it as a shared online notebook where everyone has the same information.’”
- Benefit: Simplifies complex ideas without losing meaning.
Klariti Checklist for Writing Few-Shot Prompts
- Provide Clear Examples
Bad: “Rewrite this to sound better.”
Good: “Rewrite this in a friendly tone. Example: ‘Formal: We regret to inform you. Friendly: We’re sorry to let you know.’” - Keep Examples Relevant
Bad: “Write a formal email like this casual text: ‘Hey, let’s meet up!’”
Good: “Write a formal email using this example: ‘Dear Mr. Smith, I hope this message finds you well.’” - Be Specific About Style and Audience
Bad: “Rewrite this text.”
Good: “Rewrite this text for a beginner audience, using this example: ‘Advanced: The algorithm processes data sequentially. Beginner: The algorithm works step by step to handle data.’” - Refine Based on Results
Example: “This is good, but make the tone more conversational and add an example.” - Use Few-Shot Prompts Iteratively
Start with one example, and refine further based on ChatGPT’s response.
Challenge: Create a Few-Shot Prompt
Think of a piece of writing where tone or style is essential. Use a few-shot prompt like this:
“Rewrite this email for a friendly tone. Example: ‘Formal: Please be advised of the change in schedule. Friendly: Just a quick heads-up—the schedule has been updated.’”
Refine ChatGPT’s response until it matches your vision. Few-shot prompts not only help ChatGPT learn your style but also ensure consistent and high-quality outputs every time.
What’s Next? Advanced Multi-Shot Prompts
Few-shot prompts are a very effective way to teach ChatGPT your ‘personal’ style, but what if you need to fine-tune even more? In our next tutorial, we’ll explore multi-shot prompts, where multiple examples allow for even deeper customization and nuanced outputs.