Chain of Thought
Chain of Thought (CoT) prompting is a technique used to improve the reasoning capabilities of large language models (LLMs) by guiding them through a series of intermediate reasoning steps.
CoT prompting encourages LLMs to articulate their reasoning process step-by-step, mimicking human-like problem-solving. Instead of directly answering a complex question, the model generates a sequence of thoughts that lead to the final answer. This approach enhances the model's ability to handle complex tasks, including arithmetic, commonsense reasoning, and symbolic manipulation, by breaking down the problem into smaller, more manageable steps. The effectiveness of CoT prompting often relies on providing examples of how to solve similar problems, demonstrating the desired reasoning path to the LLM. This technique is particularly useful in scenarios where the model's internal reasoning process is opaque, offering a way to make the model's decision-making more transparent and interpretable.
graph LR
Center["Chain of Thought"]:::main
Pre_philosophy["philosophy"]:::pre --> Center
click Pre_philosophy "/terms/philosophy"
Rel_prompt_engineering["prompt-engineering"]:::related -.-> Center
click Rel_prompt_engineering "/terms/prompt-engineering"
Rel_function_calling["function-calling"]:::related -.-> Center
click Rel_function_calling "/terms/function-calling"
Rel_machine_learning["machine-learning"]:::related -.-> Center
click Rel_machine_learning "/terms/machine-learning"
classDef main fill:#7c3aed,stroke:#8b5cf6,stroke-width:2px,color:white,font-weight:bold,rx:5,ry:5;
classDef pre fill:#0f172a,stroke:#3b82f6,color:#94a3b8,rx:5,ry:5;
classDef child fill:#0f172a,stroke:#10b981,color:#94a3b8,rx:5,ry:5;
classDef related fill:#0f172a,stroke:#8b5cf6,stroke-dasharray: 5 5,color:#94a3b8,rx:5,ry:5;
linkStyle default stroke:#4b5563,stroke-width:2px;
🧠 Knowledge Check
🧒 Explain Like I'm 5
It's like asking a friend to show their work when solving a math problem, instead of just giving the answer. This helps them think more clearly and get the right answer.
🤓 Expert Deep Dive
Chain-of-Thought prompting fundamentally alters the inference process of LLMs by introducing an explicit intermediate reasoning stage. Architecturally, it leverages the autoregressive nature of transformer models, encouraging the generation of a sequence of tokens that represent logical steps. This can be viewed as a form of implicit program synthesis or structured prediction, where the LLM generates a 'program' of reasoning steps before producing the final 'output'. The effectiveness stems from the model's ability to condition subsequent token generation on previously generated tokens, effectively creating a dynamic computational graph. Trade-offs include increased latency and token consumption. Vulnerabilities might arise if the intermediate steps are flawed, leading to 'garbage in, garbage out' despite the structured approach. Research explores methods to automatically generate CoT, optimize step granularity, and verify the logical consistency of the generated chains.