Temperature

Temperature controls how random or creative the model’s output is.

It does NOT control intelligence. It does NOT control accuracy. It controls how much the model is willing to choose less-likely words.

Think of it as:

TemperatureBehavior
0.0Very deterministic
0.2Mostly predictable
0.5Balanced
0.8Creative
1.0+Very creative/random

The higher the temperature:

  • More variety
  • More creativity
  • More unexpected wording

The lower the temperature:

  • More consistent
  • More factual
  • More repeatable

Suppose the model wants to generate the next word.

WordProbability
Data60%
Information25%
Knowledge10%
Magic5%

Temperature = 0;
The model always picks “Data”. Because Probability is 60%.

Temperature = 0.5;
The model usually picks “Data”, sometime may pick “Information”

Temperature = 1.0;
The model may pick Data, Information, Knowledge

Temperature = 2.0;
“Magic” becomes one of options.
甚至可能选 Magic, 输出变得天马行空。

A Better Example,
Prompt:
Finish this sentence:
Azure Databricks is …

Set Temperature = 0

Response:

Azure Databricks is a cloud-based analytics platform.

Run again:

Azure Databricks is a cloud-based analytics platform.

Run again:

Azure Databricks is a cloud-based analytics platform.

Set Temperature = 0.7

Response 1:

Azure Databricks is a cloud-based analytics platform for big data processing.

Response 2:

Azure Databricks is a unified platform for data engineering and analytics.

Response 3:

Azure Databricks is a scalable environment for Spark workloads.

They are have approximate meaning, but description are different.

Real Enterprise Usage

ScenarioTemperature
SQL Generation0 ~ 0.2
PySpark Code0 ~ 0.2
RAG Q&A0.1 ~ 0.3
Agent Workflows0.3 ~ 0.7
Email Writing0.7
Blog Writing0.8
Creative Writing1.0+

For most enterprise RAG systems, temperature = 0.2, because Users want facts,
not creativity.