Home Knowledge Base Zero-, one-, and few-shot are the same mechanism with the demonstration count turned up.

Few-shot prompting is the practical recipe that turns in-context learning into a tool: instead of describing a task in the abstract, you show the model a handful of worked examples — a few input-output pairs — and then the real input, and let the model continue the pattern. Ask a model to classify sentiment cold and it may hesitate; show it three reviews each labeled "positive" or "negative" and then a fourth review, and it falls into line and labels it. The "few" is literal — typically one to a few dozen demonstrations — and it names one point on a spectrum whose other end, zero-shot, gives the model only an instruction and no examples at all. Understanding few-shot means understanding that spectrum, why adding examples helps, and where the help runs out.\n\nZero-, one-, and few-shot are the same mechanism with the demonstration count turned up. In zero-shot you give only a task description; in one-shot, a single example; in few-shot, several. All three ride on the identical in-context-learning machinery — the model's weights never change, and the examples simply become context that conditions its next-token prediction. What you are really doing as you add shots is disambiguating the task: each demonstration pins down the exact format you want, the label vocabulary, the level of detail, and the mapping from input to output, so the model has less room to guess wrong. This is why few-shot often dramatically outperforms zero-shot on tasks with an unusual output format or a subtle labeling scheme — the examples communicate what an instruction alone leaves vague.\n\nMore shots help — until they plateau, and the choice and order of examples can matter as much as the count. The gain from adding demonstrations is real but diminishing: the jump from zero to one to a few is usually large, after which accuracy flattens, and eventually you simply run out of context window. More consequential is which examples you pick and how you arrange them. Few-shot performance is famously sensitive to demonstration selection and ordering — the same examples in a different order can swing accuracy, and models can latch onto the distribution of labels or the surface format of your examples rather than the true input-output relationship. Good few-shot prompting is therefore partly an engineering craft: choosing representative, well-formatted, class-balanced demonstrations rather than just grabbing the first few you have.\n\nFew-shot prompting is not the same as few-shot learning, and it competes with fine-tuning. The phrase "few-shot learning" long predates LLMs and referred to meta-learning — training a model so it can master a brand-new class from just a few labeled examples, as in few-shot image classification. Few-shot prompting borrows the "few examples" idea but does no learning in the parameter sense at all; the model is frozen and the examples live only in the prompt. In practice few-shot prompting is the fast, zero-training way to steer a capable model, and it trades off against fine-tuning: prompting is instant and flexible but spends context tokens on every call and is brittle, while fine-tuning bakes the behavior into the weights for stability and token savings at the cost of a training run and data.\n\n| Setting | Examples in prompt | Weights change? | Best when |\n|---|---|---|---|\n| Zero-shot | 0 (instruction only) | No | Task is simple or well-known |\n| One-shot | 1 | No | One example fixes the format |\n| Few-shot | a few → a few dozen | No | Format/labels are unusual or subtle |\n| Few-shot learning (meta) | a few, per new class | Yes (meta-trained) | Classic ML, not LLM prompting |\n| Fine-tuning | (whole dataset) | Yes | Stable, high-volume, token-efficient |\n\n``svg\n\n \n Few-shot prompting: teach by showing, not by training\n Zero → one → few shots are the same frozen-model mechanism, with more examples pinning down the task.\n\n \n \n zero-shot\n "Label the sentiment:"\n "Great value." →\n instruction only —\n model must guess the\n format and labels\n\n \n few-shot\n "Loved it." → positive\n "Broke fast." → negative\n "Okay-ish." → neutral\n "Great value." →\n examples fix format + labels ⇒ reliable\n\n \n \n \n positive\n weights frozen —\n learned from the prompt\n\n \n \n More shots help — then plateau\n \n \n accuracy\n number of examples (shots)\n \n 0\n 1\n few\n diminishing returns →\n\n \n \n It is a craft — and it is brittle\n • example order can swing accuracy\n • pick representative, class-balanced demos\n • models lean on label distribution + format\n • every shot spends context-window tokens\n \n Not the same as few-shot learning\n "few-shot learning" = meta-learning, which does\n update weights. Few-shot prompting updates nothing —\n it competes with fine-tuning as the no-training option.\n\n``\n\nThe unhelpful way to treat few-shot prompting is as a magic incantation — sprinkle in some examples and hope the model behaves. The useful way is to see it as one dial on the in-context-learning mechanism: you are not training the model, you are disambiguating the task by showing it exactly the format, labels, and mapping you want, and each added example buys clarity until the returns flatten and the context window fills. That framing tells you what to optimize — not just how many examples but which ones and in what order, chosen to be representative and balanced rather than convenient — and it keeps you from confusing few-shot prompting (a frozen model reading your prompt) with few-shot learning (a meta-trained model actually updating). Read few-shot through a how-many-examples-to-show-a-frozen-model lens rather than a smaller-training-set lens, and it stops being a trick and becomes a controllable, if brittle, way to steer a model with no training at all.

few shotfew shot promptingfew shot examplesfew shot inferencezero shotone shotzero one few shotdemonstrations in prompt

Explore 500+ Semiconductor & AI Topics

From EUV lithography to CUDA optimization — search the full knowledge base or chat with our AI assistant.