Skip to content
Glossary · AI building blocks

Temperature (LLM setting)

Also called sampling temperature.

Definition

A setting that controls how random a language model's output is: lower is more predictable, higher is more varied.

Last updated

What it is.

At each step a model has a ranked list of possible next 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 it matters

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.

Watch out

Common mistakes.

  1. 01

    Raising temperature to fix wrong answers. It makes them less predictable, not more correct.

  2. 02

    Assuming low temperature means fully repeatable output.

  3. 03

    Tuning temperature before fixing the prompt and the data the model is given.

Tools

Work it out with a tool.

Related

Related terms.

Building something with this? Ask an engineer.

OceanLab designs and builds production software. Tell us what you are planning and we will reply with how we would approach it.

OceanLab

Enterprise Software Engineering - Human + AI

Languages

Locations

Global Headquarters

21 Merchant Road, 3rd Floor, Singapore 058267

Main corporate office and leadership operations

North America Office

548 Market Street, PMB 12472, San Francisco, CA 94104

Client operations and business development

India Office

402 Shivalik Shilp II, SG Highway, Ahmedabad 380015

Engineering and delivery center

© 2026 - Copyright. All Rights reserved OceanLab