Temperature: The Creativity Dial

** Prompt Engineering: Mastering AI Communication from Zero to Expert
Lesson Content
0% Complete

Learning Objectives:

(1) Define Temperature and its operational range.

(2) Predict output behavior at low, medium, and high Temperature values.

(3) Select the correct Temperature for 5 different use cases.

What Is Temperature?

Temperature controls the randomness and diversity of the model’s output. Mathematically, it scales the probability distribution of next-token selection — making high-probability tokens even more dominant (low temperature) or flattening the distribution so lower-probability tokens get more chances (high temperature).

MENTAL MODEL

Temperature is like the creativity dial on a writer.

Temperature = 0 is a precise technical writer who always says the safest, most expected thing.

Temperature = 1 is a creative director who surprises you with unexpected word choices and imaginative ideas.

Temperature × Use Case Decision Matrix

Temperature range and behavior

Use Case

Recommended Temperature

Why

Code Generation

0.2

Correctness over creativity — syntax must be exact

Data Analysis Scripts

0.2

Deterministic, follows established patterns

Code Comments

0.3

Slightly varied but still precise and relevant

Chatbot Responses

0.5

Natural conversation — coherent but not robotic

Marketing / Copywriting

0.7

Diverse vocabulary, punchy and engaging

Creative Writing / Stories

0.7–0.8

Exploratory, imaginative, emotionally resonant

Brainstorming / Ideation

0.9–1.0

Maximum diversity of ideas — quantity over precision

note: Some model scale varies between 0 to 2

 

Course Outline