Chain-of-Thought & Problem Decomposition
Use step-by-step reasoning prompts and decomposition to get more accurate and explainable outputs.
Chain-of-thought means asking the model to show its steps out loud. Decomposition means breaking a big job into small, simple jobs.
Why use them?
- Complex problems are easier when done step-by-step.
- Seeing the steps helps you find where the model goes wrong.
Simple step-by-step pattern:
- Ask for a short plan or outline.
- For each plan item, ask the model to expand into simple steps.
- Run checks on each step (automated or manual).
- Ask the model to combine the verified steps into a final answer.
Short example prompt for reasoning:
βExplain your reasoning step-by-step, then give the final short answer.β β this asks the model to show intermediate thought.
Notes and cautions:
- Chain-of-thought adds tokens because the model writes more, so it costs more.
- Not all models or settings support exposing internal reasoning; sometimes a short plan is enough.
- Use decomposition when parts can be validated by simple rules or code (e.g., format checks, number ranges).
Practical tip: when debugging a tricky prompt, ask the model to show an outline first. If the outline looks wrong, fix the prompt before asking for the full answer.
Quick Quiz
Test what you just learned. Pick the best answer for each question.
Q1 What is 'chain-of-thought' prompting?
Q2 Why decompose complex tasks?