NeurIPS 2026QuestionsPapersAreasAboutMarkdown

Optimal In-Context Learning of Autoregressive Processes under Heterogeneous Second-Order Moments of the Prompts

Hanna Tseran, Masaaki Imaizumi

NeurIPS page · OpenReview · Open on the map

Category: Interpretability & Model Adaptation › Transformer In-Context Learning · Type: theory · Keywords: in-context learning, second-order moments, autoregressive processes, transformer theory, statistical learning theory, optimal estimation

Summary

The paper provides theoretical guarantees that in-context learning can approximate optimal second-order moment-based AR(1) estimators under heterogeneous prompt moments, extending prior first-moment analyses.

Explained to a 5-year-old

When you give a computer a story, it can learn to guess what comes next without changing its brain. The computer looks at how the story changes and also at how the words vary. It uses a simple rule that works like a game of guessing numbers. The computer learns to make good guesses about future parts of the story. This helps it be more clever when it sees new stories.

Explained to a 5-year-old, longer

Imagine a robot that reads stories and tries to predict what happens next. It does this without changing any of its internal settings. The robot pays attention not only to the usual words but also to how the words change from one story to another. It looks at patterns in the story, like how often something repeats and how things vary together. The robot uses a simple rule that works like a game where you guess the next number. It learns this rule by looking at many examples and adjusting its guesses slowly. Over time, the robot becomes good at guessing the next part of any new story. This makes the robot more flexible and helpful when faced with unfamiliar situations. The researchers proved that this learning works under certain conditions. They also showed with experiments that the robot’s guesses match the expected results. This gives us confidence that the robot can be trusted in real-world tasks. Finally, the study opens the door to better understanding how computers can learn from data without being explicitly programmed.

For a technical reader

The paper investigates how transformer-based language models can learn to predict autoregressive sequences purely from prompt examples, without any parameter updates. It focuses on cases where the statistical properties of the prompts vary in their second-order moments, such as variance and covariance. By analyzing a two-layer architecture with a linear attention head and a non-linear MLP trained via gradient descent, the authors prove that a specific parametrization leads to convergence toward the optimal second-order moment estimator. They derive theoretical bounds on approximation error and convergence rates, and they validate these results with experiments. This work extends the prior first-moment view of in-context learning and shows that ICL can be robust to new tasks.

Problem

Understanding how in-context learning can estimate autoregressive processes when prompt distributions have varying second-order moments is challenging. The problem is to characterize the conditions under which transformers can learn optimal second-order moment-based estimators without parameter updates.

Method

The authors analyze a two-layer transformer consisting of a linear attention head followed by a nonlinear MLP, training the outer layer via gradient descent. They identify a parametrization that ensures convergence to the unique function approximating the optimal second-order moment-based AR(1) estimator and derive approximation and convergence bounds.

Results

The approach achieves convergence to the optimal second-order moment estimator with derived approximation and convergence rate bounds, and experimental validation supports the theoretical analysis.

Contributions

The work extends the understanding of in-context learning from first-moment to second-order moment-based estimators, provides a convergence guarantee for a specific parametrization, and supplies both theoretical bounds and experimental confirmation.

Practical relevance

These results deepen the understanding of ICL's robustness, potentially enabling more reliable deployment of language models on novel tasks without fine-tuning.

This page was written by language models from the title and abstract of each paper, and the answers were checked by two other models. It can be wrong: check the paper itself. Suggest a correction