Khemshieldhemshield
AI Parameters Explained

What are
Temperature & Top_p?

Two dials that control how an AI picks its next word, and why they matter more than you think.

🌡️
temperature
Reshapes the probability curve, makes it steep or flat
Analogy

Imagine a student answering a quiz. At temperature = 0, they always write the safest, most obvious answer, "The capital of France is Paris." At temperature = 2, they've had three energy drinks: they might still say Paris, but could also say "the city where croissants rule the universe." The knowledge is the same, what changes is how willing they are to take a risk on an unusual answer.

temperature =1.0
0: Always predictable1: Default2: Very random

Next-word probabilities for: "She felt very ___"
🎯
top_p
Cuts words below a cumulative probability threshold
Analogy

Imagine a chef choosing a dish for tonight's special. Before deciding, they first write a shortlist: the most likely options that together cover 90% of what guests might want. Anything below that, the pickled seaweed ice cream, gets crossed off entirely, no matter what. Top_p is that shortlist threshold. At top_p = 1.0, nothing is crossed off. At top_p = 0.1, only the top one or two dishes survive.

top_p =1.00
0.01: Only the top word0.5: Shortlist1.0: All words allowed

Next-word probabilities for: "She felt very ___"
Both working together
See the two-stage process, then run the lottery to pick a word
Stage 1: Temperature

Reshapes all probabilities. High temp = flat curve. Low temp = steep curve.

Stage 2: Top_p

Walks down the reshaped list, adds up probabilities, cuts off the tail.

Stage 3: Sample

Randomly draws one word from what's left, weighted by its probability.

temperature =1.0
top_p =1.00
🌡 Temperature applied 🎯 Top_p: all words in pool 7 words in lottery
Probability after both parameters
Hit the button to sample a word from the current distribution
Quick presets
Click to load common use-case combinations into all three sections

Side-by-side comparison

Key differences at a glance

Propertytemperaturetop_p
What it doesReshapes probabilities, stretches or squashes the whole curveHard filters, removes words below a cumulative threshold
AnalogyA student's risk appetite on an examA chef's shortlist before choosing tonight's special
At minimum0 → always picks the single most likely word~0 → only one word survives the cut
At maximum2 → all words become nearly equally likely1.0 → every word in the vocabulary is allowed
Changes %?Yes, every word's probability shifts up or downNo, probabilities stay the same, words just get removed
Common default1.01.0 (effectively off)
Use both?Generally no, adjust one at a time. Temperature is your main dial; top_p is a safety net.