Does few-shot prompting pay for itself?
Adding worked examples to a prompt (few-shot) almost always improves quality — but those examples are re-sent on every call, so the token cost compounds with volume. This calculator shows the per-call and monthly cost of zero-shot vs few-shot, the extra spend the examples add, and a breakeven view so you can decide if the quality gain is worth it.
How the comparison works
fewshot_input = zeroshot_input + (example_tokens × example_count)
extra_per_call = (fewshot_input − zeroshot_input)/1e6 × in_price
monthly_extra = extra_per_call × requests_per_month
cost_per_quality_point = monthly_extra / quality_delta_pct
The key insight is that the example tokens are a fixed tax on every request. At low volume the tax is negligible; at high volume it can dominate, and that is exactly when prompt caching or fine-tuning starts to look attractive.
A concrete example
For illustration: suppose your zero-shot prompt is 500 tokens and you want to add three worked examples of 150 tokens each. Your few-shot input grows to 500 + 450 = 950 tokens — nearly double. At a hypothetical input rate of $3 per million tokens:
- Zero-shot cost per call: 500 / 1,000,000 × $3 = $0.0015
- Few-shot cost per call: 950 / 1,000,000 × $3 = $0.00285
- Extra per call: $0.00135
- At 50,000 calls per month: $67.50 extra per month
If few-shot raises accuracy from 78% to 90% — a 12-percentage-point improvement — and each error costs you $1 in downstream work, the break-even is 67.50 / 12 = $5.63 per quality point. With 50,000 calls and a 22% error rate reduced to 10%, you save roughly 6,000 × $1 = $6,000 per month in error handling. The $67.50 is trivial. Conversely, if the error cost is low and you have very high volume, the math flips quickly.
When zero-shot is good enough
Zero-shot with a well-crafted instruction is often competitive with few-shot when:
- The task is common enough to appear heavily in training data (simple classification, standard format conversions).
- The model is already near-perfect on the task and the marginal quality gain from examples is small.
- Response latency matters and you want to minimise prompt size.
When few-shot clearly wins
- Idiosyncratic output formats — if your JSON schema or writing style is unusual, examples are far more reliable than a long description.
- Rare domain language — examples teach vocabulary and phrasing that the model hasn’t seen in training.
- Consistency across runs — even if average quality is similar, few-shot often reduces output variance, which matters in production systems.
Alternatives when few-shot is expensive
- Prompt caching — some model APIs cache the fixed prefix (including your examples) and charge a reduced rate for cache hits. This can reduce the effective example-token cost by 80–90%.
- Fine-tuning — bake the examples into the model weights once; inference input shrinks back to zero-shot size.
- Distillation — generate a large few-shot labelled dataset, then fine-tune a smaller model on it.
How to read the result
If the cost per quality point is small relative to what an error costs you, keep the examples. If it is large and your volume is high, evaluate prompt caching (re-use the example prefix cheaply) or fine-tuning (bake the behaviour into the model so you stop paying for examples at all).