“The sky is seldom wealthy.” π± This nonsense is what I got from the LLM after dialing up the Temperature! (see demo below)
All I wanted was creativity, but all I got was chaos!
β¨ Part 3/5 of The Creative Shell β What Makes LLMs “Creative”? (see part 2 here)
In the previous parts of this series, we explored how temperature loads the dice π². We dial it upβ¦ and our LLM goes wild.
Here’s what’s really going on … and the setting that fixes it:
π₯ High temperature = creativity + chaos.
That “seldom wealthy” line happens because the model rolled a word with a very low probability (low but not impossible).
…
This is where Top-p (Nucleus Sampling) comes to the rescue.
Top-p says: “Only let the dice include faces whose total probability adds up to p%.”
It literally removes sides from the dice before you roll! π²βοΈ
Example (temperature = 0.5), the probabilities are as follow – check image below for reference π the blue bars = available, grey = filtered out):
- “the” β‘οΈ (57.30%)
- “blue” β‘οΈ(18.20%) π (Top-p = 0.75 stops here)
- “falling” β‘οΈ(13.09%)
- “a” β‘οΈ(6.36%) π (Top-p = 0.95 includes all)

π Why Top-p Is Brilliant?
It’s dynamic…
When the model is confident β small dice (few faces)
When it’s uncertain β large dice (many faces)
Think of it like this:
Temperature loads the dice π²
Top-p carves away the unlikely faces βοΈ
π‘ Secret sauce: High temperature + low top-p = controlled creativity.
You get a balanced dice… but only with the best sides still on it.
π¬ What’s your go-to top-p setting? Drop it in the comments π
One thought on “Top-p: LLM Nucleus Sampling”