我們都知道,CoT的實(shí)現(xiàn)其實(shí)更多的是在提示詞中加入一句:Think Step By Step. 例如下面這個(gè)Prompt:
Think step by step to answer the following question. Return the answer at the end of the response after a separator ####.
CoD其實(shí)也類似,只需要在提示詞中加幾句話:
Think step by step, but only keep a minimum draft for each thinking step, with5 words at most. Return the answer at the end of the response after a separator ####.
輸出區(qū)別示例:對(duì)于同一個(gè)提問,
Q: Jason had 20 lollipops. He gave Denny some lollipops. Now Jason has 12 lollipops. How many lollipops did Jason give to Denny?
CoT回復(fù):
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
CoD回復(fù):
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
3. 效果驗(yàn)證
(1)基準(zhǔn)測試數(shù)據(jù)
任務(wù)類型
模型
CoT準(zhǔn)確率
CoD準(zhǔn)確率
Token節(jié)省率
數(shù)學(xué)推理(GSM8K)
Claude 3.5
95.8%
91.4%
79%
體育常識(shí)推理
GPT-4o
95.9%
98.3%
92.4%
代碼調(diào)試
DeepSeek-R1
87%
85%
83%
注:Code任務(wù)需放寬至每步10詞,但仍顯著優(yōu)于CoT
(2)延遲對(duì)比實(shí)驗(yàn)
在AWS g5.12xlarge實(shí)例上,處理1000次并發(fā)請(qǐng)求:
· CoT(200 Tokens):平均響應(yīng)4.2秒,費(fèi)用$0.15/千次
· CoD(40 Tokens):平均響應(yīng)1.0秒,費(fèi)用$0.03/千次
4. 總結(jié)
Chain of Draft并非簡單的“壓縮”,而是對(duì)LLM推理本質(zhì)的重新思考。它證明:高質(zhì)量的思維輸出無需冗長,關(guān)鍵信息的提取與傳遞才是核心。