Nearby lessons

16 of 49

Prompt Engineering - Reflection and Self-Consistency

Reflection — Review Before You Trust

Reflection means asking AI to review and improve its own answer. The first answer may not be perfect. Reflection adds a checking step:

Generate → Review → Fix → Give the improved final answer.

  • Exam example: you write the answer, check it again, and correct the mistakes — that checking is reflection.
  • AI can do the same when you ask it to.
Example01
Prompt PreviewChatGPT-style
Solve the problem step by step. Then: - Review your answer - Check the calculation and logic - Correct if needed - Give the final answer in 2 lines
Copy the prompt and paste it into ChatGPT, Gemini, or Claude to try it.

Self-Consistency — Ask Three Friends

Self-consistency means solving the same problem multiple times and comparing the answers. If AI gives the same answer every time, you can trust it more.

  • Three-friends analogy: ask three friends and choose the common answer — that is self-consistency.
  • If all three give the same answer, it is probably right.
In simple words: Never trust the first answer blindly. Multiple attempts reduce errors.
Normal OutputReflection + Self-Consistency
One answerMultiple checks
Errors possibleReduced errors
Less reliableMore reliable
No validationValidated output
Example02
Prompt PreviewChatGPT-style
Solve this problem 3 times independently. Compare the answers. Give the most reliable final answer. Problem: CP = 500, Profit = 20%. Find SP.
Copy the prompt and paste it into ChatGPT, Gemini, or Claude to try it.

Combined Reflection + Consistency

For important tasks, use both together: solve multiple times, then reflect on the best answer.

Example03
Prompt PreviewChatGPT-style
Solve the problem 3 times independently. Compare the answers. Choose the best one. Then reflect: - Check for mistakes - Improve the final answer - Give the final output
Copy the prompt and paste it into ChatGPT, Gemini, or Claude to try it.

Putting It Together

TechniqueOne-Line Purpose
ReflectionAI reviews and improves its own answer
Self-ConsistencySolve multiple times, compare, trust the common answer
Tree of ThoughtsGenerate options, compare, decide
Chain of HindsightLearn from the mistake and improve
Step-BackUnderstand the concept before solving
Example04
Prompt PreviewChatGPT-style
Step 1: Explain the concept (STEP-BACK) Step 2: Solve the problem (REASONING) Step 3: Review the answer (REFLECTION) Step 4: Improve and give the final output (HINDSIGHT)
Copy the prompt and paste it into ChatGPT, Gemini, or Claude to try it.
📝 Key Takeaways
  • Reflection = AI reviews and improves its own answer.
  • Reflection: generate → review → fix → give the improved final answer.
  • Self-consistency = solve multiple times and choose the common answer.
  • Never trust the first answer blindly — multiple attempts reduce errors.
  • For important tasks, use both together.
  • Check twice, answer once — combine reflection + consistency for trust.

🧠 Test Your Knowledge

2 Questions
Progress: 0 / 2