Example

Example of a Few-Shot CoT Prompt with Mean Square Demonstration

To improve a Large Language Model's performance on algebraic calculations, a few-shot Chain-of-Thought prompt can incorporate detailed problem-solving steps from a similar problem. For instance, a prompt can demonstrate the step-by-step calculation for the mean square of 1{}1, 3{}3, 5{}5, and 7{}7, which involves squaring each number (12=1{}1^2 = 1, 32=9{}3^2=9, 52=25{}5^2=25, 72=49{}7^2=49), summing the squares (1+9+25+49=84{}1+9+25+49=84), and dividing by the count (84/4=21{}84 / 4 = 21). By learning from this reasoning process, the model can successfully determine the average of 2{}2, 4{}4, and 9{}9 by computing the sum (2+4+9=15{}2 + 4 + 9 = 15), dividing by the count (15/3=5{}15 / 3 = 5), and arriving at the correct final answer of 5{}5.

0

1

Updated 2026-04-30

Contributors are:

Who are from:

Tags

Foundations of Large Language Models

Ch.3 Prompting - Foundations of Large Language Models

Foundations of Large Language Models Course

Computing Sciences