While crafting prompts for a large language model, an engineer supplies several complete example pairs of inputs and desired outputs, then asks the model to answer a new, similar request. What prompting approach is this?
Select an answer to reveal the explanation.
Short Explanation and Infographic
Here's the deal. You want the model to answer like your team answers—same tone, same structure. So you drop a few worked examples into the prompt, then ask the real question. That's few-shot prompting: a small number of shots (examples) in context. Think of it like showing a new hire three filled-out tickets before they write their first one. Exam trap: zero-shot is instruction-only, no examples; chain-of-thought is about step-by-step reasoning; RAG is about pulling docs from a store. Pay close attention—if the stem says "a few examples of input-output pairs," the answer is few-shot. Land it: examples in the prompt = few-shot. Got it? Sweet. Let's keep rolling.
Full explanation below image
Full Explanation
Large language models can adapt behavior from patterns present in the prompt without updating weights. When the prompt includes several complete demonstrations—each pairing an input with a desirable output—and then presents a new input, the technique is called few-shot prompting (a form of in-context learning). The demonstrations communicate expected structure, style, decision criteria, and edge-case handling more efficiently than a bare instruction alone. Practitioners choose examples that are diverse, correct, and representative of the target distribution, and they keep formatting consistent so the model can pattern-match cleanly.
The correct answer names few-shot prompting for exactly this setup. Related settings include one-shot (a single example) and zero-shot (instruction only, no examples). Few-shot often improves adherence to schemas, reduces format drift, and can raise accuracy on classification, extraction, or rewriting tasks when labeled fine-tuning is unavailable. Limitations include context-window cost, sensitivity to example order and quality, and potential bias if the shot set is skewed. Best practice is to curate shots carefully, evaluate on a held-out set of prompts, and version prompt templates as production artifacts.
Distractors mix neighboring techniques. Zero-shot prompting omits demonstrations and depends on the instruction and model priors; the scenario’s multiple examples rule it out. Chain-of-thought prompting encourages intermediate reasoning steps and can be zero-shot or few-shot, but supplying input–output pairs alone does not equal chain-of-thought unless those examples (or the instruction) explicitly show reasoning. Retrieval-augmented generation grounds answers in externally retrieved documents or databases; it is an architecture pattern, not the same as packing a few static examples into the prompt. Memory aid: count the demonstrations—none is zero-shot, one is one-shot, a few is few-shot; reasoning traces are chain-of-thought; document lookup is RAG. On certification items, map “several examples then the real question” straight to few-shot prompting.