Chain-of-thought prompting encourages a language model to write intermediate steps before giving an answer. A prompt can provide worked examples or simply ask the model to “think step by step”; the generated steps can help it reach a correct solution. section 16.4.4
At test time, systems can also search through possible reasoning steps in natural language, a form of test-time adaptation. This differs from fine-tuning, which updates model weights using generated answers. section 16.4.4 section 19.3.6
>>> gemma_lm.generate(PROMPT_TEMPLATE.format(prompt)) <start_of_turn>user Judy wrote a 2-page letter to 3 friends twice a week for 3 months. How many letters did she write? Be brief, and add "ANSWER:" before your final answer.<end_of_turn> <start_of_turn>model Here's how to solve the problem: * **Letters per week:** 3 friends * 2 letters/week = 6 letters/week * **Letters per month:** 6 letters/week * 4 weeks/month = 24 letters/month * **Letters in 3 months:** 24 letters/month * 3 months = 72 letters * **Total letters:** 72 letters * 2 = 144 letters ANSWER: 144<end_of_turn> >>> gemma_lm.generate(PROMPT_TEMPLATE.format(prompt)) <start_of_turn>user Judy wrote a 2-page letter to 3 friends twice a week for 3 months. How many letters did she write? Be brief, and add "ANSWER:" before your final answer.<end_of_turn> <start_of_turn>model Here's how to solve the problem: * **Letters per week:** 3 friends * 2 letters/week = 6 letters/week * **Letters per month:** 6 letters/week * 4 weeks/month = 24 letters/month * **Total letters:** 24 letters/month * 3 months = 72 letters ANSWER: 72<end_of_turn>
In the Judy letter problem, one generated response lays out its arithmetic but incorrectly counts the pages in each letter as additional letters. Intermediate steps make the mistake visible; they do not guarantee a correct answer. section 16.4.4

















