Module 2: Mastering Communication with AI

Advanced Techniques

Lesson 2.4 30–40 minutes 4 activities

Few-Shot Examples: Show, Don't Just Tell

In Lesson 2.2, you learned that providing examples is one of the five prompt components. Let's go deeper on this technique, because it's one of the most powerful tools in your prompting toolkit.

Few-shot prompting means giving AI a few examples of the input-output pattern you want, then asking it to follow the same pattern for new input. It's called "few-shot" because you're showing a few "shots" (examples) before the real task.

Here's how it works:

I need to write catchy one-line descriptions for app features. Here are some examples:

  • Feature: Daily reminders → Description: "Never forget a habit — gentle nudges exactly when you need them."
  • Feature: Streak counter → Description: "Watch your consistency grow — every day counts."
  • Feature: Weekly summary → Description: "See your week at a glance — celebrate wins, spot patterns."

Now write descriptions for these features:

  • Feature: Dark mode
  • Feature: Data export
  • Feature: Custom categories

By showing three examples, you've defined the exact format, length, and tone you want. The AI will match that pattern closely. Without examples, it would have to guess — and its guess might be a paragraph-long description when you wanted a single punchy line.

When to use few-shot: Anytime you need consistent formatting, a specific writing style, or a pattern that's hard to describe in words but easy to show with examples.

Answer: Examples create a concrete pattern for AI to match. Descriptions can be interpreted in many ways, but examples lock in the format, length, tone, and style you're looking for. AI is a pattern-matching engine — give it a pattern.

Style Matching and Tone Control

Different situations need different writing styles. A project README sounds different from an Instagram caption, which sounds different from a school essay. AI can write in any of these styles — but only if you tell it what style you need.

Three ways to control tone:

1. Describe the tone directly

"Write in a casual, friendly tone" or "Keep this professional and concise" or "Use a confident, encouraging tone like a coach talking to a team."

2. Reference a familiar style

"Write like a tech blog post" or "Match the tone of a college application essay" or "Write like a clear, modern instruction manual."

3. Provide a writing sample

This is the most powerful method. Give AI a paragraph you've written and say: "Match this writing style for the rest of the project." AI will mimic your voice remarkably well.

For your projects in this course, you'll often want two styles: one for user-facing text (the words someone sees when they use your project) and one for documentation (the behind-the-scenes explanation of how it works). Being intentional about tone is part of building something professional.

Constraints and Guardrails

You've already used constraints to control length and format. But advanced prompting uses constraints more creatively:

Negative constraints

What NOT to do: "Do NOT use bullet points." "Avoid clichés." "Don't suggest anything that requires a paid subscription."

These prevent AI from falling into its default patterns.

Audience constraints

Calibrate complexity: "Explain this so a 13-year-old could follow it." "Write for someone who has never used a spreadsheet."

These adjust vocabulary and depth automatically.

Priority constraints

Make trade-off choices: "Prioritize simplicity over features." "Focus on mobile-first design." "Value privacy over convenience."

These help AI make decisions about what to emphasize.

Structural constraints

Control output structure: "Respond in exactly three paragraphs." "Use the format: Problem → Solution → Example."

These give you predictable output structure.

Answer: A negative constraint — it tells AI what to exclude rather than what to include. Negative constraints are especially useful when AI keeps defaulting to options you don't want.

When to Start a New Conversation vs. Continue

This is a judgment call that even experienced AI users struggle with. Here's a practical framework:

Continue the conversation when:

  • You're iterating on the same output and each version is getting closer
  • The conversation context is helpful (AI remembers your project details)
  • You're having a productive back-and-forth exploration

Start fresh when:

  • AI seems confused or stuck in a wrong direction (the "spinning wheels" feeling)
  • The conversation is very long and AI is forgetting earlier instructions
  • You want to try a completely different approach
  • You're starting a different task, even within the same project

Pro tip: When starting fresh, paste key context from the old conversation into your new prompt. "I'm building a habit tracker. Here's my project plan: [paste]. Now help me with [new specific task]." This gives you a clean start without losing important context.

Key Concepts

  • Few-shot prompting means providing examples of the pattern you want. AI matches the format, style, and structure of your examples.
  • Control tone by describing it directly, referencing a familiar style, or providing a writing sample to match.
  • Use negative constraints ("don't do X") to prevent AI from falling into default patterns you don't want.
  • Priority constraints help AI make trade-off decisions: "value simplicity over features."
  • Start a new conversation when AI seems confused. Carry over key context by pasting it into your fresh prompt.

Try It: Prompt Lab

Experiment with advanced techniques to see which ones work best for different tasks.

Check Your Understanding

1. What is few-shot prompting?

Explanation: Few-shot prompting shows AI 2–3 examples of your desired input-output pattern. AI then follows the same pattern for new input. It's one of the most reliable ways to get consistent, well-formatted output.

2. What's the most reliable way to get AI to match your writing style?

Explanation: Giving AI a concrete writing sample is far more effective than describing the style you want. AI excels at pattern-matching, so showing your actual voice gives it the clearest target to aim for.

3. When should you start a new conversation with AI instead of continuing?

Explanation: Start fresh when the conversation feels stuck, AI is contradicting itself, or it's lost track of your earlier instructions. Carry key context to the new conversation so you don't lose progress.

4. "Don't use jargon. Don't suggest paid tools. Keep responses under 200 words." These are examples of:

Explanation: These are all constraints — rules that shape and limit AI's output. The first two are negative constraints (what NOT to do), and the third is a structural constraint (length limit). Together, they keep AI's response focused and useful.

Reflect & Write

Write 2–3 sentences: Which advanced technique (few-shot, style matching, negative constraints, starting fresh) do you think will be most useful for your specific project? Why?

Project Checkpoint

Try one advanced technique on your project:

  1. Write a few-shot prompt that shows AI 2–3 examples of the style/format you want for some part of your project (descriptions, labels, help text, documentation — whatever fits).
  2. Test it and evaluate: did the examples help? How close was the output to what you wanted?
  3. Log this in your Prompt Iteration Tracker (PDF).

Find this and all other downloadable resources on the Dashboard Resources page.

Level Up: Coming Next

Lesson 2.5 — Prompting for Your Project. Time to put everything together. You'll use everything you've learned in this module to create a detailed, AI-assisted project plan. This is where prompting stops being practice and starts being real.

Continue to Lesson 2.5 →