Prompt Library 📚 Education Few-Shot Learning Setup
GPT-4o 📚 Education Basic

Few-Shot Learning Setup

Teach an AI a custom task pattern using 3-5 examples so it replicates your exact style and logic consistently.
👁 4 views ⎘ 0 copies ♥ 0 likes

The Prompt

# Few-Shot Learning Setup

You are an expert at training AI models through demonstration. Use few-shot learning to teach an AI your exact pattern for a task so it can replicate it consistently without further instruction.

## Task to Teach

**Task description:** [TASK_DESCRIPTION — e.g., write product descriptions in my brand voice, classify customer feedback into categories, extract key data from receipts]
**Why standard prompting fails here:** [REASON — e.g., the pattern is too specific to describe in words, the output format is highly customized]

## Example Demonstrations

Provide [EXAMPLE_COUNT] input-output pairs that perfectly demonstrate the pattern:

**Example 1:**
Input: [EXAMPLE_1_INPUT]
Output: [EXAMPLE_1_OUTPUT]

**Example 2:**
Input: [EXAMPLE_2_INPUT]
Output: [EXAMPLE_2_OUTPUT]

**Example 3:**
Input: [EXAMPLE_3_INPUT]
Output: [EXAMPLE_3_OUTPUT]

## Pattern Analysis

After reviewing my examples, explicitly state the pattern you have learned:
- Output structure: [WHAT_YOU_OBSERVED]
- Tone and style: [WHAT_YOU_OBSERVED]
- Rules that seem to apply in every case: [RULES]
- Edge case handling: What would you do if the input has [EDGE_CASE]?

## New Task

Now apply the exact pattern from my examples to this new input:
[NEW_INPUT]

Output only the result — no explanation, no preamble. Match my examples exactly.

📝 Fill in the blanks

Replace these placeholders with your own content:

[TASK_DESCRIPTION — e.g., write product descriptions in my brand voice, classify customer feedback into categories, extract key data from receipts]
[REASON — e.g., the pattern is too specific to describe in words, the output format is highly customized]
[EXAMPLE_COUNT]
[EXAMPLE_1_INPUT]
[EXAMPLE_1_OUTPUT]
[EXAMPLE_2_INPUT]
[EXAMPLE_2_OUTPUT]
[EXAMPLE_3_INPUT]
[EXAMPLE_3_OUTPUT]
[WHAT_YOU_OBSERVED]
[RULES]
[EDGE_CASE]
[NEW_INPUT]

How to use this prompt

1
Copy the prompt

Click "Copy Prompt" above to copy the full prompt text to your clipboard.

2
Replace the placeholders

Swap out anything in [BRACKETS] with your specific details.

3
Paste into GPT-4o

Open your preferred AI assistant and paste the prompt to get started.