Skip to content
프로젝트

소개

Code and data for the Chain-of-Draft (CoD) paper

AI 및 머신러닝

이 수치를 측정하는 방법

측정된 스타 증가

in 24h
0
in 7 days
0
in 15 days
0
in 1 month
기록 수집 중

서로 겹치는 기간의 순증가량이며 일별 합계가 아닙니다. 측정값이 없으면 비워 둡니다. 스타는 관심도를 나타내며 품질을 보장하지 않습니다.

README.md

Original

Chain of Draft: Thinking Faster by Writing Less

[Paper]

Large Language Models (LLMs) have demonstrated remarkable performance in solving complex reasoning tasks through mechanisms like Chain-of-Thought (CoT) prompting, which emphasizes verbose, step-by-step reasoning. However, humans typically employ a more efficient strategy: drafting concise intermediate thoughts that capture only essential information. In this work, we propose Chain of Draft (CoD), a novel paradigm inspired by human cognitive processes, where LLMs generate minimalistic yet informative intermediate reasoning outputs while solving tasks. By reducing verbosity and focusing on critical insights, CoD matches or surpasses CoT in accuracy while using as little as only 7.6% of the tokens, significantly reducing cost and latency across various reasoning tasks.

Usage

To run evaluation:

python evaluate.py \
    --task gsm8k \      # Task to evaluate (options: gsm8k, date, sports, coin_flip)
    --model gpt-4o \    # Model to be evaluated
    --prompt cod \      # Prompting strategy (options: baseline, cod, cot)
    --shot 5 \          # [Optional] Number of few-shot examples to include in the prompt (uses all available examples by default if omitted)
    --url $BASE_URL \   # [Optional] Base URL for an OpenAI-compatible interface (e.g., locally hosted models)
    --api-key $KEY \    # [Optional] API key for model access (automatically loads from environment variables for Claude and OpenAI models if not provided)

Currently, the script supports Claude models, OpenAI models, as well as any model that uses an OpenAI-compatible interface. The evaluation results will be stored under ./results/.

All prompts and fewshot examples are stored under ./configs/{task}-{prompt}.yaml.

Citation

@article{xu2025cod,
    title={Chain of Draft: Thinking Faster by Writing Less},
    author={Xu, Silei and Xie, Wenhao and Zhao, Lingxiao and He, Pengcheng},
    journal={arXiv preprint arXiv:2502.18600},
    year={2025}
}

관련 프로젝트 살펴보기

불러오는 중…