【ゆっくり解説】なぜAIは、同じ質問に毎回ちがう答えを返すのか|温度0でも揺れる本当の理由
AIゆっくり探究所
0:00 / 0:00
【ゆっくり解説】なぜAIは、同じ質問に毎回ちがう答えを返すのか|温度0でも揺れる本当の理由
580 просмотров · 5 дней назад
AIゆっくり探究所
283 подписчика
580 просмотров · 5 дней назад
AIに同じ質問を2回すると、答えが変わることがあります。この動画はその理由を2つに分けて、論文と開発元の説明書の原文で確かめます。
1つめは、作る側がわざと入れている揺れです。AIは次の1語を、候補ぜんぶに確率をつけた表からくじで引いています。毎回いちばん確率の高い語だけを選ばせると、2019年の研究では GPT-2 の文の73.66%が同じ言い回しの繰り返しに落ちました(人が書いた文は0.28%)。
2つめは、誰も入れたつもりのない揺れです。「温度」を0にしてくじをやめても、答えは完全には同じになりません。2025年の Thinking Machines Lab の実験では、温度0で同じ質問を1000回して答えは80種類。原因は、コンピューターの小数の足し算が足す順番で変わることと、サーバーが同じ時間にまとめて計算する人数によってその順番が変わることでした。揺れを止めることはできますが、そのぶん遅くなります。
■ 主な出典
・Holtzman ほか "The Curious Case of Neural Text Degeneration"(2019) https://arxiv.org/abs/1904.09751
・Thinking Machines Lab "Defeating Nondeterminism in LLM Inference"(2025) https://thinkingmachines.ai/blog/defe...
・Anthropic API リファレンス(temperature) https://docs.anthropic.com/en/api/mes...
・OpenAI Cookbook "Reproducible outputs with the seed parameter" https://cookbook.openai.com/examples/...
・Hugging Face "How to generate text" https://huggingface.co/blog/how-to-ge... / GPT-2 のドキュメント https://huggingface.co/docs/transform...
・Python ドキュメント「浮動小数点演算、その問題と制限」 https://docs.python.org/3/tutorial/fl...
・Goldberg "What Every Computer Scientist Should Know About Floating-Point Arithmetic" https://docs.oracle.com/cd/E19957-01/...
・Google Cloud "bfloat16" https://cloud.google.com/tpu/docs/bfl...
・Anyscale "Continuous batching" https://www.anyscale.com/blog/continu...
・"Non-determinism in GPT-4 is caused by Sparse MoE" https://152334h.github.io/blog/non-de...
・LMSYS "Towards Deterministic Inference in SGLang"(2025) https://lmsys.org/blog/2025-09-22-sgl...
・vLLM "Batch Invariance" https://docs.vllm.ai/en/latest/featur...
・"Same Request, Different Answer"(2026) https://arxiv.org/abs/2609.04748
・Xu ほか "Learning to Break the Loop"(2022) https://arxiv.org/abs/2206.02369
・Peeperkorn ほか "Is Temperature the Creativity Parameter of Large Language Models?"(2024) https://arxiv.org/abs/2405.00492
・Shi ほか "A Thorough Examination of Decoding Methods in the Era of LLMs"(2024) https://arxiv.org/abs/2402.06925
・Wang ほか "Self-Consistency Improves Chain of Thought Reasoning"(2022) https://arxiv.org/abs/2203.11171
・"When Self-Consistency Backfires"(2026) https://arxiv.org/abs/2608.11403
・Jentzsch & Kersting "ChatGPT is fun, but it is not funny!"(2023) https://arxiv.org/abs/2306.04563
・Kirk ほか "Understanding the Effects of RLHF on LLM Generalisation and Diversity"(2023) https://arxiv.org/abs/2310.06452
・Zhang ほか "Verbalized Sampling"(2025) https://arxiv.org/abs/2510.01171
■ 注意
くじ箱・札・電卓などの図は仕組みを説明するための模式図です。実験の数字はそれぞれの論文・記事の条件でのもので、どのAIサービスでも同じになるとは限りません。
■ 章
0:00 導入
1:38 第1章 次の1語のくじ引き
3:20 第2章 1番だけを選ぶと壊れる
5:57 第3章 温度と札の捨て方
7:54 第4章 温度0でも変わる
10:24 第5章 小数の足し算は順番で変わる
12:49 第6章 隣の誰かが順番を変える
16:58 第7章 揺れを止める代償
18:46 第8章 揺れの使い道と足りない揺れ
───
音声合成: AquesTalk (株式会社アクエスト) https://www.a-quest.com/
BGM: OpenTracks(旧DOVA-SYNDROME)「プラネタリウムガーデン」「さみしいおばけと東京の月」「YOIYAMI-宵闇-」「Serene」「Fireworks」
写真: Richard Feynman 1959(Public domain) https://commons.wikimedia.org/wiki/Fi...
写真: NVIDIA H100 (极客湾Geekerwan) 002(CC BY 3.0・一部を切り抜き) https://commons.wikimedia.org/wiki/Fi...
この動画は東方Projectの二次創作です。