potentialpaper

In-Context Benign Overfitting: A Feature-Selection Model in Linear Regression ICL

Puneesh Deora, Bhavya Vasudeva, Christos Thrampoulidis

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 develop an in-context analogue of benign overfitting for supervised learning for in-context learning of linear regression.

Abstract. In in-context learning (ICL), a frozen pre-trained model solves tasks by conditioning on a prompt of a few input–output examples, without gradient updates. If the task was present in pretraining but the particular prompt sequence was unseen, the resulting in-distribution generalization is retrieval-based ICL. Learning-based ICL instead reflects out-of-distribution generalization, where the model succeeds on prompts generated by a novel task. Empirically, both forms improve with scale. By analogy to benign overfitting in supervised learning, we call this in-context benign overfitting: larger models more faithfully memorize the pretraining tasks (improving retrieval ICL) while also generalizing better to novel tasks (improving learning ICL). We prove that this phenomenon already arises in a minimal in-context linear-regression feature-selection model. In contrast, standard in-context linear-regression models exhibit a retrieval–learning tradeoff, where the emergence of learning-based ICL coincides with degraded retrieval-based performance.

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
4 May 2026NeurIPS 2026submittedNeurIPS 2026Accept (poster)reviews ↓[1]PDF[1]
Missing a version?

NeurIPS 2026

Accept (poster) · 3 reviews · OpenReview

Updated 25 Nov 2026, 03:43 UTC.

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

The reviewers appreciate the paper's theoretical analysis of the relationship between retrieval- and learning-based in-context learning and find the proposed characterization of model-scale effects to be interesting. However, several important issues should be addressed in the rebuttal. Among them, the authors should especially clarify (1) the interpretation and terminology of ``in-context benign overfitting,'' including its relationship to the classical notion of benign overfitting and the distinction between in-distribution and the paper's notion of out-of-distribution generalization, (2) the extent to which the conclusions depend on the simplified feature-selection model and how they relate to scaling in practical transformer-based ICL, and (3) the empirical and theoretical evidence supporting the proposed framework, including the role of the Gaussian equivalence and the connection between the theoretical predictions and the transformer experiments. 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. The authors also provided additional experimental evidence. Some limitations remain regarding the simplified theoretical model and the lack of a formal Gaussian-equivalence result for the original structured model, but the reviewers generally view these limitations acceptable compared with similar works in this line of research. Given the overall positive evaluations after discussion, I recommend acceptance.

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

The reviewers appreciate the paper's theoretical analysis of the relationship between retrieval- and learning-based in-context learning and find the proposed characterization of model-scale effects to be interesting. However, several important issues should be addressed in the rebuttal. Among them, the authors should especially clarify (1) the interpretation and terminology of ``in-context benign overfitting,'' including its relationship to the classical notion of benign overfitting and the distinction between in-distribution and the paper's notion of out-of-distribution generalization, (2) the extent to which the conclusions depend on the simplified feature-selection model and how they relate to scaling in practical transformer-based ICL, and (3) the empirical and theoretical evidence supporting the proposed framework, including the role of the Gaussian equivalence and the connection between the theoretical predictions and the transformer experiments. 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. The authors also provided additional experimental evidence. Some limitations remain regarding the simplified theoretical model and the lack of a formal Gaussian-equivalence result for the original structured model, but the reviewers generally view these limitations acceptable compared with similar works in this line of research. Given the overall positive evaluations after discussion, I recommend acceptance.

1 comment
Authors · CommentOpenReview ↗

Thank you for the summary.

We have addressed all three points in our reviewer responses, and we will incorporate the clarifications in the camera-ready given the additional page.

Terminology. In our discussion with Reviewer ahC7, we clarified that our use of “in-context benign overfitting” is a task-level analogue of the post-interpolation behavior studied in classical benign overfitting and double descent: once the pretraining sequences are interpolated, increasing capacity improves prediction on fresh sequences from seen tasks (ID/retrieval) while preserving or improving performance on unseen tasks (OOD/learning) relative to the best underparameterized model. Further, to avoid confusion with conventional distribution-shift OOD, we will replace the ID/OOD terminology throughout with retrieval/learning, consistent with the terminology used in the Introduction.

In response to Reviewer c9tf, we also quantified the finite-task nature of this distinction using our derived risks. The retrieval-learning distinction vanishes only in the large-task-diversity limit, quantified by p/M→0p/M\to 0. Importantly, our main in-context benign-overfitting result is a fixed-task-diversity statement: at finite task diversity, where retrieval and learning risks remain distinct, increasing model scale beyond the interpolation threshold improves retrieval performance while retaining or improving learning performance.

Feature-selection model. Feature selection is a capacity knob that holds the ambient dimension and the data and task distributions fixed, similar to classical benign-overfitting models for linear regression. The standard p=dp=d formulation has no separate capacity parameter, and Fig. 3 (setting of Lu et al., 2025) instead exhibits a retrieval-learning tradeoff. Empirically, the phenomenon is not confined to this choice: in Fig. 5 and Appendix H, transformer width is varied at fixed input dimension, and both linear-attention and full softmax-attention models exhibit the same qualitative post-interpolation behavior (see our detailed response to Reviewer c9tf).

Evidence and Gaussian equivalence. We clarified to Reviewer c9tf that Theorems 1 and 2 rigorously characterize the Gaussian-equivalent problem, which matches the second-order quantities entering the squared risk. Figs. 2–3 show that these predictions closely track the original structured model in both regimes; a formal universality proof remains open, as noted in lines 191-195. We have also run transformer experiments jointly varying embedding dimension and task diversity, as suggested by Reviewer mMGa, and observe the same qualitative behavior predicted by Fig. 4. We will include these results in the camera-ready version.

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

The paper introduces the feature-selection formulation from prior work, to be applied to the linear regression model setting in ICL. By studying the proportional limit regime, the authors convert the problem into a gaussian equivalent problem. They identify the impact of task diversity and scale which affect whether benign overfitting happens. They also provide some Transformer experiments to verify benign overfitting happens.

Strengths and weaknesses

Strengths: The writing is clear and easy to understand.

Weakness:

  • Line 81~82 and Line 87~88 seem repetitive, where feature-selection formulation is repeated twice. Related work should appear in the main paper instead of appendix.
  • The Transformer experiments seem to be pretty limited. Figure 11~15 and Figure 5 only shows its relationship with embedding dimension, but not with task diversity too. It might be helpful to look at this papers for additional experiments, although they are on markov chains, to investigate the threshold of various factors in transformer experiments [1].
  • It is unclear about the connection between section 3.3 and 4 and section 3.3 still remains hard to parse, it would be great if authors can comment on how model scale and task diversity appear in the two theorems.
  • It would be great if the authors can explicitly write more technical innovations of this work from prior work, i.e. how the feature selection mechanism interacts with the techniques in Lu et al. . Line 538~542 seems to mention a bit but it would be better to make it more explicit.

[1] Competition Dynamics Shape Algorithmic Phases of In-Context Learning. Park et al. ICLR 2025.

Questions

Questions:

  • Can you explain in more detail about the difference between p and d? In line 103 you mentioned that vanilla formulation of prior work corresponds to p = d. In equation (3), you mentioned p/d -> rho. Do you mean p <= d and is a fixed propotion of d (since it takes subsets of original features).
  • Why p appears before the lim, in both theorem 1 and 2?
  • In Section Line 232~242, can you establish a clearer and more precise criteria about the transition of in-context benign overfitting, to harmful overfitting? Does it have any relationship with T/d’s limit too?
  • Line 243~266 seem to be operating in the overparametrized regime, while it holds in standard neural network training, it does seem to be the case in language modelling, for example, scaling law might imply that we should train smaller models for much larger amount of data, can authors comment on this? It would be great if the threshold (ρ > √ν) can be drawn in Figure 4.
Limitations

Yes, it would be better to provide more thorough Transformer experiments to strengthen the paper. I am willing to raise score if the questions regarding experiments and readability of the theoretrical result are resolved.

Final justification

The rebuttal has effectively resolved my concerns.

Formatting concerns

No

1 comment
Authors · RebuttalOpenReview ↗
Rebuttal

Thank you for the positive endorsement of our work and constructive feedback. We answer specific questions below.

Q1: Difference between p and d.

Yes. Here, dd is the ambient dimension of the features xx, while p≤dp\leq d is the subset of features selected by the model. Under the proportional scaling in Eq. (3), pp grows with dd while p/d→ρp/d \to \rho, with ρ∈(0,1]\rho \in (0, 1]. Similarly, N,T,MN, T, M grow with dd according to the ratios ν,τ,μ\nu, \tau, \mu, respectively.

Q2: Meaning of plim\text{plim}.

The notation plim⁡\operatorname{plim} denotes the limit in probability; the “p” in plim⁡\operatorname{plim} is unrelated to the model-size variable pp. Under the joint scaling in Eq. (3), as d→∞d \to \infty, the ID and OOD risks converge in probability to the deterministic limits stated in Theorems 1 and 2. Thank you for asking, we will define the operator to avoid confusion.

Q3: Benign and harmful overfitting.

Lines 232–242 compare two different ways of increasing overparameterization. In Fig. 2, we fix the number of training sequences ν=N/d\nu = N/d, task diversity μ=M/d\mu=M/d, and context length τ=T/d\tau=T/d and vary the explicit model-scale parameter ρ=p/d\rho=p/d. Beyond the interpolation threshold, both ID and OOD risks decrease. In Fig. 3, we instead fix ρ=1\rho=1 and vary 1/ν=d2/N1/\nu = d^2/N (similar to Lu et al. 2025). This changes the sample-to-dimension ratio rather than independently scaling model capacity, and in the isotropic setting shown, OOD risk decreases while ID risk increases.

Thus, the post-interpolation behavior of the two risks is the key quantity: in-context benign overfitting occurs when increasing scale improves ID performance without degrading OOD performance, whereas harmful overfitting or a retrieval–learning tradeoff occurs when ID risk increases while OOD risk decreases or vice-versa. The exact transition is determined implicitly by the risk expressions in Theorems 1 and 2 as a function of ρ,ν,μ,τ,σn2\rho,\nu,\mu,\tau,\sigma_n^2; we do not currently derive a simple universal closed-form threshold.

The context-length ratio T/dT/d also affects this transition. In both theorems, it enters through c=1+σn2τc=\frac{1+\sigma_n^2}{\tau}, and therefore changes both ID and OOD risks. Larger τ\tau provides more demonstrations to infer the underlying task in the sequence, although deriving a separate closed-form transition threshold in τ\tau is beyond the current result.

We will clarify these in reference to Lines 232-242.

Q4: Fig. 4 and scaling laws.

Figure 4 is not restricted to the overparameterized regime. For every fixed task diversity μ\mu, moving vertically by increasing ρ\rho crosses from the underparameterized regime ρ2<ν\rho^2<\nu to the overparameterized regime ρ2>ν\rho^2>\nu. The bright yellow high-loss band corresponds to the interpolation peak near ρ=ν\rho=\sqrt{\nu}​. We will explicitly draw this ρ=(ν)\rho = \sqrt(\nu) line to make this more clear.

The discussion in Lines 262–266 specifically considers fixed overparameterized models and the effect of varying task diversity: higher task diversity improves OOD generalization but worsens ID performance. This is connected to the task diversity thresholds studied in previous ICL literature (Raventos et al., 2023, Park et al., 2025).

Finally, compute-optimal language-model scaling concerns a different comparison: under a fixed compute budget, one may trade off a larger model trained on less data against a smaller model trained on more data. Our analysis instead characterizes the ID and OOD risks of the limiting solution achieved by gradient descent training: least-squares solution in the underparameterized regime and the minimum-norm interpolator in the overparameterized regime. We hold the data parameters (ν,μ,τ\nu, \mu, \tau) fixed while varying model scale ρ\rho, and do not impose a fixed compute constraint. Thus, our results isolate the statistical effect of model scale rather than identifying a compute-optimal allocation between model size and training data. Studying such an allocation would require jointly varying model size ρ\rho, the amount and length of pretraining data through ν\nu and τ\tau, and the optimization budget under an explicit compute constraint. While this is an interesting direction that we will mention in the future work section, it is beyond the scope of the current work.

W2: Transformer experiments on task diversity.

Thank you for the valuable suggestion. Figure 4 already studies this interaction where we plot the ID and OOD risks obtained in Theorems 1 and 2, capturing both the effect of model scale ρ\rho studied here and the task-diversity thresholds in μ\mu observed in prior work, including Park et al. 2025. We have additionally run corresponding transformer experiments varying both embedding dimension and task diversity, and observe the same qualitative behavior as in Fig. 4. We will include these results in the camera-ready version.

W3: Connections between Sec. 3.3 and Sec. 4.

We welcome your feedback on the presentation. The formulas in Section 3.3 capture explicit dependencies on all the principal problem parameters: model scale ρ\rho, task diversity μ\mu, context length τ\tau, number of pretraining sequences ν\nu, and noise level σn2\sigma_n^2​. Model scale enters directly through ρ\rho and the overparameterization ratio ρ2/\rho^2/, while task diversity enters through the Marchenko–Pastur ratio used in the empirical task covariance matrix γ=ρ/μ\gamma=\rho/\mu.

Because these dependencies are coupled through the Stieltjes transform and the fixed-point quantities (Eq. 8), we only briefly discuss the most interpretable one in the paragraph following Theorems 1 and 2. For example, in the underparameterized regime,κ∞→∞\kappa_\infty\to\infty as ν/ρ2→1+\nu/\rho^2\to1+, causing both ID and OOD risks to diverge. On the overparameterized side, as ν/ρ2→1−\nu/\rho^2\to1-, the fixed-point quantities aa and βˉ∗\bar\beta_*​ become singular, again yielding divergence of both risks at the interpolation threshold.

In order to clearly see the dependencies on model scale and task diversity, in Section 4, we plot the exact ID and OOD loss predictions given by Theorems 1 and 2. Figure 2 varies model scale ρ\rho while fixing the other parameters, Figure 3 varies ν\nu with ρ=1\rho=1, and Figure 4 jointly varies model scale ρ\rho and task diversity μ\mu.

We will add a small paragraph immediately after Theorem 2 summarizing how the problem parameters ρ,μ,ν,τ\rho,\mu,\nu,\tau, and σn2\sigma_n^2 enter the risk formulas, and short roadmap at the beginning of Section 4 explaining that Figs. 2-4 evaluate these formulas along the ρ\rho-, ν\nu-, and joint (ρ,μ)(\rho,\mu)-directions, respectively.

W4: Technical innovations relative to Lu et al. 2025.

Thank you for the question. The technical differences from Lu et al., 2025 are twofold. First, we introduce and analyze a new feature-selection model for ICL. Lu et al., 2025 consider the full-feature setting p=dp=d, whereas our model restricts the learner to a random subset SS of pp visible coordinates. This does not merely introduce an additional parameter ρ(p/d)\rho (p/d): it changes the regression-feature dimension to p2p^2, places the interpolation threshold at p2=Np^2=N (equivalently, ρ2=ν\rho^2=\nu), and replaces the full empirical task covariance by

1M∑i=1Mwi[S]wi[S]⊤\frac{1}{M}\sum_{i=1}^{M}w_i[S]w_i[S]^\top,

whose limiting spectrum depends jointly on model scale and task diversity through p/M→ρ/μp/M\to\rho/\mu. Consequently, the risks for the model using feature selection cannot be obtained by simply replacing dd with pp in the formulas of Lu et al., 2025.

Second, we use different technical machinery to analyze this new model. We first compute the relevant first- and second-order moments of the selected features and query labels, and construct a Gaussian linear problem matching the feature covariance, feature-label cross-covariance, and label second moments. We then apply the CGMT to characterize the least-squares and minimum-norm estimators of this Gaussian equivalent problem and derive the corresponding ID and OOD risks (as discussed in the proof sketch in Section 5).

Gaussian equivalence and CGMT are flexible and well-established tools in modern high-dimensional statistics and learning theory. In contrast, Lu et al., 2025 directly analyze their full-feature ridge formulation through an extended-resolvent random-matrix calculation. We will make both technical innovations: i) the introduction and analysis of the feature-selection model, ii) and the use of this distinct analytical route more explicit in the camera-ready version.

W1: Related work.

Thank you for the suggestion. We will fix the repetition between Lines 81-82 and 87-88 and move the related-work discussion into the main body in the camera-ready version, where the page limit allows an additional page.

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

This paper proves that in-distribution (ID) and out-of-distribution (OOD) in-context learning (ICL) performance can both improve in the limit of large model capacity. The authors call this phenomenon, "in-context benign overfitting", as an analogue of the similar phenomenon in supervised learning. The main argument is that this phenomenon is present even in the most minimal model and is therefore not a unique feature of larger-scale models. The suthors show further that this phenomenon depends on the model scale parameter.

Strengths and weaknesses

The paper reads well and the theory appears correct, validated with small-scale numerical experiemnts. I have several concerns.

  1. I do not believe the term "benign overfitting" is appropriate for the phenomenon considered. Benign overfitting means interpolating while still generalizing, enabled by overparameterisation. In fact, increasing the model scale almost does not suppress the ID loss and does not decrease OOD loss below the limit of vanishing model scale (Fig 2); this is far from "generalizing" either ID or OOD
  2. The model scale is tied to the data dimension (seen by the model). The results therefore confound the effects of data dimensions and those from varying model scale.
  3. The paper makes a distinction between in-context benign overfitting and standard ICL, but it is unclear whether this behavior is purely due to the properties of the linear tasks or to in-context learning. As it is formulated, they are confounded.
  4. The use of min-norm formulation results in interpolation singularity at p=N, which dominates the figure and masking the effects of model scale, data size and task diversity. Small but larger-scale transfromers are known to adapt to the data and implement an algorithm closer to optimally tuned ridge regression with no or much weaker interpolation peak.
  5. Both ID and OOD defined in the paper are in-task-distribution. That is, the training and test tasks are from the same probability distribution. OOD generally implies some form of distribution shift which is absent from the current work. The authors should rectify the termoinology or significantly clarify this point so readers do not confuse the OOD case with out-of-task-distribution.
  6. Related to the above, how does the current work compare with those that consider out-of-task-distribution generalization (e.g., https://openreview.net/forum?id=YKyza9lrv4)? Do the authors expect the insights from this work to also apply there?
  7. In Fig 4, what do the dashed lines represent? Are they contour lines? The left and right panels have different color scales, making it hard to directly compare ID and OOD generalization.
Questions

Please see Strengths And Weaknesses.

Limitations

Yes

Final justification

The authors have agreed to modify terminology surrounding ID/OOD which will significantly improve the clarity. The assumptions of the theory remain a limitation, but they are in line with average published work in this area.

Formatting concerns

No concerns

5 comments
Authors · RebuttalOpenReview ↗
Rebuttal

Thank you for the careful reading and constructive feedback. We respond to specific comments and questions below. We hope the responses address your concerns, and we would be happy to answer any additional questions.

1. On Benign overfitting terminology.

We agree that one common reading of classical benign overfitting is interpolation of the training data together with good generalization to fresh samples. A closely related reading, particularly in the double-descent literature, concerns behavior beyond interpolation: increasing model capacity improves population prediction rather than causing generalization to deteriorate. Our use of the term is the task-level analogue of this latter behavior. Beyond interpolation of the NN pretraining sequences, increasing capacity improves prediction on fresh sequences from the pretraining tasks while retaining performance on unseen tasks. This is the behavior established by our theoretical analysis and observed more generally in our experiments, motivating our terminology.

In the in-context setup, the key distinction is that the ID loss in Fig. 2 is not the training loss. Our training set consists of NN fixed sequences generated from a finite pool of pretraining tasks, and in the overparameterized regime p2≥Np^2\geq N, these sequences are interpolated exactly. At inference time, ID evaluation uses a fresh sequence whose task is sampled from the finite pretraining task pool, whereas OOD evaluation uses a fresh sequence whose task is independently sampled from Dtask\mathcal D_{\mathrm{task}}​ and is therefore almost surely outside that finite pool. Consequently, neither risk is expected to vanish merely because the pretraining sequences are interpolated: label noise, finite context length, finite pretraining data, and feature selection all contribute to nonzero prediction risk.

Concretely, in the isotropic setting of Fig. 2, the overparameterized extreme achieves substantially lower ID loss than the underparameterized extreme while attaining comparable OOD loss. The power-law covariance experiments in Appendix H show the stronger case in which both overparameterized risks fall below their respective underparameterized minima.

Overall, we agree that this distinction would benefit from being stated more explicitly, and we will clarify the post-interpolation, meaning of “in-context benign overfitting” where the terminology is introduced.

2. Model scale tied to data dimension seen by model.

We agree that, in our theoretical model, the number of selected features pp is linked to the number of trainable parameters p2p^2. This is a deliberate choice: in classical double descent literature [Hastie et al., 2019; Belkin et al., 2020], feature selection provides a minimal mechanism to control the model size, and we similarly use it as one way to control model capacity. Importantly, in Fig. 2, the ambient dimension dd, the underlying data and task distributions, and all other data-generation parameters are fixed; only pp (model scale proxy) is varied. Thus, the underlying data distribution does not change.

Within the standard p=dp=d linear-attention formulation, there is no separate model-capacity parameter. Increasing the parameter-to-sample ratio therefore requires varying dd relative to NN, as in Lu et al. [2025]. As shown in Fig. 3, this scaling does not capture the desired model-scale effect: OOD loss improves, but ID loss worsens.

The transformer experiments provide a complementary check where the input dimension and all data-generation parameters remain fixed, while model scale is varied through one of the standard ways by increasing the embedding dimension. Thus, unlike in the theoretical model, model size is not tied to the number of features selected by the model. We still observe the same qualitative post-interpolation behaviour in both linear-attention and softmax transformers.

3. Distinction between in-context benign overfitting and standard ICL.

Thanks for the question. Prior work [Raventos et al., 2023, Park et al., 2025] on retrieval and learning modes have primarily studied the effect of task diversity at a fixed model architecture or capacity. These works identify a task-diversity threshold: as the number of pretraining tasks increases, the model transitions from good retrieval performance (low ID loss but high OOD loss) to good learning performance (low OOD loss but higher ID loss).

Empirical observations in larger language models [Wei et al., 2023] suggest that retrieval- and learning-based ICL can both improve with scale; our goal is to show that this coexistence can already arise in a minimal, analytically tractable model for ICL (Fig. 2). Figure 4 makes the distinction between these two effects explicit. Horizontal cuts, which vary task diversity at fixed model scale, recover the task-diversity effects identified in prior work. Vertical cuts, which vary model scale at fixed task diversity, reveal the in-context benign-overfitting behavior studied here. Thus, our framework recovers the known effects of task diversity while additionally characterizing the effect of model scale.

4. Interpolation peak and minimum norm formulation.

First a clarification: the interpolation threshold in our model is p2=Np^2 =N, rather than p=Np=N. The interpolation threshold in our model is p2=Np^2 =N, rather than p=Np=N. We agree that the divergence exactly at this threshold is a consequence of the ridgeless minimum-norm formulation. However, the height of this peak is not central to our claim, which concerns the behavior along the post-interpolation branch: as model scale increases beyond the threshold, ID performance improves substantially while OOD performance is retained (compared to the underparameterized extreme). This effect is clearly visible in Fig. 2, while Fig. 4 separately characterizes the joint effects of model scale and task diversity.

We also distinguish the minimum-norm solution used to fit the model across the NN pretraining sequences from the algorithm implemented in-context over the TT demonstrations. Prior works [Garg et al. 2022, Akyurek et al. 2023, etc.] showing that transformers can implement ridge-like in-context estimators concern the latter and do not imply that the outer pretraining problem cannot be interpolated.

Finally, the transformer experiments (Fig 5. and App. H) are not restricted to our minimum-norm theoretical formulation. Nevertheless they follow the same pattern: their training loss falls to approximately zero as embedding dimension increases, after which both ID and OOD losses exhibit the same qualitative post-interpolation descent. Thus, weakening or smoothing the interpolation peak does not alter the model-scale phenomenon studied in the paper.

5. OOD terminology.

We agree that our use of “OOD” does not refer to a conventional distribution shift. Rather, it is task-level: ID evaluation uses fresh sequences generated by tasks from the finite pretraining task pool, whereas OOD evaluation uses fresh sequences generated by tasks not contained in that pool. The pretraining and OOD tasks are nevertheless drawn from the same parent task distribution. Section 2 explicitly states this finite-MM distinction and notes that we follow the terminology used in prior finite-task ICL work [Park et al. 2025]. Please also refer to Rev 1 Q2: we will clarify this further in the camera-ready.

6. Comparison with out-of-task-distribution work.

Thank you for the reference. Goddard et al., 2025 study a complementary setting in which the pretraining tasks cover a restricted region of task space and evaluation includes tasks outside that pretraining distribution. Our setting instead fixes the parent task distribution and studies the effect of model scale with a finite pretraining task pool. Accordingly, our current results do not directly address shifts in the underlying task distribution. Understanding how model scale interacts with such task-distribution shifts is an interesting direction for future work. We will add a discussion in the camera-ready.

7. Dashed lines in Fig 4.

Yes, the dashed lines are iso-risk contours, with each line connecting values of task diversity μ\mu and model scale ρ\rho that yield the same loss. At fixed model scale, increasing task diversity raises ID loss while lowering OOD loss, consistent with prior work on task-diversity thresholds [Raventos et al., 2023, Park et al., 2025]. The upper ID contour shows that larger models can accommodate a more diverse pretraining task pool before reaching the same fixed ID loss, reflecting greater task-memorization capacity. The corresponding OOD contour slopes in the opposite direction because, on the post-interpolation branch, both increasing model scale and increasing task diversity improve OOD performance; hence, larger models require less task diversity to reach the same fixed OOD loss. We use different color scales because ID loss varies over a substantially wider range than OOD loss; the colors are intended to show trends within each panel rather than to be compared across panels. We will clarify the contour levels and color scales in the revised version.

References:

Goddard et al., 2025. When can in-context learning generalize out of task distribution?

Reviewer ahC7 · CommentOpenReview ↗

Thank you for clarifying. I appreciate the detailed response.

My objection to terminology stands. In my opinion, they (benign overfitting, ID vs OOD) add more confusion. While Park et al (2025) adopt the same ID-OOD distinction, Raventos et al (2023) avoid it completely. As it is, the ID and OOD tasks are from the same distribution. This means that as the number of pretraining tasks (task diversity) increases, OOD performance increases since OOD tasks become less distinct from seen tasks; this behaviour is well within the scope of in-distribution generalisation.

On interpolation divergence, I agree that its height (infinity) alone might not hide the effect under investigation. However, its feature is not limited to exactly at the interpolation threshold; it is the dominant feature of the entire range in Figs 2 & 3. While the claim is about the extreme limits, all observations will be from intermediate regimes and if the interpolation divergence always dominates there, what are the empirical signatures of the proposed phenomenon? This question may be answerable, but the min-norm formulation completely hides it.

Also, is the OOD performance nontrivial? The figures do not seem to show the OOD loss below that in the limit N → 0 (equivalent to \nu → infinity)

Authors · CommentOpenReview ↗

Response to Reviewer ahC7

Thank you for the follow-up and for clarifying the remaining concerns.

ID/OOD terminology. We understand the concern. Following your suggestion, to avoid conflating our setting with conventional distribution-shift OOD generalization, we will replace the ID/OOD terminology with retrieval/learning throughout the paper, consistent with the terminology used in the Introduction. In particular, we will rename the losses in Eq. (2) as LretL_{\text{ret}}​ and LlrnL_{\text{lrn}}​ and update the notation consistently throughout.

Empirical signature of the proposed phenomenon. We agree that the sharp minimum-norm divergence occupies a substantial vertical range in Figs. 2 and 3. However, the phenomenon we study is characterized by the behavior after interpolation, not by the rate at which the risk moves away from the interpolation peak. This is also the usual perspective in theoretical analyses of classical double descent works: the peak marks the interpolation threshold, while the object of interest is whether generalization improves as model capacity increases further along the interpolating branch.

In Fig. 2, this post-interpolation behavior is already visible at finite model sizes: increasing model scale beyond the interpolation threshold improves retrieval performance while learning performance settles at or slightly below the underparameterized value (see “Nontriviality of learning performance” below). Concretely, the empirical signature that you asked for is where the post-interpolation branch settles relative to the best underparameterized risk, and this is not an automatic consequence of the divergence: two settings in our own paper exhibit the same peak but fail the comparison. With top-pp instead of random feature selection (Fig. 6b), both risks settle above the underparameterized minimum, and with a frozen embedding (Fig. 15), the learning loss ends slightly worse. The power-law covariance experiments in Appendix H show the stronger finite-scale behavior in which both retrieval and learning losses fall below their respective underparameterized minima.

The transformer experiments (Fig 5, and Fig. 11-14 in App. H) provide complementary evidence beyond the minimum-norm formulation, where the peak is finite and modest. Once the training loss has already reached approximately zero at an intermediate embedding dimension (emb dim 64 in Fig. 5a and emb dim 8 in Fig. 5b), increasing model width further decreases both retrieval and learning losses.

Thus, the empirical signature is continued improvement after interpolation, with retrieval loss improving and learning loss matching or improving upon its best underparameterized performance. This behavior is also observed in transformers that are not constrained to follow the minimum-norm solution.

Nontriviality of learning performance. We interpret the comparison as being with the vanishing-model-scale limit in Fig. 2, where p→0p \to 0 and the predictor becomes identically zero. Under our normalization, the zero predictor has a loss 1+σn21+\sigma_n^2, which equals 1.011.01 in Fig. 2 since σn=0.1\sigma_n=0.1. This experiment also uses very low task diversity, with μ=M/d=10/80=0.125\mu=M/d=10/80=0.125. Even at this small finite task diversity, the large-model endpoint (horizontal dashed line in Fig 2) achieves a learning loss of approximately 1.0021.002, compared with 1.011.01 for the p→0p \to 0 baseline, while also yielding a substantial improvement in retrieval performance.

Importantly, this value is not an intrinsic floor for large models. For example, holding the other parameters fixed and doubling the context length from T=120T=120 to T=240T=240 lowers the learning loss at the large-model endpoint to approximately 0.9850.985. We will add the zero-predictor baseline and a longer-context variant to Fig. 2 to make this comparison clearer. The power-law covariance experiments in Appendix H provide further evidence: in those settings, both retrieval and learning losses on the finite post-interpolation branch fall below their respective underparameterized minima.

Thank you again for your suggestions. We will adopt the retrieval/learning terminology, update Fig. 2 with the zero-predictor baseline and a longer-context variant, and clarify the post-interpolation comparison in the text. We hope this addresses your concerns and are happy to answer further questions.

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

This paper studies how the two modes of in context learning evolve as model size grows. The first is the retrieval mode, which corresponds to in distribution generalization on tasks seen during pretraining. The second is the learning mode, which corresponds to out of distribution generalization on tasks that are novel relative to pretraining. The authors introduce the notion of in context benign overfitting, defined as the property that a sufficiently large model can simultaneously memorize the pretraining task set, achieving very low in distribution risk, while also generalizing to novel tasks, achieving very low out of distribution risk. The study is carried out in a minimal in context linear regression setting with a simplified linear attention predictor, where a feature selection mechanism controls model size while the underlying data distribution is held fixed. The authors point out that feature selection is precisely the key ingredient that makes benign overfitting visible, in contrast to the prior setting that uses all features and therefore observes only a tradeoff between retrieval and learning, and they support this with the recovery of task diversity thresholds and with transformer experiments.

Strengths and weaknesses

Strengths

  • The conceptual contribution is clean and natural. Lifting benign overfitting from the sample level to the task level is a natural idea that had not been formalized in the in context learning setting. The framing also reconciles the scaling intuition with prior tradeoff results, which gives the paper a clear and coherent narrative.
  • The theory is a sharp characterization rather than merely a bound. The paper gives closed form asymptotic expressions for both the in distribution and the out of distribution risk in the overparameterized and the underparameterized regimes, expressed through a low dimensional fixed point system and the Stieltjes transform of the Marchenko Pastur law.

Weaknesses

  • The model is fairly simple and the capacity mechanism is somewhat artificial relative to real scaling. The analysis uses only linear attention, the predictor relies on a fixed averaging estimator as its internal feature rather than an attention mechanism that is genuinely trained to implement an algorithm, and overparameterization is induced by randomly dropping input coordinates rather than by widening a network. The mapping from this feature selection knob to what happens when a real transformer is made wider is therefore only a proxy.
  • The out of distribution notion is finite sample in nature, namely tasks drawn from the true task distribution but falling outside the finite training pool, rather than a genuine distribution shift. As the number of training tasks grows this gap vanishes, so the learning mode here is a milder form of generalization than the term out of distribution might suggest. The authors note this, but it limits how far the reassuring conclusion can be carried.
Questions
  1. The Gaussian equivalence principle is verified only empirically, yet both main theorems rest on it. Can the authors give either a partial proof for this specific construction, or quantitative evidence on how the empirical gap between the original problem and the Gaussian equivalent problem scales as the dimension grows. A convergence rate or a finite dimension error measurement, even for one setting, would substantially raise confidence that Theorem 1 and Theorem 2 describe the original model and not only its Gaussian surrogate.

  2. The out of distribution mode is finite pool generalization, and the gap vanishes as the number of training tasks grows. Can the authors quantify, within their own formulas, at what task diversity the out of distribution risk becomes statistically indistinguishable from the in distribution risk, so that a reader can see how strong the reassuring conclusion remains once the training pool is large relative to the model scale.

Limitations

Yes

Formatting concerns

no

3 comments
Authors · RebuttalOpenReview ↗
Rebuttal

Thank you for the careful reading and constructive feedback. We are encouraged that you find the conceptual framing clean and the theoretical characterization sharp. We respond to specific comments and questions below.

Q1: Gaussian Equivalence gap

Thank you for raising this important point. To clarify the scope of the results, Theorems 1 and 2 are rigorous asymptotic characterizations of the linear Gaussian-equivalent problem. Gaussian equivalence is then used to transfer these predictions to the original structured, non-Gaussian feature model; it is not an additional assumption within the CGMT analysis itself.

We briefly explain why we expect Gaussian equivalence to hold in our setting. As defined in Definition 2, we choose the Gaussian feature covariance as Σg=ΣHSp:=1NEX,ϵ[HSp⊤HSp]\Sigma_g=\Sigma_{H_{S_p}}:=\frac{1}{N}\mathbb{E}_{X,\epsilon}[H_{S_p}^{\top}H_{S_p}] and the effective regression parameter as θ⋆:=1NΣHSp−1σHSpy\theta_\star:=\frac{1}{N}\Sigma_{H_{S_p}}^{-1}\sigma_{H_{S_p}\mathbf{y}}, where σHSpy:=EX,ϵ[HSp⊤y]\sigma_{H_{S_p}\mathbf{y}}:=\mathbb{E}_{X,\epsilon}[H_{S_p}^{\top}\mathbf{y}]. We then choose the noise variance for sample ii as σni2:=σx2∣∣wi∣∣2+σn2−θ⋆⊤ΣHSpθ∗\sigma_{n_i}^{2}:=\sigma_x^{2}||w_i||^{2}+\sigma_n^{2}-\theta_\star^{\top}\Sigma_{H_{S_p}}\theta_*. Thus, the Gaussian-equivalent problem exactly matches the feature covariance, feature-label cross-covariance, and label second moments of the original problem. The explicit expressions for these quantities are derived in App. B.

The squared-loss structure provides additional reason to expect these matched moments to capture the relevant behavior. For any fixed predictor θ\theta, its population risk is

$\mathbb{E}_{X,\epsilon}[(\theta^\top h_{S_p}(X)-y_q)^2] =\theta^\top\mathbb{E}_{X,\epsilon}[h_{S_p}(X)h_{S_p}(X)^\top]\theta -2\theta^\top\mathbb{E}_{X,\epsilon}[h_{S_p}(X)y_q] +\mathbb{E}_{X,\epsilon}[y_q^2]$,

and therefore depends only on precisely the second-order quantities matched by the Gaussian construction. Universality based on such quantities has proved robust in many high-dimensional squared-loss problems.

This observation does not by itself prove Gaussian equivalence. The learned least-squares or minimum-norm estimator θ^Sp\widehat{\theta}_{S_p} is a data-dependent nonlinear function of the empirical feature matrix HSpH_{S_p} and labels y\mathbf{y}. Proving universality of its asymptotic risk therefore requires additional problem-specific control of these random quantities and is often a separate technical contribution from the Gaussian analysis itself.

Our results in Figs. 2 and 3 provide complementary quantitative evidence: the empirical ID and OOD risks of the original structured model are closely tracked by the theoretically derived risks of the Gaussian-equivalent problem across both the underparameterized and overparameterized regimes. This being said, we do not currently have a formal Gaussian equivalence proof for our structured features and their feature-label dependence. Establishing one, potentially by adapting recent universality techniques [Hu and Lu, 2022; Montanari et al., 2023], is an important future direction, as already noted in Lines 191-195.

W2, Q2: OOD generalization and task diversity

We agree that in our paper, “OOD'' does not refer to changes in the underlying task distribution; rather it refers to unseen tasks relative to the finite pretraining task set. As discussed in Section 1, this distinction is used to study retrieval (low ID, high OOD loss) and learning (high ID, low OOD loss) models of ICL.

You are right in your comment that “ID/OOD distinction disappears in the large task diversity limit” and this is indeed something that can be seen directly from our formulas. Task diversity enters through

γ=ρμ=pM,\gamma=\frac{\rho}{\mu}=\frac{p}{M},

which governs the empirical task covariance. Keeping all other problem parameters fixed, taking μ→∞\mu\to\infty gives γ→0\gamma\to 0. In this limit, the Marchenko-Pastur law converges to a point mass at 11. For example,

mγ(−c)⟶11+c,mγ′(−c)⟶1(1+c)2.m_\gamma(-c) \longrightarrow \frac{1}{1+c}, \qquad m_\gamma'(-c) \longrightarrow \frac{1}{(1+c)^2}.

Substituting these limits into the risk expressions makes the ID and OOD risks coincide. Thus, the relevant scaling is

M≫p,or equivalentlyμ≫ρ,M\gg p, \qquad\text{or equivalently}\qquad \mu\gg\rho,

rather than a universal absolute number of tasks.

Because our formulas describe deterministic asymptotic risks, a point at which the risks are statistically indistinguishable additionally requires specifying a tolerance. For any ε>0\varepsilon>0, this can be formalized as

μϵ:=inf⁡(μ:∣LID(μ)−LOOD(μ)∣≤ϵ).\mu_\epsilon := \inf ( \mu :|\mathcal{L}_{\mathrm{ID}}(\mu)-\mathcal{L}_{\mathrm{OOD}}(\mu)| \leq \epsilon ).

which is directly computable from Theorems 1 and 2 for any fixed problem parameters.

Importantly, the in-context benign-overfitting result does not rely on this μ→∞\mu \to \infty limit. It is a fixed-task-diversity statement: at finite μ\mu, where the ID and OOD risks remain distinct, increasing model scale can yield low ID risk while retaining low OOD risk. This is precisely the behavior illustrated by the vertical cuts (fixed μ\mu) in Fig. 4.

Thank you for the suggestion. We will elaborate on this point in the camera-ready.

W1: Simplicity of the model and the feature-selection proxy.

We agree that feature selection is a deliberately minimal proxy for model scale rather than a literal model of widening a Transformer. Its purpose is to vary the capacity of the predictor while holding the data distribution fixed: selecting pp out of dd coordinates gives p2p^2 trainable parameters, while dd and the underlying task distribution remain unchanged. This follows the feature-selection mechanism commonly used to study double descent and benign overfitting in linear regression [Hastie et al., 2019, Belkin et al., 2020]. In contrast, in the standard p=dp=d formulation, varying model scale requires varying the ambient dimension (relative to number of sequences NN) itself. As shown in Fig. 3, this does not capture the phenomena of in-context benign overfitting.

The averaging estimator is also not an unrelated algorithm imposed externally on the predictor. The model fθ(X)=xq⊤Θwavgf_{\theta}(X) = x_q^\top\Theta w_{\text{avg}} is the standard reduced form of a one-layer linear-attention model [Zhang et al. 2025], and similar forms have been used in several prior works [Zhang et al., 2025, Lu et al., 2025, Wu et al., 2023, Zhang et al., 2023, Frei and Vardi, 2024] to study ICL in linear regression (discussed in lines 80-85). We will discuss the reduction in the appendix.

Finally, the phenomenon of in-context benign overfitting is not limited to the feature-selection model. In Fig. 5, we train both linear-attention-only and full softmax-attention Transformers and vary their embedding dimension while keeping the ambient data dimension fixed. Both exhibit the same qualitative post-interpolation improvement in ID and OOD risk. We therefore view feature selection as a tractable mechanism that isolates the effect of capacity, rather than an exact architectural model of width. Having said that, we agree it would be an interesting future direction to develop this theory for richer architectures like softmax attention as well as deeper transformers, as mentioned in the conclusion.

Reviewer c9tf · CommentOpenReview ↗

Thank you for your response. While some of the clarifications are helpful, the responses do not resolve my concerns. Since these issues affect the paper’s theoretical claims, I will maintain my original score.

Authors · CommentOpenReview ↗

Thank you for the update. If possible, could you please indicate which specific concern remains unresolved? We would be more than happy to address any remaining questions during the discussion period.

Comments on the paper

1 comment
Area Chair R9Yr · 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…