Crafting AI Prompts Framework

Chain of Thought (CoT) prompting

Last updated: Aug 1, 2026

Remember the good old times at school when we had to explain how we arrived at the conclusion of our math solutions? This approach also works remarkably well for Prompt Engineering and is called "Chain of Thought (CoT) prompting."

Chain of Thought prompting, is a technique used in working with large language models, where you break down a complex question or problem into a series of steps or a logical chain of thought. Instead of directly asking the model to generate a final answer, you instruct it to go through a reasoning process and provide a step-by-step explanation or solution.

The idea behind chain prompting is to guide the model through the thought process you want it to follow. By doing so, you can often get more accurate and detailed responses, especially for complex or multi-step problems. It encourages the model to think through the problem systematically, similar to how a human would explain their thought process when solving a problem.

Imagine the example below. If you simply ask the model to provide an answer, you might receive an incorrect output as it's merely "predicting" the answer.

CoT - Example one (wrong)

CoT - Example one (wrong)

However, if we apply the same method as we did in high school when solving math problems, where we had to provide a reasoning process, and then ask the model to do the same, you'll discover that the answer differs and, in this case, is correct:

CoT - Example two (correct)

CoT - Example two (correct)

By going through the reasoning process first, it helps ensure that the model reaches the correct final answer. This approach not only improves the accuracy of the response but also provides a clearer understanding of the thought process behind it. Incorporating this method as part of your "task - (t)" instruction following the Crafting AI Prompts Framework can lead to more reliable and informative outcomes.

When we instruct the model to generate a Chain of Thought without providing any specific examples, we're referring to Zero-Shot Chain of Thought. This means the model is generating the reasoning process based on its general knowledge and capabilities without any additional guidance or fine-tuning. If we provide additional examples to guide the reasoning process, we're referring to Single-Shot or Few-Shot Chain of Thought, which can be more effective for specific tasks or domains.


The three phases

CRAFT

Craft (write) the prompt with the following elements: Context, Register, Acting Role, Format, and Task.

ING

Validate the prompt and ensure it maintains an interactive approach. Keep in mind the importance of non-disclosure and staying goal-driven throughout the process.

AI

Continuously assess and refine the output based on the prompts output to improve the overall quality.

Terms of Service

Before accessing the "Prompt Injections" examples on our website, please read and agree to the following terms of service:

  1. Educational Purpose Only: The "Prompt Injections" examples provided are intended solely for educational purposes. They are meant to help you understand how prompt injections work and how to defend yourself against them.
  2. No Misuse: You agree not to use the provided examples for any malicious or unethical activities. This includes, but is not limited to, using prompt injections to manipulate, deceive, or harm others.
  3. Responsible Use: By accessing these examples, you confirm that your intention is to learn about the risks associated with prompt injections and to enhance your ability to safeguard against them.
  4. Legal Compliance: You agree to comply with all applicable laws and regulations while using the information provided on this website.
  5. No Liability: We are not responsible for any misuse of the information provided on our website. Users are solely responsible for their actions and any consequences that may arise from the use of this information.

By clicking "I agree," you accept these terms for this documentation visit. "I agree & save" remembers your choice for future visits in this browser. If you decline, the examples remain hidden.