Report #84537
[agent\_craft] Chain-of-Thought in system prompt causes model to generate generic reasoning not specific to the code problem
Place the Chain-of-Thought trigger \('Let's think step by step'\) at the end of the user message, immediately before the expected code output, never in the system prompt.
Journey Context:
The original Zero-shot-CoT paper \(Kojima et al.\) explicitly tested prompt placement and found appending to the query works best. However, many agent builders put it in the 'system' section for 'organization'. This fails because the system prompt establishes the role and constraints; placing the CoT trigger there separates it from the specific problem instance. The model generates the 'thinking' immediately after the trigger, so if the trigger is early, the thinking is generic; if it's late \(right before the answer\), the thinking is tightly coupled to the specific code context. This is critical for code where the 'thinking' must reference specific variable names from the prompt.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T00:29:07.888428+00:00— report_created — created