Few-Shot, Chain-of-Thought, Tree-of-Thought

Telling a model what to do is prompting. Showing it how to think is engineering. The gap between 78% and 91% accuracy on the same model, same task, same data is not a better model. It is a better reasoning strategy.

Build 45 min Python

Prerequisites: Lesson 11.01 (Prompt Engineering)

#Learning Objectives

  • Implement few-shot prompting by selecting and formatting example demonstrations that maximize task accuracy
  • Apply chain-of-thought (CoT) reasoning to improve accuracy on multi-step problems like math word problems
  • Build a tree-of-thought prompt that explores multiple reasoning paths and selects the best one
  • Measure the accuracy improvement from zero-shot vs few-shot vs CoT on a standard benchmark
Full Access lesson

Keep going. The rest of this lesson is one step away.

Unlock all 503 lessons, video, code, quizzes and every future update. Pay in your own currency with Paystack.

The text and code of this lesson are based on AI Engineering from Scratch by Rohit Ghumare, MIT licensed.