Prompt Engineering Mastery: 5 Thinking frameworks to make AI think like an expert
3/26/2026
查看这篇文章的中文版本
Introduction
”Why do some people get precise answers with ChatGPT, while mine always miss the point?” This is a common frustration for many AI beginners. The answer is actually quite simple - you can speak, but do you know how to “ask”? Prompt is the bridge for communicating with large language models. A well-written prompt acts like a precise navigation system for AI; a poorly written one only allows it to “chat aimlessly”. In this article, I’ll explain 5 core prompt techniques that can instantly make your AI “smarter” in the most accessible language: chain of thought, tree of thoughts, self-consistency, reflection, and ReAct reasoning with action. Each technique comes with ready-to-use prompt templates that you can copy and paste!
1. What is a Prompt? Why is it so important?
Prompt is the text instruction you input to the large language model. Here’s an example: Basic prompt:
Write a product description for me quality prompt: You are an e-commerce copywriting expert with 10 years of experience. Please write a Xiaohongshu (Little Red Book) style post for a “sugar-free sparkling water”, targeting 18-25 year old young women. Highlight the three selling points: “0 sugar 0 calories”, “refreshing and thirst-quenching”, “suitable for weight loss”, with a lively and interesting style, include emoji expressions, around 200 words. See the difference? A quality prompt includes: role setting + task goal + audience positioning + style requirements + constraints. The clearer this information, the more precise the AI’s response will be.
2. 5 basic principles of prompt design
Before diving into advanced techniques, master these basic principles first 1. Role setting Let AI play a specific role to activate domain knowledge.
you are a senior Python developer...
you are a child psychology expert...
2. task decomposition Break complex tasks into multiple steps to reduce error probability.
please complete the following steps:
Step 1: analyze the core problem
step 2: list solutions
step 3: give final recommendation
3. provide examples give the expected output format to let AI learn by example.
example output:
[Title] xxx
[key points] xxx
[suggestions] xxx
4. set constraints clearly define boundaries like word count, format, style.
requirements: within 300 words, colloquial expression, no professional jargon
5. iterative optimization If it doesn’t work once, keep asking follow-up questions to gradually refine the requirements.
3. Advanced technique 1: Chain of thought (CoT)
what is chain of thought?
The core idea of chain of thought is CoT is to let AI “think step by step”, breaking down complex problems into multiple intermediate steps, just like writing out the calculation process when solving math problems.
why is it effective?
Large language models are essentially “probability prediction machines” that are prone to errors when jumping directly to answers. But requiring them to “think first then answer” can significantly improve accuracy.
prompt template
Please answer the question using chain of thought:
[understand the problem]
first, rephrase the problem in your own words to ensure correct understanding.
[analyze key information]
list key elements and known conditions in the problem
[reasoning process]
reason step by step:
- step 1: xxx
- step 2: xxx
- ...
[verify answer]
check if there are loopholes in the reasoning process and and whether the answer is reasonable.
[final answer]
give a clear and concise conclusion.
practical example
problem: Xiaoming has 5 apples, gave 2 to Xiaohong, bought 3 more, how many does left? **after using chain of thought prompt, AI will answer like this: [understand the problem] need to calculate the change in the number of Xiaoming’s apples. [analyze key information]
- initial: 5 apples
- reduced: gave 2 to Xiaohong
- increased: bought 3 more [reasoning process]
- step 1: 5 - 2 = 3 (remaining after giving Xiaohong)
- step 2: 3 + 3 = 6 (total after purchase) [verify answer] 5 - 2 + 3 = 6, calculation correct. [final answer] Xiaoming now has 6 apples.
---
## 4. Advanced technique 2: tree of thoughts (ToT)
### what is tree of thoughts?
Chain of thought is "one path to the end", while tree of thoughts allows AI to **explore multiple paths and choose the optimal solution**, like considering multiple moves in chess and choosing the one with the highest winning rate.
### applicable scenarios
- creative writing (multiple style attempts)
- decision analysis (multi-option comparison)
- complex problem solving (needs trial and error)
### prompt template
```markdown
please analyze this problem using tree of thoughts:
[generate multiple solutions]
please generate 3 different solution approaches:
- solution A: xxx (approach description)
- solution B: xxx (approach description)
- solution c: xxx (approach description)
[evaluate each solution]
evaluate each solution from these dimensions:
- feasibility (1-10 points)
- cost (1-10 points, lower is better)
- risk (1-10 points, lower is better)
[choose optimal solution]
after comprehensive evaluation, choose the optimal solution and explain the reason.
[execute solution]
explain in detail how to implement the optimal solution.
practical example
problem: how to improve team work efficiency? Using tree of thoughts prompt, AI will generate and compare multiple solutions: [generate multiple solutions]
- solution A: introduce project management tools (e.g., Notion, Feishu)
- solution b: implement flexible work arrangements
- solution c: organize regular skill training [evaluate each solution] | solution | feasibility | cost | risk | score | |----------|--------|------|------|-------| | A | 9 | 3 | 2 | excellent | | b | 7 | 8 | 5 | good | | c | 8 | 5 | 3 | good | [choose optimal solution] after comprehensive evaluation, solution a (introduce project management tools) is optimal:
- low implementation difficulty, quick results
- controllable cost, free versions available for most tools
- minimal risk, no impact on existing work patterns
---
## 5. Advanced technique 3: self-consistency
### what is self-consistency?
Let AI **generate multiple answers to the same question, then "vote" to choose the most consistent conclusion**. Like asking multiple experts the same question and taking the consensus answer.
### why is it effective?
Large model output is random, and the same question may get different answers. through multiple sampling + voting, answer reliability can be significantly improved.
### prompt template
```markdown
please analyze the following question from multiple angles using self-consistency:
[first analysis]
please analyze this problem from angle a and give a conclusion.
[second analysis]
please analyze this problem from angle b and give a conclusion.
[third analysis]
please analyze this problem from angle c and give a conclusion.
[consistency check]
compare the conclusions from the three analyses:
- similarities: xxx
- differences: xxx
[final conclusion]
based on the principle of majority consistency, give the most reliable answer.
practical example
problem: Will AI replace programmers? [first analysis] from technical perspective AI can automatically generate code, but struggles with complex business logic and innovation requirements. conclusion: partial replacement, not complete replacement. [second analysis] from economic perspective AI lowers the barrier to programming, but demand for high-end development is still growing. conclusion: won’t replace, but change the way of working. [third analysis] from historical perspective every technological revolution has eliminated some jobs, but created more new jobs. conclusion: won’t replace, but transform. [consistency check] all three conclusions are consistent: AI won’t completely replace programmers. [final conclusion] AI will change the way programmers work, automating repetitive tasks, but high-end development positions requiring creativity and business understanding remain irreplace.
---
## 6. advanced technique 4: reflection mechanism
### what is reflection mechanism?
let AI **"self-criticize" and "iteratively improve" its output**, like writing an article and then checking and revising it yourself.
### prompt template
```markdown
please complete the task using the following reflection cycle:
[initial answer]
first give your preliminary answer.
[self-reflection]
please review your answer from the following perspectives:
1. is the logic rigorous?
2. is any important information missing?
3. are there biases or errors?
4. is the expression clear and easy to understand?
[improvement plan]
list specific points for improvement:
- improvement point 1: xxx
- improvement point 2: xxx
[optimized answer]
based on the reflection results, give the improved answer.
[verify again]
confirm whether the improved answer has resolved the above problems.
practical example
problem: recommend a mechanical keyboard suitable for programmers [initial answer] recommend Cherry mx blue switch mechanical keyboard, good feel, crisp sound. [self-reflection]
- logic issue: didn’t consider usage scenarios (office/home)
- missing information: didn’t mention price range, connection method
- bias: blue switches are too noisy in office, not suitable
- expression: too brief, lack of comparison [improvement plan]
- add usage scenario distinctions
- add price range information
- recommend multiple switch options
- add product comparison table [optimized answer] recommend based on different scenarios: | scenario | recommendation | price | features | |---------|-------------|------|----------| | office | brown/red switch | 300-500 | quiet, no disturbance | | home | blue switch | 400-800 | satisfying feel | | travel | 60% layout | 200-400 | lightweight, portable | specific recommendation: keychron K series (multi-device switching), ikBC (cost-effective)
---
## 7. advanced technique 5: ReAct (reasoning + acting)
### what is reAct?
ReAct = **reasoning + action**, allowing AI not only think but but call tools and perform operations. This is the core paradigm of current agents.
### workflow
think → act → observe → think → act → …
### prompt template
```markdown
you are an intelligent assistant, please use the ReAct method to solve problems.
you can use the following tools:
- search(query): search network information
- calculate(expression): calculate mathematical expressions
- code(code): execute code
please answer in the following format:
[think]
analyze what needs to be done now...
[action]
select the tool and parameters to execute...
[observe]
the result returned by the tool...
(repeat the think-act-observe cycle until the problem is solved)
[final answer]
give the final answer to the question.
practical example
problem: which country won the most gold medals in the 2024 Olympics? [think] need to search the 2024 Olympics gold medal table information. [action] search(“2024 Paris olympics gold medal table”) [observe] search results show: usa won 40 gold medals, china won 40 gold medals… (tied for first) [think] both usa and china have 40 gold medals, tied for first. need to confirm this information. [action] search(“2024 paris olympics gold medal table final ranking official”) [observe] official confirmation: usa 40 gold, china 40 gold, usa ranked first in the medal table due to more silver medals. [final answer] in the 2024 paris olympics, the countries with the most gold medals were usa and China, each with 40 gold medals. according to medal table ranking rules, usa ranked first due to more silver medals.
---
## 8. comparison of 5 techniques
| technique | core idea | applicable scenarios | complexity |
|-----------|----------|------------------|-----------|
| chain of thought | step-by-step reasoning | math, logic problems | ⭐⭐ |
| tree of thoughts | multi-path exploration | creative, decision analysis | ⭐⭐⭐ |
| self-consistency | multiple sampling + voting | need high accuracy | ⭐⭐⭐ |
| reflection | self-criticism + improvement | need high-quality output | ⭐⭐⭐⭐ |
| reAct | reasoning + tool calling | need real-time information | ⭐⭐⭐⭐⭐ |
---
## 9. practical recommendations
**beginners**: start with chain of thought, the simplest and most effective method.
**daily use**: combine chain of thought + reflection for best results
**complex tasks**: use tree of thoughts to explore multiple solutions, then use reflection to optimize
**need internet**: use reAct mode to let AI search, calculate, execute
**pursue accuracy**: self-consistency + chain of thought, verify multiple times for reliability
---
## 10. a cold thought
After learning these techniques, you might wonder: **is prompt engineering really that important?**
To be honest, I have a different view.
**large model evolution is too fast.**
Looking back: GPT-3 to GPT-4, the capabilities have leaped more more than one level; Claude 2 to Claude 3.5, the context window has surged from 9K to 200K; not to mention GPT-4o, Claude 3.5 Sonnet, Gemini 1.5 Pro...
Every iteration, the model's basic understanding, reasoning, and instruction following capabilities are rapidly improving.
**what does this mean?**
last year's carefully designed prompts, this year can be asked directly; the math problems that required chain of thought last month might be solved at a glance.
**my judgment is: prompt engineering is just the icing on the cake, not the charcoal for**
when the model's capabilities are strong enough, good prompt can make it more stable and controllable. Like an F1 racing driver, the car is fast enough is the base, but the driving skills determine the best lap time.
**but this doesn't mean prompt techniques have no value.**
On the contrary - when the model is strong enough, good prompt can make it more stable, controllable. Like F1 drivers, the faster the car, the better the driving skills determine the best lap time
**my recommendations:**
1. **understand principles, but don't blindly believe**: know what chain of thought and reflection are about, but don't need to use templates every time
2. **follow model iteration**: when a new model is released, test whether the previous prompts are still needed to be so complex
3. **focus on core needs**: focus on "what problem do I want to solve" instead of "how to write a perfect prompt"
Prompt is a tool, not an end. The tool itself is already powerful enough, sometimes, just speaking directly is enough.
Prompt engineering is not metaphysics, but but a skill that can be learned.
remember this formula:
**good prompt = role setting + task decomposition + example guidance + constraints + chain of thought reasoning**
with these 5 techniques, you can make AI go from "only chatting" to "professional assistant"
more importantly - these techniques can be combined! for example, "chain of thought + reflection" or "tree of thoughts + self-consistency" have better results
next time you use AI, don't just ask casually. spend 1 minute writing a good prompt, AI will surprise you.
---
**Reference resources:**
prompt engineering guide: https://www.promptingguide.ai/
chain of thought: https://www.promptingguide.ai/techniques/cot
tree of thoughts: https://www.promptingguide.ai/techniques/tot
reflection: https://www.promptingguide.ai/techniques/reflexion
---
欢迎关注公众号 **FishTech Notes**, 一块交流使用心得!