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

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

TL;DR

Existing theories of in-context learning (ICL) typically assume that prompt examples are independent and identically distributed (i.i.d.). This paper breaks that assumption by analyzing ICL under sequentially correlated data, revealing that within-context correlations effectively shorten the prompt's useful length, while query-context correlations provide a powerful predictive signal that standard softmax attention exploits far better than linear attention.

What Problem Does This Paper Address?

In-context learning (ICL) allows large language models to master new tasks at inference time simply by looking at examples provided in a prompt. To understand the mathematical mechanics behind this phenomenon, researchers frequently use linear regression as a theoretical sandbox.

However, almost all existing ICL literature relies on a major simplification: assuming that the examples within a prompt are entirely independent. Real-world data—like natural language, code, or time-series data—is highly structured and sequentially correlated. This paper addresses this critical gap by exploring how sequential correlations alter the sample efficiency of ICL and how different attention architectures handle this realistic data structure.

Methods

The authors introduce a solvable model of in-context linear regression featuring sequentially correlated tokens. Their approach combines exact mathematical derivation with empirical validation:

  • Theoretical Sandbox: They analyze a reduced linear-attention model using random matrix theory in a high-dimensional asymptotic regime (where both the data dimension $d$ and context length $\ell$ scale to infinity proportionally).
  • Correlation Modeling: They introduce a sequence correlation kernel $K$ to control dependencies across context positions, alongside a query correlation vector $k_{\text{test}}$ that dictates how the final test query relates to the preceding context. They primarily use an exponential/autoregressive AR(1) kernel to simulate varying correlation lengths ($\xi$).
  • Architectural Comparison: To test their theoretical predictions, they evaluate three distinct architectures: reduced-parameter linear attention, full-parameter linear attention, and standard softmax attention combined with a Multi-Layer Perceptron (MLP).

Datasets

The study relies entirely on synthetic datasets explicitly designed to isolate sequential correlations:

  • Tokens: Mean-zero Gaussian tokens $x_1, \dots, x_\ell, x_{\text{test}}$ are generated such that their token-to-token covariance is governed by the matrix $K$.
  • Labels: Targets are generated via a standard linear relationship $y = x^\top w + \epsilon$, where the task vector $w$ is drawn from a Gaussian distribution and $\epsilon$ represents independent Gaussian noise.

Key Insights and Ideas

  • The Effective Context Length Law: When correlations are confined strictly within the context (and the query remains independent), the prompt behaves exactly like a shorter i.i.d. prompt. The authors derive an explicit formula for this effective context length: $$\ell_{\text{eff}} = \frac{1 + \rho}{k_2 + \rho}\ell$$ where $k_2$ is a bulk measure of context correlation and $\rho$ is the noise variance. Redundant information simply shrinks the effective sample size.

  • The Query Gain: If the test query is also correlated with the context, it provides an additional statistical signal. Models can exploit this relationship to significantly reduce test error below what is possible with i.i.d. data.

  • Architectural Mismatch: This query-dependent benefit exposes a massive performance gap between architectures. Softmax attention with an MLP excels at exploiting query correlations, whereas linear attention architectures struggle because they compress sequence dependencies into static second-order summaries.
  • Breakdown of High-Dimensional Concentration: If correlations are too strong and persist across a length scale proportional to the context length itself, standard high-dimensional concentration fails. The authors establish a strict participation ratio condition ($\frac{\text{tr}(K^4)}{\text{tr}(K^2)^2} \to 0$) required for predictable asymptotic behavior.

Key Results

  • The derived effective context length formula perfectly predicts the performance drop observed in linear attention models when context tokens are correlated.
  • When query correlations are active, softmax attention exhibits a dramatic reduction in ICL test loss as correlation strength increases, vastly outperforming both reduced and full-parameter linear attention models.
ICL test loss against token correlation strength for three attention architectures.
  • In regimes with very strong correlations where the concentration condition is violated, the empirical ICL error sharply diverges from the weak-correlation theory, signaling a breakdown in standard high-dimensional scaling assumptions.
Simulation vs theory for n < d^2 Simulation vs theory for n > d^2
Breakdown of theory when $n < d^2$ Breakdown of theory when $n > d^2$
Simulation vs theory for n < d^2
Simulation vs theory for n > d^2

Limitations and Future Work

While this work provides a foundational step toward understanding non-i.i.d. in-context learning, it features a few key limitations:

  • Weak Correlation Constraint: The exact asymptotic formulas assume weak correlations ($\Theta(1)$ scaling). A complete mathematical description of the strong correlation regime where concentration fails remains open.
  • Task Simplicity: The theory is restricted to linear regression with Gaussian tokens. Extending these proofs to non-linear tasks, multi-layer softmax architectures, and more complex sequential structures (like deep Markov chains or language-like data) is an essential direction for future research.

Summary updated

BibTeX
@misc{letey2026sequential,
  author = {Mary Letey and Yue M. Lu and Cengiz Pehlevan and Jacob Zavatone-Veth},
  title = {{Sequential Correlations Change In-Context Learning: Effective Context Length and Architectural Mismatch}},
  year = {2026},
  eprint = {2607.03660},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2607.03660},
}
Figure