NeurIPS 2026QuestionsPapersAreasAboutMarkdown

Attention as In-Context Empirical Bayes: A Two-Stage View via Particle Dynamics

Matthew Smart, Soumya Ganguly, Nilava Metya, Alexandre V Morozov, Anirvan Sengupta

NeurIPS page · OpenReview · alphaXiv · Open on the map

Category: Interpretability & Model Adaptation › Transformer Attention Theory · Type: theory · Keywords: attention mechanisms, empirical Bayes, particle dynamics, transformer theory, noisy input inference, statistical interpretation

Areas: Long Context › Long-context mechanisms › In-context learning; Model Architectures & Sequence Modeling › Language Model Architectures › Attention Geometry

Summary

The work reveals that minimal attention-only transformers under corrupted inputs implement a two-stage empirical Bayes inference, providing a statistical interpretation of attention as in-context posterior estimation via particle dynamics.

Explained to a 5-year-old

Imagine a simple robot brain that looks at many words at once. It gets some of the words mixed up, but it still tries to guess the right answer. By stacking a few of these brains, the robot can smooth out the mistakes and get better guesses. The paper shows that this guessing process is like a two-step game where the robot first makes a rough guess and then refines it. It works without needing extra tricks, just using the way the brains are connected.

Explained to a 5-year-old, longer

Think of a tiny computer brain that reads lots of words together. Sometimes the words get messed up, but the brain still tries to guess what they should be. If you stack a few of these brains on top of each other, they help each other correct the mistakes and give better answers. The researchers found that this guessing is like playing a two-step game: first the brain makes a rough guess, then it refines that guess using the connections between the brains. This works without any special tricks, just by how the brains are linked together. It helps us understand why these simple brains can be so good at fixing errors. The idea also connects to ideas from probability, where the brain acts like a tiny version of a scientist estimating the truth from noisy data. By studying this simple setting, we learn more about how bigger, real-world AI systems might be doing something similar when they process language.

For a technical reader

The paper shows that a plain attention-only transformer can be seen as performing Bayesian inference on corrupted inputs. Depth in the network refines a particle-based estimate of the posterior, while a skip connection carries the noisy input as a query for the final estimate. This yields a principled relationship between depth, noise, and denoising without needing an explicit noise schedule. Theoretical analysis proves that under certain priors the transformer’s output converges to the optimal Bayesian predictor as the amount of data grows.

Problem

There is a need to understand how attention-only transformers perform inference when their inputs are corrupted, and to characterize the statistical behavior of such models under noise.

Method

The approach analyzes minimal attention-only transformers under all-token corruption, showing they admit a two-stage empirical Bayes interpretation where depth refines a particle-based distribution and a skip-connection carries noisy input for posterior inference.

Results

The approach demonstrates that denoising can be achieved with a fixed kernel bandwidth and finite integration horizon, and provides a posterior-mean recovery guarantee showing convergence to the Bayes-optimal predictor under asymptotic conditions.

Contributions

The paper contributes a two-stage empirical Bayes interpretation of attention, linking depth and attention residuals to particle dynamics and posterior inference, and establishes theoretical guarantees for denoising and recovery under corrupted inputs.

Limitations and assumptions

The analysis assumes a class of well-behaved priors and asymptotic regimes, and focuses on minimal attention-only architectures under uniform token corruption.

Research questions this paper is counted under

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