Google DeepMind 论文:LLM 无法自主生成真随机选择
DeepMind 实测发现 Gemini、Qwen3 都装不出真随机,攻击者胜率能被拉到 99.9%,写 Agent 的朋友记得在代码里生成随机数再传进去。
Google DeepMind 的论文测试了 Gemini、Qwen3 和 OLMo 三类模型,各让其从简单分布中采样 1024 次,结果显示所有统计检验均未通过,模型明显偏爱 7、42 或选项 C 等数字。调整 temperature 和 top-p 参数也无法解决该问题。在一个安全测试游戏中,真随机检查可让攻击者获胜 75%,而 Gemini 的选择让攻击者胜率高达 96.6% 到 99.9%。论文给出的解决办法是:由程序生成随机数后传入模型,而不是让模型自己随机。
New Google DeepMind paper finds that AI models cannot make truly random choices on their own, but larger models pick correctly when a computer program gives them a random number first.
Agents often need to pick actions at random with set odds, like checking servers in an unpredictable order. LLMs say they will pick uniformly, then keep landing on favorites like 7, 42, or answer C.
They asked Gemini, Qwen3, and OLMo models to sample from simple distributions 1024 times each. They also tried other temperature and sampling settings, and gave models a random number to convert.
Every reported statistical test for matching the target odds failed, and changing temperature or top-p did not fix it. In a security game where truly random checks let attackers win 75% of the time, Gemini's picks let them win 96.6% to 99.9%.
If your agent needs randomness, generate it in code and pass it in, instead of asking the model to be random.