Adaptive Mean Estimation by In-Context Learning: A Gradient-Flow Analysis
cs.LG, stat.ML
Submitted: 2026-10-06
Updated: 2026-10-06
License: http://creativecommons.org/licenses/by/4.0/
The gist: Prior Fitted Networks (PFNs) such as TabPFN now rival established statistical procedures across prediction and estimation tasks.
Terminology
Abstract
Prior Fitted Networks (PFNs) such as TabPFN now rival established statistical procedures across prediction and estimation tasks. A natural explanation is that PFNs have the property of statistical adaptivity, that is, they perform nearly as well as a method tailored to the true data-generating model for a heterogeneous set of models, while not being told which model the data comes from. We study how such adaptivity is learned in a controlled location-estimation problem. Each task is an unlabeled sample whose family is hidden: Gaussian data call for averaging, with error of order n-1, whereas uniform data are best estimated from their extremes, at the faster rate n-2. We also provide the example of a symmetric Gaussian mixture, for which a rate of σ 2 n/n can be attained. On scalar inputs, softmax attention computes the derivative of the empirical cumulant-generating function. A single primitive therefore both supplies features that distinguish the families and forms estimators interpolating between the sample mean and the mid-range. We combine attention experts through either a softmax mixture of experts or a gated linear unit (GLU), and analyze stagewise gradient flow. With Ω(n 1+ε) pretraining tasks, the learned estimator is asymptotically efficient on Gaussian tasks, within a factor n ε of the minimax rate on uniform tasks, and order-optimal on mixtures in a shrinking-variance regime. These guarantees extend to new locations and longer contexts. A risk decomposition separates expert error, routing error and normalization error, which clarifies the architectural contrast. Softmax gating enforces normalization and exact translation equivariance, whereas the GLU must learn it: its dynamics separate into fast bias removal followed by slow expert selection. End-to-end experiments recover the predicted specialization.
Sources
- What learning algorithm is in-context learning? Investigations with linear models
- CausalPFN: Amortized Causal Effect Estimation via In-Context Learning
- Language Models are Few-Shot Learners
- Training Dynamics of Multi-Head Softmax Attention for In-Context Learning: Emergence, Convergence, and Optimality
- How Transformers Utilize Multi-Head Attention in In-Context Learning? A Case Study on Sparse Linear Regression
- Language Modeling with Gated Convolutional Networks
- What Can Transformers Learn In-Context? A Case Study of Simple Function Classes
- In-Context Convergence of Transformers
- Compound decisions and empirical Bayes via Bayesian nonparametrics
- Transformers Learn Nonlinear Features In Context: Nonconvex Mean-field Dynamics on the Attention Landscape
- Transformers are Minimax Optimal Nonparametric In-Context Learners
- One-Layer Transformer Provably Learns One-Nearest Neighbor In Context
- Optimal In-context Adaptivity and Distributional Robustness of Transformers
- Pretrained transformer efficiently learns low-dimensional target functions in-context
- Meta-Statistical Learning: Supervised Learning of Statistical Estimators
- GLU Variants Improve Transformer
- Outrageously Large Neural Networks: The Sparsely-Gated Mixture-of-Experts Layer
- Solving Empirical Bayes via Transformers
- In-Context Learning Is Provably Bayesian Inference: A Generalization Theory for Meta-Learning
- A Closer Look at Deep Learning Methods on Tabular Datasets
Related papers
- Polynomial-Augmented Neural Networks (PANNs) with Weak Orthogonality Constraints for Enhanced Function and PDE Approximation
- AIRL-S: Unifying Reinforcement Learning and Search-Based Test-Time Scaling via Adversarial Inverse Reinforcement Learning
- Transformers as Bayesian In-Context Experimenters: Smoothness-Adaptive Efficient ATE Estimation
- Convergence issues in Relational Concept Analysis based on AOC-posets
- Beliefs Beyond Posteriors: The Predictive Cost of ELBO Binding
- Understanding Diffusion Models via Ratio-Based Function Approximation with SignReLU Networks