Chain of Draft
Chain of Draft (CoD) is an advanced prompt engineering technique that encourages AI models to break down complex problems into smaller, logical steps before arriving at a final answer (like Chain of Thought), but it has some key differences that reduce latency and costs.
CoD comes from the paper "Chain of Draft: Thinking Faster by Writing Less". The paper highlights that while CoT tends to be verbose and detailed, "Humans typically employ a more efficient strategy: drafting concise intermediate thoughts that capture only essential information".
Benefits
- Improved accuracy on complex tasks
- More transparent reasoning process
- Better debugging of AI responses
- Reduced hallucinations
- More reliable outputs
- Low cost in terms of tokens
How it Works
CoD works by explicitly telling the AI to solve the problem step by step and by exposing to the user a minimum draft of its thinking process.
CoD Example (333 total characters)
Think step by step, but only keep a minimum draft for
each thinking step, with 5 words at most. Return the
answer at the end of the response after a separator
####.
Q: Jason had 20 lollipops. He gave Denny some
lollipops. Now Jason has 12 lollipops. How many
lollipops did Jason give to Denny?
A: 20 - x = 12; x = 20 - 12 = 8. #### 8
CoT Example (843 total characters)
Think step by step to answer the following question.
Return the answer at the end of the response after a
separator ####.
Q: Jason had 20 lollipops. He gave Denny some
lollipops. Now Jason has 12 lollipops. How many
lollipops did Jason give to Denny?
A: Let’s think through this step by step:
1. Initially, Jason had 20 lollipops.
2. After giving some to Denny, Jason now has 12
lollipops.
3. To find out how many lollipops Jason gave to
Denny, we need to calculate the difference between
the initial number of lollipops and the remaining
number.
4. We can set up a simple subtraction problem:
Initial number of lollipops - Remaining number of
lollipops = Lollipops given to Denny
5. Putting in the numbers: 20 - 12 = Lollipops given
to Denny
6. Solving the subtraction: 20 - 12 = 8
Therefore, Jason gave 8 lollipops to Denny.
####
8 lollipops
The CoD prompt explicitly tells the AI to think step by step and arrive at the final answer but to output a minimum draft for each thinking step. This will reduce latency because the output will be more concise and reduce costs because the output will use less tokens.