A transformer trained on sequences whose source parameters are drawn afresh each time can learn only what the sequences share: the source family and its prior. The Bayesian predictor that knows both, which we call informed Bayes, is the unique minimizer of the training loss and is computable from the family alone; we use it as a quantitative, falsifiable reference. Where earlier work compared transformers with Bayes on sources whose contexts can be learned independently, we build Markov sources with up to 64 symbols in which observations in one context inform prediction in another: product sources with known or hidden encodings, transition rows sharing an unknown base law and depth, and a mixture of three families. Our main result is that informed Bayes predicts, from the family and prior alone, how a trained transformer behaves in four tests that go beyond the learning curve: the loss that remains under a source outside the training family (predicted 2.237 bits, measured 2.309), the doubling of the extra loss when two independent components change rather than one (0.345 predicted, 0.350 measured), the benefit of other contexts when a token appears for the first time, and the depth at which copying an earlier continuation starts to pay. On the learning curves themselves, small transformers match informed Bayes when the shared structure is visible in the tokens, and hidden structure needs more layers and training, with gaps below 0.01 bits per token for the largest models. We explain why the imitation is possible and where it must fail: informed Bayes decomposes into sufficient statistics that attention selects and accumulates and an estimator, fixed by the prior, that the feed-forward network learns; training pays the complexity of informed Bayes under the architecture's prior, and finite-memory universal prediction bounds how closely a bounded network can reach it.
Can Transformers Learn Full Bayesian Inference in Context?
Department of Statistics, LMU Munich(慕尼黑大学统计系);Munich Center for Machine Learning (MCML)(慕尼黑机器学习中心);Center for Data Science, New York University(纽约大学数据科学中心);Department of Computer Science, Technical University of Munich(慕尼黑技术大学计算机科学系)
Bayesian Inverse Problems Meet Flow Matching: Efficient and Flexible Inference via Transformers
Skolkovo Institute of Science and Technology(斯克洛夫学院科学与技术研究所);Sberbank(储蓄银行);AI4S Center(AI4S中心);Artificial Intelligence Research Institute(人工智能研究 institute)
Columbia University(哥伦比亚大学);Columbia University School of Professional Studies(哥伦比亚大学专业研究学院);Department of Statistics(统计学系);Columbia University Department of Computer Science(哥伦比亚大学计算机科学系)
A Multi-target Bayesian Transformer Framework for Predicting Cardiovascular Disease Biomarkers during Pandemics
Department of Computer Science, WPI(计算机科学系,WPI);Department of Genetics and Computational Biology, UMass Chan Medical School(遗传学与计算生物学系,UMass Chan医学学院);AI Exploration Center, Department of Data Science and Analytics, SUNY Polytechnic Institute(AI探索中心,数据科学与分析系,SUNY polytechnic学院)
Geographically-Weighted Weakly Supervised Bayesian High-Resolution Transformer for 200m Resolution Pan-Arctic Sea Ice Concentration Mapping and Uncertainty Estimation using Sentinel-1, RCM, and AMSR2 Data
Department of Geomatics Engineering, Schulich School of Engineering, University of Calgary(地质工程系,Schulich 工程学院,卡尔加里大学)
Bayesian Transformer for Probabilistic Load Forecasting in Smart Grids
O&M Analytics, AES Clean Energ(O&M分析部,AES清洁能源);The AES Corporation(AES公司);Department of Information and Communication Engineering(信息与通信工程系);Pabna University of Science and Technology(帕纳大学科学与技术)
Bayesian Physics Informed Neural Networks for Reliable Transformer Prognostics
Department of Electronics & Computing, Mondragon University(蒙龙大学电子与计算系);Department of Physical Chemistry, University of the Basque Country (UPV/EHU)(巴斯克国家大学物理化学系);Department of Mathematics, University of the Basque Country (UPV/EHU)(巴斯克国家大学数学系);Department of Computer Science and Artificial Intelligence, University of the Basque Country (UPV/EHU)(巴斯克国家大学计算机科学与人工智能系);Basque Centre for Applied Mathematics (BCAM)(巴斯克应用数学中心);Ikerbasque, Basque Foundation for Science(巴斯克科学基金会)
Advanced Risk Prediction and Stability Assessment of Banks Using Time Series Transformer Models
Southern Methodist University(南卫理公会大学);Washington University in St. Louis(圣路易斯华盛顿大学);New York University(纽约大学);College of William & Mary(威廉与玛丽学院);Stevens Institute of Technological(史蒂文斯理工学院)
Universal priors: solving empirical Bayes via Bayesian inference and pretraining
Courant Institute of Mathematical Sciences, NYU(纽约大学Courant数学科学研究所);Center for Data Science, NYU(纽约大学数据科学中心);Department of EECS, MIT(麻省理工学院电子工程与计算机科学系)
Bayesian Information Sharing Between Noise And Regression Models Improves Prediction of Weak Effects
Aalto University(阿尔托大学);University of Helsinki(赫尔辛基大学);Institute for Molecular Medicine Finland (FIMM)(芬兰分子医学研究所(FIMM));University of Oulu(奥卢大学);Oulu University Hospital(奥卢大学医院);University of Eastern Finland(东芬兰大学);Imperial College London(帝国理工学院);National Institute for Health and Welfare(国家健康与福利研究所);University of Bristol(布里斯托大学)