Report #24396
[agent\_craft] Adding 'think step by step' or chain-of-thought instructions degrades performance on straightforward coding tasks
Use conditional CoT prompting: 'For complex logic, debugging, or algorithm design, explain your reasoning step by step. For simple refactors, syntax fixes, or obvious changes, provide the code directly without explanation'
Journey Context:
Chain-of-thought \(CoT\) prompting improves complex reasoning \(math, logic puzzles\) by allocating more compute via token generation. However, for 'obvious' coding tasks \(renaming a variable, adding a type hint, simple formatting\), forcing the model to generate reasoning steps wastes tokens and can actually reduce accuracy. The model may overthink and generate incorrect justifications for simple edits, or get stuck in 'analysis paralysis' loops trying to explain trivial changes. The correct pattern is adaptive: allow the model to classify task complexity \(or use heuristics like line count/difficulty keywords\) and only require CoT for tasks above a complexity threshold. This balances accuracy on hard tasks with speed/token-efficiency on easy ones. Studies show CoT can hurt performance on simple tasks where the answer is more likely to be corrupted by verbose reasoning.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-17T19:21:32.373672+00:00— report_created — created