From: aidotengineer
Chain of Thought (CoT) prompting is a revolutionary technique in prompt engineering that has proven particularly effective, especially for “test time compute” [00:00:30]. It is considered one of the most effective and topical methods [00:02:08].
What is Chain of Thought Prompting?
Chain of Thought prompting involves instructing a language model (LLM) to explicitly reason or think about a problem or solution before providing its final answer [00:02:27].
Key Characteristics and Benefits
- Problem Decomposition It breaks down complex problems into smaller, manageable sub-problems [00:02:38].
- Transparency It provides insight into the model’s thought process, which is beneficial for troubleshooting and understanding its reasoning [00:02:41].
- Wide Applicability CoT can be used with virtually any model [00:02:47].
- Ease of Implementation It is relatively easy to implement [00:02:51].
- Power and Integration It is so powerful that it is now being built directly into reasoning models, often making explicit prompting for reasoning unnecessary for these models [00:02:52].
Methods of Implementation
Zero-Shot Chain of Thought
The simplest way to implement CoT is to add a phrase to your prompt that encourages the model to think before generating the output [00:02:58]. Examples include:
- “Think step by step” [00:03:08]
- “Take a breath and take it through things” [00:03:10]
Few-Shot Chain of Thought
Another popular method involves providing few-shot examples that demonstrate the desired reasoning steps [00:03:14]. For instance, when solving math problems, you can include an example where the reasoning steps are explicitly shown [00:03:22].
Automated Chain of Thought Generation
LLMs can also be used to generate these reasoning chains [00:03:30].
- Automatic Chain of Thought is a framework that involves LLMs generating reasoning chains [00:03:32].
- Auto Reason is a single prompt that, when given a task or question, generates reasoning chains, often including few-shot examples of reasoning [00:03:39].
- DeepSeek’s R1 model training template leveraged this by having the model generate its thinking process within “think tags,” then using these generated reasoning chains to train the model to excel at Chain of Thought [00:03:53].
Chain of Thought with Reasoning Models
Reasoning models differ in how they work and how they should be prompted [00:06:51]. Research, including Microsoft’s MedPrompt framework and DeepSeek’s R1, has shown that for these models:
- Few-shot prompting can degrade performance by over-complicating things and confusing the model [00:07:06].
- More reasoning generally leads to better output [00:07:35]. Studies indicate that as the length of the thought process increases, accuracy and performance also increase [00:07:55].
- Minimal Prompting is Key A clear task description is often sufficient. While encouraging more reasoning can help with performance, explicitly instructing the model how to reason can actually hurt performance because it’s built into the model [00:08:09]. If few-shot prompting is used, it should be limited to one or two diverse examples [00:08:24].
CoT prompting, along with Few-shot prompting, are considered the most effective and topical methods in prompt engineering [00:02:08]. Many other reasoning prompts exist, often falling under the broader umbrella of general reasoning models [00:02:11].