Temperature Guide
Master the temperature parameter to control creativity and consistency in AI responses.
What is Temperature?
Temperature controls the randomness of AI responses on a scale from 0.0 to 2.0.
0.0 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 2.0
Deterministic Random
Consistent Creative
Focused Diverse
How It Works
Low Temperature (0.0 - 0.3)
Behavior: Predictable, consistent, focused
Characteristics:
- ✅ Same input → Same output (mostly)
- ✅ Picks most probable tokens
- ✅ Factual and conservative
- ❌ Less creative
- ❌ Can be repetitive
Use When:
- Factual accuracy is critical
- Consistency matters
- Following templates
- Data extraction
- Classification tasks
Examples:
Temperature: 0.1
Prompt: "What is 2+2?"
Response: "4" (always)
Temperature: 0.1
Prompt: "Classify this email as spam or not spam"
Response: Highly consistent classification
Medium Temperature (0.4 - 0.9)
Behavior: Balanced creativity and consistency
Characteristics:
- ✅ Good variety
- ✅ Mostly coherent
- ✅ Creative but controlled
- ✅ Natural-sounding responses
Use When:
- General conversation
- Customer support
- Content generation
- Most use cases
Examples:
Temperature: 0.7 (DEFAULT - RECOMMENDED)
Prompt: "Write a welcoming email to a new customer"
Response: Friendly, natural, varied responses
High Temperature (1.0 - 2.0)
Behavior: Creative, diverse, unpredictable
Characteristics:
- ✅ Highly creative
- ✅ Unexpected ideas
- ✅ Diverse outputs
- ❌ Less factual
- ❌ May be incoherent
- ❌ Unpredictable quality
Use When:
- Creative writing
- Brainstorming
- Generating diverse options
- Experimental prompts
Examples:
Temperature: 1.5
Prompt: "Write a creative product description"
Response: Highly varied, creative, sometimes unexpected
Temperature by Use Case
| Use Case | Recommended Temperature | Why |
|---|---|---|
| Code Generation | 0.2 - 0.4 | Need accuracy, syntax correctness |
| Data Extraction | 0.0 - 0.2 | Consistency critical |
| Classification | 0.0 - 0.3 | Same input should give same category |
| Customer Support | 0.5 - 0.8 | Balance helpful & natural |
| Content Writing | 0.7 - 1.0 | Creative but coherent |
| Brainstorming | 1.0 - 1.5 | Maximum creativity |
| Translation | 0.3 - 0.5 | Accurate but natural |
| Summarization | 0.3 - 0.6 | Factual with some flexibility |