NeuroNomixer
  • Home
  • Blog
  • Visual Guides
  • Authors
  • Contact
Sign InSign Up
HomeBlogAuthorsContactPrivacy Policy

© 2026 NeuroNomixer — Built with Next.js & Tailwind CSS

Visual Guides/Temperature & Top-K: Controlling Creativity
LLMs

Temperature & Top-K

After producing logits, LLMs use sampling parameters to shape outputs. Adjust them below and watch the probability distribution reshape in real time.

Temperature adjusted
Top-K adjusted
Samples viewed: 0/3

Sign in to save progress

1. The Base Probabilities

Prompt: "The sky is ___", raw softmax at T=1.0

blue
52.4%
clear
17.4%
dark
12.9%
bright
7.8%
cloudy
5.3%
red
2.6%
falling
1.1%
hungry
0.5%

2. Temperature Slider

P(i) = exp(logit_i / T) / Σ exp(logit_j / T): higher T flattens the distribution.

Temperature (T)
1.0Balanced
0.1 Focused1.0 Balanced2.0 Creative3.0 Chaotic
blue
52.4%
clear
17.4%
dark
12.9%
bright
7.8%
cloudy
5.3%
red
—
falling
—
hungry
—

Turquoise = in Top-K pool · Gray = excluded

3. Top-K Sampling

Only sample from the K highest-probability tokens. Excluded tokens have their mass redistributed.

K value
K = 5Balanced
K=1 GreedyK=5 BalancedK=8 Open
blue
54.7%
clear
18.2%
dark
13.5%
bright
8.2%
cloudy
5.5%
red
—
falling
—
hungry
—

Probabilities are renormalized across included tokens.

4. Top-P (Nucleus) Sampling

Pick the smallest set of tokens whose cumulative probability ≥ P. Adapts to distribution shape.

P thresholdP = 0.90
blue
52.4%
clear
17.4%
dark
12.9%
bright
7.8%
cloudy
—
red
—
falling
—
hungry
—

Using 4 tokens

Cumulative: 90.6%

5. What Gets Generated

Five deterministic samples from the current T + Top-K distribution.

Sample 1:The sky isblue
54.7%
Sample 2:The sky isblue
54.7%
Sample 3:The sky isdark
13.5%
Sample 4:The sky isblue
54.7%
Sample 5:The sky isblue
54.7%

Real-world settings

Major LLM APIs (OpenAI, Anthropic) default to T=1.0 with no top-p cutoff, and what consumer apps like ChatGPT use internally is not published. In practice, developers often dial down to T≈0–0.3 for code and extraction tasks, and up to T≈0.9–1.1 for creative writing.

Up Next

Context Windows: What the Model Can See

Slide context length and test information retrieval at different positions.

Next Guide →
← Previous GuideNext Guide →