用蒙特卡洛方法揭示贝叶斯Transformer的隐变量信念
What does a Bayes-filtered transformer believe? A predictive Monte Carlo approach

- 通过预测性蒙特卡洛采样直接估计模型内部的隐变量先验与后验
- 在0阶与1阶可交换任务中验证了该方法能复现已有现象
- 无需对比参考后验,即可从生成过程反推模型真实信念
贝叶斯滤波变压器(BFT)是一种在两步生成序列上训练的Transformer:首先从先验中抽取一个隐变量任务,然后根据该任务生成观测。在理想极限下,其下一个词的预测即为由该先验和条件分布诱导的贝叶斯后验预测分布(PPD)。然而实际训练的BFT仅是该理想分布的近似,引发关键问题:模型实际内化了怎样的隐变量先验与后验?现有方法通过将模型预测与多个“参考后验”进行比较来回答,但此类预测空间对比易受干扰——不同后验可能具有相同的后验均值预测。本文提出使用预测性蒙特卡洛(PMC)作为通用可解释性工具:仅依赖下一步词生成,即可在隐变量空间中逼近模型内化的先验与后验,直接回答该问题。我们将PMC应用于三类简化任务,覆盖0-Markov与1-Markov交换性场景。此前报告的现象在隐空间中依然清晰可见。代码已开源:https://github.com/afiq-aswadi/bft-pmc
原文摘要 · Abstract (English)
A Bayes-filtered transformer (BFT) is a transformer trained on sequences that are generated in two steps: first a latent task is drawn from a prior, then observations are drawn conditional on that task. Trained under autoregressive log loss, the BFT's next-token prediction, in the idealized limit, is the Bayesian posterior predictive distribution (PPD) induced by that prior and that conditional law. In practice the trained BFT is only an approximation of this ideal PPD, raising an interpretive question: what prior and posterior over the latent task has the trained BFT actually internalized? Existing work answers this question by comparing the trained BFT's predictions against the predictions of various "reference" posteriors, each standing in for a different candidate algorithm or computation the BFT might be implementing. This prediction-space comparison is fragile: different posteriors can share the same posterior-mean predictions. We use predictive Monte Carlo (PMC) as a general interpretability tool for any BFT: using only next-token generation, PMC returns an approximation to the implicit prior and posterior over the latent task, answering the interpretive question directly in latent space. We apply PMC to three stylized task families spanning 0-Markov and 1-Markov exchangeability. The phenomena previously reported in these settings remain visible in latent space. Code is available at https://github.com/afiq-aswadi/bft-pmc
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。