We've covered the basics and moved into intermediate techniques, but now it's time to unlock the real power of Large Language Models (LLMs). This final installment of the Prompt Engineering series dives deep into advanced strategies that turn a basic LLM into a sophisticated, autonomous reasoning agent.
If you're ready to tackle highly complex problems—from multi-step coding architectures to tricky logic puzzles—these techniques are your next step. If you need a refresher on the foundations, check out Prompt Engineering (Part 2)
Let us start with:
- Chain of Thought Prompting (Step by Step Reasoning): This type of prompting shows the AI model how to reason and solve a specific problem by breaking down the problem into step that are interconnected. The previous step acts as the base for the next step.
Problem: Laxmi has 34 apples. She gives 20 to Sudha who already has 10 apples. How many apples do Laxmi and Sudha have individually?
Chain-of-Thought Reasoning
Laxmi has 34 apples.
She gave 20 to Sudha.
Now she has 34-20=14 apples.
Sudha got 20 apples.
She had 10 apples.
Sudha now has 20+10=30 apples.
Answer: Laxmi: 14 apples Sudha: 10 apples
2.ReAct prompting (Reasoning and Action)
The ReAct (Reasoning and Action) framework combines Chain-of-Thought reasoning with the ability to perform external actions (like searching the web, running code, or accessing a database). The LLM uses internal Thought steps to plan, reflect, and track its progress, and Action steps to gather necessary information.
This is critical when the LLM's knowledge is limited or outdated, enabling it to function as a powerful, autonomous agent.
It works in steps of Thought, Action and Observation.
Thought: "The LLM's internal monologue: planning, analyzing the next step, or reflecting on the previous outcome."
Action: "A function call or API request (e.g., search(""latest stock price of Flipkart""))."
Observation: "The result returned from the action (e.g., ""The latest stock price is $180.50"")."
Question: Who won the last FIFA World Cup, and what year was it held?
Thought 1: I need to find the winner of the most recent FIFA World Cup. My internal knowledge might be out of date.
Action 1: search("last FIFA World Cup winner")
Observation 1: The last FIFA World Cup was held in 2022 and won by Argentina.
Thought 2: I have the winner (Argentina) and the year (2022). I can now formulate the final answer.
Action 2: finish("Argentina won the 2022 FIFA World Cup.")
3.Tree-of-Thought prompting: If CoT is a single-threaded thought process, ToT is a multi-threaded thought process. Instead of just following one chain, the model explores multiple diverse reasoning paths (thoughts) simultaneously and strategically decides the best next step by evaluating the potential of each path.
Use Case: Ideal for complex planning, generating code with multiple architectural options, or strategic games (like Sudoku or chess moves).
Prompt: "You have a 3-liter jug and a 5-liter jug. Measure exactly 4 liters.
How can you do it?
Let’s reason using a Tree of Thought.
At each step, explore multiple possible actions (like branches).
For each, note what state it leads to and decide which branch is most promising.
Continue exploring until you find a path to exactly 4 liters.
Write the reasoning tree and then the final solution."
Model (Tree-of-Thought reasoning):
Root:
Start (0L, 0L) => Both jugs have 0 litres.
Possible actions:
Which jug to fill?
- Fill 3L → (3,0)
- Fill 5L → (0,5) → Choose (0,5) (larger jug gives flexibility)
Branch 1 (0,5):
Possible actions:
- Pour 5→3 → (3,2) => Pouring 3 liters into the 3L jug, leaving 2 liters in 5L jug.
- Empty 5 → (0,0) → Choose (3,2)
Branch 2 (3,2):
Possible actions:
- Empty 3 → (0,2)
- Pour 3→5 → (0,5) → Choose (0,2) (use smaller jug later)
Branch 3 (0,2):
Possible actions:
- Fill 5 → (5,2)
- Fill 3 → (3,2) → Choose (5,2) Branch 4 (5,2): Possible actions: Pour 5→3 (until full): (4,3) Target reached.
Found solution path:
(0,0) → (0,5) → (3,2) → (0,2) → (5,2) → (4,3)
4 liters achieved in 5L jug.
4.Self-Consistency prompting
Self-consistency prompting is a reasoning technique where instead of trusting one chain of thought, we ask the model to generate multiple reasoning paths and then choose the most common or consistent answer among them.
It’s like asking a student to solve the same problem in different ways — if multiple approaches lead to the same answer, that answer is likely to be correct.
For example,
Problem: A train leaves City A at 8 a.m. traveling at 60 km/h.
Another train leaves City B at 9 a.m. traveling at 80 km/h towards City A. The distance between the two cities is 300 km.
At what time will they meet?
Normally, a single reasoning path is adopted to arrive at the answer.
A model might reason once like this:
- The first train travels 1 hour before the second starts → covers 60 km. Now 300 − 60 = 240 km left.
- Relative speed = 60 + 80 = 140 km/h.
- Time to meet after 9 a.m. = 240 ÷ 140 = 1.714 hours ≈ 1 hour 43 minutes. Meeting time ≈ 9 a.m. + 1h43m = 10:43 a.m. If the model made a small arithmetic or logic mistake, it would give a wrong answer confidently. Self-consistency prompting
Prompt: "A train leaves City A at 8 a.m. traveling at 60 km/h.
Another train leaves City B at 9 a.m. traveling at 80 km/h towards City A. The distance between the two cities is 300 km.
At what time will they meet?
Solve the problem carefully in at least three different ways (e.g., using algebra, relative speed, and time-distance table).
Then choose the answer that appears most consistent across your reasoning paths.
"
Path 1 — Relative speed
Train A travels 60 km before 9 a.m.
Remaining distance = 240 km.
Relative speed = 60 + 80 = 140 km/h.
Time = 240 ÷ 140 = 1.71 hours → 1 hour 43 minutes.
Meeting time = 10:43 a.m.Path 2 — Algebraic approach
Let 𝑡 = time (hours) after 8 a.m. when they meet.
Train A distance = 60t
Train B distance = 80(t − 1)
Sum = 300
→ 60t + 80(t − 1) = 300
→ 140t = 380
→ t = 2.714 hours after 8 a.m. → 10:43 a.m.
Time Train A dist Train B dist Total 10:00 120 km 80 km 200 km 10:30 150 km 120 km 270 km 10:45 165 km 140 km 305 km (close!) → Meet at ~10:43 a.m.
All three paths converge near 10:43 a.m. → that’s the self-consistent result.
5.Multi Step prompting
Multi-step prompting means guiding an AI model through a series of smaller, structured sub-prompts, rather than asking it to solve everything in one big question.
You break a complex reasoning or generation task into logical stages, where each step builds on the previous one — much like how a human would tackle a multi-part problem.
Task: “Summarize this research paper and propose 2 improvements.”
Single Prompt: Summarize the paper and suggest 2 improvements.
Model may produce a vague summary or irrelevant improvements.
Multi-step prompt:
1. Summarize the paper in 5 bullet points focusing on methodology.
2. Identify one limitation in the methodology.
3. Suggest 2 improvements addressing those limitations.
6.Meta prompting
Meta prompting is about guiding how the model uses and controls its reasoning process.
It makes the model self-aware of its own instructions — i.e., it reasons about how to reason.
QUESTION:
A bat and a ball cost $1.10 in total.
The bat costs $1.00 more than the ball.
How much does the ball cost?
Most popular models like Gemini, GPT, etc. would provide the correct answer as they have been typically trained on huge number of datasets and they are trained to reason. But typically, models would respond saying ball: $0.10 and bat: $1.00.
Instead in meta prompting:
A bat and a ball cost $1.10 in total.
The bat costs $1.00 more than the ball.
How much does the ball cost?
Before answering, think step by step about what kind of reasoning this question needs.
Decide whether it’s arithmetic, logical, or linguistic.
Then apply arithmetic reasoning carefully before giving the final answer.
Answer: The ball costs $0.05, the bat costs $1.05.
Model’s reasoning (meta-level awareness)
Step 1: Identify reasoning type → arithmetic reasoning problem involving relationships.
Step 2: Let the ball = x. Then the bat = x + $1.00.
Step 3: Total = x + (x + 1) = $1.10 → 2x + 1 = 1.10 → 2x = 0.10 → x = 0.05.
Answer: The ball costs $0.05, the bat costs $1.05.
What happened?
Without meta prompting, the model jumped to a pattern-based answer (“$10” appears frequently in similar text).
With meta prompting, it explicitly paused, chose a reasoning style, and verified each step — preventing a common heuristic error.
Without meta prompting in unknown domains, the model might hallucinate.
That wraps up our three-part series on Prompt Engineering! You've moved from understanding basic structure to mastering agentic strategies like ReAct and Tree-of-Thought. These techniques are no longer about just asking questions; they're about engineering thinking.
The LLM ecosystem is moving toward autonomous agents, and understanding these advanced strategies is how you future-proof your development skills.
I'm keen to hear where you plan to use these complex methods first. Are you building a ReAct agent to automate a workflow, or will you use Self-Consistency to verify critical output in a new project? Drop a comment below and let's discuss which strategy you find the most game-changing!
Top comments (0)