home/productivity/unit-1-2-few-shot-prompting

Unit 1.2 Few Shot Prompting

GPTClaudeDeepSeek··1,168 copies·updated 2026-07-14
unit-1-2-few-shot-prompting.prompt
# Unit 1.2: Few-Shot Prompting for Consistency

**Task Statement 4.2** — Apply few-shot prompting to improve output consistency and quality

## The core principle

When detailed instructions alone produce inconsistent output, **2-4 targeted few-shot examples** are the single most effective fix. The exam treats this as a first-line solution, not a last resort.

Few-shot examples work because they demonstrate *judgment* — not just rules. A rule says "handle ambiguous cases." An example shows what ambiguous looks like and what the correct response is.

## What the exam expects you to know

### Knowledge areas

1. Few-shot examples are **the most effective technique** for achieving consistently formatted, actionable output when instructions alone are inconsistent
2. Examples should demonstrate **ambiguous-case handling** — showing reasoning for why one action was chosen over plausible alternatives
3. Few-shot examples enable the model to **generalize** to novel patterns, not just match pre-specified cases
4. Few-shot examples **reduce hallucination** in extraction tasks (handling informal measurements, varied document structures)

### Skills tested

1. Creating **2-4 targeted examples** for ambiguous scenarios with reasoning
2. Including examples that demonstrate **specific output format** (location, issue, severity, suggested fix)
3. Providing examples that **distinguish acceptable patterns from genuine issues** to reduce false positives while enabling generalization
4. Using examples to handle **varied document structures** (inline citations vs bibliographies, narrative vs tables)
5. Adding examples showing **correct extraction from varied formats** to fix empty/null extraction of required fields

## When few-shot beats instructions

| Situation | Instructions alone | Few-shot wins? |
|-----------|-------------------|----------------|
| Output format inconsistency | Model varies between bullet points, paragraphs, JSON | ✅ Yes — examples set the format |
| Ambiguous tool selection | Model picks wrong tool for edge cases | ✅ Yes — examples show reasoning |
| False positives in code review | Model flags acceptable patterns | ✅ Yes — examples show what to skip |
| Extraction from varied doc formats | Model misses fields in unusual layouts | ✅ Yes — examples show each layout |
| Simple factual task | "What is 2+2?" | ❌ No — no ambiguity to resolve |

## Example structure for the exam

The exam tests whether you know the **anatomy of a good few-shot example**:

when to use it

Community prompt sourced from the open-source GitHub repo maxwellsdm1867/caludeArchitect (no explicit license). A "Unit 1.2 Few Shot Prompting" style prompt — adapt the placeholders and specifics to your task. Imported as-is and not independently retested here, so check the output before relying on it.

tags

productivitycommunitydeveloper

source

maxwellsdm1867/caludeArchitect · no explicit license