Few-shot vs chain-of-thought prompting: when to use each
Few-shot prompting shows the model examples; chain-of-thought asks it to reason step by step. What each technique is good at, with examples and when to combine them.
By the ThinkWithPrompt editorial team at Synottic · Updated 11 October 2026
Few-shot and chain-of-thought are two of the most widely used prompting techniques. They solve different problems: few-shot prompting shows the model what the answer should look like; chain-of-thought prompting helps it work out what the answer is.
Few-shot prompting
A few-shot prompt includes one or more worked examples of input and output before your real input. The model follows the pattern it sees. The term was popularised by the 2020 research paper Language Models are Few-Shot Learners (Brown et al.), which showed that large language models can pick up a task from a handful of examples in the prompt.
Use it when the format or style is easier to show than to describe: a house writing voice, a classification scheme, a consistent table layout, or product descriptions that must all follow one pattern.
Tips: use examples that differ from each other in the ways your real inputs will, keep their format identical, and avoid examples so similar to your input that the model simply copies them.
Chain-of-thought prompting
A chain-of-thought prompt asks the model to reason through a problem step by step before giving its answer. The 2022 paper Chain-of-Thought Prompting Elicits Reasoning in Large Language Models (Wei et al.) found that this helps on multi-step reasoning, such as arithmetic and logic problems.
Use it when the route to the answer matters: comparing options, diagnosing a problem, planning in stages, or any question with several dependent steps.
Many newer models reason step by step on their own, but writing out the steps still helps you control the order of the analysis and check each stage.
Side by side
| Few-shot | Chain-of-thought | |
|---|---|---|
| What you add | Worked examples | A request to reason in steps |
| Improves | Consistency of format and style | Reasoning on multi-step problems |
| Good for | Classification, templated writing, extraction | Decisions, analysis, planning, troubleshooting |
| Cost | Longer prompts | Longer answers |
Combining them
The techniques work together. You can show a worked example that includes its reasoning, so the model copies both the format and the way of thinking. Both also fit inside a role, context, task and format structure: see how to write a good AI prompt.
When neither is needed
For a clear, common request (“summarise this paragraph in two sentences”) a direct, zero-shot instruction is usually enough. Add examples or reasoning steps when the plain version gives you inconsistent or shallow answers.
Frequently asked questions
What is few-shot prompting?
Few-shot prompting means including one or more worked examples of the input and output you want in the prompt, so the model copies the pattern. It is the most reliable way to get a consistent format or style, such as a classification scheme or a house writing voice.
What is chain-of-thought prompting?
Chain-of-thought prompting asks the model to work through a problem step by step before answering. It helps on multi-step reasoning such as comparisons, diagnoses and plans, and makes each stage of the reasoning visible so you can check it.
Chain-of-thought prompts from the library
- Design an AI agent or automated AI workflowDefines an agent's goal, tools, steps, guardrails, and human checkpoints before you build it.
- Solve a pet behavior problemTraining plans for common dog and cat behavior problems, step by step.
- Choose and interpret the right statistical testPicks the right method for your question and data and explains results in plain language.
- Fix a Git problemStep-by-step help for merge conflicts, undoing mistakes, branching, and recovering lost work.
- Write a script to automate a repetitive taskBash, Python, or PowerShell scripts that automate a task safely, with instructions to run them.
- Build a working app, tool, or game from a descriptionTurns a plain-English idea into a complete, runnable app — web tool, dashboard, or browser game.
More guides
- How to write a good AI prompt: a practical guide
- RTF vs RCTF vs RCTFVV: which prompt framework should you use?
- The CO-STAR prompt framework explained, and how it compares to RCTF
- Prompt meaning: what is a prompt in AI? Parts and examples
- Prompt meaning in Hindi: प्रॉम्प्ट का मतलब, AI प्रॉम्प्ट क्या है और उदाहरण
- What is prompt engineering? A practical beginner’s guide
- What is a system prompt? How to write one, with examples
- Prompt templates: how to build reusable AI prompts, with examples
- How to prompt reasoning models: what changes with “thinking” AI
- Prompt chaining: how to break big AI tasks into steps