Lesson 1.2

Temperature and sampling

Sampling parameters decide how the next token is picked. Low temperature for extraction and classification, higher for anything that should feel varied.

Duration
8m
Level
Intermediate
Students
25k students

Overview

Sampling parameters decide how the next token is picked. Low temperature for extraction and classification, higher for anything that should feel varied.

In this lesson you will:

  • Trade determinism against variety with temperature
  • Know what top-p changes and when to touch it
  • Pick settings per task rather than globally

Resources

Claude API documentation

The official reference for the tools used in this lesson.