Free | No tracking | Every fact with a source|German and English

Glossary / Text and chat

Temperature – explained simply

The temperature controls how randomly a language model writes: low is predictable and factual, high is more varied and creative.

Also: Temperature, temperature, top_p, top_k

A language model calculates a probability for each possible next token and then selects one. At low temperature, it almost always picks the most likely token; at high temperature, less likely ones are also considered. Related settings are top_k and top_p, which limit the selection to the most likely candidates.

In Ollama, the default value according to the Modelfile documentation is 0.8. Lower values make sense for facts, summaries, and code, while higher values are better for stories and ideas. Very high values lead to confused or nonsensical answers.

What does that mean for you? For factual answers, set the temperature to about 0.2 to 0.5; for creative writing, more like 0.8 to 1.0.

Related terms

Sources