liveBook · Manning

Randomization

As explained in Data Analysis with LLMs

Randomization is the introduction of stochastic variation during generation so repeated generation attempts can produce different outputs.

Randomization adds stochastic variation when mapping token scores to output tokens, allowing repeated generation from the same input to produce different replies. section 3.5.3

It balances diversity against usefulness: too little randomization makes outputs repetitive, while too much can disconnect them from the input and instructions. Choosing the right degree may require experimentation. section 3.5.3

Common ways to control randomization include:

  • Temperature: higher values increase randomization; lower values make the highest-scoring token more likely. Values range from 0 to 2, with a default of 1. section 3.5.3
  • Top_p: an alternative parameter for controlling how token scores become output choices. section 3.5.3

Regenerating an answer

When a ChatGPT reply is unsatisfactory, select Regenerate to request another answer to the same input. Randomization makes the second output likely to differ and potentially improve. section 2.2

Figure 2.3 After ChatGPT generates an answer, the Regenerate button appears below the generated response. Click this button to receive an alternative answer to your last input.
figure

Shows where the Regenerate control appears below a generated ChatGPT response. section 2.2

How Data Analysis with LLMs covers it

How deep it goes
Explains token-score selection, diversity tradeoffs, temperature behavior, and top_p, but stops short of deeper implementation details.
Examples
Demonstrates ChatGPT's Regenerate control producing a different answer to the same input.
What you can do after
Operate/configure generation by adjusting temperature or top_p and regenerating outputs when needed.
How it connects
Connects token scores with temperature, top_p, and output diversity.

Also explained in

Compare how 5 books explain randomization →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Data Analysis with LLMs. The section links point to the parts of the book it draws on.