Teach the pattern with a couple of examples
prompting basics
// what it does
Few-shot prompting means showing two or three input-to-output pairs before the real input, so ChatGPT copies the pattern instead of guessing at it. Reach for it when a plain instruction (zero-shot) gives inconsistent formatting or the wrong style. Keep the examples diverse so the model generalizes rather than latching onto one case.
// prompt
> Extract keywords from each text. Text 1: Stripe provides APIs for payment processing. Keywords 1: Stripe, payment processing, APIs ## Text 2: OpenAI trains language models available through an API. Keywords 2: OpenAI, language models, API ## Text 3: [paste text] Keywords 3:// gotcha
Examples eat into the context window and can bias the model toward their exact wording. Start zero-shot; add examples only when the plain instruction underdelivers, and make them representative of the range you actually expect.