Glossary

Few-Shot Learning

Show, do not just tell. A few worked examples placed in the prompt let a language model copy a task’s format and style on the spot, with no training run and no new model.

General definition

Few-Shot Learning entered everyday use with the 2020 GPT-3 paper, “Language Models are Few-Shot Learners” by Brown and colleagues, which showed that a large enough LLM could perform a new task given only a handful of demonstrations in its prompt. The model is not trained on the examples; it recognises the pattern and continues it. This behaviour is also called in-context learning, and it is one of the main reasons prompting replaced task-specific training for many applications.

The spectrum runs from zero-shot, where the prompt contains only an instruction, through one-shot and few-shot, where it contains one or several examples, to fine-tuning, where the examples are used to update the model’s weights. Few-shot is the middle ground: more reliable than zero-shot for format-sensitive tasks, cheaper and faster to iterate than fine-tuning, and reversible by editing the prompt.

  • Best for: fixing output format (a JSON shape, a ticket summary layout), setting tone, teaching a classification scheme with its edge cases
  • Example quality: examples should be correct, diverse and in the exact format you want back; the model copies mistakes as faithfully as it copies the pattern
  • Order and count: models are sensitive to example ordering, and a few good examples usually beat many mediocre ones
  • Token cost: every example is sent on every call and occupies the context window, so long example sets raise latency and cost; prompt caching of a stable prefix offsets much of this

Few-shot examples do not add knowledge the model lacks and they do not enforce rules. They shape form. For facts, use retrieval; for rules, use the system prompt and application code; for a style that must hold across thousands of conversations with minimal prompt overhead, fine-tuning on the same examples is the next step.

Want to try it yourself? Build an AI agent that answers from your own pages and documents with the Ethora no-code AI agent builder. No coding is needed and it is free to start.

In the Ethora ecosystem

The natural place for few-shot examples in the Ethora AI SDK is the per-agent system prompt. Two or three model exchanges showing the intended answer length, the handoff phrasing when a question is out of scope, or the exact shape of a structured reply give a support or intake agent a stable voice without any training. Because each agent has its own prompt, different agents in one app can carry different examples.

Keep the examples short and let the other layers do their jobs. The agent’s knowledge base supplies facts through retrieval, the per-room transcript memory supplies conversation context, and tool calling supplies actions, so the examples only need to demonstrate form. On self-hosted models behind an OpenAI-compatible endpoint such as vLLM, a stable system prompt with examples is also a cacheable prefix, which keeps the per-call cost of those examples low.

Get started

Build your own AI agent, no code needed

Train an agent on your pages and documents, test it in minutes, then put it on your website or in your app.

Free tier available Enterprise SLA No vendor lock-in