liveBook · Manning

Temperature

As explained in The Complete Obsolete Guide to Generative AI

Temperature is a generation parameter that controls the randomness or diversity of a language model's output.

Temperature is the randomness dial for language-model generation. Lower values make responses more focused and conservative; higher values make them more varied, creative, and unpredictable. The commonly described range is 0 to 2, with 1 as the default. section 2.7

Use temperature to match an output to its job. A hotel chatbot might need a restrained answer for a reliable recommendation, but a storytelling prompt can benefit from extra creative wiggle room. Temperature changes the model’s generation preferences alongside controls such as frequency penalties, presence penalties, and Top P. section 2.5 section 6.8

One restaurant question, two moods

For “Can you suggest a good restaurant nearby?”, a high setting such as 1.3 produces an imaginative answer with varied food options and an adventurous tone. A lower setting such as 0.2 gives a more focused recommendation, such as a specific Italian restaurant. Neither setting magically guarantees accuracy, so verify factual recommendations. section 2.7

Figure 2.6 Upper selection of tools in the Playground UI

Use the Playground controls to see temperature alongside other completion settings before transferring a configuration into programmatic API code. section 2.14 section 2.5

How The Complete Obsolete Guide to Generative AI covers it

How deep it goes
Defines the setting, gives its 0–2 range and default, and demonstrates contrasting outputs without explaining sampling internals.
Examples
Demonstrates restaurant recommendations at 1.3 and 0.2, plus a creative story prompt using 0.8.
What it assumes
Assumes basic prompt use; teaches the role of temperature before customized configurations require deeper technical background.
What you can do after
Operate temperature through the OpenAI Playground and transfer tested settings into API code.
How it connects
Connects temperature with completion configurations, prompt engineering, language models, Top P, and frequency and presence penalties.

Also explained in

Compare how 17 books explain temperature →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of The Complete Obsolete Guide to Generative AI. The section links point to the parts of the book it draws on.