Few shot
Description
A small set of examples teaches the pattern. The agent generalizes from demonstration rather than from explicit description — “watch this and that, then do the next one.” The structural shape is N examples + implicit pattern + new query: the pattern is never stated explicitly; it’s induced from the examples’ commonalities. This makes few-shot powerful (humans and models can learn things they couldn’t be told) and brittle (the examples have to share the load-bearing pattern, not just the surface). The diagnostic question — “do the examples share a structural shape, or just surface features?” — separates productive few-shot from cargo-cult-by-example. If the examples share only superficial features (formatting, vocabulary, length), the agent generalizes the wrong invariant; the new output looks right at surface level but misses the structural point.Triggers
User-initiated: User provides examples and asks “do another like this,” or asks “how can I teach the agent to do X?” with example data. Vocabulary cues: “few-shot,” “examples,” “like these,” “in the style of,” “demonstration.” Agent-initiated: Agent notices a task where explicit rule-articulation is hard but examples are available. Candidate inference: “provide N examples that share the structural shape; the implicit pattern will transfer.” Situation-shape signals: Tasks where rules are easier to demonstrate than to state. Documentation that includes examples (most well-written documentation does). Teaching contexts where the learner is meant to induce from cases.Exclusions
- Tasks better served by explicit instructions — when a rule can be stated cleanly, stating it beats demonstrating it; few-shot can introduce variance.
- Examples don’t share the right pattern — if the demonstrations don’t actually exemplify the target shape, the model generalizes the wrong invariant.
- One example is enough (or zero) — some tasks need only an instruction; piling on examples adds noise.
- Adversarial / edge-case heavy — when the failure modes are at the edges, few-shot of typical examples teaches the wrong central tendency; explicit edge-case discussion is better.
Structure
Relationships
- seeding — few-shot IS seeding applied to in-context generation; examples are the seed that shapes interpretation.
- cargo-cult — contrast: few-shot fails when examples teach only surface; the model cargo-cults the format without the structure.
- shape — few-shot trades on shared shape across examples; if shape varies between examples, the model has nothing to pattern-match.
- doctrine — sometimes few-shot is the right primitive; sometimes a doctrine (explicit rule) is. The choice between them is a meta-level call.
- chain-of-thought — few-shot + CoT = examples with reasoning traces; teaches the process, not just input-output mapping.
Examples
GPT-3 and successor LLMs · computer-science
GPT-3 and successor LLMs · computer-science
Cooking recipes vs cooking shows · family-and-consumer-science
Cooking recipes vs cooking shows · family-and-consumer-science
Apprenticeship in skilled crafts · education
Apprenticeship in skilled crafts · education
Apprenticeship literature: Lave & Wenger (1991), *Situated Learning* — apprenticeship as legitimate peripheral participa · education
Apprenticeship literature: Lave & Wenger (1991), *Situated Learning* — apprenticeship as legitimate peripheral participa · education
Bandura (1977), *Social Learning Theory* — humans learn from observation of others' actions. · psychology
Bandura (1977), *Social Learning Theory* — humans learn from observation of others' actions. · psychology
Brown et al. (2020), "Language Models are Few-Shot Learners" (GPT-3 paper) — https://arxiv.org/abs/2005.14165. · computer-science
Brown et al. (2020), "Language Models are Few-Shot Learners" (GPT-3 paper) — https://arxiv.org/abs/2005.14165. · computer-science
Code review feedback · computer-science
Code review feedback · computer-science
Common-law tradition: precedent as few-shot teaching for legal reasoning. · law
Common-law tradition: precedent as few-shot teaching for legal reasoning. · law
Language acquisition in children · linguistics
Language acquisition in children · linguistics
Legal precedent · law
Legal precedent · law
Pinker, *The Language Instinct* — children's grammar acquisition from examples. · linguistics
Pinker, *The Language Instinct* — children's grammar acquisition from examples. · linguistics