Few-shot prompting — CCA-F Exam Prep

PencilPrepPencilPrep
L2.02|Few-shot prompting
1/12
Side by side
Two dashboards showing invoice extraction accuracy. Left: 'Zero-shot: 61% accuracy' with red error highlights. Right: 'Few-shot (3 examples): 94% accuracy' with green checkmarks. Same stack of messy invoices feeding into both. Clean data viz style.

Same model. Same invoices. Same task. One prompt got 61% accuracy. The other got 94%.

A fintech startup was building an invoice extraction pipeline. Thousands of invoices per day from hundreds of vendors. Different formats, different layouts, different languages. They needed to extract vendor name, date, line items, and total.

Their first prompt: "Extract the vendor name, date, line items, and total from this invoice. Return JSON."

61% accuracy. Dates in wrong formats. Vendor names truncated. Line items missing. They spent two weeks rewriting the instructions. Added 400 words of detailed rules.

63% accuracy. Then someone added three examples. 94%.