Same prompt, same model, wildly different results. Sound familiar?
The difference between a mediocre AI response and a genuinely useful one often comes down to how you structure the prompt. Not what you ask, but how you ask it.
I've gone through the research papers and studies so you don't have to. What follows are the 10 most important prompting techniques, from Zero-Shot to Chain-of-Thought to Self-Consistency, with practical examples for each one.
- Zero-shot, few-shot, and Chain-of-Thought are different approaches to test for your task
- Chain-of-Thought is particularly suited for complex tasks that require multiple thinking steps
- Clear goals, context, examples, and checkable output requirements are a useful starting point
1. Zero-Shot Prompting
In Zero-Shot Prompting, you give the AI language model a task without first showing examples of how the task should be solved. The model solves the task based on your instruction alone.
You get a quick sense of the model's capabilities and which tasks it handles well. Results are often not optimal, though, and can be improved through other techniques.
Here's an example of a Zero-Shot Prompt:
Write a poem about a sunset at the sea.
The poem should contain the following words:
reddish, shimmer, gentle, waves, sand, seagulls.2. Few-Shot Prompting
Few-Shot Prompting gives the language model one or more examples within the current prompt. They show how the task should be solved and provide a template for its answer. This does not change the model's trained weights.
Examples can lead to more specific results on tasks with a recognizable pattern. Experiment with different Few-Shot prompts and compare them with a Zero-Shot version.
Here's what a Few-Shot Prompt might look like:
Task: Add a creative addition to these greetings.
Example 1:
Hello! - Hello, great to see you!
Example 2:
Good morning! - Good morning, I wish you a fantastic start to the day!
Example 3:
Hi! - Hi, how are you doing on this wonderful sunny day?
Now you:
Welcome! -3. Chain-of-Thought (CoT) Prompting
Chain-of-Thought (CoT) Prompting is a powerful method where you ask the AI model to explain its thought process when solving a task. Instead of just generating an answer, the model describes step by step how it arrived at the solution.
By verbalizing the solution path, errors in logic or understanding of the task can be uncovered. CoT Prompting is particularly suited for complex problems that require multiple thinking steps. Results are often better than with standard prompts, and you can better understand the language model's capabilities.
The original Chain-of-Thought study shows the effect on arithmetic tasks. With eight Chain-of-Thought examples, PaLM 540B scored 56.9% on GSM8K, compared with 17.9% under standard prompting. The study names no universal minimum size. On the tested arithmetic tasks, the gain appeared only for models around the 100-billion-parameter scale.
Here's an example of a CoT Prompt:
Question: A farmer has 10 cows, 5 pigs, and 20 chickens.
How many legs do all the animals have together?
Step 1: Calculate the number of legs for each animal type.
- Cows have 4 legs each. 10 cows x 4 legs = 40 legs
- Pigs also have 4 legs each. 5 pigs x 4 legs = 20 legs
- Chickens have 2 legs each. 20 chickens x 2 legs = 40 legs
Step 2: Add all legs together.
40 + 20 + 40 = 100
Answer: All animals have 100 legs together.Here's a more detailed example of a prompt with and without Chain-of-Thought (CoT) Prompting:
Without CoT:
Question: A rectangle has a length of 12 cm and a width of 5 cm. A square has the same perimeter as the rectangle. What is the area of the square?
Answer:With CoT:
Question: A rectangle has a length of 12 cm and a width of 5 cm. A square has the same perimeter as the rectangle. What is the area of the square?
Step 1: Calculate the perimeter of the rectangle.
- Formula for perimeter of a rectangle: P = 2 * (length + width)
- Perimeter of the rectangle: P = 2 * (12 cm + 5 cm) = 2 * 17 cm = 34 cm
Step 2: Determine the side length of the square.
- Since the square has the same perimeter: Perimeter of square = 34 cm
- Formula for perimeter of a square: P = 4 * side length
- 34 cm = 4 * side length
- Side length = 34 cm / 4 = 8.5 cm
Step 3: Calculate the area of the square.
- Formula for area of a square: A = side length²
- Area of the square: A = (8.5 cm)² = 72.25 cm²
Answer: The area of the square is 72.25 cm².4. Self-Consistency
Self-Consistency is a technique that builds on CoT prompting. You send the same Chain-of-Thought prompt to the model several times and let it produce different reasoning paths, for example with a higher temperature. In the end, the answer that most reasoning paths arrive at wins.
The idea: a single line of reasoning can go wrong, but several independent paths land on the correct result more often than on any particular wrong one. The technique works best for tasks with exactly one correct answer, such as math or logic problems. The trade-off is that it costs several requests instead of one.
Here's an example of Self-Consistency:
Question: Anna is 3 years older than Ben and 2 years younger than Clara.
Clara is 20 years old. How old is Ben?
Think step by step.
Reasoning path 1:
- Anna is 2 years younger than Clara: 20 - 2 = 18
- Ben is 3 years younger than Anna: 18 - 3 = 15
- Answer: 15
Reasoning path 2:
- Clara is 2 years older than Anna, and Anna is 3 years older than Ben.
- So Clara is 5 years older than Ben: 20 - 5 = 15
- Answer: 15
Reasoning path 3:
- Anna is 20 - 2 = 18 years old.
- Ben is 3 years older than Anna: 18 + 3 = 21
- Answer: 21
Majority vote: 15 (2 of 3 reasoning paths)
Answer: Ben is 15 years old.5. Automatic Chain-of-Thought (Auto-CoT)
Automatic Chain-of-Thought (Auto-CoT) is an evolution of Chain-of-Thought Prompting where examples for Few-Shot prompting are automatically generated. Instead of manually creating examples that demonstrate the solution path, these are generated by a language model. The method picks a diverse set of sample questions and lets the model write the reasoning chains itself using the "Let's think step by step" prompt.
The advantage of this method is that the effort of creating high-quality Few-Shot prompts is reduced. The automatically generated examples can be used to guide the model and improve result quality without requiring manual curation.
Here's an example of Auto-CoT:
Question: Laura has a box with 12 red, 8 blue, and 6 green beads.
She takes out 3 red, 2 blue, and 1 green bead.
What is the probability that she draws a red bead next?
Automatically generated examples:
Example 1:
- Originally there were 10 red and 5 blue marbles in the box.
- 3 red and 2 blue marbles were removed.
- There are still 7 red and 3 blue marbles remaining.
- The probability of drawing a red marble is 7/(7+3) = 7/10.
Example 2:
- There were 15 red, 10 yellow, and 5 green candies in the bag.
- 5 red and 3 yellow candies were eaten.
- Now there are 10 red, 7 yellow, and 5 green candies remaining.
- The probability of choosing a red candy is 10/(10+7+5) = 10/22.
Step 1: Calculate the number of remaining beads.
- Red beads: 12 - 3 = 9
- Blue beads: 8 - 2 = 6
- Green beads: 6 - 1 = 5
Step 2: Calculate the total number of remaining beads.
- Total: 9 + 6 + 5 = 20
Step 3: Calculate the probability of drawing a red bead.
- Probability = Number of remaining red beads / Total number of remaining beads
- Probability = 9 / 20 = 0.45
Answer: The probability of drawing a red bead next is 0.45 or 45%.6. Program-of-Thoughts (PoT)
Program-of-Thoughts (PoT) is a prompting technique where the language model writes its reasoning as a program instead of in words. An interpreter, such as Python, then executes the code and does the actual computation.
The advantage over Chain-of-Thought: language models easily make arithmetic mistakes in longer calculations, an interpreter doesn't. The model only has to get the logic right. In ChatGPT or Claude, this works directly as soon as the model is allowed to run code.
Here's an example of Program-of-Thoughts:
Question: A bakery sells cakes for 12 euros each and cookies for 2 euros each.
A total of 32 items are sold and total revenue is 114 euros.
How many cakes and how many cookies were sold?
Write a Python program that calculates the answer and run it.
Program-of-Thoughts:
def solve_bakery_problem(total_items, total_revenue, cake_price, cookie_price):
for num_cakes in range(total_items + 1):
num_cookies = total_items - num_cakes
revenue = num_cakes * cake_price + num_cookies * cookie_price
if revenue == total_revenue:
return num_cakes, num_cookies
return None
num_cakes, num_cookies = solve_bakery_problem(32, 114, 12, 2)
print(f"{num_cakes} cakes and {num_cookies} cookies were sold.")
Interpreter output: 5 cakes and 27 cookies were sold.7. Least-to-Most Prompting
Least-to-Most Prompting is a technique where a complex problem is broken down into several simpler sub-problems. The language model is first asked to identify and solve the sub-problems before tackling the overall solution.
The name "Least-to-Most" refers to the model starting with the simplest sub-problems and then working its way to the more complex aspects. Through the step-by-step solution of sub-problems, the model can develop a better understanding of the overall problem and generate a more precise answer.
Here's an example of Least-to-Most Prompting:
Question: A train travels from City A to City B, covering a distance of 320 km.
The train's speed is 80 km/h.
In City B, the train takes a 30-minute break before traveling back to City A at 100 km/h.
How long does the entire journey including the break take?
Step 1: Break down the problem into sub-problems.
- Calculate the travel time from City A to City B.
- Calculate the travel time from City B to City A.
- Add the break time to the total travel time.
Step 2: Solve the sub-problems.
Sub-problem 1: Travel time from City A to City B
- Distance: 320 km, Speed: 80 km/h
- Travel time = Distance / Speed
- Travel time = 320 km / 80 km/h = 4 hours
Sub-problem 2: Travel time from City B to City A
- Distance: 320 km, Speed: 100 km/h
- Travel time = Distance / Speed
- Travel time = 320 km / 100 km/h = 3.2 hours
Sub-problem 3: Total travel time including break
- Travel time from A to B: 4 hours
- Travel time from B to A: 3.2 hours
- Break time: 30 minutes = 0.5 hours
- Total journey time = Travel time A to B + Travel time B to A + Break time
- Total journey time = 4 hours + 3.2 hours + 0.5 hours = 7.7 hours
Step 3: Formulate the answer.
The entire journey including the break takes 7.7 hours or 7 hours and 42 minutes.8. Chain-of-Symbol (CoS)
Chain-of-Symbol (CoS) is a prompting technique for planning tasks in spatial environments that are described only in text. Instead of spelling out relationships like "is on top of" or "left of" in full sentences, the model condenses them into short symbols in its intermediate steps.
The researchers tested CoS on tasks such as stacking bricks ("Brick World") and navigating from directions. The compact notation helps the model keep track of the arrangement and saves tokens along the way.
Here's an example of Chain-of-Symbol Prompting:
Question: There are two stacks of bricks on the table.
Stack 1: Brick B is on brick A, brick C is on brick B.
Stack 2: Brick E is on brick D.
You may only take the top brick of a stack.
In which order do you need to take bricks to get to brick A?
Represent the stacks with symbols.
Symbolic representation (bottom to top):
Stack 1: A / B / C
Stack 2: D / E
Step 1: The top brick of stack 1 is C. Take C.
Stack 1: A / B
Step 2: The top brick of stack 1 is B. Take B.
Stack 1: A
Step 3: A is now on top. Take A.
Answer: C, B, A. Stack 2 stays untouched.9. Structured Chain-of-Thought (SCoT)
Structured Chain-of-Thought (SCoT) is an extension of Chain-of-Thought Prompting where the language model's response is generated in a structured form. The technique originally comes from code generation: the model builds its reasoning from the three program structures sequence, branch, and loop, and only then writes the code. You can transfer the idea to other tasks by prescribing a fixed structure, such as a list of given information, solution steps, and result.
By specifying a structure, the model can be made to organize its response better and highlight important information. This improves clarity and makes it easier for users to understand and follow the response.
Here's an example of Structured Chain-of-Thought Prompting:
Question: A sports store sells tennis balls in packs of 4.
A pack costs $8.99. A tennis club wants to buy tennis balls
worth a maximum of $500 for a tournament.
How many tennis balls can the club buy and how much money is left over?
Answer:
Given information:
- Tennis balls are sold in packs of 4.
- One pack costs $8.99.
- The tennis club's budget is $500.
Solution steps:
1. Calculate the maximum number of packs that can be bought with the budget.
* Maximum number of packs = Budget / Price per pack
* Maximum number of packs = $500 / $8.99 ≈ 55.62
* Since only whole packs can be bought, round down: 55 packs
2. Calculate the number of tennis balls contained in 55 packs.
* Tennis balls per pack = 4
* Total number of tennis balls = Number of packs × Tennis balls per pack
* Total number of tennis balls = 55 × 4 = 220
3. Calculate the actual cost for 55 packs and the remaining budget.
* Actual cost = Number of packs × Price per pack
* Actual cost = 55 × $8.99 = $494.45
* Remaining budget = Budget - Actual cost
* Remaining budget = $500 - $494.45 = $5.55
Result:
- The tennis club can buy 220 tennis balls (55 packs).
- $5.55 remains from the budget.10. Plan-and-Solve (PS)
Plan-and-Solve (PS) is a prompting technique that focuses on solving complex problems by first creating a plan and then executing it step by step. In PS, the language model is asked to analyze the problem, divide the task into smaller subtasks, and then carry them out according to the plan.
The main advantage of PS is that it allows the model to develop a structured approach to complex problems. By creating a plan, the model can identify the most important steps and focus on the essential aspects of the problem.
Here's an example of Plan-and-Solve Prompting:
Question: A hiker covers a distance of 18 km in one day.
He starts at 8:30 AM and takes a 15-minute break during the first half of the route.
After covering half the distance, he takes a 30-minute lunch break.
Afterward, he walks 2 km/h faster than in the morning.
At 1:00 PM he reaches his destination. What was the hiker's average speed?
First devise a plan, then carry it out step by step.
Answer:
Plan:
1. Calculate the total time from start to finish.
2. Subtract the breaks to get the pure walking time.
3. Calculate the average speed.
4. Check the result against the morning and afternoon details.
Step 1: Total time
- 8:30 AM to 1:00 PM = 4 hours 30 minutes
Step 2: Pure walking time
- Breaks: 15 minutes + 30 minutes = 45 minutes
- Walking time = 4 hours 30 minutes - 45 minutes = 3 hours 45 minutes = 3.75 hours
Step 3: Average speed
- Average = 18 km ÷ 3.75 hours = 4.8 km/h
Step 4: Cross-check
- Morning: 9 km at v km/h, afternoon: 9 km at (v + 2) km/h
- With v = 4 km/h: 9 ÷ 4 = 2.25 hours and 9 ÷ 6 = 1.5 hours
- 2.25 + 1.5 = 3.75 hours, which matches the walking time from step 2.
The hiker walked at an average speed of 4.8 km/h (4 km/h in the morning, 6 km/h in the afternoon).11. What Changes with Reasoning Models
Many current models think on their own before they answer. At OpenAI, this started with the o-series and now applies to the GPT-5 and GPT-6 models too; with Claude, it's the adaptive thinking of newer models. Some of the techniques above only apply to them in a limited way.
- No "think step by step" needed: OpenAI writes in its reasoning best practices that such instructions are unnecessary because the models already reason internally.
- General instead of prescriptive instructions: Anthropic recommends in its prompting best practices writing something like "think thoroughly" rather than a hand-written step-by-step plan.
- Zero-shot first, then few-shot: OpenAI advises starting without examples and adding them only if needed.
- Structure still helps: Clear delimiters such as Markdown, XML tags, or section titles remain useful so the model can tell the parts of your prompt apart.
The providers do not write a new guide for every product either. Anthropic describes XML tags for complex inputs, Google shows examples and response-format instructions in its prompting strategies, and OpenAI recommends clear tasks and relevant context. Nothing in that points to a separate prompting language for each chatbot.
That doesn't make Chain-of-Thought, Plan-and-Solve, and the rest worthless. They still help with models without built-in reasoning, when thinking is turned off, or when you want to follow the solution path.
11.1 Sources
- Schulhoff, S., Ilie, M., Balepur, N., Kahadze, K., Liu, A., Si, C., … & Resnik, P. (2024). The Prompt Report: A Systematic Survey of Prompting Techniques.
- Vatsal, S., & Dubey, H. (2024). A Survey of Prompt Engineering Methods in Large Language Models for Different NLP Tasks.
Frequently Asked Questions About Prompting Techniques
A zero-shot prompt could ask “Classify this review as positive or negative.” A few-shot prompt adds examples of reviews and their labels before the new review. For a complex task, state the goal, relevant context, and checks the result must pass. Examples and explicit criteria help the model follow the pattern you need. For more examples and practical writing tips, see my guide to writing prompts for ChatGPT.
No technique works best for every task. In the original Chain-of-Thought study, PaLM 540B scored 56.9% on GSM8K with eight Chain-of-Thought examples, compared with 17.9% under standard prompting. Examples can help with recurring tasks that follow a clear pattern. Compare prompts on test cases from your own use case.
There is no universal minimum size. In the original CoT study, gains on the tested arithmetic tasks appeared around the 100-billion-parameter scale.
There is no authoritative, cross-provider list of the “newest” techniques. Current provider guides mainly recommend clear tasks, relevant context, a requested output format, and examples when they demonstrate a pattern.






