potentialpaper

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

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

FoGen @ ICML 2026

Edit this page

Or clone it with git

Run in a terminal:

Needs Git LFS. To push, use an API key from your profile as the password.

Or let your agent set it up

It checks and sets up everything: signing in, git, the clone, credentials and an SSH key.

TL;DR. Attention-only transformers admit a two-stage empirical Bayes interpretation: depth refines a particle prior in-context, while a long-range attention residual performs posterior inference against it.

Abstract. We study minimal attention-only transformers under all-token corruption and show they admit a two-stage empirical Bayes interpretation. A single attention step computes a kernel-weighted posterior mean with respect to the empirical distribution defined by the context. Depth refines this distribution through particle dynamics (Stage 1), while a long-range skip-connection carries the noisy input as a query for posterior inference (Stage 2), revealing distinct statistical roles for depth and attention residuals. The framework isolates a minimal setting in which the context itself induces a depth-dependent energy landscape governing in-context inference. We show that effective denoising can emerge without an explicit noise schedule: a fixed kernel bandwidth and finite integration horizon suffice, yielding a principled depth–noise relationship. We further establish a posterior-mean recovery guarantee for Gaussian priors, showing the empirical estimator converges to the Bayes-optimal predictor under sequential asymptotic conditions. Connecting these dynamics to reverse-diffusion limits, our results provide a statistical interpretation of attention as in-context inference via sample-based posterior estimation, without explicit density modeling.

Are you an author? Claim this paper to see who's reading it, with views and other statistics, and to write about it here.

Claim this paper
How does this paper connect to your work? Write how you built on it, compared with it or reproduced it, or add a summary, a critique or errata.
Or make it interactive:
Start writing

edit · history

FromAToBDateVersionSubmitted toPDFEvidence
4 May 2026NeurIPS 2026submittedNeurIPS 2026Accept (poster)reviews ↓[1]—[1]
8 May 2026FoGen @ ICML 2026submittedFoGen @ ICML 2026Accepted · Poster—[1]
Their titles, abstracts and, where both have a PDF, the text.Missing a version?

NeurIPS 2026

Accept (poster) · 3 reviews · OpenReview

Updated 25 Nov 2026, 03:48 UTC.

Program Chairs · DecisionOpenReview ↗
Decision
Accept (poster)
Read decision
Meta-review

The paper proposes a two-stage interpretation of minimal attention-only Transformers for collective denoising when all context tokens are corrupted by Gaussian noise. In Stage 1, repeated Gaussian-kernel self-attention refines a particle approximation to the unknown clean distribution. In Stage 2, a long-range residual preserves the original noisy token as a query and computes a posterior-mean-like readout against the refined particles. The paper connects these dynamics to reverse diffusion, and derives a posterior-mean recovery guarantee for admissible priors.

Main Strengths

  • The two-stage decomposition is conceptually appealing and gives distinct statistical roles to depth and residual attention.

  • The empirical Bayes perspective connects attention, kernel regression, particle systems, and denoising in a clear way.

  • The experiments support the proposed depth/context/noise behavior in the simplified setting.

Main Weaknesses

  • The noise variance is assumed known and controls key algorithmic parameters such as the bandwidth/depth relation.

  • A Reviewer raised an important concern on the novelty of the results, and pointed out strong overlap between Stage 1 of the paper and prior work by Rosu et al.

  • Multiple reviewers questioned how far the current theory justifies broader practical transformer behavior.

I suggest that the authors should address the main weaknesses above in detail.

Final justification

Although a reviewer’s concern about the paper’s significance in light of existing related work remains, all reviewers agree that the two-stage view is interesting and has practical implications. On balance, I believe the paper makes a worthwhile contribution and recommend acceptance.

Area Chair area · Meta-reviewOpenReview ↗
Read meta-review
Meta-review

The paper proposes a two-stage interpretation of minimal attention-only Transformers for collective denoising when all context tokens are corrupted by Gaussian noise. In Stage 1, repeated Gaussian-kernel self-attention refines a particle approximation to the unknown clean distribution. In Stage 2, a long-range residual preserves the original noisy token as a query and computes a posterior-mean-like readout against the refined particles. The paper connects these dynamics to reverse diffusion, and derives a posterior-mean recovery guarantee for admissible priors.

Main Strengths

  • The two-stage decomposition is conceptually appealing and gives distinct statistical roles to depth and residual attention.

  • The empirical Bayes perspective connects attention, kernel regression, particle systems, and denoising in a clear way.

  • The experiments support the proposed depth/context/noise behavior in the simplified setting.

Main Weaknesses

  • The noise variance is assumed known and controls key algorithmic parameters such as the bandwidth/depth relation.

  • A Reviewer raised an important concern on the novelty of the results, and pointed out strong overlap between Stage 1 of the paper and prior work by Rosu et al.

  • Multiple reviewers questioned how far the current theory justifies broader practical transformer behavior.

I suggest that the authors should address the main weaknesses above in detail.

Final justification

Although a reviewer’s concern about the paper’s significance in light of existing related work remains, all reviewers agree that the two-stage view is interesting and has practical implications. On balance, I believe the paper makes a worthwhile contribution and recommend acceptance.

1 comment
Authors · CommentOpenReview ↗

We thank the AC and reviewers for the careful and constructive discussion. We are encouraged that the meta-review identifies the two-stage decomposition, and the distinct statistical roles it assigns to depth and attention residuals, as principal strengths. To summarize where the three highlighted issues now stand:

Known noise and calibration. As detailed in our response to Reviewer 13Hq (W1) and Reviewer Yym2 (Q3), we will explain the classical empirical Bayes convention, the identifiability obstruction to jointly recovering an unrestricted prior and noise level from a single corrupted population, and the limitation that one fixed unconditioned depth is not proved optimal across noise levels.

Relation to prior attention-dynamics work. This work extends the clean-context/noisy-query denoising setting of Smart et al. (2025); a fully corrupted context creates the need to reconstruct the contextual memory before posterior readout, which motivates the two-stage formulation.

As detailed in our response to Reviewer auLL (Q1,Q2,Q4), the submission already identifies the Stage 1 update as an attention implementation of the classical mean-shift algorithm of Fukunaga and Hostetler (1975) and cites Rosu et al. when introducing this shared mechanism. We agree the submission was insufficiently clear at several points, and the revision will make the novelty boundary more prominent:

  • Inherited ingredients: classical empirical Bayes methodology; the mean-shift/Gaussian-attention Stage 1 primitive; the general attention–diffusion connection; compact-support mean-field theory; and Gaussian closure.
  • Intended contributions: the two-stage composition in which a fully corrupted context is refined before posterior readout using the preserved original observation; the associated particle-to-posterior result, including the noncompact Gaussian case; and the noise-calibrated finite stopping horizon.

We will also add and discuss Castin et al. 2025, and label the particle-count scaling explicitly as heuristic. Relative to Rosu et al., the all-token construction there (Sec. 3) evolves every particle without preserving a separate query for posterior readout, while their cross-attention constructions (Sec. 4) use clean fixed samples or clean contextual examples as memory. Relative to Castin et al., the technical distinction our result adds is the noncompact Gaussian particle approximation used in the particle-to-posterior argument. The discussion has clarified the boundary between inherited ingredients and the contributions claimed here; the remaining disagreement concerns their degree of significance.

Scope relative to practical Transformers. As detailed in our responses to Reviewer Yym2 (W1-W2) and Reviewer 13Hq (W2), we will state explicitly that the theory concerns a minimal Gaussian-kernel attention model and collective denoising. It does not establish that trained multi-head Q/K/V Transformers learn the same mechanism, nor does it provide finite-context or finite-depth rates. Minimal attention-only dynamics form an established theoretical testbed for studying transformer dynamics (e.g., the works Reviewer auLL mentions); studying them under controlled synthetic datasets enables a proposed mechanism to be checked against an analytically known baseline, i.e. the Bayes optimal predictor.

We view the paper’s central contribution as a rigorous statistical abstraction and synthesis. Rather than claiming a new Stage 1 primitive, the work develops a common framework that brings classical empirical Bayes together with attention-dynamics theory to assign distinct, checkable statistical roles to depth (particle prior construction) and the long-range attention residual (posterior readout against the refined particle approximation). Looking ahead, we hope this provides a useful bridge among groups studying in-context inference, mean-field attention dynamics, and Bayesian approaches to transformer mechanisms.

We are grateful to the AC and reviewers for helping us sharpen the contribution and its limitations, and will incorporate these clarifications in the revision.

Reviewer auLLOpenReview ↗
Rating
3/6
Confidence
2/5
Quality
2/4
Clarity
3/4
Significance
2/4
Originality
2/4
Contribution type
theory
Ethical concerns
NO or VERY MINOR ethics concerns only
Read review
Summary

The paper studies an attention-only transformer architecture for a Gaussian denoising task in which all tokens are corrupted by noise. The authors propose a two-stage empirical Bayes interpretation. In Stage 1 repeated Gaussian self-attention updates evolve the noisy tokens as particles, with the goal of refining an empirical approximation of the unknown clean prior. In Stage 2 a long-range residual preserves the original noisy input and uses it as a query for a posterior-mean readout against the refined particles.

Strengths and weaknesses

Strengths

  • The two-stage empirical Bayes interpretation and, in particular, separating prior refinement from posterior readout, gives an interesting statistical role to depth and to the long-range residual.
  • The part that seems genuinely new to me is Stage 2: after the particle dynamics, the original noisy input is preserved and used as the query for inference against the refined particles. This could have implications in practice.

Weaknesses

  • I may be missing an important distinction in the authors' intended contribution (please correct me if I am wrong): from my understanding, Eq. (1), equivalently Stage 1 of Algorithm 1, appears to overlap very strongly with the in-context manifold denoising dynamics of Rosu et al., Section 3. Rosu et al. introduce the same kernel-weighted attention update in Eq. (4), prove its implementation by attention in Lemma 2, and state in Lemma 3 that their manifold denoising algorithm is exactly this update. The present Stage 1 seems to use essentially the same Gaussian-kernel residual averaging mechanism, up to notation, including the all-token noisy denoising task and the fixed-bandwidth kernel update. The main difference I see is that Rosu et al. formulate the clean distribution as supported on a manifold, whereas this paper works directly on Rd\mathbb R^d. This is a difference in setting, but I do not see it as changing the underlying attention dynamics substantially. Could the authors give more details about the difference between their approach and Rosu et al.?
  • The N/βd+2N/\beta^{d+2} scaling is interesting, since it suggests the finite-sample regime where the kernel estimate should approximate the desired vector field. However, in the current version it is mostly intuitive. If this scaling is meant to be a main contribution, it should be stated and proved as a precise theorem or estimate.
  • The connection between mean-field self-attention and diffusion dynamics, forward or backward, is also already well established in prior work. For example, Sinkformers proves diffusion/heat-equation limits in Theorem 1 and discusses the corresponding mean-field attention dynamics in Proposition 4, for the same Gaussian attention on Rd\mathbb R^d. Related results also appear in Bruno et al., Proposition 3.9, on Sd−1S^{d-1}. The paper would benefit from clarifying more precisely what is new in its attention-diffusion interpretation.
  • Regarding Theorem 5.1, I think the relation to Castin et al. should be discussed more explicitly. Castin et al. already prove the mean-field limit of essentially the same type of attention dynamics on Rd\mathbb R^d for compactly supported measures. The interesting part here would be the extension to non-compact data. However, much of the difficult part seems to be absorbed into the definition of the admissible class Aτ\mathcal A_\tau, which appears to assume the stability and recovery properties needed for the conclusion. Thus the theorem reads more like a conditional consistency statement than a new general mean-field theorem.
  • The Gaussian case is analyzed more explicitly, which is useful. However, in this case the dynamics is explicit. Moreover, Gaussian preservation and the reduction of transformer PDEs to mean/covariance equations were already studied by Castin et al. I therefore find the Gaussian analysis useful for understanding Stage 2, but not by itself a substantially new mean-field phenomenon.

I think the most interesting contribution is the two-stage empirical Bayes composition, especially the Stage 2 long-range-residual readout. My concern is that the other components carrying much of the mathematical weight of the paper (Stage 1, the attention-denoising dynamics, the score/reverse-diffusion interpretation, and the compact support mean-field limit) seem already substantially present in prior work. I am therefore not fully convinced that the new part is developed enough in the current version. That said, I would be happy to reconsider my score if the authors can clarify more precisely what is new, what is inherited from prior work, and whether there are additional technical contributions of the two-stage empirical Bayes mechanism that I have not fully appreciated.

References

  • Sander, Michael E., et al. "Sinkformers: Transformers with doubly stochastic attention."
  • Castin, Valérie, et al. "A unified perspective on the dynamics of deep transformers."
  • Bruno, Giuseppe, et al. "A multiscale analysis of mean-field transformers in the moderate interaction regime."
  • Rosu, Paul, et al. "From softmax to score: Transformers can effectively implement in-context denoising steps."
Questions
  • What exactly is new in Stage 1 compared with Rosu et al., Section 3?
  • How is the forrward/reverse-diffusion interpretation different from Rosu et al., Sander et al., and Bruno et al.?
  • Is the N/βd+2N/\beta^{d+2} type scaling a formal contribution? If so, can it be stated as a theorem or estimate?
  • What is the precise relation between Theorem 5.1 and the compact-support mean-field limit of Castin et al.?
Limitations

yes

Final justification

From my point of view, the theoretical contribution of the paper remains limited, especially in light of the existing literature discussed during the rebuttal. For this reason, I keep my original score.

Formatting concerns

no

3 comments
Authors · RebuttalOpenReview ↗
Rebuttal

We thank the reviewer for the detailed comparison with Rosu et al., Sander et al., Bruno et al., and Castin et al. Three of the four are already cited, though not at the depth the reviewer points to; we are grateful for the specificity. The fourth, Castin et al., we simply missed. It is directly relevant, and we regret the omission. The reviewer also identifies a genuine presentation problem, which we address below.

What kind of contribution this is. Our contribution is a formulation and abstraction, not a new attention primitive; not signposting that invites the reading that novelty is claimed for the dynamics themselves. It is not: Gaussian attention is an established variant (Chen et al., 2021), and the Stage 1 update, the attention–diffusion connection, compact-support mean-field machinery, and Gaussian closure are all established results we build on. We generalize the in-context denoising task of Smart et al. (ICML 2025) to the all-tokens-corrupted regime, rather than only the query. This harder task is what motivates Stage 1: the memory used for posterior readout is itself corrupted, so the architecture first refines that empirical memory before querying it.

Formulating this as two-stage empirical Bayes supplies a well-posed question and a vocabulary (prior construction versus posterior readout) assigning distinct, checkable roles to depth and the long-range residual. Stage 1 draws on the mean-field attention-dynamics literature for tractability; in return, empirical Bayes supplies a well-posed task on which those dynamics can be interpreted. Theorem 5.1 makes one instance of that vocabulary rigorous, and in doing so takes a step on an established problem: particle-level recovery for noncompactly supported data. We do not aim to solve empirical Bayes with transformers; we use EB because confronting attention with a well-studied problem makes the mechanism legible. More broadly, we hope that deriving architectural components from well-posed statistical tasks may be one route toward models that are interpretable by construction rather than only through post-hoc analysis.

Since the weakness and question lists overlap, we answer under the four questions.

Q1 / W1: Stage 1 relative to Rosu et al. We agree with the reviewer's factual comparison: up to notation and residual-step conventions, our Eq. (1) is the same update studied in Rosu et al., cited prominently throughout, including at the first mention of the shared mean-shift primitive (Fukunaga & Hostetler, 1975) in Section 3, L100–102. The issue is not omission, but that we did not clearly distinguish their expressivity results from the statistical formulation built on that shared primitive.

The distinction is structural. In Rosu et al.'s Section 3 (all-token noise), every particle evolves and the denoised estimate of each token is the evolved particle itself; no query is held outside the flow, so there is no separate posterior readout. In their Section 4 (score-based cross-attention), the memory is a clean, frozen set of training samples while only the query is noisy, and their in-context variant likewise supplies clean contextual examples (the configuration also studied in Smart et al. 2025). So no configuration there estimates a prior from a fully corrupted context and then queries it.

Our composition addresses that missing regime: the corrupted context is evolved into a particle estimate of the clean law, the original noisy observation is preserved outside the dynamics, and a second attention operation performs posterior averaging against the refined memory. Theorem 5.1 shows that posterior readout against a prior estimated from corrupted samples converges, through the stated sequential limits, to the Bayes-optimal denoiser. The two papers also ask different questions: theirs is which algorithms attention can implement; ours is what statistical computation the network carries out in-context.

Q2 / W3: Forward/reverse diffusion. We agree that the general attention--diffusion connection was already established by Sander et al., Bruno et al., Rosu et al., and related work, and we will remove any wording suggesting otherwise.

What we add is the role the empirical Bayes problem assigns to the flow. For a single corruption level, a fixed-bandwidth dynamics is run only to a finite, task-calibrated horizon. In normalized score-flow time the leading horizon is s∗≈σ2/2s^*\approx \sigma^2/2, with depth determined by (β,η,σ2)(\beta,\eta,\sigma^2). This horizon is set by the statistical task (the corruption level σ2\sigma^2) not by any timescale intrinsic to the dynamics, such as a blow-up or clustering time of the flow. Where the interacting-particle literature emphasizes long-time behaviour, the denoising formulation gives a reason the dynamics should not run indefinitely. To our knowledge this noise-calibrated use of the horizon does not appear in prior analyses of these dynamics. We restrict the novelty claim to this use, not to the diffusion connection itself.

Q3 / W2: Particle-count scaling. We agree. The condition Nρˉβ−d/2→∞N\bar\rho\beta^{-d/2}\to\infty is an occupancy heuristic for the expected number of samples in a kernel neighborhood, not a formal statement. We take the reviewer's point that the relevant object is the empirical vector field: occupancy is the weaker requirement, since controlling a kernel density gradient classically demands more than controlling the density at the same bandwidth, and the submission establishes neither. We will define ρˉ\bar\rho, label the statement heuristic, and state the finite-sample estimate as open; Theorem 5.1 proceeds by sequential limits and does not rely on this scaling.

Q4 / W4--W5: Castin et al. and the status of Aτ\mathcal{A}_\tau. Our denoising law begins from f0=γτ∗P0f_0=\gamma_\tau*P_0, which has full support even when P0P_0 is compactly supported, so noncompactness is intrinsic to the problem. Castin et al.'s particle-to-mean-field and stability results are stated for compactly supported initial data. Their noncompact analysis is a well-posedness and closure result at the PDE level, exploiting Gaussian invariance to reduce the PDE to mean/covariance ODEs and establish uniqueness within the Gaussian ansatz; it contains no particle-approximation or stability statement for noncompactly supported data. Both the compact-support machinery and the Gaussian closure are established results we build on directly.

What a particle-to-posterior theorem requires, and what our Gaussian case supplies, is precisely the missing particle statement: convergence of finite truncated particle systems to the noncompact Gaussian flow. Our proof combines convergence for the renormalized hard truncation at fixed (β,R)(\beta, R); removal of RR at the deterministic level via uniform moment and action bounds, compactness, and uniqueness of the limiting flow; continuity of the posterior map on bounded query sets; and the large-β\beta limit. For non-Gaussian priors Gaussian invariance is unavailable, so neither ingredient applies directly.

We also agree without reservation about Aτ\mathcal{A}_\tau: its definition packages both hard-truncation admissibility and deterministic recovery, so the general theorem is a conditional transfer result for priors with those properties, not an unconditional mean-field theorem on Rd\mathbb R^d. We will remove the phrase "well-behaved priors", foreground the Gaussian case where both properties are proved, and explain that the Gaussian calculation establishes nonemptiness and supplies the reference solution for the truncation-removal argument.

Response to the reviewer's closing invitation.

What is established elsewhere, and used here: classical empirical Bayes methodology; the mean-shift Stage 1 primitive, shared with Rosu et al.; the attention--diffusion connection; compact-support mean-field theory and Gaussian closure (Castin et al.); Gaussian-kernel attention as an architectural variant (Chen et al., 2021).

What is new: (i) the two-stage composition, in which a fully corrupted context is refined into a particle prior and then queried by the preserved original observation; (ii) a sequential particle-to-posterior recovery theorem for that composition, including a particle-approximation statement for the noncompact Gaussian case absent from the PDE-level literature; (iii) a noise-calibrated finite stopping horizon and its interpretation as a statistical role for depth.

What we would add. A value of the formulation, in our view, is not that it replaces existing analyses of attention, but that it places several previously separate observations within a single mathematical framework. It gives a common statistical account of (i) where the stored patterns in associative-memory accounts of attention (e.g., Ramsauer et al., 2021) come from: Stage 1 constructs them in-context from a corrupted prompt; (ii) why preserving the original noisy token through a long-range residual naturally serves posterior inference, offering a mechanistic interpretation of attention residuals' reported empirical benefits; and (iii) whether the clustering emphasized in mean-field analyses is only a dynamical pathology, or has a functional role (we observe that Stage 2 inference remains accurate even after the particles concentrate into clusters, suggesting it may yield a posterior-sufficient surrogate, an empirical observation we will label as such). These interpretations arise from studying the two-stage decomposition proposed here rather than from the Stage 1 dynamics alone.

We are grateful to the reviewer for inviting us to state this directly, and for a detailed reading that has sharpened how we present the contribution.

Reviewer auLL · CommentOpenReview ↗

Thank you to the authors for clarifying the scope and nature of the contributions. The two-stage empirical Bayes formulation, the particle-to-posterior result, and the noise-calibrated stopping horizon are potentially interesting directions. However, in their current form, I feel that these contributions would benefit from further development, as they still appear somewhat incremental when compared with the cited literature on attention denoising, diffusion interpretations, and mean-field dynamics.

For this reason, while I appreciate the rebuttal and the improved positioning of the paper, my overall assessment remains unchanged, and I will keep my original score.

Authors · CommentOpenReview ↗

We thank the reviewer for their thoughtful engagement throughout the discussion. We understand that the remaining concern is the degree to which the two-stage formulation and associated results advance beyond prior attention-denoising, diffusion, and mean-field work.

We regard the statistical abstraction developed here as a central contribution of the work: it connects in-context inference, classical empirical Bayes, and rigorous analyses of attention dynamics under a common framework. We are glad the reviewer found the composition itself potentially interesting.

The reviewer's detailed reading has improved the paper's positioning and clarity, and we will incorporate the revisions outlined in our rebuttal.

Reviewer 13HqOpenReview ↗
Rating
5/6
Confidence
3/5
Quality
3/4
Clarity
3/4
Significance
4/4
Originality
3/4
Contribution type
theory
Ethical concerns
NO or VERY MINOR ethics concerns only
Read review
Summary

This paper studies collective in-context denoising under an all-token corruption model, where x1,…,xN∼P0x_{1},\ldots,x_{N}\sim P_{0}, x~i=xi+ϵi\tilde x_i=x_i+\epsilon_i, and ϵi∼N(0,σ2Id)\epsilon_{i}\sim N(0,\sigma^{2}I_{d}). The goal is to recover the clean tokens from the noisy tokens when the underlying clean distribution P0P_{0} is unknown. The authors propose a two-stage interpretation of multilayer self-attention for this task. In Stage 1, repeated self-attention updates move the noisy particles iteratively and construct a particle approximation to the clean data distribution P0P_{0}. In Stage 2, a long-range skip connection preserves the original noisy token as a query, and a cross-attention step against the refined particles produces a denoised estimate. Under suitable asymptotic limits, this estimate is shown to converge to E[X∣X~=x~]E[X\mid \tilde{X}=\tilde{x}].

Strengths and weaknesses

Strengths

  • The paper offers a conceptually appealing decomposition of in-context denoising into two stages, and it gives distinct statistical roles to depth and long-range attention residuals.
  • The work makes an interesting connection between the estimation of the underlying distribution P0P_{0} and the view of transformers as interacting particle systems, in the spirit of Geshkovski et al. (2023) and related work.
  • The work also draws a connection between reverse diffusion and attention-based particle dynamics.

Weakness

  • The noise level is assumed to be known. In many practical denoising or in-context inference settings, the noise variance would itself need to be inferred from the context. Relatedly, the proposed construction requires a fixed choice of β\beta and a corresponding depth or integration horizon that are matched to a given σ2\sigma^{2}. As currently formulated, it is not clear whether a single fixed model, with fixed β\beta and fixed depth, can handle a broad range of noise levels σ2\sigma^{2}. This issue is discussed to some extent as a limitation, but it would be helpful to clarify its implications for the intended interpretation of the model.
  • The main recovery result, leaves open the quantitative regime in which the proposed approximation is accurate for finite context length and finite transformer depth.
Questions
  • The terminology “empirical Bayes” seems somewhat nonstandard from a statistical perspective. In my view, the method may be more accurately described as an empirical-Bayes-inspired denoising interpretation of attention, rather than empirical Bayes in the classical sense. That said, I am open to alternative interpretations, and I would appreciate clarification from the authors on how they intend the term “empirical Bayes” to be understood.
  • Given the title and framing of the paper as "in-context empirical Bayes," I think the related-work discussion should more clearly position the contribution relative to recent Bayesian perspectives on in-context learning, such as Wakayama and Suzuki (2026) and Ma et al. (2025). My understanding is that the present paper uses "prior" in a different, more object-level sense: the prior is the unknown clean data distribution from which the context tokens are sampled, and empirical Bayes refers to estimating this distribution from corrupted samples before performing denoising. By contrast, in much of the Bayesian ICL literature, the prior is typically a higher-level prior over tasks, functions, or data-generating mechanisms, so that in-context learning itself is interpreted as Bayesian inference at the meta-learning level. Clarifying this distinction would help avoid possible confusion about what is meant here by "Bayes" or "empirical Bayes," and would better situate the paper within the broader ICL literature.
  • As a minor comment, the notation RR should be defined explicitly when it first appears in the main theorem or immediately before it. Although its role as a truncation radius becomes clear from the surrounding discussion and appendix, adding a short definition in the main text would improve readability.

Reference

  • Wakayama and Suzuki (2026, ICML). In-Context Learning Is Provably Bayesian Inference: A Generalization Theory for Meta-Learning.
  • Ma et al. (2025). Optimal In-context Adaptivity and Distributional Robustness of Transformers.
Limitations

yes

Final justification

This paper develops a two-stage empirical Bayes interpretation of transformers for in-context denoising, in which depth refines a particle approximation of the clean-data distribution and a final cross-attention step performs posterior mean estimation. Overall, I find this submission conceptually novel and technically solid, providing a new perspective on transformers for in-context inference.

Formatting concerns

N/A

3 comments
Authors · RebuttalOpenReview ↗
Rebuttal

We thank the reviewer for the comments on terminology, noise adaptation, finite context, and the relation to Bayesian in-context learning. These comments have helped us sharpen both the scope and the language of the paper. We will describe the framework more explicitly as classical empirical Bayes for a within-context latent signal distribution, rather than relying on terminology that can be confused with Bayesian meta-learning over tasks.

Q1: What we mean by "empirical Bayes." We use the term in the classical compound-decision (Robbins, 1951, 1956) / normal-means (James and Stein, 1961) sense. The likelihood

Y∣X=x∼N(x,σ2I)Y\mid X=x\sim \mathcal{N}(x,\sigma^2 I)

is specified, while the mixing law P0P_0 of the latent clean variables is unknown and inferred from repeated noisy observations. Stage 1 constructs a particle law approximating P0P_0; Stage 2 substitutes that empirical law into the Bayes posterior-mean formula. This is the classical plug-in empirical-Bayes structure, not merely an analogy. We will make this definition explicit at first use.

More broadly, our aim is not to solve Empirical Bayes with transformers; it is closer to what the reviewer suggested. We want Empirical Bayes to probe some aspect of the inner workings of transformers. Confronting attention with a well-studied statistical problem is what lets us give depth and the residual connection distinct, checkable statistical roles---prior construction versus posterior readout---rather than leaving them as an architectural description without a stated function. That decomposition, more than the EB machinery itself, is the point of the two-stage formulation.

Q2: Relation to Bayesian ICL. The reviewer's characterization is correct, and we thank them for pointing us to this literature, including Wakayama and Suzuki (2026) and Ma et al. (2025). In our setting the prior is object-level: P0P_0 is the unknown clean data distribution from which the context tokens are sampled, and empirical Bayes refers to estimating P0P_0 from the corrupted samples before performing denoising. As the reviewer notes, much of the Bayesian ICL literature instead takes the prior to be a higher-level prior over tasks, functions, or data-generating mechanisms, so that in-context learning itself is interpreted as Bayesian inference at the meta-learning level. There is no meta-prior over tasks in our theorem. We will cite Wakayama and Suzuki (2026) and Ma et al. (2025) and draw this contrast explicitly in the revision, to forestall exactly the confusion about "Bayes" and "empirical Bayes" the reviewer flags, and to better situate the paper within the broader ICL literature.

W1: Known noise level. Three points should be separated.

First, this is the standard convention in classical normal-means empirical Bayes: the likelihood, including σ2\sigma^2, is specified, and the unknown object is the prior P0P_0.

Second, without additional assumptions this is not merely a convenient simplification; there is an identifiability obstruction. If

Y∼N(0,vI),Y\sim \mathcal{N}(0,vI),

then for every 0<σ2<v0<\sigma^2<v the same marginal can be represented as

Y=X+ε,X∼N(0,(v−σ2)I),ε∼N(0,σ2I).Y=X+\varepsilon, \quad X\sim\mathcal{N}\bigl(0,(v-\sigma^2)I\bigr), \quad \varepsilon\sim\mathcal{N}(0,\sigma^2 I).

Thus P0P_0 and σ2\sigma^2 are not jointly identifiable from the noisy marginal over an unrestricted prior class. In particular, for the Gaussian priors covered by our recovery result, estimating σ2\sigma^2 from a single corrupted population is impossible in principle. Adaptation requires side information, repeated measurements, structural restrictions such as low intrinsic dimension, calibration data, or a small clean sample. A more elaborate architecture could use such information to estimate σ2\sigma^2 before applying our procedure, but that is a separate statistical problem.

Third, not every algorithmic parameter scales with σ2\sigma^2. The horizon and the Stage 2 posterior scale depend on it; the Stage 1 bandwidth β\beta need not. Our experiments already report behavior across noise levels (Fig. 4b) and show that Stage 2 posterior averaging substantially reduces the bandwidth sensitivity of Stage 1 alone (Fig. 5b). We agree, however, that one fixed unconditioned depth is not proved Bayes-optimal over a wide range of noise strengths, and will say so clearly; adaptation would require a noise-conditioned model, an adaptive stopping mechanism, or additional input information from which the noise level can be estimated.

W2: Finite context length and finite depth. We agree that this limitation should appear next to the theorem rather than only in the discussion. Theorem 5.1 is a sequential consistency result: particle convergence at fixed (β,R)(\beta,R), removal of truncation, and then the large-β\beta posterior-recovery limit. It is stated in continuous time, does not include Euler error, and provides no joint quantitative regime in (N,R,β,L)(N,R,\beta,L) or optimal finite-depth rule. The experiments provide finite-regime evidence, not rates.

We will also clarify where depth earns its role. In the population limit, the exact score of f0f_0 gives the Bayes posterior mean through Tweedie's formula. Stage 1 is therefore not asymptotically necessary once the population law is known. Its role is specifically finite-sample: it transforms a noisy empirical context into a representation that gives a better posterior readout. Accordingly, Theorem 5.1 establishes consistency of the composition; it does not prove that depth is necessary asymptotically or derive a finite-NN improvement rate. We will also correct one characterization: Eq. (19) applies the readout at the fixed scale βc=1/σ2\beta_c = 1/\sigma^2 rather than with an independent bandwidth shrinking with NN, so its bias does not vanish. The Remark on Tweedie and finite NN (App. C.1) does not draw this distinction and we will correct it.

This finite regime may be the more interesting one. We observe that posterior inference can remain accurate even when the particle law has concentrated into discrete clusters. This suggests that Stage 2 may need only a sparse surrogate that places mass near high-density regions, rather than a uniformly faithful density estimate. We will present this as an empirical observation and an open theoretical direction, not as an established theorem.

Q3: Definition of RR. Agreed. We will define

f0[R]=1BRf0f0(BR)f_0^{[R]}=\frac{\mathbf 1_{B_R}f_0}{f_0(B_R)}

immediately before the theorem and state that RR is the deterministic hard-truncation radius of the noisy initial law. It is a proof device used to access compact-support particle theory, not a quantity supplied to or observed by the model.

We thank the reviewer again for the pointer to the Bayesian ICL literature and for pressing on the terminology and the finite-sample scope; both have sharpened how we frame the contribution and where we state its limits.

Reviewer 13Hq · CommentOpenReview ↗

Thank you for the thoughtful and detailed response. Your clarifications regarding the use of classical empirical Bayes and its distinction from Bayesian perspectives on ICL in the meta-learning sense have addressed my concerns. I also appreciate the explanation that assuming a known noise level is standard in the classical empirical Bayes setting and is further motivated by the identifiability obstruction when both the prior and noise variance are unrestricted.

Overall, I find this work provides a novel and insightful perspective on transformer-based in-context denoising. I will therefore increase my Clarity, Significance, and overall scores.

Authors · CommentOpenReview ↗

We thank the reviewer for their positive feedback and for their time and engagement. The revision will explain the known-noise assumption and its identifiability obstruction in our ICL setting. It will also clarify our usage of empirical Bayes and the object-level versus meta-level ICL distinction while citing the suggested prior work.

Reviewer Yym2OpenReview ↗
Rating
5/6
Confidence
4/5
Quality
4/4
Clarity
4/4
Significance
3/4
Originality
4/4
Contribution type
theory
Ethical concerns
NO or VERY MINOR ethics concerns only
Read review
Summary

The paper uses the collective denoising task to show that minimal attention-only transformers under all-token corruption admit a two-stage empirical Bayes interpretation: a prior recovery stage and an inference stage of computing the posterior mean. Here, the task is to estimate the true signal from the iid noisy data (x~i)i=1N( \tilde x_i )_{i=1}^N (called context), where $ \tilde x_i = x_i + \epsilon_i $ with Gaussian noise. The minimal attention has a single head, and each of its layers updates a kernel-weighted posterior mean with respect to the empirical distribution defined by the context:

ziℓ+1=(1−η)ziℓ+η∑jaij[z1,…,zN]zjℓz_i^{\ell+1} = (1-\eta) z_i^{\ell} + \eta \sum_j a_{ij}[z_1,…,z_N] z_j^{\ell}

where aij\prope−β/2∗∥zi−zj∥2a_{ij} \prop e^{-\beta/2 * \|z_i-z_j\|^2}. This simplified setting provides a statistical interpretation of in-context inference via sample-based posterior estimation.

Strengths and weaknesses

Strength:

  • The paper presents a simple, clear and insightful collective denoising task for a statistical interpretation of in-context inference. The kernel-regression-type denoising is neat and resembles attention.
  • The two-stage view and its connection to particle dynamics provide insights into the understanding of transformers.
  • The paper is well-written, with clear, informal results in the main text and detailed, rigorous results in the appendix, making it pleasant to read.

Weakness:

  • The kernel-regression-type updates are very different from the canonical attention model, in which the query, key, and value matrices are estimated from data. Here, each self-attention is simply a Nadaraya-Watson kernel regression. The results seem difficult to extend to the canonical attention model or to provide insight into other tasks beyond collective denoising.
  • The main theorems (on particle dynamics and sequential posterior mean recovery) are more relevant to collective denoising with kernel approximations but less relevant to the attention mechanism.
Questions
  • Can these results be extended to the standard attention mechanism utilizing query, key, and value matrices? Furthermore, is such a model capable of addressing the collective denoising problem?
  • Line 112: What is a “good particle approximation”, and why is the fixed distribution ρˉ\bar \rho needed in Nρˉβd/2\frac{N\bar \rho}{\beta^{d/2}}? Is there a mathematically rigorous statement of this proposition?
  • Line 119: What is denoising time? Is there an optimal LL for finite N and β\beta?
  • Line 596: why Eq.(1) differs slightly from the canonical attention? It would be helpful to provide a more detailed justification.
Limitations

yes

Final justification

The original version was a solid papper, and the additional revisions by the authors have strengthed the paper. Thus, I keep my rating: 5 accpet.

Formatting concerns

no

3 comments
Authors · RebuttalOpenReview ↗
Rebuttal

We thank the reviewer for the positive assessment and for questions that identify exactly where the architectural and theoretical claims should be stated more precisely. We are especially encouraged that the reviewer recognized the distinct roles of the two stages. In the revision, we will foreground the paper's central contribution: a two-stage posterior-inference formulation in which depth constructs an in-context particle approximation of the clean-data distribution, while a long-range residual preserves the noisy query required for posterior readout.

W1, Q1: Relation to standard Q/K/V attention. The operator in Eq. (1) is already a Q/K/V attention operator: it is Gaussian-kernel self-attention with WQ=WK=βI,WV=I.W_Q=W_K=\sqrt{\beta} I, W_V=I. Gaussian-kernel attention is an established architectural variant (Chen et al., 2021 NeurIPS) rather than a device introduced solely for tractability, and we cite this connection in Appendix C. We will move this explanation into the main text and make it more prominent.

For softmax dot-product attention, the relation follows from −β2∥z−zj∥2=βz⊤zj−β2∥zj∥2−β2∥z∥2.-\frac{\beta}{2} \lVert z - z_j \rVert^2=\beta z^\top z_j -\frac{\beta}{2}\lVert z_j\rVert^2 -\frac{\beta}{2}\lVert z\rVert^2. The last term (query norm) is independent of jj and therefore cancels under row-wise softmax. Thus Gaussian-kernel and dot-product attention coincide when key norms ∥zj∥2\lVert z_j\rVert^2 are constant, for example under the idealized spherical projection version of layer normalization. Off the sphere, the key-norm term remains. We will state this precisely rather than leaving Eq. (1) to appear disconnected from standard attention.

To answer the second part of the question directly: the Gaussian/RBF specialization we analyze does solve the collective denoising task (Fig. 4). What we do not establish is that a learned multi-head Transformer (which contains a variety of other practical bells and whistles) discovers the same procedure, or that the theorem extends to anisotropic or depth-varying Q/K/V maps. Extending first to fixed anisotropic weights and then to learned depth-dependent ones is the natural next step, and we will state this limitation explicitly.

Q4: Why the update differs from the canonical residual block. Our revised text will clarify this distinction with the canonical residual block. The reason we use the update,

ziℓ+1=ziℓ+η(Attnβ(Zℓ)i−ziℓ)=(1−η)ziℓ+ηAttnβ(Zℓ)iz_i^{\ell+1}=z_i^{\ell}+\eta\bigl(\textrm{Attn}_{\beta}(Z^{\ell})_i-z_i^{\ell}\bigr)=(1-\eta)z_i^{\ell} + \eta \textrm{Attn}_{\beta} (Z^\ell)_i

is simply because it arises as the explicit-Euler discretization of the regularized score Attnβ(Z)i−zi=1β∇log⁡(Gβ∗μN)(zi)\textrm{Attn}_\beta(Z)_i-z_i=\tfrac{1}{\beta}\nabla\log(G_\beta*\mu_N)(z_i) (where μN\mu_N is the evolving empirical measure).

For η∈(0,1]\eta\in(0,1], each layer is a convex interpolation between a token and its attention barycenter. This gives a controlled amount of forgetting/leakage, preserves the convex hull of the particle cloud, and supplies the stability property used by the compact-support analysis. We regard this form as an attention-based implementation of score-based denoising stemming from the classical mean-shift primitive for density gradient estimation (Fukunaga & Hostetler, 1975), which we and others (Rosu et al., 2025) build on.

W1 (second part): Insight beyond collective denoising. The theorem is specific to collective denoising, and we will not claim otherwise. The broader contribution is the statistical formulation. The two-stage decomposition assigns distinct roles to architectural ingredients that are often discussed separately:

  • Depth refines an in-context particle approximation of the unknown latent distribution.
  • The long-range residual preserves the original noisy token, not merely as an optimization path but as the query needed for posterior inference.
  • The refined particles provide the provenance of the "stored patterns" in associative-memory accounts of attention (e.g., Ramsauer et al. 2021; Smart et al., 2025): the memory is generated dynamically from the context rather than assumed fixed.

The general shape of this procedure is in-context rather than denoising-specific: attention, as a kernel over arbitrarily many tokens, builds an estimate of a latent object from the prompt itself, and a preserved query then reads it out. Instantiating that shape for another task would require specifying a new latent-variable model and the corresponding readout, which we do not do here. Relatedly, because prior construction and readout are separated, the refined representation could in principle be reused across queries; we will present this as a design implication rather than a validated claim.

We especially thank the reviewer for this comment, which points to a key aspect of the formulation our Discussion does not properly emphasize; we will revise accordingly.

W2: Relevance of the theorems to attention. The analyzed dynamics are themselves a self-attention network with tied identity-scaled weights. This is what gives the network's long-range attention residual (Stage 2) a derivable statistical function rather than only an architectural interpretation. Theorem 5.1 further establishes that the Stage 2 readout against a prior constructed from corrupted samples converges to the Bayes posterior mean for priors in Aτ\mathcal{A}_{\tau} (Gaussian priors verified).

More broadly, attention-only dynamics of this kind are an established, actively studied class (Sander et al., Geshkovski et al., Castin et al.), used across the literature as a tractable proxy for what real Transformers do layer by layer. Giving one instance a precise statistical reading, as Theorem 5.1 does, is intended as a first step toward using well-posed statistical tasks as probes on richer architectures. E.g. asking whether a layer-to-layer sharpening of a latent-space representation emerges in trained models.

Q2: "Good particle approximation" and ρˉ\bar\rho. We agree that the phrase "good particle approximation" is too vague and will remove it. Here ρˉ\bar\rho denotes a representative local density in the region being estimated. Since a Gaussian kernel of inverse bandwidth β\beta has radius O(β−1/2)O(\beta^{-1/2}), the quantity Nρˉβ−d/2N\bar\rho \beta^{-d/2} is the expected occupancy of a kernel neighborhood. This aspect of Proposition 3.1 is only an occupancy heuristic; it proves neither concentration nor a joint scaling theorem. We will label it accordingly, and define ρˉ\bar\rho explicitly.

The rigorous result is Theorem 5.1, which takes the sequential limits N→∞N\to\infty at fixed (β,R)(\beta,R), then R→∞R\to\infty, and finally β→∞\beta\to\infty, yielding uniform convergence of the Stage~2 posterior mean on compact query sets for priors P0∈AτP_0 \in \mathcal{A}_{\tau}. It does not establish a joint NN--β\beta rate.

Q3: Denoising time and optimal depth. We will use one notation consistently. Let t=ηℓt=\eta\ell denote raw attention-depth time and s=t/βs=t/\beta normalized score-flow time. The leading reverse-heat horizon is

s∗=σ22,t∗=βσ22,L≃βσ22ηs^{*}=\frac{\sigma^2}{2}, \quad t^{*}=\frac{\beta \sigma^2}{2}, \quad L \simeq \frac{\beta\sigma^2}{2\eta}

For an isotropic Gaussian prior N(m,a2I)\mathcal N(m,a^2I), the exact population time needed to return the variance from a2+σ2a^2+\sigma^2 to a2a^2 is

sβ∗=σ22+12βlog⁡(1+σ2a2).s^{*}_{\beta}=\frac{\sigma^2}{2}+\frac{1}{2\beta}\log \left(1+\frac{\sigma^2}{a^2}\right).

No theorem in the present paper identifies the optimal finite-(N,β)(N,\beta) depth, because we do not control finite-sample fluctuations or time-discretization error. The empirical optimum may reflect a bias--variance/clustering tradeoff. We will present the formula above as a population calibration and state the finite-depth problem as open.

The conceptual point is that the empirical Bayes formulation gives depth a statistical meaning: it predicts a finite, noise-calibrated stopping horizon rather than only long-time clustering or equilibrium.

We thank the reviewer again for their encouraging feedback and questions, and hope these clarifications address the remarks about scope; we are happy to expand on any of them.

Reviewer Yym2 · CommentOpenReview ↗

Thank you for the detailed responses. This is a solid paper, and I keep my rating: 5 Accept.

Authors · CommentOpenReview ↗

We thank the reviewer for the careful reading, insightful questions, and continued support. We appreciate their positive feedback and engagement, and will incorporate all clarifications discussed above in the revision.

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

Missing a submission?

Loading the discussion…