{"head":{"title":"What Is Temperature in an LLM? Definition | OceanLab","description":"Temperature is the setting that controls how random a language model's word choices are. What low and high values do, when to change it, and mistakes.","canonical":"https://oceanlab.in/glossary/temperature"},"crumbs":[{"name":"Home","path":"/"},{"name":"Glossary","path":"/glossary"},{"name":"temperature","path":"/glossary/temperature"}],"slug":"temperature","term":"Temperature (LLM setting)","aka":["sampling temperature"],"category":"AI building blocks","short":"A setting that controls how random a language model's output is: lower is more predictable, higher is more varied.","body":[["At each step a model has a ranked list of possible next ",{"href":"/glossary/token","text":"tokens"},". Temperature reshapes that list before one is picked. Low values make the top choice win almost every time, so answers are consistent. Higher values give less likely tokens more of a chance, so answers vary more."],["It is one of several sampling settings, alongside top-p and top-k. Some models, especially reasoning models, fix or ignore these settings, so check the provider's docs."]],"why":["Extraction, classification and code usually want consistency, so they run at low temperature. Brainstorming and creative writing can benefit from more variety. Even at the lowest setting, outputs are not always identical, so tests and checks are still needed."],"example":["A product team generates ten tagline ideas at a higher temperature to get variety, then uses a low temperature when the chosen tagline is turned into structured ad copy for every market."],"inBuild":null,"mistakes":[["Raising temperature to fix wrong answers. It makes them less predictable, not more correct."],["Assuming low temperature means fully repeatable output."],["Tuning temperature before fixing the prompt and the data the model is given."]],"related":[{"href":"/glossary/llm","label":"LLM (large language model)","detail":"An AI model trained on very large amounts of text that predicts the next piece of text, which lets it read, write and reason in language."},{"href":"/glossary/hallucination","label":"Hallucination (AI)","detail":"When an AI model produces information that is false or made up, presented as if it were true."},{"href":"/glossary/structured-output","label":"Structured output","detail":"Getting a language model to reply in a fixed, machine-readable format, such as JSON that matches a schema you define."},{"href":"/glossary/token","label":"Token (LLM)","detail":"The unit an AI language model reads and writes, and the unit most LLM APIs bill by."}],"tools":[{"href":"/tools/llm-model-picker","label":"LLM model picker","detail":"Free tool"}],"links":[{"href":"/ai","label":"AI by industry","detail":"AI use cases, costs and risks per industry."},{"href":"/pricing/categories/llm-api","label":"LLM API pricing","detail":"Model prices side by side, with sources."}],"sources":[],"legal":false,"updatedAt":"2026-10-25"}