179 questions
No questions match those filters.
What does temperature actually control in an LLM, and h...
This is one of the questions in the full AI/ML interview bank. Pro unlocks all 1789 questions; Premium includes the same bank plus the highest daily Practice limit.
See plansTemperature is a single scalar dividing the logits before softmax, so its effect is entirely about how peaked or flat the resulting probability distribution is over the vocabulary — it doesn’t change which tokens are possible, only how sharply the model prefers the top few. That’s why temperature 0 isn’t “no randomness added” in some vague sense; it’s the limiting case where the distribution collapses onto the single highest-probability token, making generation fully deterministic for a fixed prompt and model.
The practical calibration is by task, not by preference: a customer-support classifier or a JSON extraction endpoint wants temperature at or near 0, because the “correct” answer is usually unique and variance is pure downside. A brainstorming assistant or a creative-writing tool wants temperature closer to 0.7–1.0, because variety across generations is the actual product. Going above roughly 1.2–1.5 usually degrades into incoherence rather than useful creativity, since the distribution flattens enough that low-probability, off-topic tokens start getting sampled regularly.
Top-p and top-k are complementary controls, not substitutes: top-p caps the candidate set to the smallest group of tokens whose combined probability crosses a threshold, which adapts automatically to how confident the model is at each step, while top-k fixes a hard candidate count regardless of confidence. Production systems typically set a moderate top-p (0.9–0.95) alongside a task-appropriate temperature, rather than relying on temperature alone to control output quality.