← Back to concept explainers

Concept Fable

Few-shot prompting

Conclusion first:Few-Shot Prompting provides a small number of input-output examples in the prompt so the model can learn the task format, judgment scale, and output style from the examples. It does not change the model weights; it guides model behavior within the current context. It suits tasks such as classification, extraction, rewriting, and formatting, but example selection, order, quantity, and version all affect the results.

Few-Shot Prompting · LLM Interaction

Read the story first. There is no rush to give a definition here; let the question grow on its own first.

Fable

The master doesn't explain long rules—he just lays out three samples

A temporary assistant came to the calligraphy and painting shop, and the shopkeeper had no time to teach him all the rules from the beginning. On the first day, a customer wanted an inscription on a fan, and he wrote it like a stele inscription; a customer wanted a wedding card, and he wrote it like a bill.

The shopkeeper did not give a long theory, but brought out three sample drafts. The first was a birthday banquet invitation, solemn in tone; the second was an invitation card, concise in phrasing; the third was a reply to a return request, polite but not overpromising. Beside each was written how the customer asked and how the shop answered.

The assistant followed the sample draft and improved immediately. But he also mislearned: seeing that birthday banquet invitations had four-character auspicious phrases, he stuffed auspicious phrases into return letters too, making customers frown.

The shopkeeper added two more counterexamples to show which formats couldn't be copied freely, and placed the sample drafts before new tasks so the clerks could first see "this kind of question corresponds to this kind of answer." The samples didn't cover every case, but they gave him an imitable format, tone, and boundaries.

The next day a new customer arrived, asking to "write a short invitation for a housewarming banquet." The assistant had never seen the same topic before, but learned structure from the invitation samples and borrowed the appropriate tone from birthday banquet cards, and wrote a usable letter.

The shopkeeper also had the assistant explain what each sample draft could teach and what it could not. A birthday banquet invitation could teach the proper measure of congratulatory words, but that could not be learned into a return letter; a return letter could teach polite refusal, but that could not be learned into cold officialese. A few samples give direction, but they also leave misleading impressions.

A few days later, the shopkeeper brought in a new kind of customer: someone wanted an apology letter. The assistant searched all three sample drafts and could only piece together a half-convincing reply. Only then did the shopkeeper tell him that when samples are few, you must choose accurately and also know where the samples do not cover; otherwise, copying the cat and drawing the tiger will still go astray. Later, the shopkeeper regularly changed the sample drafts, including both common incoming letters and counterexamples that were easy to mislearn. A temporary assistant did not need to memorize the entire shop rulebook to quickly approximate the style; but he knew that beyond the samples, caution was still required.

The shopkeeper reminded him that a few sample drafts can quickly calibrate the approach, but they are not complete training. If the sample drafts are well chosen, the assistant immediately gets closer to the requirements; if the sample drafts are chaotic, he will also go astray. The most useful thing about a small number of examples is that they let a person see from context how to answer.

Reveal

This story is about: few-shot prompting

Few-Shot Prompting provides a small number of input-output examples in the prompt so the model can learn the task format, judgment scale, and output style from the examples. It does not change the model weights; it guides model behavior within the current context. It suits tasks such as classification, extraction, rewriting, and formatting, but example selection, order, quantity, and version all affect the results.

What matters is that it is not just a term, but a structural problem that repeatedly appears in real AI / Agent systems. Understanding it lets you judge when to add a model, when to change a process, and when to add governance.

Metaphor mapping

  • Good, medium, poor—three words: a prompt with only the task name
  • One-page rule: plain text explanation
  • Three sample pieces: few-shot examples
  • Inputs and expected labels together: input-output demonstrations
  • Twenty samples cause confusion: too many or low-quality examples bring noise
  • Filtering out duplicate samples: example selection
  • Sample versioning: prompt example versioning
  • Final insight: Few-Shot Prompting uses a small number of examples in context to align model behavior

Andy Ren Xu's judgment

The practical value of this concept is that it helps you break "AI features that look smart" into deliverable, verifiable, and governable units of work.

in-context learningprompt engineeringdemonstrationszero-shot prompting

Related distinctions

This concept is easily confused with adjacent concepts; it is recommended to continue to the comparison page.

京ICP备2026014272号