Few shot prompting involves supplying a language model with a small set of task–demonstration pairs within the prompt so it performs the target task by analogy. Few Shot Prompting leverages in-context learning, characterized at scale by Brown et al. (2020) in “Language Models are Few-Shot Learners” (https://arxiv.org/abs/2005.14165). It reduces reliance on parameter updates and can improve accuracy on classification, extraction, and transformation tasks compared with zero-shot prompting. Effective practice includes selecting representative, diverse exemplars, matching input–output formatting, and ordering examples to minimize bias; calibration methods can mitigate label imbalance (Zhao et al., 2021: https://arxiv.org/abs/2102.09690). Performance is sensitive to the number of examples relative to context limits, example quality over quantity, and domain drift. Variants include chain-of-thought demonstrations for reasoning (Wei et al., 2022: https://arxiv.org/abs/2201.11903), self-consistency sampling, and retrieval-augmented example selection. Risks include propagating errors from flawed exemplars and leakage of sensitive data if examples contain private information. Evaluation typically uses held-out validation with ablations over example count, order, and phrasing, alongside exact-match and calibration metrics.
