通过硬币翻转实验,发现大模型能像贝叶斯推理一样更新信念。
Enough Coin Flips Can Make LLMs Act Bayesian

- 用少量硬币翻转样例引导模型进行贝叶斯推理
- 足够多的示范使模型信念更新符合贝叶斯规律
- 模型偏差主要来自先验不准,而非推理机制错误
大型语言模型(LLMs)在输入提示中仅需少量示例即可实现泛化,这一能力被称为上下文学习(ICL)。我们研究了LLMs是否利用ICL以符合贝叶斯框架的方式进行结构化推理,还是仅依赖模式匹配。在受控的偏置硬币翻转设定下,我们发现:(1) LLMs通常具有偏倚的先验,导致零样本设置下的初始偏差;(2) 上下文证据强于显式偏倚指令;(3) LLMs总体遵循贝叶斯后验更新,偏差主要源于先验校准不足而非更新机制缺陷;(4) 注意力幅度对贝叶斯推断影响微乎其微。当通过ICL提供足够多的偏置硬币翻转示例时,LLMs会以贝叶斯方式更新其先验。
原文摘要 · Abstract (English)
Large language models (LLMs) exhibit the ability to generalize given few-shot examples in their input prompt, an emergent capability known as in-context learning (ICL). We investigate whether LLMs use ICL to perform structured reasoning in ways that are consistent with a Bayesian framework or rely on pattern matching. Using a controlled setting of biased coin flips, we find that: (1) LLMs often possess biased priors, causing initial divergence in zero-shot settings, (2) in-context evidence outweighs explicit bias instructions, (3) LLMs broadly follow Bayesian posterior updates, with deviations primarily due to miscalibrated priors rather than flawed updates, and (4) attention magnitude has negligible effect on Bayesian inference. With sufficient demonstrations of biased coin flips via ICL, LLMs update their priors in a Bayesian manner.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。