liveBook · Manning

Temperature scaling

As explained in Build AI Drug Discovery Pipelines

Temperature sampling generates tokens from probabilities obtained by scaling logits with a temperature parameter that controls randomness and diversity.

Temperature sampling controls randomness when a sequence decoder generates molecular SMILES tokens. The decoder scales its logits before sampling: lower temperatures favor conservative outputs, while higher temperatures increase diversity. section 10.4.3

Use temperature scaling to adjust the balance between:

  • Conservatism: lower values make generated molecules less diverse. section 10.4.3
  • Diversity: higher values broaden the decoder's sampled outputs. section 10.4.3
  • Generation quality: temperature interacts with decoding strategy and can affect downstream molecule quality. section 10.4.3

Sampling molecules from a latent vector

A VAE decoder can generate SMILES from a latent vector z by starting with a start-of-sequence token, predicting tokens step by step, and applying a chosen temperature until an end token or maximum length is reached. The implementation exposes temperature with a default of 1.0. section 10.4.3

How Build AI Drug Discovery Pipelines covers it

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 it assumes
Assumes familiarity with decoder probabilities and SMILES tokens while contrasting temperature sampling with greedy decoding.
What you can do after
Apply it via a sequence decoder to trade conservative molecular outputs against greater sampling diversity.
How it connects
Connects decoding strategy, greedy decoding, logits, latent vectors, SMILES, and sequence decoders.

Also explained in

Compare how 2 books explain temperature scaling →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Build AI Drug Discovery Pipelines. The section links point to the parts of the book it draws on.