AI & LLMs

Few-Shot Prompting

Teaching by example inside the prompt — the model imitates demonstrations without any training.

Few-shot prompting puts worked examples in the context and lets the model infer the pattern — in-context learning, no weight updates. Zero-shot is the same task with instructions only. A few diverse, canonical examples usually beat many noisy ones: examples act like pictures of the desired behavior, and the model imitates what it sees — including your mistakes.

Worked example: putting 3 labeled examples (input → output) in the prompt before the real query lets the model infer the pattern and format with no fine-tuning — in-context learning. Gotcha: examples eat context and cost tokens every call, their order and choice measurably shift results, and gains flatten past a handful; for stable high-volume tasks, fine-tuning often beats a big few-shot prompt.