# Zero-shot, few-shot or chain-of-thought

[Skip to content](#lm-inhoud)Network/[NL](/en/prompttechniek-kiezen)EN[Hubhub.llmnet.nlCompare models on task, language, cost and license.](https://hub.llmnet.nl/en/)[Communitycommunity.llmnet.nlPrompt techniques, patterns and system prompts.](https://community.llmnet.nl/en/)[APIapi.llmnet.nlLLMs in production: rate limits, routing, structured output.](https://api.llmnet.nl/en/)[Consultancyconsultancy.llmnet.nlRolling out AI in an organization, pilot to production.](https://consultancy.llmnet.nl/en/)[Newsnieuws.llmnet.nlAI developments, explained for the Netherlands.](https://nieuws.llmnet.nl/en/)[Benchmarkbenchmark.llmnet.nlMeasure AI quality yourself, on your own tasks.](https://benchmark.llmnet.nl/en/)[Careersvacatures.llmnet.nlAI roles, salaries and career paths in the Netherlands.](https://vacatures.llmnet.nl/en/)[Learnleren.llmnet.nlAI concepts in plain language, beginner to builder.](https://leren.llmnet.nl/en/)[Guidegids.llmnet.nlRun AI privately on your own Mac, PC, NAS or home server.](https://gids.llmnet.nl/en/)[Directorydirectory.llmnet.nlMapping the AI ecosystem: tools, models, companies.](https://directory.llmnet.nl/en/)[Radarradar.llmnet.nlSignals from X, research and communities for indie developers.](https://radar.llmnet.nl/en/)[Appsapps.llmnet.nlReviews of AI apps and open-source repos, with tips for builders.](https://apps.llmnet.nl/en/)[llmnet.nl — main site](https://llmnet.nl/en/)[](https://x.com/intent/post?url=https%3A%2F%2Fcommunity.llmnet.nl%2Fen%2Fprompttechniek-kiezen&text=Zero-shot%2C%20few-shot%20or%20chain-of-thought)[](https://www.linkedin.com/sharing/share-offsite/?url=https%3A%2F%2Fcommunity.llmnet.nl%2Fen%2Fprompttechniek-kiezen)[](https://www.reddit.com/submit?url=https%3A%2F%2Fcommunity.llmnet.nl%2Fen%2Fprompttechniek-kiezen&title=Zero-shot%2C%20few-shot%20or%20chain-of-thought)[](#)[](https://x.com/intent/post?url=https%3A%2F%2Fcommunity.llmnet.nl%2Fen%2Fprompttechniek-kiezen&text=Zero-shot%2C%20few-shot%20or%20chain-of-thought)[](https://www.linkedin.com/sharing/share-offsite/?url=https%3A%2F%2Fcommunity.llmnet.nl%2Fen%2Fprompttechniek-kiezen)[](https://www.reddit.com/submit?url=https%3A%2F%2Fcommunity.llmnet.nl%2Fen%2Fprompttechniek-kiezen&title=Zero-shot%2C%20few-shot%20or%20chain-of-thought)[](#)By Ivo Donker — created with AI assistance (Claude & Gemini) · Last updated: July 27, 2026

 
 
# Zero-shot, few-shot or chain-of-thought: which prompt technique when?

 
 Prompt Engineering
 Read time: 4 min
 
 

 
 As a developer building web applications and integrating powerful APIs like Claude Pro or DeepSeek via OpenRouter, you quickly realize that the quality of your output stands or falls with your prompt. Large context windows and advanced RAG (Retrieval-Augmented Generation) systems are great, but if the base prompt is lacking, even the most expensive model will deliver mediocre JSON or incoherent text.

 
 In this overview article, we cover the three fundamental prompting techniques and show you when to use which one to keep API costs, latency, and output quality perfectly balanced.

 
## 1. Zero-Shot Prompting

 With zero-shot prompting, you give the model a task directly, without providing any examples (shots). You rely purely on the trained knowledge and the model's ability to understand the instruction.

 
### When to use?

 
 
- For simple tasks like translations, summarizing a paragraph, or basic sentiment analysis.
 
- When latency (speed) is crucial and you want to consume as few tokens as possible.
 
- In combination with highly intelligent models that need very little explanation.
 

 
### Example

 Classify the sentiment of the following text as Positive, Negative, or Neutral.
Text: "The new vector search implementation is lightning fast!"
Sentiment:

 
## 2. Few-Shot Prompting

 Models can sometimes lose their way if you require a specific output format (such as a complex nested JSON). With few-shot prompting, you include one (one-shot) or more examples in the context, directly above the actual question. This is essential for pattern matching.

 
 
 Pro Tip: In [RAG optimization](https://leren.llmnet.nl/en/), few-shot works brilliantly to guide the model on how to cite or structure the retrieved documents (chunks) in the final response.
 

 
### When to use?

 
 
- When the output must strictly adhere to a specific tone of voice or data structure.
 
- If zero-shot fails to capture the subtleties of your domain.
 
- When you want to address specific edge cases in advance.
 

 
### Example

 Translate the technical terms from English to Dutch in informal spoken language.
English: We need to debug the backend pipeline.
Dutch: We moeten de backend pijplijn even fixen.
English: The API latency is too high.
Dutch: De API is echt te traag nu.
English: Optimize the database queries.
Dutch:

 
## 3. Chain-of-Thought (CoT) Prompting

 Large language models are not calculators; they predict the next word. If you give them a complex logical puzzle without giving them the space to "think out loud", they often hallucinate the answer immediately. Chain-of-Thought forces the model to break the problem down into intermediate steps ("Let's take this step by step").

 
### When to use?

 
 
- For mathematical problems, code architecture issues, or complex logical reasoning.
 
- When you need to navigate a decision tree.
 
- For [complex benchmarks](https://benchmark.llmnet.nl/en/) where you prioritize accuracy over speed and token costs.
 

 
### Example

 Question: A 450-liter aquarium needs a 20% water change every week. You use a 15-liter bucket. How many buckets do you need to fill?
Answer: Let's calculate this step by step.
1. First, we calculate what 20% of 450 liters is. 450 * 0.20 = 90 liters.
2. We have 15-liter buckets.
3. We divide the total amount of water by the capacity of the bucket: 90 / 15 = 6.
The answer is 6 buckets.

 
## Decision Table: Which technique do you choose?

 
 
 
 Requirement / Context | 
 Zero-shot | 
 Few-shot | 
 Chain-of-Thought | 
 

 
 
 
 Speed / Lowest Latency | 
 ✅ Best choice | 
 ❌ Moderate | 
 ❌ Poor (many output tokens) | 
 

 
 Strict JSON/Data formatting | 
 ❌ Unreliable | 
 ✅ Essential | 
 ⚠️ Possible, in combination with few-shot | 
 

 
 Complex Logic / Reasoning | 
 ❌ Hallucinates easily | 
 ⚠️ Limited | 
 ✅ Required | 
 

 
 Save token costs | 
 ✅ Yes (fewest tokens) | 
 ❌ No (costs context) | 
 ❌ No (costs generation tokens) | 
 

 
 

 
## Practical Checklist for Developers

 
 
- Start with Zero-shot: Always test your prompt zero-shot first. Modern models often surprise you. Why waste tokens if you don't have to?
 
- Scale up to Few-shot for parsing errors: Do you often get errors in your web application because the API does not return valid JSON? Add 2 to 3 concrete examples.
 
- Activate CoT for hallucinations: If the output structure is correct but the internal logic fails, add the instruction to write out the thinking process first. (You can hide this process in the backend and only show the final conclusion to your user).
 
- Monitor your usage: Especially if you run an advanced setup, CoT generation tokens add up quickly. Use it selectively.
 

 

 
 
 © 2026 LLMnet Community. Made for developers, by developers.
