Chain-of-thought (CoT) asks the model to show intermediate reasoning before the final answer—often improving math and multi-step logic.
Prompt phrase
prompt = """Solve step by step. Show reasoning, then on the last line write:
FINAL_ANSWER: """
Hidden CoT in production
Many products use internal reasoning traces users never see—still log them carefully (may contain sensitive context).
Limits
CoT can hallucinate plausible steps. Always verify final answers with code execution, calculators, or retrieval—not faith in the narrative.
Important interview questions and answers
- Q: Does CoT guarantee correctness?
A: No—it improves some reasoning tasks but remains probabilistic.
Self-check
- Why separate FINAL_ANSWER line?
- One risk of logging chain-of-thought?
Tip: Parse a machine-readable FINAL_ANSWER line—do not regex free-form essays in CI.
Interview prep
- CoT risk?
Plausible reasoning steps can still be wrong—verify final answer.
- Hidden CoT?
Internal traces may leak sensitive context in logs—handle carefully.