When to use which (and why it saves money)

PatternUse it forStrengthWeaknessCost note
Zero-shotClear tasks with rules/schemasFast, cheapestStyle/format may driftStart here 80% of the time
One-shotYou need a style/format anchorBig quality jump for tiny costExample can bias too hardAdd one compact exemplar
Few-shot (2–3)Ambiguous tasks; multiple edge casesMost stable outputsHighest input costKeep examples tiny & diverse

Rule of thumb: Zero → One → Few only if the previous step fails validation.

Core cost levers

  1. Shrink input first (examples + context dominate spend).

  2. Use a strict schema instead of long prose instructions.

  3. Cap output (max_tokens) and forbid rambling: “Return only the final result.”

  4. Add a tiny verifier (cheap check) before escalating models or shots.

Reusable guardrails (paste once)

System (cost guard)

Follow the schema exactly; no extra text. If unsure, output "INSUFFICIENT_CONTEXT".
Keep within token limits. Do not explain your reasoning; return only the final result.

Zero-shot: the cheapest baseline

Template

Task: <one sentence>
Inputs (bullets): <facts only, short>
Output Schema: { ...exact keys/limits... }
Constraints: length≤N; tone=<X>; banned=<list>
Budget: max_output_tokens=M
Return only the schema-compliant result.

Example – JSON extraction

Task: Extract purchase to JSON.
Inputs:
- "2 notebooks at $5 each, 1 backpack for $40."
Output Schema:
{"items":[{"item":"string","qty":int,"unit_price":float}],"total":float}
Constraints: items length≤3; currency USD; no commentary.

If zero-shot fails format → keep schema, reduce instructions, lower temperature (0–0.3).

One-shot: tiny exemplar, big payoff

Template

You will output exactly the schema. Here is ONE example:

Example Input:
"3 pens at $2 each, 1 notebook for $5."
Example Output:
{"items":[{"item":"pen","qty":3,"unit_price":2.0},{"item":"notebook","qty":1,"unit_price":5.0}],
 "total":11.0}

Now process:
<new input here>
Schema: {...same as above...}

Tips

Few-shot: only when necessary (2–3 mini examples)

Template (compact pairs)

Schema: {"label":"<A|B|C>","reason":"≤15 words"}

Ex1:
Input: "Refund processed; customer happy."
Output: {"label":"Positive","reason":"Refund success and satisfaction"}

Ex2:
Input: "Support ignored my emails for weeks."
Output: {"label":"Negative","reason":"No response for weeks"}

Ex3:
Input: "App works but drains battery."
Output: {"label":"Mixed","reason":"Works yet power issue"}

Now classify:
<your text>

Tips

Verifier (cheap, universal)

Run this with a small/cheap model after any shot size:

Validate DRAFT against rules: [schema valid, length≤N, required fields present, no extra keys].
Return {"pass":true|false,"failed":["rule-id",...]}

If fail → retry once with the same shot size; only then consider escalating shots or model tier.

Real-life mini-recipes

1) Customer email (apology/update) — start zero-shot

2) SQL from natural language — one-shot anchor

3) Policy Q&A (RAG) — zero→one with compression

Keep examples cheap (practical tricks)

Troubleshooting

Pocket checklist

This playbook gets you stable results with the minimum tokens necessary, scaling from quick zero-shot wins to robust few-shot handling only when the task truly needs it.