freecoding.school100% FREE · NO SIGNUP
Tensor TownISSUE #63 of 120

zero-shot · one-shot · few-shot

NeuraVSThe Overfit Ogre
Neura saysZero-shot, one-shot, and few-shot describe how many examples you put in the prompt.

Zero-shot: just instructions, no examples. One-shot: one example of the desired input→output. Few-shot: several examples that demonstrate the pattern, format, and edge cases. More examples generally improve reliability and formatting — leveraging in-context learning, where the model adapts from examples without any weight updates. Few-shot is a quick way to pin down a tricky format.

Power-ups you unlock

The Overfit Ogre attacks — common mistakes

Boss battleDecide zero-shot vs few-shot for enforcing a strict JSON output format.

Example code

<!doctype html><html><head><meta charset="utf-8"></head>
<body style="background:#06040d;color:#e6e0ff;font-family:monospace;padding:20px"><pre>zero-shot: "classify sentiment"
few-shot:  "happy → positive
            terrible → negative
            okay → ?"   ← examples pin the format</pre></body></html>
▶ Open the interactive comic issue
‹ Prompt Engineering · The New ProgrammingChain Of Thought · Think Before Answering ›