Thermostat (source) shows what effect the temperature parameter has on LLMs.
Set the prompt at the top and tap “Generate” to watch how an LLM continues the prompt while the temperature changes for each token. Blue is cold, predictable and red is hot, uncommon, unhinged.
Advanced usage allows you to set the math function that produces the temperature when predicting each next output. 0.0 is extremely boring and predictable. 1.0 is normal. and 2.0 is hot and spicy.
Expressions are evaluated with math.js.
The variable i is the token index (0, 1, 2, ...). The result should be a non-negative number (temperature). All built-in math.js functions (sin, cos, abs, pow, sqrt, floor, ceil, min, max, mod, pi, e, etc.) are available, plus these extras:
| Function | Description |
|---|---|
sin01(x) | Sine normalized to 0-1 range |
sin01ma(t, period, offset, m, a) | Sine wave with period, offset, multiply, and add |
triangle(t) | Triangle wave (period 1) |
square(t) | Square wave, 0 or 1 (period 1) |
pulse(center, width, x) | Smooth bump centered at center |
stay01(t, period, offset, power) | Wave that holds at 0 and 1. Higher power = longer hold |
stay(t, lo, hi, period, offset, power) | Like stay01 but mapped to a custom range |
step(edge, x) | 0 if x < edge, else 1 |
smoothstep(lo, hi, x) | Smooth 0-to-1 transition between lo and hi |
map(v, lo1, hi1, lo2, hi2) | Remap v from one range to another |
map01(v, lo, hi) | Remap v from 0-1 to lo-hi |
mix(a, b, t) | Linear interpolation: a + (b - a) * t |
clamp(v, lo, hi) | Clamp v to [lo, hi] |
fract(v) | Fractional part (sawtooth wave) |
snap(v, step) | Quantize v to nearest multiple of step |
smin(a, b, k) | Smooth minimum (higher k = sharper) |
noise(x) | Deterministic pseudo-random, 0-1 |