Few-Shot Prompting

A technique that includes example input-output pairs in the prompt to demonstrate the desired format and style, where format consistency matters more than label accuracy.

Few-shot prompting provides example input-output pairs before the actual query, helping the model understand the expected response format. Research shows that the accuracy of labels in examples matters less than the label space (showing possible output categories), input distribution (examples resembling real inputs), and structural consistency. Few-shot prompting is highly sensitive to example order; reordering examples can swing accuracy by 30% or more. The technique primarily controls format and style rather than teaching reasoning.

Also known as

in-context learning, few shot, example-based prompting, k-shot prompting