Inferensys

Prompt

Difficulty-Stratified Few-Shot Example Set Prompt

A practical prompt playbook for generating a sequenced set of few-shot examples across easy, moderate, and hard difficulty tiers to improve model robustness and prevent ceiling effects.
ML engineer working on model compression and quantization, laptop showing performance benchmarks, technical workspace.
PROMPT PLAYBOOK

When to Use This Prompt

Determine when difficulty-stratified example generation is the right tool and when simpler approaches suffice.

Use this prompt when you are constructing a training or evaluation example set and need to ensure your model encounters a systematic progression of difficulty. The primary job-to-be-done is preventing your model from overfitting to simple, homogeneous patterns that cause brittle failures on complex production inputs. This is critical for prompt engineers and AI builders who are moving beyond a handful of hand-crafted examples and need a structured, labeled dataset that explicitly teaches the model how to handle edge cases, long contexts, ambiguous constraints, and multi-step reasoning. If your production traffic includes a wide variance in user sophistication, input length, or task complexity, a flat example set will train a model that performs well on average but fails silently on the hardest 10% of requests.

You should not use this prompt when your task has a narrow, well-defined input distribution with low variance in difficulty. If all inputs are structurally identical—such as classifying single-sentence intents into five fixed categories—a stratified set adds unnecessary token overhead and complexity. Similarly, avoid this approach when you lack a clear definition of what constitutes 'easy,' 'moderate,' and 'hard' for your specific domain. The prompt requires you to supply concrete difficulty criteria and progression logic; without these, the generated tiers will be arbitrary and may introduce noise rather than signal. For high-risk domains like healthcare or legal review, the output of this prompt is a starting point for human curation, not a final dataset. Every generated example must be reviewed for factual accuracy and safety before it enters a production system prompt or fine-tuning dataset.

Before using this prompt, gather your seed examples, define your difficulty dimensions (e.g., input length, constraint count, ambiguity level, reasoning steps), and decide how many examples you need per tier. After generation, validate the output by running the stratified set through your model and measuring whether performance degrades gracefully across tiers. A sharp drop-off at the 'hard' tier indicates the examples are too difficult or poorly taught; a flat performance curve across all tiers suggests insufficient challenge variation. Use the companion Example Diversity Scoring Rubric Prompt and Coverage Gap Detection Prompt to audit the generated set before deployment. If you observe ceiling effects where the model fails on most hard examples, return to your difficulty criteria and adjust the progression logic rather than simply adding more examples.

PRACTICAL GUARDRAILS

Use Case Fit

Where difficulty-stratified few-shot prompting delivers value and where it introduces unnecessary complexity or risk.

01

Good Fit: Non-Trivial Classification or Generation

Use when: the task has clear easy, moderate, and hard cases that a single instruction cannot fully disambiguate. Guardrail: define difficulty tiers with concrete criteria (e.g., entity count, constraint overlap, ambiguity level) so example selection is repeatable.

02

Good Fit: Production QA and Regression Testing

Use when: you need a golden example set that proves the model handles the full difficulty spectrum before release. Guardrail: version-lock the stratified set and run it as a regression gate on every prompt or model change.

03

Bad Fit: Trivial or Single-Mode Tasks

Avoid when: the task has no meaningful difficulty variation or a single instruction plus one example already produces ceiling performance. Guardrail: run a ceiling-effect check—if easy and hard examples produce identical accuracy, stratification adds token cost without value.

04

Bad Fit: Unstable or Undefined Difficulty Criteria

Avoid when: the team cannot agree on what makes an example easy, moderate, or hard. Guardrail: define difficulty dimensions (e.g., input length, constraint count, entity density) and validate inter-annotator agreement before building the stratified set.

05

Required Inputs

You need: a task definition, 3+ difficulty tier definitions with measurable criteria, and at least 2-3 seed examples per tier. Guardrail: if seed examples are missing for any tier, generate synthetic candidates and have a domain expert validate them before inclusion.

06

Operational Risk: Ceiling Effects and Token Waste

Risk: the model saturates performance on easy and moderate examples, making the hard tier the only differentiator—while burning tokens on redundant examples. Guardrail: monitor per-tier accuracy in production. If easy-tier accuracy is consistently 100%, collapse or remove that tier to save context budget.

PROMPT PLAYBOOK

Copy-Ready Prompt Template

A copy-ready template for generating a difficulty-stratified few-shot example set with progression logic and evaluation checks.

The following template is designed to be pasted directly into your prompt engineering workspace. It instructs the model to produce a sequenced set of examples across easy, moderate, and hard difficulty tiers, each with a difficulty label and a brief justification for its placement. Replace every square-bracket placeholder with your specific task details before use. The template assumes you have already defined the core task and the desired output format; its job is to enforce stratified coverage and progression logic.

text
You are an expert example curator for training AI systems. Your task is to generate a difficulty-stratified set of few-shot examples for the following task:

[TASK_DESCRIPTION]

Each example must be a complete input-output pair demonstrating the desired behavior. Produce exactly [TOTAL_EXAMPLE_COUNT] examples, distributed across three difficulty tiers as follows:
- Easy ([EASY_COUNT] examples): Straightforward cases with clear, unambiguous inputs and standard expected outputs.
- Moderate ([MODERATE_COUNT] examples): Cases with some complexity, such as multiple constraints, longer inputs, or edge-adjacent scenarios.
- Hard ([HARD_COUNT] examples): Challenging cases involving ambiguity, conflicting constraints, rare patterns, or boundary conditions.

For each example, output a JSON object with the following schema:
{
  "difficulty": "easy|moderate|hard",
  "input": "[INPUT_FIELD_DESCRIPTION]",
  "expected_output": "[OUTPUT_FIELD_DESCRIPTION]",
  "difficulty_rationale": "One sentence explaining why this example belongs in this tier."
}

Arrange the examples in progression order: all easy examples first, then moderate, then hard. Within each tier, order examples from simplest to most complex.

Before finalizing, verify:
1. No two examples are near-duplicates.
2. The hard tier includes at least one example that tests a known failure mode: [KNOWN_FAILURE_MODE].
3. The easy tier does not contain any examples that could be confused with moderate difficulty.
4. The set as a whole covers these required input variations: [REQUIRED_VARIATIONS].

Output the complete example set as a JSON array.

To adapt this template, start by filling in [TASK_DESCRIPTION] with a precise statement of what the model should do. Define [TOTAL_EXAMPLE_COUNT] and the per-tier counts based on your token budget and coverage needs—a common starting ratio is 40% easy, 40% moderate, 20% hard. The [KNOWN_FAILURE_MODE] placeholder should reference a specific production failure you have observed, such as 'misclassifying negated statements as positive' or 'hallucinating fields when the input is empty.' For [REQUIRED_VARIATIONS], list input dimensions that must appear, such as 'inputs under 10 words, inputs over 200 words, inputs with nested lists, and inputs with missing optional fields.' After generating the set, run it through your existing eval harness to confirm the hard-tier examples actually produce failures in your current prompt before you rely on them for improvement.

IMPLEMENTATION TABLE

Prompt Variables

Required and optional inputs for the Difficulty-Stratified Few-Shot Example Set Prompt. Populate these before calling the model to ensure reliable difficulty tier assignment and progression logic.

PlaceholderPurposeExampleValidation Notes

[TASK_DESCRIPTION]

Defines the target behavior the model should learn from examples

Classify customer refund requests as APPROVED, DENIED, or ESCALATE

Must be a single, unambiguous task. Reject if task implies multiple disjoint objectives

[DIFFICULTY_TIERS]

Specifies the number and labels for difficulty levels

easy, moderate, hard

Use 3-5 tiers. Tier labels must be mutually exclusive and ordered from least to most challenging

[TIER_DEFINITIONS]

Describes what makes an example belong to each difficulty tier for this task

easy: single clear reason, moderate: multiple reasons with one dominant, hard: conflicting reasons with no clear dominant

Each tier must have a definition that a reviewer could apply consistently. Reject if definitions overlap

[SEED_EXAMPLES]

Optional starting examples the model should use as reference for style and format

Input: 'Item arrived damaged and I need it for tomorrow' Output: 'ESCALATE - time sensitivity and product defect'

If provided, must include at least one example per tier. Null allowed if generating from scratch

[OUTPUT_FORMAT]

Schema for each generated example in the set

{"difficulty": "easy|moderate|hard", "input": "string", "expected_output": "string", "rationale": "string"}

Must be a valid JSON schema or structured format specification. Reject if format is ambiguous

[EXAMPLES_PER_TIER]

Number of examples to generate for each difficulty level

3

Integer between 2 and 10. Total examples across all tiers must not exceed token budget. Reject if 0 or negative

[DOMAIN_CONSTRAINTS]

Restrictions on example content such as prohibited topics, required terminology, or compliance boundaries

Do not use real customer names. All monetary values must be in USD. Exclude healthcare-related scenarios.

Each constraint must be testable. Reject constraints that are vague or cannot be verified programmatically

[PROGRESSION_RULE]

How examples should be sequenced when presented to the model

easy examples first, then moderate, then hard

Must specify ordering logic. Acceptable values: 'tier-ascending', 'tier-descending', 'interleaved', or a custom ordering description

PROMPT PLAYBOOK

Implementation Harness Notes

How to wire the difficulty-stratified example set prompt into a reliable, testable application workflow.

This prompt is not a one-off generator; it is a component inside a larger example curation pipeline. The implementation harness should treat the prompt as a deterministic specification that receives a fixed set of inputs and produces a structured, machine-readable output. The primary integration points are: (1) a seed example or task description, (2) a difficulty taxonomy (easy, moderate, hard) with definitions, (3) a target example count per tier, and (4) an output schema that downstream tooling can parse. Because the generated examples will be used to teach model behavior in production, the harness must enforce validation, versioning, and human review before any example set is deployed.

Wire the prompt into a pipeline function that accepts a configuration object: { seed_task, difficulty_definitions, examples_per_tier, output_format }. The function should call the LLM with the prompt template, parse the response into a typed structure (e.g., a list of Example objects with difficulty, input, expected_output, and rationale fields), and run a series of post-generation validators. Validation checks must include: (1) schema conformance—every example matches the expected fields and types; (2) difficulty distribution—the actual count per tier matches the requested count; (3) progression logic—hard examples genuinely require more steps, constraints, or reasoning than easy ones; (4) ceiling effect detection—if the hardest tier examples are still trivial, flag the set for human review; and (5) contradiction scanning—no two examples teach conflicting behaviors. Log every generation run with a unique example_set_id, the model version used, the raw prompt, the raw response, and all validation results. This audit trail is essential for debugging drift and regressions.

For model choice, use a model with strong instruction-following and structured output capabilities (e.g., GPT-4o, Claude 3.5 Sonnet). Set temperature low (0.0–0.2) to maximize reproducibility. If the model supports structured output mode (JSON mode or function calling with a strict schema), use it to enforce the output shape directly rather than relying on post-hoc parsing. Implement a retry loop with up to 3 attempts: if validation fails, feed the validation errors back into the prompt as [CORRECTION_NOTES] and request a repaired output. If retries are exhausted, escalate the failed generation to a human reviewer queue with the full context. For high-risk domains (healthcare, legal, finance), always require human approval before the example set enters any training or evaluation pipeline. Store approved example sets in a versioned registry with a status field (draft, validated, approved, deprecated).

Finally, integrate evaluation hooks that run before deployment. After the example set is generated and approved, use it in a separate evaluation prompt that measures whether the examples actually teach the intended behavior. Run a set of held-out test inputs through a model using the new examples and compare outputs against expected behavior. Track metrics: behavioral alignment score, failure rate on edge cases, and difficulty calibration accuracy. If the hardest examples don't improve model performance on hard test cases, the stratification is likely ineffective. Wire these metrics into your prompt observability stack so that example set quality is monitored alongside other prompt assets. Avoid the temptation to auto-approve generated examples; even with strong validation, example quality is a human judgment call that directly shapes model behavior in production.

IMPLEMENTATION TABLE

Expected Output Contract

Fields, format, and validation rules for the difficulty-stratified example set generated by this prompt. Use this contract to parse, validate, and store the output before injecting it into downstream prompts or evaluation harnesses.

Field or ElementType or FormatRequiredValidation Rule

example_set

Array of objects

Must contain at least 3 objects. Reject if empty or null.

example_set[].id

String (slug)

Must match pattern ^[a-z0-9-]+$. Must be unique within the set.

example_set[].input

String

Must be non-empty. Length must not exceed [MAX_INPUT_LENGTH] characters.

example_set[].expected_output

String or Object (per [OUTPUT_SCHEMA])

Must parse successfully against [OUTPUT_SCHEMA] if JSON. String outputs must be non-empty.

example_set[].difficulty

Enum: easy | moderate | hard

Must be one of the three allowed values. Reject any other string.

example_set[].rationale

String

Must be non-empty and contain a justification referencing specific difficulty features.

example_set[].progression_order

Integer >= 1

Must be a positive integer. Sequence must be contiguous starting from 1 with no gaps.

metadata.coverage_gaps

Array of strings

If present, each string must match a known category from [COVERAGE_TAXONOMY]. Null allowed.

PRACTICAL GUARDRAILS

Common Failure Modes

Difficulty-stratified example sets fail silently when the model memorizes patterns instead of learning to generalize, or when easy examples dominate and hard cases never get tested. These are the most common production failure modes and how to catch them before they reach users.

01

Ceiling Effect on Easy Tiers

What to watch: The model scores perfectly on easy and moderate examples but fails catastrophically on hard cases, creating a false sense of robustness. Easy examples dominate the eval signal and mask real capability gaps. Guardrail: Weight hard-tier examples at least 40% of your eval score. Set a minimum hard-tier pass rate before any release, and flag any prompt where easy-tier accuracy exceeds hard-tier accuracy by more than 20 percentage points.

02

Difficulty Label Drift

What to watch: Human annotators or automated classifiers assign inconsistent difficulty labels, so 'hard' examples in one batch are easier than 'moderate' examples in another. The stratification becomes meaningless and the model never sees genuine challenge. Guardrail: Run inter-rater reliability checks on difficulty labels across annotators. Use a calibration set of 10-20 anchor examples with consensus difficulty labels to normalize new example ratings before adding them to the set.

03

Progression Leakage into Evaluation

What to watch: Examples used in the few-shot prompt appear in the evaluation set, or near-duplicates slip through. The model isn't generalizing—it's regurgitating. Accuracy looks inflated until production traffic hits. Guardrail: Run semantic deduplication between your few-shot examples and eval set using embedding similarity. Flag any pair above 0.85 cosine similarity. Maintain a strict separation registry tracking which examples are for training, which are for eval, and which are held out.

04

Hard-Tier Collapse Under Ambiguity

What to watch: Hard examples that require nuanced judgment or uncertainty expression get rewritten into easier versions during example curation. The model never learns to say 'I'm not sure' or to handle genuine ambiguity, so it hallucinates confidently on hard production inputs. Guardrail: Audit hard-tier examples for whether they actually require uncertainty, multi-step reasoning, or conflicting evidence. Include at least 20% of hard examples where the correct output is a qualified answer, abstention, or explicit uncertainty marker.

05

Token Budget Starvation for Hard Examples

What to watch: Hard examples are longer and more complex, so they get trimmed or dropped first when token budgets tighten. The model sees a distorted distribution skewed toward easy cases and overfits to shallow patterns. Guardrail: Allocate token budget by difficulty tier proportionally to production input complexity, not equally across examples. Monitor the actual token count per tier in every prompt version. Set a hard floor—never drop below two hard examples regardless of budget pressure.

06

False Confidence from Memorized Patterns

What to watch: The model learns surface-level patterns from examples—specific phrasings, entity names, or output structures—without understanding the underlying task. It performs well on examples that look like the few-shot set and fails silently on anything structurally different. Guardrail: Test with held-out examples that preserve the task but change surface features: swap entities, rephrase instructions, alter output field order. If accuracy drops more than 15%, the model is pattern-matching, not generalizing. Add counterexamples that explicitly break surface patterns.

IMPLEMENTATION TABLE

Evaluation Rubric

Use this rubric to test the quality of the generated difficulty-stratified example set before shipping. Each criterion includes a concrete pass standard, a failure signal to watch for, and a test method that can be automated or run manually.

CriterionPass StandardFailure SignalTest Method

Difficulty Tier Completeness

All three tiers (easy, moderate, hard) contain at least [MIN_EXAMPLES_PER_TIER] examples

One or more tiers is empty or below the minimum count

Count examples per tier label in the output; compare against [MIN_EXAMPLES_PER_TIER]

Difficulty Progression Logic

Hard examples require strictly more reasoning steps or domain knowledge than moderate examples, which require more than easy examples

A hard example is trivially solvable or an easy example requires complex multi-step reasoning

Manual review by a domain expert; spot-check 3 examples per tier for relative difficulty ranking

Ceiling Effect Absence

At least one hard-tier example produces a non-perfect score when evaluated against [OUTPUT_SCHEMA] by the target model

All hard examples receive perfect scores, indicating insufficient challenge at the top tier

Run each hard example through the target model; score outputs against [OUTPUT_SCHEMA]; flag if all scores equal maximum

Floor Effect Absence

At least one easy-tier example produces a non-zero score when evaluated against [OUTPUT_SCHEMA] by the target model

All easy examples receive zero or near-zero scores, indicating examples are too difficult at the bottom tier

Run each easy example through the target model; score outputs against [OUTPUT_SCHEMA]; flag if all scores equal zero

Difficulty Label Accuracy

At least 80% of difficulty labels match independent human rater assignments

Human raters disagree with the generated difficulty label on more than 20% of examples

Have two independent raters label a random sample of 10 examples; compute agreement rate with generated labels

Output Schema Compliance

Every example's expected output field conforms to [OUTPUT_SCHEMA] with no missing required fields

An expected output is missing a required field, contains an extra field not in the schema, or has a type mismatch

Validate each expected output against [OUTPUT_SCHEMA] using a JSON Schema validator; fail on any validation error

Input Diversity Coverage

Examples span at least [MIN_DOMAIN_CATEGORIES] distinct domain categories or input patterns from [INPUT_DOMAIN_LIST]

All examples cluster in one or two categories, leaving [MIN_DOMAIN_CATEGORIES] minus actual categories uncovered

Map each example input to categories in [INPUT_DOMAIN_LIST]; count unique categories covered

No Contradictory Examples

No pair of examples teaches conflicting behavior for semantically equivalent inputs

Two examples with similar inputs have expected outputs that contradict each other on a key field

Run pairwise similarity check on inputs above [SIMILARITY_THRESHOLD]; manually review high-similarity pairs for output conflicts

ADAPTATION OPTIONS

Adapt This Prompt

How to adapt

Start with the base prompt and 6–8 examples (2 easy, 3 moderate, 2 hard). Use manual difficulty labels like [DIFFICULTY: easy] before each example. Skip formal eval—just spot-check outputs for ceiling effects where the model aces everything.

Watch for

  • All examples clustering at the same difficulty
  • No true hard examples (inputs the model currently fails on)
  • Difficulty labels leaking into the output format
Prasad Kumkar

About the author

Prasad Kumkar

CEO & MD, Inference Systems

Prasad Kumkar is the CEO & MD of Inference Systems and writes about AI systems architecture, LLM infrastructure, model serving, evaluation, and production deployment. Over 5+ years, he has worked across computer vision models, L5 autonomous vehicle systems, and LLM research, with a focus on taking complex AI ideas into real-world engineering systems.

His work and writing cover AI systems, large language models, AI agents, multimodal systems, autonomous systems, inference optimization, RAG, evaluation, and production AI engineering.