Few-Shot and Chain of Thought
Two techniques do most of the heavy lifting in prompting: show worked examples, and ask the model to reason before it answers. Here is how to use both.
If you only learn two prompting techniques, learn these. Few-shot prompting shows the model examples of the task so it copies the pattern. Chain of thought asks the model to reason step by step before answering so it gets harder problems right. They are independent, and they combine well.
Few-shot: show, then ask
Zero-shot is just asking. Few-shot is asking after you have shown a handful of solved examples. Those examples pin down the format, the level of detail and the edge-case handling far better than a written spec. Two to five examples is usually enough.
Extract the action item from each message.
Message: "can you send the deck by friday?"
Action: send the deck by Friday
Message: "we should probably loop in legal at some point"
Action: loop in legal
Message: "the staging build is broken again"
Action:Chain of thought: reason before answering
Adding a phrase like "think step by step" tells the model to lay out its reasoning before committing to an answer. For math, logic and multi-step problems this meaningfully improves accuracy, because the model works through intermediate steps instead of jumping to a guess.
Combine them for hard tasks
The two techniques stack. Show a couple of examples where the worked-out reasoning is part of the example, and the model learns both the format and the habit of reasoning. This is especially effective for classification or extraction where the right answer depends on a judgment call.
Decide if the review is a complaint or a question.
Review: "does this come in blue?"
Reasoning: the user is asking about availability, not unhappy.
Label: question
Review: "i waited a week and it never arrived"
Reasoning: the user reports a failed delivery, that is a grievance.
Label: complaint
Review: "how do i return this if it does not fit?"
Reasoning:When to reach for each
| Situation | Technique |
|---|---|
| Output format keeps drifting | Few-shot with 2 to 3 examples |
| Model gets multi-step logic wrong | Chain of thought |
| A judgment call with a fixed format | Both, with reasoning inside each example |
| Simple lookup or rewrite | Neither, just ask clearly |
Putting it together
- Try a clear zero-shot prompt first.
- If the format wanders, add a few examples.
- If the logic breaks, ask for step-by-step reasoning.
- For hard judgment calls, do both and bake the reasoning into the examples.
- In production, keep the reasoning out of the final output.
Examples teach the model what good looks like. Reasoning teaches it how to get there. Most prompting wins come from one of the two.
0 Comments
Loading discussion...