Benchmark
Receipt extraction: a fine-tuned 4B beats its optimized teachers
July 12, 2026
200 real scanned receipts, a fixed held-out split, and every configuration scored the same way. Prompt optimization lifted the frontier baseline by 11.3 points. A small fine-tuned model then beat the optimized frontier prompt by 5 more. Everything below is reproducible from public data.
Method, exactly
How the split works
- Data: 200 examples sampled (seed 42) from Voxel51/scanned_receipts (SROIE: real scanned receipts, human-annotated, CC-BY-4.0). Input is the receipt's OCR text; output is JSON with company, address, date, total.
- Split: 140 train, 60 held out. The held-out rows never touch optimization or training. Same 60 rows for every system.
- Metric: field-level F1, 0 to 100. Scores compare within this task only.
- Prompt optimization: DSPy GEPA, run 2026-07-06. Fine-tunes: LoRA (r=16), Unsloth on Colab; Qwen on 2026-07-06, Gemma on 2026-07-07. Exact fine-tuned Qwen score 89.17, shown as 89.2.
Results
Before and after, per model
Two readings. First, prompt optimization is real money on messy tasks: +11.3 on the same model, no training. Second, the verified dataset is what makes the small model work: raw Qwen3.5-4B scores 42.5 on this task; after fine-tuning on 140 verified rows it scores 89.2 and beats the GEPA-optimized GPT-4o-mini (84.2) and GPT-5.4-mini (79.6).
Reproduce it
The benchmark repo carries the data preparation script, the GEPA command, both Colab fine-tune notebooks, and the run logs. Rerun everything:
git clone https://github.com/singhabhishekkk/apprentice-benchmark
Task folder: tasks/receipt-extraction. Fine-tuned adapters are public on Hugging Face, linked from the task README.
Limitations, honestly
- 60 held-out rows is a modest eval; treat single-point differences with care.
- One task family (OCR-to-JSON extraction). Do not generalize these numbers to chat or reasoning work.
- SROIE receipts are English and retail-shaped. Your documents will differ; run the loop on your own data before believing anyone's numbers, including ours.
Related
How the prompt optimization step works, and migrating off OpenAI fine-tuning, which uses this benchmark as its evidence base. Apprentice ships the optimization and local fine-tuning that produced these numbers; eval-gated production takeover is coming soon. Or see every guide.