mlsanityData to 7 Oct 2026

A Unified Framework for In-Context Learning with Causal and Masked Language Models

arXiv 2607.04081 ↗First posted 5 Jul 2026cs.LG stat.MLcited by 0

Not on the map. Why?

Abstract (arXiv)

In-context learning (ICL) has emerged as a central capability of pretrained language models, yet its theoretical analysis has focused primarily on causal language models trained by left-to-right autoregressive prediction, such as GPT-style models. Masked language models instead recover masked tokens from bidirectional context, and their role in ICL remains less understood. We develop a statistical learning framework that represents the context examples by their empirical measure and models prediction as a function of the context and the query. This formulation places autoregressive and masked pretraining objectives within a common excess-risk analysis. Under Wasserstein-type regularity conditions, we relate pretraining with T tasks and N samples per task to k-shot excess risk at inference, obtaining same-order upper bounds for masked and autoregressive objectives. We also study task-distribution shift, where pretraining tasks are sampled from P and inference tasks from Q; the resulting bound contains an additional term controlled by the lifted Wasserstein distance between P and Q. The bounds further imply an order-optimal allocation under a fixed pretraining data budget and refined rates under intrinsic low-dimensional structure. Experiments on controlled function-learning tasks show that the Masked Pair Encoder (MPE) can achieve performance comparable to GPT-2-style causal Transformers, suggesting that ICL behavior is not specific to causal language models.

Key facts. No citing papers in the map yet (data through 7 Oct 2026). Builds on 41 of its 61 references that are in the map. First posted on arXiv 5 Jul 2026.

Builds on

41 of 61 references.

References · 41

  1. 2018BERT: Pre-training of Deep Bidirectional Transformers for Language Understandingcited by 40,204
  2. 2022Training Compute-Optimal Large Language Modelscited by 2,927
  3. 2020DeBERTa: Decoding-enhanced BERT with Disentangled Attentioncited by 2,157
  4. 2018Reconciling modern machine learning practice and the bias-variance trade-offcited by 919
  5. 2021An Explanation of In-context Learning as Implicit Bayesian Inferencecited by 915
  6. 2022Transformers learn in-context by gradient descentcited by 714
  7. 2022What Can Transformers Learn In-Context? A Case Study of Simple Function Classescited by 700
  8. 2021Transformers Can Do Bayesian Inferencecited by 338
  9. 2023Trained Transformers Learn Linear Models In-Contextcited by 331
  10. 2021The Intrinsic Dimension of Images and Its Impact on Learningcited by 307
  11. 2023Transformers as Statisticians: Provable In-Context Learning with In-Context Algorithm Selectioncited by 291
  12. 2023Transformers learn to implement preconditioned gradient descent for in-context learningcited by 274
29 more
  1. 2023Looped Transformers as Programmable Computerscited by 224
  2. 2023Transformers as Algorithms: Generalization and Stability in In-context Learningcited by 220
  3. 2015The Benefit of Multitask Representation Learningcited by 194
  4. 2023Pretraining task diversity and the emergence of non-Bayesian in-context learning for regressioncited by 138
  5. 2021Sinkformers: Transformers with Doubly Stochastic Attentioncited by 136
  6. 2023How Many Pretraining Tasks Are Needed for In-Context Learning of Linear Regression?cited by 93
  7. 2023In-Context Learning through the Bayesian Prismcited by 78
  8. 2014Learning Theory for Distribution Regressioncited by 48
  9. 2023Transformers Learn to Achieve Second-Order Convergence Rates for In-Context Linear Regressioncited by 47
  10. 2024Transformers are Minimax Optimal Nonparametric In-Context Learnerscited by 36
  11. 2024Can In-context Learning Really Generalize to Out-of-distribution Tasks?cited by 23
  12. 2013Distribution-Free Distribution Regressioncited by 21
  13. 2021Intrinsic Dimension Estimation Using Wasserstein Distancescited by 20
  14. 2023Data Management For Training Large Language Models: A Surveycited by 17
  15. 2025In-Context Learning Is Provably Bayesian Inference: A Generalization Theory for Meta-Learningcited by 17
  16. 2023A survey and taxonomy of loss functions in machine learningcited by 15
  17. 2025When can in-context learning generalize out of task distribution?cited by 13
  18. 2024BERTs are Generative In-Context Learnerscited by 11
  19. 2024On the Statistical Properties of Generative Adversarial Models for Low Intrinsic Data Dimensioncited by 10
  20. 2021On the Regularity of Attentioncited by 9
  21. 2021How to distribute data across tasks for meta-learning?cited by 7
  22. 2024Automatic Domain Adaptation by Transformers in In-Context Learningcited by 7
  23. 2026Efficient and Minimax Optimal In-context Nonparametric Regression with Transformerscited by 7
  24. 2024Context-Scaling versus Task-Scaling in In-Context Learningcited by 6
  25. 2025Out-of-Distribution Generalization of In-Context Learning: A Low-Dimensional Subspace Perspectivecited by 5
  26. 2026Approximation Theory for Lipschitz Continuous Transformerscited by 5
  27. 2026Transformers as Measure-Theoretic Associative Memory: A Statistical Perspective and Minimax Optimalitycited by 3
  28. 2025In-Context Learning as Nonparametric Conditional Probability Estimation: Risk Bounds and Optimalitycited by 2
  29. 2026Beyond the Prompt in Large Language Models: Comprehension, In-Context Learning, and Chain-of-Thoughtcited by 1

Built on by

Not cited yet.