Concepts / Task Decomposition and Chain-of-Thought Prompting

Task Decomposition and Chain-of-Thought Prompting

Chain-of-thought (CoT) prompting explicitly asks a model to think step by step, nudging it toward a more systematic approach to problem solving.

  • Programming

Why a Direct Question Can Fall Short

When you ask a language model a question, the most direct prompt often produces the most direct answer. Sometimes that is exactly what you want. For harder questions, though, you may want the model to slow down and work through the problem in a more systematic way. The source material describes two techniques for this purpose: chain-of-thought (CoT) prompting and self-critique prompting. This article focuses on CoT and introduces self-critique because the two are discussed together.

What do you think happens?

Before reading on: if a prompt asked the model to show its reasoning before giving a final answer, what would change in the response? Would the answer look different, and would it be easier for you to check?

What Chain-of-Thought Asks the Model to Do

Definition

Chain-of-thought (CoT) prompting explicitly asks a model to think step by step, nudging it toward a more systematic approach to problem solving.

The phrase explicitly asking matters. CoT is not a hidden setting and it is not a special model. It is a choice you make in the wording of the prompt. The source describes CoT as among the first prompting techniques that work well across models, which is part of why it is widely taught.

The source gives two broad ways to write a CoT prompt. The simplest is to add a phrase such as think step by step or explain your decision to your prompt. In that case the model works out for itself which steps to take. The second way is more directed: you specify the steps the model should take, or you include examples of what those steps should look like inside the prompt.

Tracing One Query Through Prompt Variations

The source shows four CoT variations written against the same original query: Which animal is faster: cats or dogs? Keep that single question fixed and watch what changes in what you send to the model. The question itself never changes. Only the surrounding prompt text changes, and each change is one of three kinds: an instruction to reason, a list of steps, or an example of the output shape.

QueryWhich animal is faster:cats or dogs?QueryWhich animal is faster:cats or dogs?Reasoning instructionfor example, think step bystepOne worked examplea question with itsreasoning and answerNo exampleno worked case in thepromptReasoning instructionsame kind of request asbeforefollowed bypreceded byfollowed by
What is included in each prompt, and how does adding one worked example change the structure of the prompt the model receives?

Look at the rows in order. The first two variations are both zero-shot, even though their wording differs. Each asks for reasoning, but neither includes an example. The third variation is also zero-shot, but it goes further by supplying the steps the model should follow. The last variation is the only one that includes an example of the output shape. Because the source says the best variation depends on the application, read this set as a list of options to choose from rather than a ranking from worst to best.

Zero-Shot and One-Shot CoT

CoT prompts are commonly grouped by how many examples they contain. The grouping comes directly from the source, and it is best understood as one question: does the prompt include an example of the reasoning you want? Zero-shot CoT includes no examples. One-shot CoT includes exactly one example in the prompt.

Key point

To classify a CoT prompt, ignore how elaborate the wording is and ask only whether an example of the desired reasoning appears inside the prompt. An instruction such as think step by step does not make a prompt one-shot. A worked case does.

Why Step-by-Step Reasoning Helps

The source reports that CoT improves model performance on various benchmarks. The Wei et al. (2022) paper, which introduced CoT, showed improvements for models of different sizes, namely LaMDA, GPT-3, and PaLM. The source's figure for this result plots performance against model scale, measured in billions of parameters, across the MAWPS, SVAMP, and GSM-8K benchmarks. In words: for each model family, the CoT version of the prompt scored higher than the standard approach on these math word problem and related benchmarks.

The source also notes that LinkedIn found CoT reduces models' hallucinations. This is a reported finding, and the source does not describe the conditions in detail. Treat it as evidence that CoT can help, not as a guarantee for every prompt.

Self-Critique and Its Cost

The source describes self-critique as similar to CoT in spirit: both nudge the model to think critically about a problem. CoT pushes the model to work through steps. Self-critique pushes the model to review what it produced. Used together, the model first reasons and answers, then examines that answer. This is a common way the two techniques are combined.

Promptthe original questionFirst answerthe model's initial outputSelf-critiquethe model reviews its ownoutputRevised answeroutput after reviewFinal answerwhat the user receivesmodel call 1model call 2revisedelivered
What happens to the model's output after the first answer, and how many sequential model passes does the loop add before the final answer arrives?

Read the flowchart as a sequence. The first answer is not the end of the process. The model examines that answer as a separate step, and the revised output is what the user sees at the end. Each stage must finish before the next can begin, so the work accumulates in order rather than happening all at once.

The Latency Trade-Off

The source is direct about a cost of these techniques. Similar to prompt decomposition, CoT and self-critique can increase the latency users perceive. A model may perform several intermediate steps before the user sees the first output token. This is especially challenging when you encourage the model to come up with its own steps, because the resulting sequence can take a long time to finish. That increases latency and can make the approach costly.

Direct answerone pass, then the answerReasoning stepsintermediate steps run insequenceFirst answerafter the reasoningCritique passadded by self-critiqueFinal answerfirst output token afterthe passesthenthenthen
How does total response time grow when reasoning steps and critique passes run one after another, compared with a single direct answer?

Mistakes Beginners Make with CoT Prompts

  • Common mistake

    Assuming any mention of reasoning makes a prompt one-shot

    Why it fails

    Zero-shot and one-shot are defined by whether the prompt includes an example, not by how many instructions it has.

    Do this instead

    Check the prompt for a worked example of the reasoning. If there is none, it is zero-shot even if it says think step by step.

  • Common mistake

    Ranking the four CoT variations from worst to best

    Why it fails

    The source states that the best variation depends on the application, so the table is a set of options.

    Do this instead

    Choose the variation that fits the question and the output you need.

  • Common mistake

    Treating CoT as a guaranteed fix for hallucinations

    Why it fails

    The hallucination finding is reported by the source without detailed conditions.

    Do this instead

    Treat the result as evidence that CoT can help, and verify important answers independently.

  • Common mistake

    Adding self-critique without considering response time

    Why it fails

    Self-critique adds passes that run before the first output token, which can increase perceived latency and cost.

    Do this instead

    Use self-critique when the extra time is worth the review, and expect slower responses.

Practice Choosing a CoT Variation

MEDIUM

You want a model to answer a question about which of two animals is faster. Your application needs answers that follow a consistent output shape, and you can afford a slightly longer response. Which kind of prompt would you choose: a zero-shot CoT prompt with a simple reasoning instruction, a zero-shot prompt that lists the steps, or a one-shot prompt that includes an example of the output shape? Explain your choice in terms of what each prompt includes.

Hints
  • Ask first whether the prompt includes an example of the output.
  • The source says the best variation depends on the application.
  • Consider whether the consistent output shape matters more than the simplest prompt.

Key Takeaways

  • Chain-of-thought prompting explicitly asks a model to think step by step, which nudges it toward a more systematic approach to problem solving. It is a choice made in the wording of the prompt, not a hidden setting.
  • Zero-shot CoT includes no example in the prompt, while one-shot CoT includes one example. The distinction depends on whether an example of the reasoning appears, not on how many instructions are given.
  • The four variations of the same query differ in what is added: an instruction, a list of steps, or an example of the output shape. The source treats them as options whose suitability depends on the application.
  • Self-critique asks the model to review its own output. Combined with CoT, the model reasons, answers, and then examines that answer, which can increase perceived latency and cost because the steps run before the first output token.

Related concepts

More concepts starting with T