Temperature (sampling)
A parameter that controls how random an LLM's output is. Low temperature (near 0) makes the model focused and predictable (it almost always picks the most likely word); high temperature makes it more creative and varied — but also more prone to going off the rails.
Mechanic: before the model picks the next token it has a probability distribution over all possible tokens. Temperature scales the distribution: a low value "sharpens" it (the probability mass concentrates on the top candidates → nearly deterministic at 0), a high value "flattens" it (more tokens get a chance → more variation and unexpected choices). Rule of thumb: temperature ~0 for facts, code, and extraction (you want the right, stable answer); 0.7–1.0 for creative writing and idea generation. Often combined with top-p/top-k which prune which tokens even get to be considered. Too high a temperature gives incoherent nonsense. One of the most fundamental dials in LLM use. Related to nucleus sampling and top-k.