acceptodds
Published as a conference paper at NeurIPS 2026

What does a Bayes-filtered transformer believe? A predictive Monte Carlo approach

Afiq Abdillah Effiezal Aswadi, Haotong Ma, Susan Wei

Abstract

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 idealised limit, is the Bayesian posterior predictive distribution (PPD) under this generative model. In practice the trained BFT is only an approximation of this ideal PPD, raising a natural interpretive question: what prior and posterior over the latent task has the trained BFT actually internalised? 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; for instance, distinct posteriors can share posterior-mean predictions exactly. We foreground 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 stylised task families spanning 0-Markov and 1-Markov exchangeability; the phenomena previously reported in these settings remain visible in latent space.

Keywords:
Sydney, Main Track

Reviews

Among:
Shape:
123456this paper, Top 24%
Figure 1. Mean review rating of the reviewed papers at NeurIPS 2026. This paper averages 4.67 over 3 reviews, above 76% of the others.
Reviewer_XX72OpenReview ↗
Rating
4
Clarity
3
Confidence
3
Originality
3
Quality
2
Significance
2
Read review
Summary

The authors study how to recover the latent beliefs of Bayes-filtered transformers beyond pre-existed predictive-space analyses. To address this, they propose Predictive Monte Carlo (PMC) that reconstructs implicit priors and posteriors from transformer-generated rollouts. Under some synthetic tasks, they prove that PMC recovers latent belief distributions and revisits previously observed in-context learning phenomena.

Strengths and weaknesses

Strengths

[S1] This paper has convincing motivation to address an underexplored question: how to recover and analyze the latent beliefs of transformers, not predictive distributions.

[S2] The proposed PMC only needs transformer-generated rollouts without access to internal activations, gradients, or model parameters.

[S3] They suggest a unified latent-space analysis across multiple Bayesian inference settings and reproduce previously reported in-context learning phenomena from a belief-space perspective.


Weaknesses

Major Weaknesses

[W1] Limited practical relevance of the experimental setting. Although the authors mentioned about this in limitations, all experiments are conducted in highly controlled Bayes-filtered synthetic environments. It makes unclear whether the proposed analysis extends to modern foundation models trained on realistic data distributions.

[W2] PMC relies on known latent task structures. It assumes access to a predefined latent variable, which is generally unavailable in realistic settings. Thus, I believe the applicability of PMC beyond toy Bayesian environments is doubtful.

[W3] I'm not sure about that PMC yields fundamentally new scientific insights. Most empirical findings revisit previously reported phenomena from a latent-space perspective. It would be more helpful if new conclusions can be obtained through PMC that are inaccessible from existing predictive-space analyses.

[W4] Analysis for the scalability and recovery of PMC are not sufficient. They should provide information about sample complexity, recovery error, or scalability to larger latent spaces and more realistic transformer settings, since they rely on extensive Monte Carlo rollouts.

Questions

[Q1] Could the authors discuss how PMC might extend to more realistic transformer settings, where the underlying data-generating process is unknown and the assumptions of exchangeability may not strictly hold?

[Q2] How would the PMC apply in settings where the latent task structure is unknown or not explicitly parameterized?

[Q3] Can the authors provide examples of conclusions that can only be obtained through PMC and would be difficult or impossible to recover from predictive-space analyses alone?

[Q4] Can I ask authors for some extra analysis regarding the reliability of the recovered posterior, such as recovery error, sensitivity to the number of rollouts, sample complexity, or scalability as the latent-space dimension increases?

Limitations

Authors adequately addressed the limitations and implications of their work.

Paper formatting concerns

None

Final justification

The rebuttal and discussion substantially addressed my main concerns. The authors clarified that PMC can target identifiable functionals without requiring an explicitly parameterized latent task, and provided concrete cases where latent-space analysis reveals phenomena missed by prediction-space comparisons. The additional rollout-length, rollout-count, and latent-dimension experiments also strengthen the reliability and scalability analysis. Applicability to realistic LLMs and broader scaling behavior remain unresolved, but I view these as limitations of scope. I therefore raise my score from 3 to 4.

Reviewer_9sxhOpenReview ↗
Rating
5
Clarity
3
Confidence
2
Originality
2
Quality
3
Significance
3
Read review
Summary

The paper proposes an approach of understanding the internal beliefs of Bayes-filtered-transformers (BFT). They use Predictive Monte Carlo to approximate prior and posterior distributions over hidden variable, finding that the approximate posterior is often true to the analytical conjugate for several tasks involving linear regression, balls and urns and markov chains.

Strengths and weaknesses

Strength

  • The paper is well written and easy to follow.
  • The tasks are well designed and provide a clean experiment where they can be compared against a true Bayesian posterior.

Weaknesses

  • Novelty should be clarified related to earlier work
  • Do the synthetic experiments translate to real world scenarios?
Questions
  • How does the simulated results translate to real world scenarios?
  • I believe the results on memorization and generalization are already previously known for transformers. What new insights were obtained in this paper?
Limitations

yes

Paper formatting concerns

No

Final justification

I am satisfied with the responses.

Reviewer_9Er4OpenReview ↗
Rating
5
Clarity
4
Confidence
4
Originality
3
Quality
4
Significance
3
Read review
Summary

This paper uses Predictive Monte Carlo (PMC) as a black-box interpretability tool to study the implicit priors and posteriors of Bayes-filtered transformers (BFTs) -- transformers trained to imitate data sequences sampled from some probabilistic generative model. In contrast to earlier work that tries to study BFT's implicit "beliefs" by comparing their next-token distributions to the posterior predictive distribution (PPD) under some prior, PMC directly reconstructs samples from the prior or posterior as (approximate) sufficient statistics of a roll-out conditioned on some prompt (representing the data to be conditioned on). For example, if the roll-out is a sequence of 1s and 0s representing coin flips, the sufficient statistic is the sample average, and this represents a sample θ\theta from the prior or posterior over the coin's weight. By sampling multiple roll-outs (unconditionally, or conditioned on a prompt), then collecting many of these sufficient statistics, PMC can reconstruct a sample-based approximation of the implicit prior or posterior respectively.

While PMC itself is not new, the paper uses PMC as an interpretability tool to study the dynamics of in-context learning (ICL) in transformers. The paper takes a Bayesian view of ICL, and so studies BFTs as way of gaining insight into the dynamics of ICL in a setting where ICL ought to be Bayesian. Accordingly, the paper synthesizes past interpretability work of ICL on synthetic tasks into a general Bayesian framework, organizing (distributions over) tasks such as linear regression, balls-and-urns, and Markov chains into the family of kk-Markov exchangeable processes. In doing so, the paper shows how BFTs ought to converge to next-token distributions that behave as if they sample the hidden task parameter θ\theta (e.g. linear regression coefficients, categorical probability vectors, transition matrices) from the prefix-conditioned posterior, then predict the next token conditioned on that parameter. Hence, if PMC is applied on these BFTs, they should recover the implicit priors or posteriors over the task parameter.

Having established these connections, the authors apply PMC to BFTs trained on the synthetic tasks mentioned above, and use it to investigate whether the implicit priors and posteriors correspond to the memorizing prior/posterior --- the case where the prior is supported only on the training dataset of task parameters used to trained the BFT -- or to the generalizing prior/posterior -- the true task parameter distribution from which the training dataset is sampled. The results replicate prior work showing that: (i) when task diversity is low, transformers tend to memorize, but they switch to the generalizing regime with enough task diversity; (ii) for intermediate levels of task diversity, there is transient generalization, where BFTs exhibit the generalizing prior midway during training, but switch back to the memorizing regime with more training. Importantly, the results show this directly using the PMC-recovered priors or posteriors over the latent tasks (latent space comparison), instead of comparing next-token distributions with the Bayesian PPD as in prior work (prediction space comparison). For at least some synthetic tasks (e.g. balls-and-urns), the latent space comparison shows ICL dynamics like the memorizing-to-generalizing transition that prediction space comparison cannot detect, demonstrating the value of the latent space / PMC approach in interpreting transformer behavior. The PMC approach also allows for direct visual comparison of the recovered priors / posteriors against the hypothesized ones, unlike prediction space comparison.

Strengths and weaknesses

Overall, I think this is a great paper that deserves acceptance. I was initially a little unclear from abstract what the upshot of the paper was, but now that I've read it, I find the paper to be a very solid addition to the literature on Bayesian accounts of ICL, primarily for the following reasons:

  • It concisely unifies and gives theoretical backing to prior studies of Bayesian ICL under the kk-Markov exchangeability framework. As a non-statistician, it's hard to know the exact representation theorems that justify the (IMO intuitive) Bayesian view of ICL beyond de Finetti / the exchangeable regime. This paper filled that information gap for me.
  • It introduces PMC as an black-box interpretability tool for studying the behavior and learning dynamics of transformers, allowing researchers to explicitly recover task priors and posteriors, and then visualize and compare them directly in latent space. This seems like quite a useful addition to the transformer interpretability toolkit, and I can imagine various extensions to more complex tasks that PMC could potentially help with (e.g. arithmetic tasks/functions, or behavioral personas as the authors discuss).

In addition to these two main reasons, the paper is well-written, and is supported by extensive empirical results that demonstrate the success of PMC as a prior/posterior-elicitation tool that can effectively replicate known results about transformer training dynamics.

That being said, I think the current version of the paper still has some unaddressed limitations and areas for improvement:

  • Diagnostic value of PMC vs. PPD comparisons. It seems to me like the paper understates the diagnostic value of PMC / latent space comparison compared to prediction space comparison, especially in the Abstract and the Experiments section. While I appreciate the in-principle argument given in Figure 2 and Intro, it seems like the empirical results do bear out this argument to some degree, especially for ball-and-urns and Markov chain transient generalization. Why not emphasize this more (with the relevant caveats)? The Abstract as written seems to suggest that PMC only replicates what could already be done in prediction space -- but what I'm seeing is that PMC can pick up phenomena which PPD comparison cannot, and also that latent space discrepancies are generally more pronounced than prediction space discrepancies.

  • Recoverability of task parameters as sufficient statistics. One fairly significant limitation of PMC seems to be that it requires the ability to reconstruct the latent task parameter (e.g. linear regression coefficient) as a (fixed-dimension) sufficient statistic of the rolled-out sequence. Per the Pitman–Koopman–Darmois theorem however, this is not possible for distributions/likelihoods outside of the exponential family. How then can be PMC be applied to cases where no obvious rollout-to-latent transformation is available (e.g. recovering the hidden "persona" from some natural language behavior)? It seems like addressing this limitation will be quite important for extending the applicability of PMC as a interpretability tool.

Finally, it would have been nice to see some applications of PMC beyond just comparisons with the generalizing and memorizing priors -- do the authors think PMC is potentially useful for recovering the priors of transformers trained on "natural" data, or for disambiguating between generalizing priors of different functional forms?

Questions

Addressing the following questions would make the paper stronger, and potentially improve my score:

Main Questions

  • Does PMC and its corresponding latent space metrics provide diagnostic value that prediction space comparison does not? If so, why isn't that emphasized more in the paper?

  • Is PMC limited to cases where task parameters can be computed as sufficient statistics of the rolled-out sequence? If not, how not? If so, do discuss this as a limitation, and potential steps for addressing it so that PMC can be more widely applied.

Minor Questions

  • Figure 2(c) doesn't obviously illustrate to me that "the predictor under the posterior mean coincides" -- perhaps the plot could be adapted to better reflect this claim?

  • How much more computationally costly is PMC over PPD comparison, given the need for long rollouts to get a single sample?

  • Why are the specific latent space metrics in Equations 10 and 11 chosen? Do these metrics capture discrepancies that more familiar metrics (e.g. KL divergence) does not?

  • Do the authors think PMC is potentially useful for recovering the priors of transformers trained on "natural" data, or for disambiguating between generalizing priors of different functional forms?

Limitations

The authors have discussed a number of limitations, primarily to do with not being able to verify the validity of PMC as a prior/posterior elicitation tool on BFTs that have not converged to the true Bayesian PPD. These limitations are sufficiently discussed.

Two other limitations that I think should be discussed more are (i) the difficulty of recovering task parameters that don't have corresponding sufficient statistics (elaborated upon above), and (ii) the increased computational cost of PMC relative to PPD comparisons (due to the need for lengthy sequence rollouts to get just one sample from the posterior).

Paper formatting concerns

None.

Final justification

I am satisfied with the authors' explanations, and continue to think this is a strong paper that deserves to be accepted. I will keep my score at a 5.

Comments on the paper

1 comment
Meta-review

This paper studies Bayes-filtered transformers (BFTs)—models fitted to data sequences sampled from a hierarchical generative process: sampling a task (or parameters defining the task) from a prior, then sampling data conditioned on that task. This provides a useful simplified system for studying in-context learning and other phenomena observed in larger transformers. The authors repurpose predictive Monte Carlo (PMC) to interrogate the beliefs of BFTs that have only approximately learned the data-generating process, and they demonstrate its utility through carefully controlled experiments. Overall, the reviewers appreciate the technical contributions and the pedagogical presentation of the paper. The paper is heading toward acceptance but could be strengthened if the authors more thoughtfully addressed the practical implications of this work, brought up by several reviewers. In particular, it is important to address Reviewer 9Er4’s concern regarding whether task parameters need to be sufficient statistics of generated sequences.

Post-rebuttal: The authors’ provided a thorough rebuttal and adequately addressed reviewer concerns strengthening an already interesting paper. The reviewers unanimously favor accepting the paper.

From OpenReview, CC BY 4.0. Authors as signed there; shown unedited.

Related papers

Loading the map…

Discussion (0)

Sign in to comment.