Chain-of-thought prompting asks a language model to reason through intermediate steps before producing an answer. Adding “think step by step” can improve mathematical accuracy without providing examples, much like asking a student to show their work. The trade-off is longer output, higher latency, and a greater risk that the model continues after reaching the answer. section 7.1.3
Use chain-of-thought prompting with practical constraints in mind:
- Treat zero-shot chain-of-thought as a baseline rather than a guarantee; prompt-only reasoning can remain inaccurate. section 12.2.5
- Measure the prompt on a task-specific dataset instead of assuming that visible reasoning indicates correctness. section 12.2.5
- Optimize the reasoning prompt with demonstrations when basic step-by-step prompting leaves substantial accuracy on the table. section 12.2.5
A DSPy math baseline and optimization
A zero-shot DSPy prompt instructs the model to think step by step while returning only the answer. On GSM8K, the Llama 3 baseline reaches 14.5%, compared with 1%–5% without prompting. DSPy’s ChainOfThought module, optimized with BootstrapFewShot, reaches 74.5% on the evaluation shown. section 12.2.5

















