12.1 Chain-of-Thought & Deliberate Prompting

Standard prompting directly asks a model for an answer, which can lead to errors in complex reasoning tasks. Chain-of-Thought (CoT) prompting is a technique that encourages the model to "think step by step," breaking down a problem into intermediate reasoning steps before giving a final answer. This significantly improves performance on arithmetic, commonsense, and symbolic reasoning tasks.

Interactive Chain-of-Thought Example

Click the button below to see how CoT prompting guides the model through a reasoning process for a word problem.

Zero-Shot vs. Few-Shot CoT

  • Zero-Shot CoT: This is the simplest form, where you append the phrase "Let's think step by step" to the end of your prompt. This simple instruction is often enough to trigger the model's internal reasoning process.
  • Few-Shot CoT: In this approach, you provide one or more examples (shots) in the prompt that demonstrate the step-by-step reasoning process. The model then follows this format for the new query. This is generally more reliable than zero-shot CoT.

Deliberate Prompting

Deliberate Prompting (or "Self-Critique") is an extension of CoT. After generating an initial reasoning chain and answer, the model is prompted to critique its own work and identify potential errors. It then re-solves the problem, taking the critique into account. This two-pass process helps the model refine its answer and catch mistakes.

The process typically looks like this:

  1. Initial Prompt: Solve the problem step-by-step.
  2. Model Generates: A full chain of thought and a final answer.
  3. Critique Prompt: "Are there any errors in the reasoning above? Double-check the calculations and logic."
  4. Model Generates Critique: Identifies a flaw (e.g., "The calculation in step 2 was incorrect").
  5. Final Prompt: "Based on your critique, provide the corrected answer."