把 temperature 設成 0,AI 就會每次都一樣嗎?
網路上常說:要 AI 每次給一樣的答案,把 temperature 設成 0 就好。但有人拿同一個 prompt、temperature 0 連跑 1000 次,還是冒出 80 種不同輸出。原因不是浮點誤差這麼簡單,而是它在 GPU 上跟多少別的請求湊成一批一起算。聊聊為什麼『最確定』不等於『可重現』。
網路上常說:要 AI 每次給一樣的答案,把 temperature 設成 0 就好。但有人拿同一個 prompt、temperature 0 連跑 1000 次,還是冒出 80 種不同輸出。原因不是浮點誤差這麼簡單,而是它在 GPU 上跟多少別的請求湊成一批一起算。聊聊為什麼『最確定』不等於『可重現』。
Ask an AI the same thing three times and you often get three different answers. It isn't being flaky — it never picks the single most-likely word, it draws one by probability. Here's the dial behind it, why even temperature 0 isn't fully repeatable, and why 'varies' isn't the same as 'making things up'.
同一個問題問 AI 三次,常常拿到三個不一樣的答案。不是它在亂講——它本來就不是每次都挑機率最高的那個字,而是照機率抽一個。用一個加權抽籤的畫面,聊聊它為什麼會飄,還有飄跟唬爛其實是兩回事。