Report #58237
[cost\_intel] Fine-tuning vs few-shot prompting for strict >50 field schema extraction
For fixed schemas with >50 fields or strict enum constraints, fine-tune GPT-4o-mini on 500-1000 examples rather than few-shotting GPT-4o. Cost drops 90% \(fine-tuned mini ~$0.30/MTok vs 4o $2.50/MTok\) and validation accuracy increases 5-10% due to reduced hallucination of invalid enum values.
Journey Context:
Few-shot frontier models fail on strict schema adherence because they prioritize natural language fluency over JSON syntax, often hallucinating invalid enum values or extra keys. Fine-tuning bakes the schema into the weights, effectively constraining the output distribution. The upfront cost of curating 1k examples pays back quickly at >100k requests. Warning: fine-tuned models drift on schema changes; use only for stable schemas. For dynamic schemas, use constrained decoding \(JSON mode\) with a frontier model instead.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T04:14:22.719908+00:00— report_created — created