CORTEXA
← Browse
arxivcs.LGstat.ML2026-07-05

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

Chenrui Liu, Chuanlong Xie, Falong Tan, Yicheng Zeng, Lixing Zhu

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.

View free PDFSource page

Related papers

arxivcs.LGstat.ML2026-07-01

Ghost in the Kernel: In-Context Learning with Efficient Transformers via Domain Generalization

Peilin Liu, Ding-Xuan Zhou

Transformer-based large models have demonstrated remarkable generalization abilities across different tasks by leveraging a context-aware attention module for in-context learning. With richer context, transformers adapt more effectively to the current use case without any paramet…

View free PDFSource page
arxivstat.MLcs.LGstat.CO2026-07-04

Sequential Correlations Change In-Context Learning: Effective Context Length and Architectural Mismatch

Mary Letey, Yue M. Lu, Cengiz Pehlevan, Jacob Zavatone-Veth

Modern sequence models have a striking capacity for in-context learning (ICL); they can perform new tasks based only on examples given in the prompt. Understanding how this ability emerges requires theory that captures important properties of natural data. Linear regression has s…

View free PDFSource page
arxivcs.LGecon.THstat.ML2026-07-15

Supervised Fine-Tuning vs. In-Context Learning: An Equilibrium Analysis of LLM Personalization under Congestion

Fengzhuo Zhang, Zhuoran Yang, Dirk Bergemann

Large Language Models (LLMs) have revolutionized AI services, but a critical tension emerges: while personalization improves model performance, it consumes scarce computational resources that users must share. When should a user invest in expensive Supervised Fine-Tuning (SFT) ve…

View free PDFSource page
arxivstat.MLcs.LGq-bio.BM2026-07-06

Geometric Causal Models

Eli N. Weinstein, David M. Blei

Scientists often seek to draw causal inferences from structured data that is not independently and identically distributed, such as spatial data, network data, or molecular data. We develop geometric causal models (GCMs), a framework for causal inference from dependent data that…

View free PDFSource page
arxivcs.LGcs.AIstat.ML2026-07-13

CDFM: Towards a General-Purpose Causal Discovery Foundation Model

Jie Qiao, Ruichu Cai, Zijian Li, Weilin Chen, Pengfei Hua, Boyan Xu, et al.

Causal discovery, the process of recovering underlying causal structures from observational data, is a fundamental pursuit across scientific disciplines. Over the past decades, numerous algorithms have been developed to tackle this challenge through workflows tailored to the spec…

View free PDFSource page