Temperature scaling
Temperature scaling modifies model output logits or probabilities with a temperature parameter to control distribution sharpness, randomness, or sampling diversity.
Build AI Drug Discovery Pipelines
Temperature sampling generates tokens from probabilities obtained by scaling logits with a temperature parameter that controls randomness and diversity.
- How it is used
- Controls randomness and diversity during autoregressive molecular SMILES generation.
- How deep it goes
- Defines logit scaling and qualitative effects, but stops short of deriving the scaling formula.
- Examples
- Demonstrates stepwise SMILES generation from a latent vector with a configurable temperature.
- What you can do after
- Apply it via a sequence decoder to trade conservative molecular outputs against greater sampling diversity.
Read how Build AI Drug Discovery Pipelines explains temperature scaling →
Build an Advanced RAG Application (From Scratch)
Temperature sampling modifies next-token probabilities by scaling their log-probabilities with a temperature value before sampling.
- How it is used
- Controls randomness, diversity, and style during probabilistic next-token generation.
- How deep it goes
- Explains log-probability scaling, temperature effects, and trade-offs without detailing a full decoder implementation.
- Examples
- Contrasts near-zero, low, and high temperatures through deterministic, repetitive, creative, and potentially nonsensical outputs.
- What you can do after
- Apply temperature scaling to tune generated text toward repeatability or creativity.
Read how Build an Advanced RAG Application (From Scratch) explains temperature scaling →
Related concepts
- samplingkind of · Sampling is a procedure for selecting items from a collection or generating outcomes from a probability distribution according to a specified rule.
Questions about temperature scaling
What is temperature scaling?
Temperature scaling modifies model output logits or probabilities with a temperature parameter to control distribution sharpness, randomness, or sampling diversity.
Which Manning books explain temperature scaling?
Build AI Drug Discovery Pipelines and Build an Advanced RAG Application (From Scratch).
What kinds of temperature scaling are there?
Kinds of temperature scaling include attention temperature scaling.
What is temperature scaling a kind of?
Temperature scaling is a kind of sampling. Sampling is a procedure for selecting items from a collection or generating outcomes from a probability distribution according to a specified rule.
These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.

