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

*Afiq Abdillah Effiezal Aswadi, Haotong Ma, Susan Wei*

[NeurIPS page](https://neurips.cc/virtual/2026/poster/149367) · [Open on the map](../papers.html#p149367)

Category: [Interpretability & Model Adaptation](../pcat/15.md) › [Predictive State Estimation in Context](../pgroup/291.md) · Type: new method · Keywords: Bayes-filtered transformer, interpretability, predictive Monte Carlo, latent task inference, transformer analysis

## Summary
Predictive Monte Carlo (PMC) is an interpretability tool that approximates the implicit prior and posterior over latent tasks in a Bayes-filtered transformer using only next-token generation.

## Explained to a 5-year-old
A Bayes-filtered transformer is a kind of computer program that learns to guess the next word in a story. It hides some secret tasks that affect its predictions, but we don't know what they are. The researchers created a new trick that looks at the computer's guesses to figure out what those secret tasks might be. They tested this trick on simple puzzles that involve remembering or forgetting things. The trick works and shows us how the computer thinks about those hidden tasks.

## Explained to a 5-year-old, longer
A Bayes-filtered transformer is a kind of computer program that learns to guess the next word in a sentence. It works by first picking a hidden task from a set of possible tasks, then using that task to generate the words. Because the hidden tasks are not visible, it is hard to know what the program really believes or thinks. Previous ways of checking what the program thinks only looked at the final guesses, which could be the same even if the hidden tasks were different. The new paper proposes a method that uses many random guesses to peek into the hidden tasks directly. By collecting many guesses, they can see patterns that tell them what the program likely thinks about each hidden task. This method works only by looking at the program's normal word-prediction process, so no extra changes are needed. The researchers tested it on simple puzzle families that involve remembering things in order or not. They showed that the method can recover the same information that earlier studies found, but in a more reliable way. The results confirm that the hidden tasks are indeed being captured by the program's predictions. This helps researchers understand how complex computer brains make decisions. It also opens the door to better tools for explaining AI systems to people.

## For a technical reader
The paper presents a technique called predictive Monte Carlo that extracts a transformer’s hidden beliefs about latent tasks by sampling its own next-token predictions. By aggregating many such samples, the method approximates the prior and posterior distributions the model has learned, giving a direct view of its internal reasoning. The approach works without modifying the model and can be applied to any Bayes-filtered transformer. Experiments on stylised exchangeability tasks confirm that the technique recovers known phenomena, offering a more reliable alternative to existing prediction-space comparisons.

## Problem
It is unclear what prior and posterior distributions over latent tasks a trained Bayes-filtered transformer has internalised, because existing methods compare predictions in output space, which can be ambiguous when different posteriors yield identical predictions.

## Method
The approach uses next-token generation samples to estimate the prior and posterior distributions over latent tasks by aggregating Monte Carlo samples from the transformer's internal computations, providing a direct latent-space estimate of its beliefs.

## Results
The results show that predictive Monte Carlo recovers the known phenomena from prior work, confirming that latent-space analysis reflects the behavior observed in prediction space.

## Contributions
The paper introduces a general interpretability method that directly estimates implicit priors and posteriors over latent tasks using only next-token generation, and demonstrates its effectiveness on stylised exchangeability tasks.

This page was written by language models from the title and abstract of each paper, and the answers were checked by two other models. It can be wrong: check the paper itself. [Suggest a correction](../feedback/?on=p/149367)
