Temperature in the context of LLMs
When it comes to LLMs, the temperature parameter is one of the fundamental settings for controlling the variability of responses. A lower temperature, like zero, makes responses more deterministic and predictable, while higher values introduce a greater degree of unpredictability, which can be useful for tasks that benefit from more creative or diverse answers. In other words, in contexts where we need ideas, the temperature can be higher; in environments where being faithful to the results is required, the lower the temperature, the better.
How it works
Temperature essentially acts on the probability of choosing the next words during text generation.
- With a low temperature, responses are more consistent and less variable. The model is more confident when choosing words.
- With a high temperature, responses are less consistent and there is a chance of introducing incoherences or context drift, intended or not, which in some cases is called hallucination.
Billing in relation to temperature
Temperature is just a parameter, so it is not a pricing lever. Providers like OpenAI, Gemini and Groq share similar views on how to think about temperature, but they all stress that it is merely a control over the randomness of the generated text.
That doesn't mean it can't generate costs: it can create indirect costs in cases where it makes the model think more and talk more, increasing the number of output tokens and making usage more expensive. In more severe cases, it can increase the number of errors and, consequently, the number of retries.