Skip to content
Finic
AI and agents

What is few-shot prompting?

Few-shot prompting is a way of guiding a language model by including a small number of worked examples of the task in the prompt, before the new input it should handle.

Also called: few-shot learning, k-shot prompting

How it works

The prompt shows the model a few pairs of input and correct output, then gives a new input. The model infers the pattern and applies it. This relies on in-context learning, so no training is needed.

Good examples are short, correct and varied. They should cover the tricky cases, not just the easy ones, and they should use the exact output format you want back.

Why it matters for fraud and risk

Few-shot prompts are a quick way to build classifiers for text that rules handle badly: dispute reasons, support tickets, seller descriptions or chat messages. When a new scam script appears, adding one or two examples can help the model recognize it.

Balance matters. If most examples show fraud, the model may over-label fraud. Including clear legitimate examples helps limit false positives.

Tips for better results

  • Use real, de-identified examples that look like production data.
  • Include at least one example for each label, including the hard edge cases.
  • Keep a fixed output format, such as a single label and a short reason.
  • Test the prompt on a held-out labeled set and track accuracy over time.

Example

A hypothetical lender wants to flag loan applications whose stated purpose looks copied from a template. The prompt shows two template-like purposes labeled suspicious and three genuine ones labeled normal. The model then labels new applications, and reviewers check a sample each week.

← All glossary terms

Ship fraud, bot and KYB checks in minutes.

Start with $5 of free credit, or copy a prompt and let your coding agent set Finic up.

Sign up See pricing