Temperature

온도

A sampling setting that sharpens or flattens the probability distribution for the next token.

···
html
<div class="scene"><div class="heading">NEXT TOKEN PROBABILITY</div><div class="temp">온도 <b class="mono" id="temp-value">0.2</b></div><div class="bars"><div><span>답 A</span><i id="bar-a"></i></div><div><span>답 B</span><i id="bar-b"></i></div><div><span>답 C</span><i id="bar-c"></i></div></div></div>
css
.scene{width:min(94vw,800px);height:min(88vh,326px);padding:clamp(10px,2.7vmin,19px);border:1px solid var(--line);border-radius:13px;background:var(--surface);font:500 clamp(13px,2.4vmin,17px)/1.3 var(--font-sans,sans-serif);position:relative;overflow:hidden}.scene .mono{font-family:ui-monospace,SFMono-Regular,monospace}.scene .muted{color:var(--muted)}.scene .accent{color:var(--accent)}.scene .heading{font-weight:750;color:var(--accent);margin-bottom:clamp(5px,1.6vmin,12px)}.temp{margin:4px 0 7px}.bars{height:65%;display:flex;flex-direction:column;justify-content:space-around;gap:6px}.bars div{display:flex;align-items:center;gap:8px}.bars span{width:44px}.bars i{height:clamp(15px,5vmin,28px);display:block;background:var(--accent);border-radius:4px;transition:width .7s}.bars div:nth-child(2) i{background:var(--accent-2)}.bars div:nth-child(3) i{background:var(--accent-3)}
js
let high=false;function draw(){high=!high;document.getElementById('temp-value').textContent=high?'1.0':'0.2';(high?[52,31,17]:[83,14,3]).forEach((n,i)=>document.getElementById(['bar-a','bar-b','bar-c'][i]).style.width=n+'%')}draw();setInterval(draw,1600)

Temperature adjusts next-token probabilities derived from model scores. Lower values concentrate probability on top candidates; higher values give alternatives more chance.

The demo compares distributions over the same options at low and high settings. Higher temperature does not imply more factual answers, and other sampling controls also matter.

When to use

Use it when tuning the balance between varied and consistent outputs.

Open as page ↗