Instead of describing the task, one shows it. A few-shot prompt contains K input–output pairs and, at the end, an input without its output; the model fills the gap (Alammar & Grootendorst, 2024, pp. 180–181). With a single example one speaks of one-shot; with none, of zero-shot. For GPT-3, K was typically between 10 and 100, which fit in its 2,048-token context window, and no weight updates were allowed (Brown et al., 2020, sec. 2). It is the most visible form of in-context learning.
One of Brown et al. (2020)'s experiments should look familiar to any linguist. The model was given the definition of a made-up word and an example of its use:
A "whatpu" is a small, furry animal native to Tanzania. An example of a sentence that uses the word whatpu is: We were traveling in Africa and we saw these very cute whatpus.
and was then asked for a sentence with farduddle ("to jump up and down really fast"). GPT-3 produced plausible uses and even conjugated a made-up verb correctly (screeg → screeghed) (2020, sec. 3.9.5). The authors cite developmental research on learning a word from a single exposure (Carey & Bartlett, 1978); the most famous precedent is Jean Berko's (1958) wug test, which showed that children apply morphological rules to words they have never heard: "this is a wug; now there are two…".
Few-shot is also the format of the original chain of thought prompting, with eight written-out reasoning examples (Wei, Wang, et al., 2022). It has practical limits: examples take up context, and the choice and order of the examples affect the result. And it leaves the underlying question open: when the model "gets" the pattern from three examples, does it induce a rule, like the child in the wug test, or recognize a task it had seen a thousand times during training? Brown et al. (2020) explicitly leave that question open (2020, sec. 1).