What is few-shot prompting? Official definitions, and how to test it

What Is Few-Shot Prompting? Official Definitions (2026) — Litmiq
On this page

LangSmith is LangChain's hosted platform for tracing, monitoring and evaluating LLM applications and agents; Litmiq is a free browser app for quick, side-by-side prompt tests with LLM-judge scores. They overlap on one thing, running a prompt against test cases and scoring the outputs, and differ on almost everything else: accounts, hosting, scale, production monitoring and price. This page compares them using LangSmith's own documentation and pricing page as checked on 11 November 2026 and rechecked on 26 November 2026.

TL;DR · The short answer

#

Few-shot prompting means you put a small number of input/output examples in the prompt so the model can follow the pattern, instead of fine-tuning a new model. That is the official idea, not a Litmiq invention. OpenAI, Google and Anthropic each describe it in their prompting docs, with slightly different wording and slightly different advice about how many examples to use.

This page quotes those official descriptions, all read on 26 November 2026, and shows how to test zero-shot against few-shot on your own cases. It does not publish accuracy lifts, because we did not run that experiment here.

Litmiq is independent and is not affiliated with, endorsed by, or sponsored by OpenAI, Google or Anthropic.

Key takeaways

#
  • OpenAI’s Prompt engineering guide, in a section titled “Few-shot learning,” says: “Few-shot learning lets you steer a large language model toward a new task by including a handful of input/output examples in the prompt, rather than fine-tuning the model.
  • Those official recommendations do not agree on a single number.
  • In Google’s official vocabulary, a zero-shot prompt has no examples; a few-shot prompt has a few. “One-shot” is the usual name for a prompt with a single example; OpenAI’s prompt-engineering page also uses “one-shot” in other examples, but the few-shot-learning section we quote describes “a handful” of pairs.
  • This is a prompt comparison, so it maps cleanly onto the Litmiq app .

Official definitions

#

OpenAI’s Prompt engineering guide, in a section titled “Few-shot learning,” says: “Few-shot learning lets you steer a large language model toward a new task by including a handful of input/output examples in the prompt, rather than fine-tuning the model. The model implicitly ‘picks up’ the pattern from those examples and applies it to a prompt. When providing examples, try to show a diverse range of possible inputs with the desired outputs.”

Google’s Prompt design strategies page defines the pair directly: “You can include examples in the prompt that show the model what getting it right looks like. The model attempts to identify patterns and relationships from the examples and applies them when generating a response. Prompts that contain a few examples are called few-shot prompts, while prompts that provide no examples are called zero-shot prompts.” Google says few-shot prompts are often used “to regulate the formatting, phrasing, scoping, or general patterning of model responses,” and to “use specific and varied examples.”

Anthropic’s official prompting techniques (the “Use examples effectively” section of its current-model prompt-engineering reference) say: “Examples are one of the most reliable ways to steer Claude’s output format, tone, and structure. A few well-crafted examples (known as few-shot or multishot prompting) improve accuracy and consistency.” Anthropic tells you to make examples relevant (close to the real use case), diverse (including edge cases, varied enough that Claude does not pick up unintended patterns), and structured in XML tags so examples can be distinguished from instructions.

What the providers recommend — and where they differ

#
Source (read 26 Nov 2026)Official recommendation we actually readWhat this page does not claim
OpenAI, Prompt engineeringA handful of input/output examples; show a diverse range of possible inputs with the desired outputs. Officially an alternative to fine-tuning for steering a new task.A required example count, or that few-shot beats fine-tuning for your task.
Google, Prompt design strategies“We recommend to always include few-shot examples in your prompts. Prompts without few-shot examples are likely to be less effective. In fact, you can remove instructions from your prompt if your examples are clear enough in showing the task at hand.” On count: “you may need to experiment with the number of examples.” “If you include too many examples, the model may start to overfit the response to the examples.” Keep structure and formatting consistent (XML tags, whitespace, newlines, splitters).A single official number of shots, or a measured accuracy gain from Google’s snow-explanation demo (that demo is an illustration, not a benchmark Litmiq ran).
Anthropic, prompting techniques“Include 3–5 examples for best results.” You can also ask Claude to evaluate your examples for relevance and diversity, or to generate additional ones from an initial set. Use XML tags when the prompt mixes instructions, context, examples and variable inputs.That 3–5 is the best count on Gemini or OpenAI models, or that we measured 3–5 against 1 or 10.

Those official recommendations do not agree on a single number. Google says it recommends always including examples, and warns that too many can overfit. Anthropic names 3–5 as a best-results range for Claude. OpenAI says “a handful” and stresses diversity. Report the vendor’s own advice for the model you are calling, and verify it on your cases rather than averaging the three sentences into a fake rule.

Zero-shot versus one-shot versus few-shot

#

In Google’s official vocabulary, a zero-shot prompt has no examples; a few-shot prompt has a few. “One-shot” is the usual name for a prompt with a single example; OpenAI’s prompt-engineering page also uses “one-shot” in other examples, but the few-shot-learning section we quote describes “a handful” of pairs. The experiment, if you run one, is: same model, same task, prompts that differ only by whether examples are present and how many, with the examples held out from the scored case.

Google’s official page shows a zero-shot prompt that asks the model to choose the better of two explanations, then a two-example prompt that prefers shorter explanations — and, in Google’s illustration, the few-shot version then picks the short snow explanation. That is Google’s worked example on gemini-2.5-flash, dated as part of that docs page. It is not a Litmiq result, and it is not a guarantee for your schema or your current model ID.

How to test 0-shot, 1-shot and 3-shot in Litmiq

#

This is a prompt comparison, so it maps cleanly onto the Litmiq app. You are not fine-tuning. You are changing only the prompt text.

  1. Open the app. There is no account. Your API keys stay in the browser and are sent only to the provider you choose.
  2. Write the zero-shot prompt: the instruction and the input you want scored, with no worked examples.
  3. Duplicate it into a one-shot prompt (one complete input/output example, then the held-out input) and a few-shot prompt (three examples is a reasonable starting point if you are following Anthropic’s 3–5 range; it is a test design, not a proven optimum). Keep formatting consistent, as Google’s official page requires.
  4. Use the same model ID for every variant. Add the same held-out test cases — the examples in the prompt must not be the cases you score. If you need a judge, define the format and correctness rule first; see LLM as a judge.
  5. Read every miss, not just the pass rate. If few-shot overfits, Google’s official warning is exactly that: the model may start to copy the examples too closely. For sampling versus examples, see LLM temperature.

Limits of this guide

#
  • No Litmiq-measured accuracy, format-compliance, or cost-per-correct-answer figures appear here, because we did not run a dated 0/1/3-shot study for this URL.
  • Official recommendations differ by vendor. This page reports each one; it does not pick a global winner.
  • Google’s and OpenAI’s worked examples in those docs are illustrations. Re-running them on a later model ID can disagree with the screenshot in the docs.
  • Few-shot examples consume input tokens and therefore cost. We did not estimate that cost here; use the token and cost calculator on a prompt you actually paste, and official list prices on LLM API pricing after you re-check the provider’s page.

FAQ

#

What is few-shot prompting?

Officially, it means putting a small number of input/output examples in the prompt so the model can follow the pattern, rather than fine-tuning. OpenAI’s prompt-engineering guide, read on 26 November 2026, calls this few-shot learning and describes “a handful” of diverse examples. Google’s prompt-design page calls prompts with a few examples few-shot and prompts with no examples zero-shot. Anthropic calls a few well-crafted examples few-shot or multishot prompting.

How many examples should I include?

The official pages do not agree on one number. Anthropic’s current prompting techniques, read on 26 November 2026, say to include 3–5 examples for best results. Google recommends always including few-shot examples, says you may need to experiment with the number, and warns that too many examples can overfit. OpenAI says “a handful” and stresses diversity. Test 0, 1 and a few examples on your own held-out cases rather than treating any of those sentences as a measured optimum.

What is the difference between zero-shot and few-shot prompting?

In Google’s official vocabulary, a zero-shot prompt provides no examples and a few-shot prompt provides a few. The task and the model stay the same; only the examples in the prompt change. This page does not publish a Litmiq accuracy comparison of the two.

Is few-shot better than writing instructions?

Google’s official page says prompts without few-shot examples are likely to be less effective, and that you can remove instructions if the examples are clear enough. That is Google’s recommendation, not a Litmiq result, and Anthropic and OpenAI phrase their advice differently. Compare a clear instruction-only prompt with the same prompt plus consistent examples on your cases in the Litmiq app.

How do I test few-shot prompting in Litmiq?

Open the app, keep the model ID fixed, and run the same held-out test cases against a zero-shot prompt, a one-shot prompt and a few-shot prompt that differ only by the examples. Do not score the examples you pasted into the prompt. Your keys stay in the browser. If you use a judge, define the format and correctness rule first.

Product names such as Promptfoo, LangSmith, LangChain, OpenAI and DeepEval are trademarks of their respective owners. They are used on this page only to identify those products. Litmiq is not affiliated with, endorsed by, or sponsored by those owners.

Sources

#

All of the following were read on 26 November 2026. ChatGPT, GPT and OpenAI are trademarks of OpenAI. Gemini and Google are trademarks of Google. Claude and Anthropic are trademarks of Anthropic. They are used here only to identify those products. Litmiq is independent and is not affiliated with, endorsed by, or sponsored by OpenAI, Google or Anthropic.

Try it in Litmiq

#

Paste your system prompt, add a few test cases and compare models from nine providers side by side. Runs in your browser with your own API key.

  • Free, no signup
  • Runs in your browser
  • Your API key, sent only to the provider you choose

Follow Litmiq on LinkedIn

Newsletter

Get Litmiq AI Weekly

Practical AI tips and the best tools of the week, in plain English.