Chain-of-Thought Prompting

CoT

التعليمات بالتفكير المتسلسل

Intermediateai-ml1 min read
CoTchain of thoughtstep-by-step reasoningscratchpad prompting

Definition

A prompting technique where you ask the LLM to reason step-by-step before giving its final answer, which significantly improves accuracy on complex tasks.

تقنية تعليمات تطلب فيها من النموذج التفكير خطوة بخطوة قبل إعطاء إجابته النهائية، مما يُحسّن الدقة بشكل ملحوظ في المهام المعقدة.

Why It Matters

CoT is one of the highest-impact prompt engineering techniques for tasks requiring logic or multi-step reasoning. If your AI feature makes decisions (classify, evaluate, diagnose), adding 'reason step by step' to your prompt will improve its accuracy with zero cost increase.

CoT هو أحد أكثر تقنيات هندسة التعليمات تأثيراً للمهام التي تتطلب منطقاً أو تفكيراً متعدد الخطوات. إذا كانت ميزة الذكاء الاصطناعي لديك تتخذ قرارات (تصنيف، تقييم، تشخيص)، فإن إضافة 'فكّر خطوة بخطوة' إلى تعليمتك سيُحسّن دقتها بدون أي زيادة في التكلفة.

Full Definition

Chain-of-Thought (CoT) prompting is the technique of instructing an LLM to show its reasoning before giving an answer. Instead of 'What is 37 × 48?', you ask 'What is 37 × 48? Think step by step.' The model then writes out its reasoning (37 × 40 = 1480, 37 × 8 = 296, 1480 + 296 = 1776) before answering. This dramatically improves accuracy on math, logic, and multi-step reasoning tasks. The key insight: by forcing the model to externalize its reasoning, it is less likely to take a wrong shortcut to the answer.
التعليمات بالتفكير المتسلسل (CoT) هي تقنية توجيه النموذج اللغوي الكبير لإظهار تفكيره قبل الإجابة. بدلاً من 'ما هو 37 × 48؟'، تسأل 'ما هو 37 × 48؟ فكّر خطوة بخطوة.' يكتب النموذج بعدها استدلاله (37 × 40 = 1480، 37 × 8 = 296، 1480 + 296 = 1776) قبل الإجابة. هذا يُحسّن الدقة بشكل كبير في مهام الرياضيات والمنطق والتفكير متعدد الخطوات. الرؤية الأساسية: بإجبار النموذج على إظهار تفكيره، يكون أقل عرضةً للقفز إلى إجابة خاطئة.

Example Usage

Weak: 'Is this customer support ticket urgent?' — LLM guesses. Strong: 'Is this customer support ticket urgent? Think step by step: (1) What is the user's stated problem? (2) Is money or data loss involved? (3) How many users are affected? (4) Based on this analysis, rate urgency: low/medium/high.' — LLM reasons through each step before deciding.

ضعيف: 'هل تذكرة دعم العملاء هذه عاجلة؟' — يخمّن النموذج. قوي: 'هل تذكرة دعم العملاء هذه عاجلة؟ فكّر خطوة بخطوة: (1) ما المشكلة التي صرّح بها المستخدم؟ (2) هل تتضمن خسارة مال أو بيانات؟ (3) كم عدد المستخدمين المتأثرين؟ (4) بناءً على هذا التحليل، قيّم الإلحاح: منخفض/متوسط/مرتفع.' — يُفكّر النموذج في كل خطوة قبل القرار.

Knowledge Graph

Avoid these mistakes when using Chain-of-Thought Prompting:

1

Using CoT for simple factual lookups — it adds tokens and cost without benefit for 'What is the capital of France?'

2

Not giving the model the reasoning steps to follow — 'think step by step' is good; defining the steps explicitly is better

3

Ignoring the reasoning in evaluation — read the CoT output; if the reasoning is flawed, the answer is wrong even if it looks correct

Sign in to unlock guided AI explanations from AI Teacher.

Generate a Prompt

Copy this prompt and use it directly with any AI model — no setup needed.

Ready-to-Use Prompt
Help me build a project using Chain-of-Thought Prompting.

Explain:
1. What is Chain-of-Thought Prompting and why it matters
2. The core architecture and required tools
3. Step-by-step implementation plan
4. Common mistakes to avoid: Using CoT for simple factual lookups — it adds tokens and cost without benefit for 'What is the capital of France?', Not giving the model the reasoning steps to follow — 'think step by step' is good; defining the steps explicitly is better, Ignoring the reasoning in evaluation — read the CoT output; if the reasoning is flawed, the answer is wrong even if it looks correct
5. Best practices and production tips

Official Resources