potentialpaper

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

Hanna Tseran, Masaaki Imaizumi

NeurIPS 2026

Edit this page

Or clone it with git

Run in a terminal:

Needs Git LFS. To push, use an API key from your profile as the password.

Or let your agent set it up

It checks and sets up everything: signing in, git, the clone, credentials and an SSH key.

TL;DR. We analyze in-context learning of autoregressive processes under heterogeneous second-order moments of prompt distributions and show convergence to an optimal estimator.

Abstract. In-context learning enables large language models to adapt to tasks directly from input sequences, without parameter updates. We investigate the mechanism underlying in-context learning of autoregressive processes in transformers under heterogeneous second-order moments of prompt distributions. Our study considers a two-layer architecture consisting of a linear attention head and a nonlinear MLP, with the outer layer trained via gradient descent. We prove that there exists a parametrization under which the model converges to the unique function that approximates the optimal second-order moment-based AR(1) estimator. We analyze bounds on approximation and convergence rates and confirm our findings experimentally. These results extend the first-moment-centric understanding of estimators realized by in-context learning to second-order moment-based estimators, offering further insight into ICL's robustness to new tasks.

Are you an author? Claim this paper to see who's reading it, with views and other statistics, and to write about it here.

Claim this paper
How does this paper connect to your work? Write how you built on it, compared with it or reproduced it, or add a summary, a critique or errata.
Or make it interactive:
Start writing

edit · history

DateVersionSubmitted toPDFEvidence
1 May 2026NeurIPS 2026submittedNeurIPS 2026Accept (poster)reviews ↓[1]PDF[1]
Missing a version?

NeurIPS 2026

Accept (poster) · 3 reviews · OpenReview

Updated 25 Nov 2026, 03:45 UTC.

Program Chairs · DecisionOpenReview ↗
Decision
Accept (poster)
Read decision
Meta-review

The reviewers appreciate the paper's extension of in-context learning theory from first-moment statistics to autoregressive processes with heterogeneous second-order moments, and find the theoretical analysis technically interesting. However, several important concerns remain regarding the interpretation and scope of the results. In particular, the rebuttal should especially clarify (1) how the proposed formulation relates to the standard notion of in-context learning, including the role of demonstrations, prompting, and adaptation through context rather than gradient-based training, (2) the extent to which the theoretical results rely on the hand-designed attention parameterization and simplified AR(1) setting, and whether the resulting claims should be interpreted as learning the estimator or approximating a fixed statistic extractor, and (3) the scope of the claimed generality, including the interpretation of ``heterogeneous second-order moments,'' the status of the multidimensional VAR extension, and the connection between the theoretical analysis and practical transformer behavior. This paper seem be to borderline due to mixed recommendations.

Final justification

I have read the authors' response and the subsequent reviewer discussion. The rebuttal addressed most of the reviewers' concerns regarding the interpretation and scope of the results, and all reviewers are now positive overall. Some limitations remain, particularly regarding the fixed-attention setting and the justification of one technical step, but these do not outweigh the paper's theoretical contribution. I therefore recommend acceptance.

Area Chair vk4R · Meta-reviewOpenReview ↗
Read meta-review
Meta-review

The reviewers appreciate the paper's extension of in-context learning theory from first-moment statistics to autoregressive processes with heterogeneous second-order moments, and find the theoretical analysis technically interesting. However, several important concerns remain regarding the interpretation and scope of the results. In particular, the rebuttal should especially clarify (1) how the proposed formulation relates to the standard notion of in-context learning, including the role of demonstrations, prompting, and adaptation through context rather than gradient-based training, (2) the extent to which the theoretical results rely on the hand-designed attention parameterization and simplified AR(1) setting, and whether the resulting claims should be interpreted as learning the estimator or approximating a fixed statistic extractor, and (3) the scope of the claimed generality, including the interpretation of ``heterogeneous second-order moments,'' the status of the multidimensional VAR extension, and the connection between the theoretical analysis and practical transformer behavior. This paper seem be to borderline due to mixed recommendations.

Final justification

I have read the authors' response and the subsequent reviewer discussion. The rebuttal addressed most of the reviewers' concerns regarding the interpretation and scope of the results, and all reviewers are now positive overall. Some limitations remain, particularly regarding the fixed-attention setting and the justification of one technical step, but these do not outweigh the paper's theoretical contribution. I therefore recommend acceptance.

Reviewer 7NZgOpenReview ↗
Rating
5/6
Confidence
4/5
Quality
3/4
Clarity
3/4
Significance
3/4
Originality
3/4
Contribution type
theory
Ethical concerns
NO or VERY MINOR ethics concerns only
Read review
Summary

This paper studies in-context learning for noisy AR(1) processes where each prompt is generated with a different autoregressive coefficient, so the second-order moments vary across prompts. The main result shows that, under a specific attention parametrization, a two-layer model with one linear attention head and a nonlinear MLP can realize the OLS-style AR(1) next-step predictor $ (c_N/v_N)x_N $, where $ c_N $ and $ v_N $ are empirical covariance and variance statistics computed from the prompt. The paper proves convergence of the trained outer MLP weights to an approximation of this estimator, gives polynomial/MLP approximation bounds, discusses a multidimensional VAR(1) extension, and provides synthetic experiments supporting the fixed-attention construction and some non-fixed-attention training behavior.

Strengths and weaknesses

The main strength is that the paper targets a relevant gap in the ICL theory literature: moving beyond i.i.d. regression and first-moment/count-based estimators to an autoregressive setting where the useful in-context statistic is genuinely second-order. The construction is intuitive: the attention layer aggregates $ v_N=\frac{1}{N-1}\sum_i x_i^2 $, $ c_N=\frac{1}{N-1}\sum_i x_ix_{i+1} $, and $ x_N $, while the MLP approximates the nonlinear map $ (v_N,c_N,x_N)\mapsto(c_N/v_N)x_N $. This gives a concrete mechanism by which a simple transformer-like architecture can implement an AR(1) estimator using prompt-level covariance information.

The result is technically interesting, but the scope is narrower than suggested in the paper. The main theorem assumes the attention layer is already parametrized to compute the required sufficient statistics, and gradient descent is only applied to the outer MLP weights. So the theoretical result is closer to "given a hand-designed attention statistic extractor, a random-feature MLP can approximate the OLS AR(1) predictor" than to "a transformer trained by gradient descent learns the estimator." The paper does include an experiment where some attention weights are trained, but this is empirical only and uses a small selected subset of the attention parameters, not a theoretical joint training result.

I also have a concern about one proof step in the approximation bound. In Lemma F.4, the paper bounds the prediction error by writing the term involving $ (\alpha-\hat{\alpha}_N)^2x_N^2 $ as a product of expectations, using the statement that for sufficiently large $ N $, $ \hat{\alpha}_N $ and $ x_N $ are "essentially independent." This is not obvious because $ \hat{\alpha}_N $ is computed from the same trajectory and includes terms involving $ x_N $. Since this step feeds into the main bound, I think it needs either a precise mixing/covariance argument or a revised bound that does not require this independence approximation.

The multidimensional extension is also underdeveloped relative to how it is presented. The formal proof is only for (d=1), while the VAR(1) case is mostly a sketch. More importantly, the text says that because $ A\sim N(0,\omega^2/d I_d) $, the matrix (A) is symmetric and almost surely positive definite. That statement seems incorrect as written: an iid Gaussian matrix is not symmetric, and even a symmetric Gaussian matrix is not almost surely positive definite. Since the matrix inverse approximation argument depends on spectral/numerical range properties, this part needs to be corrected or clearly marked as only an informal conjectural direction.

The experiments are useful sanity checks, especially the plot showing that the learned MLP surface matches the target function. However, they mostly confirm the theorem's designed setting: fixed attention, large MLP width, synthetic AR data, and last-token prediction only. The non-fixed attention experiment is too limited to support a strong claim about learned attention dynamics. I would not treat the experiments as a major weakness for a theory paper, but they do not close the gap between the hand-constructed mechanism and learned transformer behavior.

I find this submission interesting and potentially useful for the theory of ICL, but I see the main result as somewhat overstated and one part of the proof as insufficiently justified.

Questions
  1. Can the authors give a rigorous justification for the step in Lemma F.4 where $ \hat{\alpha}_N $ and $ x_N $ are treated as essentially independent? Since $ \hat{\alpha}_N $ is computed from the same AR trajectory and includes terms up to $ x_N $, this seems like a nontrivial dependence issue. A mixing-based covariance bound or a direct bound on $ E[(\hat{\alpha}_N-\alpha)^2x_N^2] $ would address my main technical concern.
  2. Can the authors more clearly separate the fixed-attention theorem from the learned-attention claim? The theorem uses the attention parametrization in Lemma 4.6 and only trains $ \gamma $, while the discussion sometimes reads as if the transformer learns the full mechanism by gradient descent.
  3. In the VAR(1) discussion, how exactly is (A) sampled? The current statement that Gaussian (A) is symmetric and almost surely positive definite appears wrong as written. If the intended assumption is symmetric positive definite (A), please state the distribution precisely. If not, the matrix inverse approximation argument needs a different justification.
  4. For the non-fixed attention experiment, can the authors report whether the trained model actually recovers statistics equivalent to (v_N,c_N,x_N), up to symmetries, rather than only matching the final prediction surface? A diagnostic comparing attention outputs to these sufficient statistics would make the experimental evidence stronger.
Limitations

The authors mention the main limitation that the theory uses fixed attention and does not analyze joint convergence of the attention head and MLP. That is the right limitation to state. I think the limitations should also explicitly mention that the formal theory is only for scalar AR(1), that the multidimensional VAR extension is not proved, and that the current embedding/attention parametrization is hand-designed to compute the required statistics.

Final justification

The rebuttal resolved most of my concerns. The authors separated the fixed-attention theorem from the learned-attention experiments, corrected the VAR(1) discussion, and agreed to state the scope and limitations more explicitly. The paper's main contribution remains technically interesting: it gives a concrete mechanism for implementing a second-order moment-based AR(1) estimator in context.

My concern about Lemma F.4 is not resolved since the response relies on the standard "essential independence" assumption rather than providing a direct covariance or mixing bound. However, this does not outweigh the overall contribution especially given the paper's theoretical scope and the authors' clarifications. I therefore increased my score from 4 to 5.

Formatting concerns

No formatting concerns noticed.

4 comments
Authors · CommentOpenReview ↗

Response to Reviewer 7NZg [1]

Thank you for the valuable, positive feedback and for appreciating the results of the submission. Please see below for our response to your questions and comments.

Q1. Can the authors give a rigorous justification for the step in Lemma F.4 where α^N\hat{\alpha}_N and xNx_N are treated as essentially independent? Since α^N\hat{\alpha}_N is computed from the same AR trajectory and includes terms up to xNx_N, this seems like a nontrivial dependence issue. A mixing-based covariance bound or a direct bound on E[(α^N−α)2xN2]E[(\hat{\alpha}_N - \alpha)^2 x_N^2] would address my main technical concern.

It is standard to treat these quantities as independent in the AR process literature. Specifically, α^N\hat{\alpha}_N and xNx_N are assumed to be essentially independent for a stationary process for sufficiently large NN. This fact is usually used as is without the confidence intervals. Since we assume that the considered AR(1) process is stationary in Section 3.1, this result applies in our case. For reference, see, for instance, Box et al. (2015), top of page 279, which says "... the estimate φ^\hat{\varphi} is assumed to be essentially independent of z~t\tilde{z}_t" for a stationary AR(1) process. To improve the presentation, we will change the phrase “…for sufficiently large NN, α^N\hat{\alpha}_N and xNx_N are essentially independent” to “…for sufficiently large NN, α^N\hat{\alpha}_N and xNx_N are essentially independent for a stationary AR(1) process (Box et al., 2015, Appendix A7.6)” in the proof of Lemma F.4. Additionally, note that in the main Theorem 4.1 we explicitly use this assumption and state that the result holds “for sufficiently large NN”.

Q2. Can the authors more clearly separate the fixed-attention theorem from the learned-attention claim? The theorem uses the attention parametrization in Lemma 4.6 and only trains γ\gamma, while the discussion sometimes reads as if the transformer learns the full mechanism by gradient descent.

We will make another pass through the submission to ensure that fixed attention is mentioned in the discussion. Additionally, note that the Limitations section in the Discussion section clearly states this limitation: “This work ... leverages a combination of a fixed-attention parametrization and a trained MLP. While we confirm convergence of the full network experimentally, theoretical analysis would require consideration of the joint convergence behavior of the attention head and the MLP, and is left for future work.” The fixed attention parameterization is also clearly presented in Lemma 4.6. To make this point even clearer, we will replace “parametrization” with “fixed parametrization” in the statement of Theorem 4.1.

Q3. In the VAR(1) discussion, how exactly is (A) sampled? The current statement that Gaussian (A) is symmetric and almost surely positive definite appears wrong as written. If the intended assumption is symmetric positive definite (A), please state the distribution precisely. If not, the matrix inverse approximation argument needs a different justification.

We thank the reviewer for pointing this out and apologize for the typo, which likely occurred during the paper edits. Conjecture 5.4 is intended to discuss an approximation to the inverse of VNV_N, which is defined as VN=1/(N−1)XX⊤V_N = 1/ (N-1) X X^\top and is symmetric and almost surely positive definite for N≥d+1N \geq d + 1. We will replace AA with VNV_N in Conjecture 5.4, and the erroneous phrase at the beginning of the Approximation and convergence bounds paragraph with “VN=1/(N−1)XX⊤V_N = 1/ (N-1) X X^\top is symmetric and almost surely positive definite for N≥d+1N \geq d + 1.” Kindly note that this does not affect any other parts of the submission.

Q4. For the non-fixed attention experiment, can the authors report whether the trained model actually recovers statistics equivalent to (v_N,c_N,x_N), up to symmetries, rather than only matching the final prediction surface? A diagnostic comparing attention outputs to these sufficient statistics would make the experimental evidence stronger.

To our knowledge, it is not possible to provide a conclusive direct comparison of the attention output for the joint training of the attention layer and the MLP. Note how even for a network with fixed attention weights, multiple combinations of MLP weights can represent the same function. Additionally, several equivalent parametrizations of the attention output are possible. Furthermore, in a jointly optimized model, any change in the attention outputs (vN,cN,xNv_N, c_N, x_N) can be compensated by a change in the MLP weights, for which there are also many possibilities. Hence, there is no clear strategy for comparing networks with fixed and unfixed attention.

Authors · CommentOpenReview ↗

Response to Reviewer 7NZg [2]

Response to additional comments

C1. Limitations: The authors mention the main limitation that the theory uses fixed attention and does not analyze joint convergence of the attention head and MLP. That is the right limitation to state. I think the limitations should also explicitly mention that the formal theory is only for scalar AR(1), that the multidimensional VAR extension is not proved, and that the current embedding/attention parametrization is hand-designed to compute the required statistics.

We agree with the raised points and will make the corresponding changes to the Limitations section. Specifically, we will state explicitly that the fixed attention parametrization is hand-designed to compute the required statistics. We will also add the following sentence: ''We also point out that the formal theoretical results are provided only for the scalar AR(1) process, while for the VAR(1) case we only discuss the possible approach to the extension.”

References

Box, G. E., Jenkins, G. M., Reinsel, G. C., and Ljung, G. M. (2015). Time series analysis: forecasting and control. John Wiley & Sons.

We hope our response and changes address the questions and comments, and we would appreciate the reviewer considering adjusting their score accordingly.

Reviewer 7NZg · CommentOpenReview ↗

Response to Author Rebuttal

Thank you for the detailed rebuttal. The responses address my concerns regarding the fixed-attention scope, the VAR(1) presentation, and the stated limitations. My main technical concern about Lemma F.4 remains. Citing that the quantities are commonly treated as "essentially independent" does not provide a rigorous justification or bound for the dependence in this setting especially since this step directly enters the main approximation result. I have updated my score accordingly.

Authors · CommentOpenReview ↗

We thank the reviewer again for their valuable feedback and for raising their score.

Here we outline the main steps of the proof of α^N\hat{\alpha}_N and xNx_N independence:

Recall that for one prompt we consider a sequence of centered random variables (x1,…,xN,xN+1),xi∈R,i=1,…,N+1(x_1, \ldots, x_N, x_{N+1}), x_i \in \mathbb{R}, i = 1, \ldots, N+1 that follows an autoregressive model of order 1, AR(1)

xi+1=αxi+ξi+1x_{i + 1} = \alpha x_{i} + \xi_{i+1}

with a coefficient α∈(−1,1)\alpha \in (-1,1) and a centered noise term ξi+1∼i.i.d.N(0,1)\xi_{i+1} \stackrel{\textnormal{i.i.d.}}{\sim} \mathcal{N}(0, 1) independent of xix_i.

The ordinary least squares (OLS) estimator is given by

α^N=∑i=1N−1xixi+1∑i=1N−1xi2.\hat{\alpha}_N = \frac{\sum_{i=1}^{N-1} x_i x_{i+1}}{\sum_{i=1}^{N-1} x_i^2}.

We want to show that α^N\hat{\alpha}_N and xNx_N are asymptotically independent. To do this, we show that for a fixed α\alpha, N(α^N−α)\sqrt{N}(\hat{\alpha}_N - \alpha) and xNx_N are asymptotically independent.

  1. The estimation error is
α^N−α=∑i=1N−1xiξi+1∑i=1N−1xi2=SNVN.\hat{\alpha}_N - \alpha = \frac{\sum_{i=1}^{N-1} x_i \xi_{i+1}}{\sum_{i=1}^{N-1} x_i^2} = \frac{S_N}{V_N}.
  1. Now consider N(α^N−α)=SN/NVN/N\sqrt{N}(\hat{\alpha}_N - \alpha) = \frac{S_N / \sqrt{N}}{V_N / N}.

  2. VN/NV_N / N converges to a constant in probability. Specifically, VN/N→N→∞1/(1−α2)V_N / N \xrightarrow[N \rightarrow \infty]{} 1 / (1 - \alpha^2) in probability. See, for instance, Fuller (1995, Theorem 6.3.5) for h=0h = 0 for the formal statement and proof.

  3. N(α^N−α)→N→∞N(0,1−α2)\sqrt{N}(\hat{\alpha}_N - \alpha) \xrightarrow[N \rightarrow \infty]{} \mathcal{N}(0, 1 - \alpha^2) in distribution, see Fuller (1995, Theorem 8.2.1) for the formal result and proof. Hence, SN/N=N(α^N−α)⋅(VN/N)→N→∞N(0,1/(1−α2))S_N / {\sqrt{N}} = \sqrt{N}(\hat{\alpha}_N - \alpha) \cdot (V_N / N) \xrightarrow[N \rightarrow \infty]{} \mathcal{N}(0, 1 / (1 - \alpha^2)) in distribution.

  4. Fix k∈N,k>0k \in \mathbb{N}, k > 0. For SNS_N we get

SN=∑i=1N−1xiξi+1=∑i=1N−k−1xiξi+1+∑i=N−kN−1xiξi+1=s1+s2,S_N = \sum_{i = 1}^{N-1} x_i \xi_{i+1} = \sum_{i=1}^{N - k - 1} x_i \xi_{i+1} + \sum_{i=N-k}^{N-1} x_i \xi_{i+1} = s_1 + s_2,

and for xNx_N,

xN=αkxN−k+∑i=0k−1αiξN−i=xN(1)+xN(2).x_N = \alpha^k x_{N - k} + \sum_{i=0}^{k-1} \alpha^i \xi_{N-i} = x_N^{(1)} + x_N^{(2)}.

Notice that s1s_1 and xN(2)x_N^{(2)} are statistically independent, since s1s_1 depends on xi,ξi+1,i=1,…,N−k−1x_i, \xi_{i+1}, i = 1, \ldots, N - k - 1, and xN(2)x_N^{(2)} depends on ξi,i=N−k+1,…N\xi_i, i = N - k + 1, \ldots N.

  1. Using the Chebyshev inequality, for a fixed kk, s2/N=∑i=N−kN−1xiξi+1/N→N→∞0s_2 / \sqrt{N} = \sum_{i=N-k}^{N-1} x_i \xi_{i+1} / \sqrt{N} \xrightarrow[N \rightarrow \infty]{} 0 in probability, since s2s_2 is a sum of kk terms with zero expectation and bounded variance. Therefore, combining with 4, s1/N→N→∞N(0,1/(1−α2))s_1 / {\sqrt{N}} \xrightarrow[N \rightarrow \infty]{} \mathcal{N}(0, 1 / (1 - \alpha^2)) in distribution and, by 5, is independent from xN(2)x_N^{(2)}.

  2. By stationarity, xN−kx_{N - k} follows stationary distribution N(0,1/(1−α2))\mathcal{N}(0, 1/(1-\alpha^2)). Then, using ∣α∣<1|\alpha| < 1 and the Chebyshev inequality once again, we get xN(1)=αkxN−k→k→∞0x_N^{(1)} = \alpha^k x_{N - k} \xrightarrow[k \rightarrow \infty]{}0 in probability.

Combining observations 3-7, we get that N(α^N−α)\sqrt{N}(\hat{\alpha}_N - \alpha) is asymptotically independent from xNx_N. □\square

We will add a Lemma with the formal proof to Appendix F.

References

Fuller, W. A. (1995). Introduction to statistical time series. John Wiley & Son

We hope our response addresses the remaining question of justification.

Reviewer urzZOpenReview ↗
Rating
4/6
Confidence
4/5
Quality
3/4
Clarity
2/4
Significance
2/4
Originality
3/4
Contribution type
theory
Ethical concerns
NO or VERY MINOR ethics concerns only
Read review
Summary

The authors investigate in-context learning for AR(1) processes using a two-layer transformer architecture consisting of a linear self-attention head and a nonlinear MLP layer. Under a specific model parametrization, they analyze the function represented by the network and establish approximation and convergence results. Experimental results on synthetic AR(1)/VAR(1) data are provided to support the theoretical findings.

Strengths and weaknesses

Strengths

  1. Understanding the mechanism underlying in-context learning (ICL) is an important and actively studied research direction.

  2. Compared with the commonly studied linear regression setting, the AR(1) model is arguably closer to the autoregressive nature of language generation and next-token prediction. Therefore, extending ICL analysis to autoregressive processes is a worthwhile direction.

Weaknesses and Questions

  1. Problem setup and definition of ICL

Although the paper follows prior work and defines ICL through the population loss in Equation (5), I still have several concerns regarding the connection between the proposed setup and the standard notion of ICL.

(1) In Section 3.2 (Lines 117--121), the paper assumes that we are given T\mathcal{T} prompts, each of length N, generated from AR(1, ατ\alpha_\tau), and the goal is to predict xN+1x_{N+1} in a new context. However, in this setup, the given prompts do not contain the corresponding prediction targets xτ,N+1x_{\tau,N+1}. Moreover, the Introduction (Lines 17--21) states that “the goal for an in-context learner is to use the prompt to form a prediction x^τ,N+1\hat{x}_{\tau,N+1}.”

In standard ICL formulations, the prompt usually consists of demonstration input-output pairs together with a query, e.g., (x1,y1,…,xT,yT,xqueryx_1,y_1,\ldots,x_{\mathcal T},y_{\mathcal T},x_{\text{query}}). Under the current AR(1) formulation, it is unclear how the role of demonstrations is reflected. More specifically, how does this setup capture the key phenomenon that providing example input-output pairs improves prediction on a new query?

(2) Based on the setup above, the paper defines ICL through the population objective in Equation (5). However, this objective appears closer to a standard approximation/generalization analysis than to the conventional notion of ICL. In practical ICL, one typically starts with a pretrained language model whose parameters are fixed, and adaptation occurs through the prompt rather than additional training. By contrast, the paper introduces a training objective and analyzes gradient descent dynamics.

Therefore, it is unclear to me how the resulting theory should be interpreted from the perspective of practical ICL. For example, how do the theoretical results explain the empirical observation that providing demonstrations often improves performance relative to prompting the same model without demonstrations?

  1. Concerns regarding the theoretical results

(1) Interpretation of heterogeneity. The paper repeatedly emphasizes “heterogeneity” and “heterogeneous second-order moments,” giving the impression that heterogeneous second moments constitute a major new theoretical framework. However, the actual setup only considers different covariance structures induced by different values of α\alpha within the same uniform distribution. This is different from the more common notion of heterogeneous training and testing distributions. Furthermore, the conclusion of Theorem 4.1 is stated after taking expectation over α\alpha. Therefore, I am not fully convinced that heterogeneity plays as central a role as suggested throughout the paper.

(2) Interpretation of consistency and asymptotic efficiency. In Remark 4.2, the paper claims that the model “…when trained with gradient descent, converges to a consistent and asymptotically efficient OLS estimator…” However, Lemma 4.5 establishes these properties for the OLS estimator of α\alpha. In contrast, Theorem 4.1 assumes that α\alpha is random and takes expectation over α\alpha, while gradient descent optimizes the network parameter γ\gamma rather than α\alpha. Therefore, the connection between Theorem 4.1 and the statement in Remark 4.2 is not entirely clear.

(3) Multi-dimensional extension. The core result in Section 5 is presented as Conjecture 5.4 rather than a theorem. The authors explicitly write “we expect” and “we anticipate,” indicating that a rigorous proof is currently unavailable. In my opinion, this part should be clearly presented as an unfinished extension or future direction, rather than being included alongside the main theoretical results. I would recommend moving Section 5 to a discussion section or appendix.

  1. Experimental limitations

All experiments are conducted on synthetic AR(1)/VAR(1) data generated according to the assumptions used in the theoretical analysis. As a result, the experiments primarily verify the behavior predicted by the proposed theory, rather than demonstrating that similar phenomena occur in realistic pretrained transformers.

The Dyck-3 experiment appears mainly as a sanity check, and the paper itself notes that this task falls outside the assumptions of the proposed model. More broadly, the experiments validate the constructed theorem under the proposed assumptions, but do not provide evidence that the same mechanism is responsible for ICL behavior observed in modern pretrained language models.

Questions

see above

Limitations

yes

Final justification

The responses satisfactorily address most of my concerns, particularly regarding the AR formulation of ICL, the presentation of the theoretical results, the clarification of the consistency statement, and the positioning of the multidimensional extension. While I still think the connection to practical ICL systems and the experimental validation remain somewhat limited, I believe these are consistent with the intended scope of the paper as a theoretical study. Therefore, I have updated my score accordingly.

Formatting concerns

no

4 comments
Authors · CommentOpenReview ↗

Response to Reviewer urzZ [1]

Thank you for the valuable feedback and for appreciating the importance of the research direction. Please see below for our response to your questions.

Q1.1. In Section 3.2 (Lines 117--121), the paper assumes that we are given T\mathcal{T} prompts, each of length NN, generated from AR(1,ατ1, \alpha_{\tau}), and the goal is to predict xN+1x_{N+1} in a new context. However, in this setup, the given prompts do not contain the corresponding prediction targets xτ,N+1x_{{\tau}, N+1}. Moreover, the Introduction (Lines 17--21) states that “the goal for an in-context learner is to use the prompt to form a prediction xτ,N+1x_{{\tau}, N+1}.” In standard ICL formulations, the prompt usually consists of demonstration input-output pairs together with a query, e.g., (x1,y1,…,xT,yT,xqueryx_1, y_1, \ldots, x_{\mathcal{T}}, y_{\mathcal{T}}, x_{\text{query}}). Under the current AR(1) formulation, it is unclear how the role of demonstrations is reflected. More specifically, how does this setup capture the key phenomenon that providing example input-output pairs improves prediction on a new query?

This discrepancy occurs because we study prompts generated using an AR process. Related works, such as Chen et al. (2024) and Zhang et al. (2024), focus on the linear regression setup and hence consider prompts of the form (x1,y1,x2,y2,…,xN,yN,xquery)(x_1, y_1, x_2, y_2, \ldots, x_N, y_N, x_{\text{query}}). Since we consider an autoregressive process, the last data point, xNx_N, which is equivalent to yNy_N in the linear regression formulation, also becomes the query, i.e., $ x_{\text{query}} $. Hence, the linear regression data generation process defined, for instance, as yquery=wxqueryy_{\text{query}} = w x_{\text{query}}, corresponds to xN+1=αxN+ξN=αxquery+ξNx_{N+1} = \alpha x_N + \xi_N = \alpha x_{\text{query}} + \xi_N in the AR scenario. Hence, the prompts PN=(x1,…,xN)P_N = (x_1, \ldots, x_N) contain all necessary information. Additionally, note that we denote by NN the length of an individual prompt and by T\mathcal{T} the number of prompts in the training dataset. We also omit τ\tau and T\mathcal{T} in most of the discussion since we work with the population loss and only use them to clarify the setup.

Q1.2. Based on the setup above, the paper defines ICL through the population objective in Equation (5). However, this objective appears closer to a standard approximation/generalization analysis than to the conventional notion of ICL. In practical ICL, one typically starts with a pretrained language model whose parameters are fixed, and adaptation occurs through the prompt rather than additional training. By contrast, the paper introduces a training objective and analyzes gradient descent dynamics. Therefore, it is unclear to me how the resulting theory should be interpreted from the perspective of practical ICL. For example, how do the theoretical results explain the empirical observation that providing demonstrations often improves performance relative to prompting the same model without demonstrations?

This is the standard setting used for ICL analysis. The intuition is the following: We assume we observe tasks of similar nature during training, during which the model learns to represent a parametrized function. Then, during in-context learning, the model estimates the function parameters from the prompt in the forward pass and makes predictions without training. This setup has appeared in many prior works, such as Akyürek et al. (2023) and Zhang et al. (2024), and was initiated by Garg et al. (2022). We refer to this point of view in the first paragraph of the submission, where we state “We take the perspective of a framework for in-context learning of function classes, as introduced in Garg et al. (2022), and characterize the function learned by a transformer”.

Authors · CommentOpenReview ↗

Response to Reviewer urzZ [2]

Q2.1. Interpretation of heterogeneity. The paper repeatedly emphasizes “heterogeneity” and “heterogeneous second-order moments,” giving the impression that heterogeneous second moments constitute a major new theoretical framework. However, the actual setup only considers different covariance structures induced by different values of within the same uniform distribution. This is different from the more common notion of heterogeneous training and testing distributions. Furthermore, the conclusion of Theorem 4.1 is stated after taking expectation over α\alpha. Therefore, I am not fully convinced that heterogeneity plays as central a role as suggested throughout the paper.

While the term “heterogeneity” might be overloaded, as it is used in other contexts with a slightly different meaning, we use it for lack of a better alternative, as we believe it captures the essence of this line of work. The submission setup focuses on understanding how the model can handle prompts with different distributions, including a simpler scenario involving different moments, which fits the general meaning of heterogeneity as the quality or state of consisting of dissimilar or diverse elements. To improve clarity, in Section 3.2, in the paragraph “Heterogeneous second-order moments”, we will add the following note: “Note that while the term ‘heterogeneity’ appears in slightly different contexts in the literature, in our work we use it to refer to the situation when the second-order moments of the distribution are different across all training and testing prompts.”

While the setup appears simple, kindly note its complexity as discussed in Subsection 3.5: “Controlling for different covariances is challenging. To do it accurately, the learned estimator needs to use second-order moments estimated in context. Published results mainly show that transformers can implement first-moment-based methods using count- or mean-based estimators and can behave as second-moment-based estimators. However, these results do not explicitly demonstrate how a transformer can use higher-order moment-based estimators.” Additionally, the second-order moments are fundamental quantities that are the lowest-order statistics that reflect dependence between variables, and their estimators enter many standard predictors, including OLS for AR(1) and AR(p), as well as linear regression. Hence, studying them is of particular interest.

Regarding the expectation being taken over α\alpha, note that it naturally arises as we consider a population loss over prompts with different distributions that depend on α\alpha. It does not affect the conclusion, which indicates that during the in-context learning stage, the optimal estimator learned by the model during training will be reused for prompts with the variances and covariances estimated in-context from the prompt. Additionally, see our response to the next question for further clarification.

Q2.2. Interpretation of consistency and asymptotic efficiency. In Remark 4.2, the paper claims that the model “…when trained with gradient descent, converges to a consistent and asymptotically efficient OLS estimator…” However, Lemma 4.5 establishes these properties for the OLS estimator of. In contrast, Theorem 4.1 assumes that is random and takes expectation over, while gradient descent optimizes the network parameter rather than. Therefore, the connection between Theorem 4.1 and the statement in Remark 4.2 is not entirely clear.

Note that Lemma 4.5 talks about the estimator ∧αN{}^{\wedge}\kern-0.6em\alpha_N, which is represented by the trained network fMLP(fatt∗(EN);γ∗,β)f_{\textnormal{MLP}}(f_{\textnormal{att}}^\ast(E_N); \mathbf{\gamma}^\ast, \mathbf{\beta}), while the expectation in Theorem 4.1 is over α\alpha, which is a true parameter used to generate the prompts. To improve clarity, we will modify Remark 4.2 by changing “…there is such a parametrization of the attention layer that the network, when trained with gradient descent, converges to a consistent and asymptotically efficient OLS estimator…” to “…there is such a parametrization of the attention layer that the network, when trained with gradient descent, converges to fMLP(fatt∗(EN);γ∗,β)f_{\textnormal{MLP}}(f_{\textnormal{att}}^\ast(E_N); \mathbf{\gamma}^\ast, \mathbf{\beta}), which approximates α^N\hat{\alpha}_N, which is a consistent and asymptotically efficient OLS estimator…”.

Authors · CommentOpenReview ↗

Response to Reviewer urzZ [3]

Q2.3. Multi-dimensional extension. The core result in Section 5 is presented as Conjecture 5.4 rather than a theorem. The authors explicitly write “we expect” and “we anticipate,” indicating that a rigorous proof is currently unavailable. In my opinion, this part should be clearly presented as an unfinished extension or future direction, rather than being included alongside the main theoretical results. I would recommend moving Section 5 to a discussion section or appendix.

We agree with this point. To improve presentation, we will revise Section 5 on the extension to multi-dimensional inputs. Specifically, we will shorten it to retain only the assumptions and intuition of the proposed proof, while moving the lemmas and the conjecture to Appendix H. Additionally, we will move the multidimensional extension from a separate section to a subsection of the Discussion section to avoid confusion with the formal results. We will use the remaining space to incorporate other proposed changes.

Q3. Experimental limitations. All experiments are conducted on synthetic AR(1)/VAR(1) data generated according to the assumptions used in the theoretical analysis. As a result, the experiments primarily verify the behavior predicted by the proposed theory, rather than demonstrating that similar phenomena occur in realistic pretrained transformers. The Dyck-3 experiment appears mainly as a sanity check, and the paper itself notes that this task falls outside the assumptions of the proposed model. More broadly, the experiments validate the constructed theorem under the proposed assumptions, but do not provide evidence that the same mechanism is responsible for ICL behavior observed in modern pretrained language models.

Since the paper has a theoretical focus, the experiments aim to confirm the correctness of the theoretical findings. Hence, the experiments adhere to the theoretical assumptions. Experiments with real data typically involve a different, more complex setting than the one we analyze theoretically. We would not be able to control for second-order moments easily, and real-data tasks introduce new issues not covered in theory. Therefore, such experimental results are likely to be inconclusive for our theoretical results. Generally, we agree that an empirical investigation that unites theoretical understanding developed by the community with empirical observations would be valuable and deserves its own dedicated study. The complexity of such an investigation is illustrated by empirical studies of ICL, including Raventós et al. (2023), Goddard et al. (2025), and Zhang et al. (2025), which are discussed in more detail in Appendix A.

References

Akyürek, E., Schuurmans, D., Andreas, J., Ma, T., and Zhou, D. (2023). What learning algorithm is in-context learning? investigations with linear models. In The Eleventh International Conference on Learning Representations.

Chen, S., Sheen, H., Wang, T., and Yang, Z. (2024). Training dynamics of multi-head softmax attention for in-context learning: Emergence, convergence, and optimality (extended abstract). In Conference On Learning Theory.

Garg, S., Tsipras, D., Liang, P. S., and Valiant, G. (2022). What can transformers learn in-context? a case study of simple function classes. Advances in Neural Information Processing Systems, 35:30583–30598.

Goddard, C., Smith, L. M., Ngampruetikorn, V., and Schwab, D. J. (2025). When can in-context learning generalize out of task distribution? In Forty-second International Conference on Machine Learning.

Raventós, A., Paul, M., Chen, F., and Ganguli, S. (2023). Pretraining task diversity and the emergence of non-bayesian in-context learning for regression. Advances in Neural Information Processing Systems, 36:14228–14246.

Zhang, X., Wang, H., Li, J., Xue, Y., Guan, S., Xu, R., Zou, H., Yu, H., and Cui, P. (2025). Understanding the generalization of in-context learning in transformers: An empirical study. In The Thirteenth International Conference on Learning Representations.

Zhang, R., Frei, S., and Bartlett, P. L. (2024). Trained transformers learn linear models in-context. Journal of Machine Learning Research, 25(49):1–55.

We hope our response and proposed changes address the questions asked, and we would appreciate the reviewer considering adjusting their score accordingly.

Reviewer urzZ · CommentOpenReview ↗

Thank you for the detailed rebuttal. The responses satisfactorily address most of my concerns, particularly regarding the AR formulation of ICL, the presentation of the theoretical results, the clarification of the consistency statement, and the positioning of the multidimensional extension. While I still think the connection to practical ICL systems and the experimental validation remain somewhat limited, I believe these are consistent with the intended scope of the paper as a theoretical study. Therefore, I will update my score accordingly.

Reviewer a8MvOpenReview ↗
Rating
5/6
Confidence
3/5
Quality
3/4
Clarity
3/4
Significance
3/4
Originality
3/4
Contribution type
theory
Ethical concerns
NO or VERY MINOR ethics concerns only
Read review
Summary

The paper studies in-context learning with a two-layer transformer of a simplified data generating process (autoregressive order 1, x_{i+1} = \alpha x_i + noise, \alpha sampled at the start of each sequence). This is an obviously over simplified setting, but interesting because the covariance between the sequences changes. The authors prove convergence rates in this setting, which shows that transformers can learn to conduct ICL on distributions of sequences with different covariances, as well as describes parameters of interest for this learning (sequence length, number of parameters, etc.).

Strengths and weaknesses

This paper has a narrow but well developed contribution. The setting is perhaps overly simplified, but in turn, offers some interpretability which is largely the point of the analysis. Despite the simplicity, the takeaways are useful and interpretable (e.g., linear dependence on sequence length). There are some efforts to extend the analysis to more realistic settings as well (e.g., multi-dim inputs).

  • I think one core weaknesses (as I have mentioned) is the simplicity of the data generation setup. There is some tradeoff between interpretation and analytic tractability vs. problem complexity that must be managed ofc. however, i think the authors could do a better job of discussing limitations and difficulties in extending the proof, specifically related to the data-generating process, since that is where most of the novelty lies to my understanding. It’s not clear whether the current strategy could at all extend to other heterogenous prompt distributions and how that would look.
  • Another weakness is that the experimental work could be more detailed eg studying convergence rates as you vary different parameters in addition to just the current experiments which show approximate recovery of the optimal parameters. These are more of an afterthought in the current paper. I almost think the multi dimensional extension might be better summarized with more detail pushed to appendix, with more empirical work in main text to see how the bound behaves compared to reality (as well as more detail to walk readers through what is happening in current experiments). For me the bound itself and its explanation of dependence on sequence size and network parameters communicates good information about the problem and is understudied besides a short explanation.
Questions
  • what aspects of the analysis break down if we change the data generating process? What types of changes might allow similar analysis?
  • how does the bound behave compared to reality (in terms of prompt length dependence and number of parameters) if this information is available?
Limitations

Yes

Final justification

I maintain a positive view of the paper after discussion.

Formatting concerns

None

2 comments
Authors · CommentOpenReview ↗

Response to Reviewer a8Mv

Thank you for the valuable, positive feedback and for appreciating the contribution and takeaway message of the submission. Please see below for our response to your questions and comments.

Q1. What aspects of the analysis break down if we change the data generating process? What types of changes might allow similar analysis?

There are several options to consider. The first possibility is to change only the data-generating process, for instance, to an AR(pp) process, while keeping the model unchanged. In this case, the OLS estimator considered in the submission might still provide a good approximation to the optimal solution. Then one would focus on investigating the convergence to this estimator for the considered data-generating process and properly bounding the approximation error.

The second option is to consider changes to both the generating process and the model. Then, an approach similar to the submission would be to consider an optimal estimator for this new generating process and to determine which building blocks of the transformer might be useful for representing its components. For instance, one can consider more heads, more layers, or nonlinear attention. We hypothesize that softmax attention may be particularly useful for representing optimal estimators when input data exhibit nonlinear dependencies. Multi-head attention might help learn combinations of estimators or estimators for processes with long memory. Both can be useful for representing, in general, more complex estimators, for instance, estimators that depend on statistics of order higher than two.

We agree with the reviewer that a more in-depth discussion of possible extensions would add value to the submission, and we will incorporate the discussion above into the Future work subsection of the Discussion section.

Q2. How does the bound behave compared to reality (in terms of prompt length dependence and number of parameters) if this information is available?

While we agree that a more detailed experimental analysis would be helpful, we do not have the results available at this time, as we are focusing on the theoretical contribution and generally confirming convergence of the discovered parametrization to the optimal estimator.

Response to the additional comment

C1. I almost think the multi dimensional extension might be better summarized with more detail pushed to appendix, with more empirical work in main text to see how the bound behaves compared to reality (as well as more detail to walk readers through what is happening in current experiments).

We agree with this point. To improve presentation, we will revise Section 5 on the extension to multi-dimensional inputs. Specifically, we will shorten it to retain only the assumptions and intuition of the proposed proof, while moving Lemmas and Conjecture to Appendix H. Additionally, we will move the multidimensional extension from a separate section to a subsection of the Discussion section to avoid confusion with the formal results. We will use the remaining space to incorporate other proposed changes. Additionally, we will modify the Experiments section by adding a summary of the experiment on Dyck-3, currently in Appendix I, to provide a reference point for the model behavior on more realistic data, and expanding the details of the other experiments.

Reviewer a8Mv · CommentOpenReview ↗

Thanks for your response and I agree with these proposed edits. I maintain my positive view of the paper

Comments on the paper

1 comment
Area Chair vk4R · CommentOpenReview ↗

Reviewer Response Needed

Dear Reviewers,

The author-reviewer discussion period will end on August 3. The authors have posted their rebuttal addressing your concerns. If you have not yet done so, please read their response and engage in the discussion. Please indicate whether the rebuttal adequately addresses your concerns, and update your scores/reviews if appropriate. Thank you.

Best regards, AC

From OpenReview, CC BY 4.0. Authors as signed there; shown unedited.

Missing a submission?

Loading the discussion…