Few-shot learning is a prompting technique where an AI model is given a small number of examples of the desired task directly in the prompt, before it processes the actual new input.
Rather than only describing the task (zero-shot), a few-shot prompt typically shows two to five concrete input/output example pairs, so the model can better grasp the exact format, style or logic of the task.
This technique is especially useful for tasks with a very specific desired output format (such as a particular JSON structure), a custom classification scheme, or an unusual style requirement that is hard to describe in words alone.
The downside of few-shot learning is the extra token usage from the examples included in the prompt, which affects both cost and the remaining available context-window capacity.



