PLAIN/TEXT — ISSUE 367/456 COMPUTER SCIENCE · FOUNDATION / AI SAMPLING · ~4 MIN READING DATE: 2027-10-03 ARCHIVE: https://plaintext.click/newsletter/ SUBJECT: What an AI temperature setting actually changes What an AI temperature setting actually changes =============================================== / START HERE A writing assistant can offer different continuations of the same sentence. Temperature is a numerical setting that changes how strongly a text generator favours its higher-scoring choices. It reshapes the chances of selection rather than changing the facts in the source material. / WHY NOW If you want varied headings, occasional lower-ranked choices can be helpful. If you want a repeatable extraction, that variation may be unwelcome. Understanding the setting means separating the model’s scores from the later decision about which piece of text to select. / THE IDEA The model first produces one score per possible next text piece. These scores are called logits; they are not yet probabilities. A function called softmax converts them into positive probabilities that add to one. Dividing scores by temperature before that conversion changes their relative influence. Lower positive temperatures enlarge score differences and concentrate probability on the leader. Higher temperatures compress differences and spread probability more evenly. Sampling then draws a choice using the resulting chances. The highest-scoring choice remains highest; its lead becomes stronger or weaker. / THE FORMAL IDEA p_j = exp(z_j/T) / Σ_k exp(z_k/T) - p_j = probability of choice j; z_j = its score; T = positive temperature. These numbers have no physical units; temperature here is not degrees. - exp(x) means e raised to x, with e about 2.718. Σ_k means add the expression for every possible choice k. / RUN THE TINY EXAMPLE Change one thing. Predict what happens. Two choices have scores ln(3) and 0. ln(3) means the power of e that gives 3, so exp(ln(3)) = 3. At T = 1, exponentials are 3 and 1: probabilities 3/(3 + 1) = 3/4 and 1/4. Change T to 0.5: the first exponent doubles, so its exponential becomes 3² = 9; the other remains 1. Probabilities become 9/(9 + 1) = 9/10 and 1/10: the leading choice is more dominant. Nothing new was learned about the sentence. Only the rule translating the same scores into selection chances changed. In repeated draws, the second choice becomes less common, not logically impossible. / SO WHAT? This also explains why temperature is not a factuality dial. A false but strongly favoured continuation can become even more dominant at low temperature. Checking evidence, constraining output and evaluating the task address different problems. Distinguish varied wording from improved reasoning before attributing a better answer to a single setting. / ONE CAVEAT These are invented scores. Other generation settings can filter or alter the probabilities too. Zero temperature is usually implemented as a special deterministic choice rule rather than literal division by zero. / KEEP THIS Lower temperature amplifies existing score differences; it does not supply missing evidence. / SOURCE TRAIL [1] Hugging Face — Generation configuration https://huggingface.co/docs/transformers/en/main_classes/text_generation [2] PyTorch — Softmax https://docs.pytorch.org/docs/stable/generated/torch.nn.Softmax.html NEXT: Why averaging cannot fix every measurement error --- HARD IDEAS. PLAIN TEXT. You are receiving this because you asked for one clear computer-science or physics idea each day. Unsubscribe: https://plaintext.click/unsubscribe View in browser: https://plaintext.click/newsletter/2027/10/2027-10-03-temperature-softmax.html From: Plain/Text / Brickston Consulting · 30 N Gould St Ste N, Sheridan, WY 82801 US · knowledge@plaintext.click