potentialpaper

Learning through Internalization

Nikolaos Tsilivis, Nirmit Joshi, Marko Medvedev, Julia Kempe, Nathan Srebro

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 study the internalization of chain of thought in transformers. We empirically show that it sometimes leads to worse OOD performance, and we theoretically show that transformers can provably internalize chain-of-thought tokens in simple settings.

Abstract. We study internalization processes, by which neural-network-based systems absorb an explicit computational procedure into their own weights, and how they facilitate learning. We investigate how transformers internalize the simulation of semiautomata by internalizing chain-of-thought (CoT) tokens, which classes of semiautomata are harder to internalize, and expose the flip side of internalization, that is, a progressive degradation of out-of-distribution performance. We then provide the first provable analysis of successful internalization: for the task of learning parities, we show that a simplified one-layer transformer provably first learns the target with explicit CoT supervision and then internalizes the autoregressive generation as CoT tokens are progressively removed, learning to directly compute the parity. Learning such a representation directly from data without CoT supervision is computationally hard. Finally, we discuss how learning through internalization relates to the \textit{Positive Distribution Shift} phenomenon recently introduced by~\citet{Med+26}.

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:47 UTC.

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

This paper needs clarification before it can be considered; a convincing response to the following issues could potentially strengthen the case for acceptance. First, please address Reviewer HVmK’s potentially theorem-critical concern that Algorithm 1 updates only Wd,1:dW_{d,1:d} in Phase 1 although Theorem 4.1 and Lemma D.6 require learning the other CoT-prediction rows, by stating the intended algorithm and providing a corrected proof or theorem. Second, clarify whether the semiautomata experiments establish exact all-input internalization under Definition 1 or only approximate IID agreement, and either rule out simple input- or class-distribution explanations for the OOD degradation or narrow the claim accordingly. Finally, address Reviewer mbJU’s concern about the connection among the semiautomata experiments, stylized parity theorem, and PDS framing, and Reviewer HqNi’s concern about the robustness of the prime-hardness claim, by clearly separating proven, empirical, and conjectural statements and providing focused evidence or tempering claims.............. During the rebuttal, the authors have addressed most of the concerns. One reviewer who gave a low score was not able to reply and increase their score. However most of the concerns that they have raised seem addressed.

Final justification

During the rebuttal, the authors have addressed most of the concerns. One reviewer who gave a low score was not able to reply and increase their score. However most of the concerns that they have raised seem addressed.

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

This paper needs clarification before it can be considered; a convincing response to the following issues could potentially strengthen the case for acceptance. First, please address Reviewer HVmK’s potentially theorem-critical concern that Algorithm 1 updates only Wd,1:dW_{d,1:d} in Phase 1 although Theorem 4.1 and Lemma D.6 require learning the other CoT-prediction rows, by stating the intended algorithm and providing a corrected proof or theorem. Second, clarify whether the semiautomata experiments establish exact all-input internalization under Definition 1 or only approximate IID agreement, and either rule out simple input- or class-distribution explanations for the OOD degradation or narrow the claim accordingly. Finally, address Reviewer mbJU’s concern about the connection among the semiautomata experiments, stylized parity theorem, and PDS framing, and Reviewer HqNi’s concern about the robustness of the prime-hardness claim, by clearly separating proven, empirical, and conjectural statements and providing focused evidence or tempering claims.............. During the rebuttal, the authors have addressed most of the concerns. One reviewer who gave a low score was not able to reply and increase their score. However most of the concerns that they have raised seem addressed.

Final justification

During the rebuttal, the authors have addressed most of the concerns. One reviewer who gave a low score was not able to reply and increase their score. However most of the concerns that they have raised seem addressed.

Reviewer HqNiOpenReview ↗
Rating
4/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 internalization: a network first solves a task with an explicit multi-step procedure, which is also called autoregressive CoT, then reconfigures its weights to produce the same output in fewer or single forward passes. The authors define it formally, output agreement plus strictly faster inference, and frame it as an instance of Positive Distribution Shift. Empirically, they study transformers internalizing semiautomaton simulation via a CoT-removal curriculum, finding that end-to-end training fails while CoT succeeds, that internalization works even at depth 1 but degrades out-of-distribution accuracy, that removing tokens from the left beats the right and width helps more than depth, and that prime-order modular counters are harder to internalize than composite ones.

Strengths and weaknesses

Methodology is careful: 30 seeds, success rates over averaged accuracy.

the headline theorem guarantees perfect internalization, but experiments show OOD degradation. The authors flag this (Remark 4.2) and blame the fixed MLP, but it means the theory doesn't explain the most interesting empirical finding.

The Positive Distribution Shift concept is mentioned repeatedly and rests on Medvedev et al. [2026] and does not quite stand on its own for a reader new to that work. The appendix is dense in places, and there is at least one broken sentence (line 818, "we use Therefore").

Significance is bounded by the synthetic scope, transfer to natural-language reasoning, where prior work already reports trouble with implicit CoT, remains open.

Questions

Remark 4.2 attributes the theory–experiment mismatch to the learned MLP. Can you run an experiment that freezes the MLP to the correct modular adder during internalization? If OOD degradation largely disappears, this confirms the explanation and it could strengthens the paper.

The claim rests on a single sweep (Figure 3, left). How stable is it across head count, seeds, and simulation length T? Can you please verify the robustness of prime-hardness.

Do you have direct samples-to-success or loss-curve data showing composite Cn reach criterion with fewer samples than nearby primes at matched width?

You attribute the left-vs-right gap to absolute positional embeddings gating a shared MLP. Have you tried rotary/relative embeddings or a MoE, as you speculate?

Limitations

Yes, largely. The authors are upfront about the OOD degradation, the conjectural nature of the prime-hardness explanation, and the stylized theoretical model.

Formatting concerns

NO

2 comments
Authors · RebuttalOpenReview ↗
Rebuttal

Thank you for your review. We respond to your points:

the headline theorem guarantees perfect internalization, but experiments show OOD degradation. The authors flag this (Remark 4.2) and blame the fixed MLP, but it means the theory doesn't explain the most interesting empirical finding.

Indeed, our theoretical analysis demonstrates perfect internalization, which we attribute to the fixed-MLP design choice (Remark 4.2). The goal of this result is to provide a concrete, provable example in which internalization successfully enables learning functions that are hard to learn directly (e.g., parities). This is one of the central - and perhaps more important - aspects of internalization that our theoretical result helps ground. Demonstrating the joint training dynamics of the MLP and attention layers, under which OOD degradation is observed, remains an important direction for future work.

The Positive Distribution Shift concept is mentioned repeatedly and rests on Medvedev et al. [2026] and does not quite stand on its own for a reader new to that work. The appendix is dense in places, and there is at least one broken sentence (line 818, "we use Therefore").

In the revised version, we improve the presentation of Section 5 and explain how internalization, and in particular the curriculum introduced there which is tailored to feed-forward networks, relate to the positive distribution shift (PDS) framework. We will also reduce the emphasis on PDS in the abstract and introduction so that it does not distract from the paper’s primary contributions, and fix the typo in the appendix.

Remark 4.2 attributes the theory–experiment mismatch to the learned MLP. Can you run an experiment that freezes the MLP to the correct modular adder during internalization? If OOD degradation largely disappears, this confirms the explanation and it could strengthens the paper.

Please note that such an experiment already exists in Appendix D.4. There we perform an experiment for the sparse parity task, where we train a 1-layer transformer with a frozen MLP that computes the "modular adder". We observe that even without some of the simplications of Theorem 1 (e.g., fixed number of training iterations per curriculum stage, weight rounding), the network learns the correct parity for any input xx. Hence, there is no OOD performance degradation during internalization in this experiment. We agree it would be useful to include similar results in the setup of Section 3 (one-layer transformers with soft-max attention and fixed MLP for CnC_n, with n>2n > 2).

The claim rests on a single sweep (Figure 3, left). How stable is it across head count, seeds, and simulation length T? Can you please verify the robustness of prime-hardness.

Please note that Figure 3 considers 30 different random seeds per configuration (MLP width, semiautomaton). Hence, the claim does not rest on a single sweep; rather results are shown for two different MLP widths. The number of heads and the size of the embedding dimension were selected based on prior grid searches that tried to determine favorable configurations for all semiautomata. The larger the simulation length TT is the larger the degradation of OOD accuracy is expected to be (see also our response to Reviewer HVmK). We can add an additional experiment for larger values of TT in the final version.

Do you have direct samples-to-success or loss-curve data showing composite Cn reach criterion with fewer samples than nearby primes at matched width?

No, we do not have such a figure and it cannot be obtained from the existing runs. Each internalization run uses a fixed number of samples, as the number of curriculum stages and iterations per stage are set in the start of the run. The difficulty of internalization is assesed by the reported metric (i.e., success rate), which implies that a sample-complexity gap exists.

You attribute the left-vs-right gap to absolute positional embeddings gating a shared MLP. Have you tried rotary/relative embeddings or a MoE, as you speculate?

Yes, we have tried internalization in transformers with relative positional embeddings. We found that relative positional embeddings indeed permit right-to-left removal strategies to succeed (in depth 4 transformers). We initially omitted these results because they used fewer random seeds than the main study, but we can provide some figures of indicative runs in the appendix.

Authors · CommentOpenReview ↗

Dear Reviewer, As the author-reviewer discussion period is ending very soon, could you please review and respond to the rebuttal? Thanks.

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

This paper studies CoT internalization of transformers from three different perspectives through semiautomata mod problem: (1) influence of architecture and curriculum (2) OOD generalization (3) hard problems exists for a single task. Followed by a provable internalization theorem for 1-Layer transformer, the paper proves parity problem can be internalized by removing CoT tokens one at a time. In the last, the paper relates the learning with recently introduced positive distribution shift.

Strengths and weaknesses

Strengths

  1. The observation of task-specific challenge: the prime/composite finding (Fig. 3) is interesting with theoretical illustrations.

Weaknesses

  1. What are the connections between the observation (Section 3) and proof (Section 4)? I think Section 3 uses multi-layer transformer while both parities problem and 1-layer transformer is simplified case of the conducted experiments.

  2. The PDS framing is underdeveloped. Section 5 is one of the shorter sections and mostly asserts the connection. Given that PDS is positioned in the abstract and intro as a load-bearing conceptual contribution, the paper either should develop it or de-emphasize it.

  3. Real-LLM experiments are lacking; to support both observations and proof, I will expect numerical experiments are conducted on modern-scale LLMs (e.g. GPT 1/2/3) to demonstrate the observation generalize to real-world transformers.

Questions
  1. The contributions are scatter around PDS/1-layer theoretical internalization and internalization propertieis. Three aspects are not well correlated, which makes me confused about the core contribution and challenge before this paper.

  2. Discussion of related work are neccessary for a comprehensive evaluation of the proposed framework.

Limitations
  1. The author didn't mention the internalization generalization from 1-layer to multi-layer transformers.
Formatting concerns

N.A.

2 comments
Authors · RebuttalOpenReview ↗
Rebuttal

We thank the reviewer for their time in reviewing our work and bringing up the concerns. We address the points raised below.

Question 1:

The contributions are scatter around PDS/1-layer theoretical internalization and internalization propertieis. Three aspects are not well correlated, which makes me confused about the core contribution and challenge before this paper.

The main focus of the paper is to elucidate the theoretical basis of chain-of-thought internalization [Deng et al. 2023]. One of the crucial aspects of internalization - and the one that relates these sections together - is that “explicit CoT training followed by internalization can provide a viable strategy for learning functions that are otherwise computationally hard to learn”.

Section 3: We conducted an empirical study of internalization on tasks (counter automatas) that are hard to learn directly, yet explicit CoT training enables perfect in-distribution and OOD accuracy (Figure 2). Internalization, however, is not always successful, as we identify. The goal of this section is to identify factors (lines 64-75) that make internalization easy or difficult, through an empirical study on GPT-2 type architecture (line 881).

Section 4: The goal of this section is to provide a concrete and, to our knowledge, the first provable example in which internalization successfully enables the learning of functions that are believed to be computationally hard to learn, such as parity functions. The presumed hardness of learning here means that, as the dimensionality of the problem increases, we do not expect any algorithm to learn the target efficiently through direct training. In contrast, learning through an internalization curriculum can be efficient (Theorem 4.1). We believe this result significantly substantiates the promise of internalization methods.

Section 5: Here, we relate how explicit CoT training, followed by internalization, is a case of Positive Distribution Shift (Admittedly, this section is under-developed, and apologies for this. We have significantly improved this in our new version, which we will discuss further below.)

In this sense, each section of the paper is tied to the broader theme mentioned above. The sections focus on different aspects of this message and are complementary to one another. In particular, we investigate theoretically motivated questions about chain-of-thought internalization (e.g., whether internalized chain-of-thought tokens are explicitly represented across transformer layers) through carefully designed experiments. We also discover a potentially practice-relevant shortcoming of internalization: degradation of out-of-distribution (OOD) performance. Finally, we connect chain-of-thought internalization, a method introduced in application papers, to the recently proposed Positive Distribution Shift framework in computational learning theory, and explain how this perspective motivates new algorithms (namely, learning from a mixture of easy and hard distributions rather than from a curriculum).

We believe that all of these aspects advance our understanding of the strengths and weaknesses of internalization and learning through internalization. We do not view these contributions as disconnected.

Weakness 1:

What are the connections between the observation (Section 3) and proof (Section 4)? I think Section 3 uses multi-layer transformer while both parities problem and 1-layer transformer is simplified case of the conducted experiments.

As noted above, the common thread between these sections is that internalization of chain of thought can be an effective strategy for learning. In Section 3, we empirically study how GPT-2-type transformers of varying width, depth (not only multi-layer, but specifically 1, 4, 10, or 25 layers), and other hyperparameters can learn to simulate certain semiautomata through various internalization processes (defined by different curriculum choices). Through an empirical study, we ask and answer questions that a purely theoretical study cannot easily address. In Section 4, our focus is on providing a provable analysis. When it comes to theory, as in many [e.g., 1,2,3,4,5] (and in fact most of) prior theoretical works, we have simplified the architecture. Also, the task considered is only learning parities. Nonetheless, we would like to emphasize that this is the first analysis, where a single autoregressive (simplified) architecture when trained with progressively removing CoT tokens learns to directly compute parities without CoT.

The PDS framing is underdeveloped. Section 5 is one of the shorter sections and mostly asserts the connection. Given that PDS is positioned in the abstract and intro as a load-bearing conceptual contribution, the paper either should develop it or de-emphasize it.

Thank you for the feedback. In the revised version, we improve the presentation of that section and explain how internalization, and in particular the curriculum of Section 5 tailored to feed-forward networks, relates to the positive distribution shift (PDS) framework. We will also de-emphasize some of the comments about PDS in the abstract and introduction to avoid diverting attention.

Real-LLM experiments are lacking; to support both observations and proof, I will expect numerical experiments are conducted on modern-scale LLMs (e.g. GPT 1/2/3) to demonstrate the observation generalize to real-world transformers.

First, let us note that the experiments in Section 3 use GPT-2-type architectures. If your criticism concerns the lack of experiments with "non-synthetic" data (such as mathematical reasoning benchmarks in natural language), then we agree that this is an important direction for future work. Our study places greater emphasis on a theoretical understanding of internalization. We will mention this limitation more prominently in the conclusion of the paper.

Discussion of related work are neccessary for a comprehensive evaluation of the proposed framework.

The results of that paper and subsequent follow-up works (lines 45-51) have shown that internalization can sometimes be more effective than direct training. Please find a discussion of related work in Appendix A.

We hope we have clarified some important aspects of our work and addressed your concerns. We were a bit surprised to see your low score for originality (2: not good), especially since the review did not raise any concerns regarding the novelty of the work. If that was your primary concern, please consider taking a look at our discussion of related work in Appendix A. We hope you will reconsider your overall rating of our work.


References:

[1] Juno Kim and Taiji Suzuki. “Transformers Provably Solve Parity Efficiently with Chain of Thought.” ICLR 2025.

[2] Johannes von Oswald, Eyvind Niklasson, Ettore Randazzo, João Sacramento, Alexander Mordvintsev, Andrey Zhmoginov, and Max Vladymyrov. “Transformers Learn In-Context by Gradient Descent.” ICML 2023.

[3] Kwangjun Ahn, Xiang Cheng, Hadi Daneshmand, and Suvrit Sra. “Transformers Learn to Implement Preconditioned Gradient Descent for In-Context Learning.” NeurIPS 2023.

[4] Yu Huang, Yuan Cheng, and Yingbin Liang. “In-Context Convergence of Transformers.” ICML 2024.

[5] Zihao Li, Yuan Cao, Cheng Gao, Yihan He, Han Liu, Jason M. Klusowski, Jianqing Fan, and Mengdi Wang. “One-Layer Transformer Provably Learns One-Nearest Neighbor In Context.” NeurIPS 2024.

Authors · CommentOpenReview ↗

Dear Reviewer, As the author-reviewer discussion period is ending very soon, could you please review and respond to the rebuttal? Thanks.

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

The paper studies internalization: a model first learns a task through explicit intermediate computation, such as CoT tokens, and is then trained to perform the same final computation with fewer or no intermediate tokens. Empirically, the paper studies transformer internalization on semiautomata simulation, comparing E2E training, full CoT training, and curricula that progressively remove intermediate states. The main findings are that E2E training often fails, CoT succeeds, and internalization can recover strong in-distribution performance but often worsens OOD generalization. The paper also reports that left-removal curricula and wider models help more than right-removal curricula and deeper models, and that prime-order modular counters are harder to internalize. Theoretically, it proves a stylized one-layer linear-attention transformer can learn parity with CoT supervision and then internalize it.

Strengths and weaknesses

S1: The paper addresses a timely and conceptually important question: when can explicit computational scaffolding be absorbed into model weights, and what is lost in the process? The semiautomata setting is clean and useful because it separates E2E learning, explicit CoT learning, and internalization. The empirical study is fairly broad within this synthetic domain, covering multiple automata, horizons, curricula, architecture choices, IID/OOD behavior, and many random seeds. The OOD degradation result is especially interesting, as it gives a concrete example where implicit reasoning appears to behave like a shortcut rather than robust algorithmic simulation.

S2: The theoretical contribution is also valuable. The parity result gives a clean mechanism by which intermediate computation can make a hard direct-learning problem tractable, and then be progressively removed. The counter-semiautomata representation result gives a plausible structural explanation for why prime and composite moduli behave differently.

W1: The main weakness is that the strongest theoretical result is proved for a highly stylized architecture. The authors are appropriately transparent about this mismatch, but it still limits how much the theorem explains the empirical semiautomata results or internalization in modern LLMs.

W2: Technical clarity. Algorithm 1 appears to update only the row Wd,1:dW_{d,1:d} in every phase, including Phase 1. However, the Phase-1 loss supervises predictions at multiple CoT locations d,d+1,…,d+k−1d,d+1,\dots,d+k-1, and Lemma D.6 later claims that Phase 1 learns all next-token CoT predictions. As written, the algorithm does not update the rows Wd+l−1,1:dW_{d+l-1,1:d} needed to learn predictions for zlz_l when l≥2l\ge 2. This creates a mismatch between Algorithm 1 and the proof of Theorem 4.1. The issue may be fixable by modifying Phase 1 to update all relevant CoT-prediction rows while preserving the initialized coefficients, but this should be clarified.

Questions

Q1: How should the empirical results be interpreted relative to Definition 1? Definition 1 requires exact agreement with the slower procedure P(hθ)P(h_\theta) on all inputs, while the experiments define success as final-state test accuracy above 95%, mainly under the IID distribution, and also show substantial OOD degradation. Are these results meant to demonstrate formal internalization, approximate in-distribution internalization, or shortcut learning that only matches final labels on the training distribution?

Q2: Can the authors clarify the relationship between Algorithm 1 and Theorem 4.1? Theorem 4.1 claims that after Phase 1 the model can autoregressively compute all explicit CoT tokens, but Algorithm 1 appears to update only Wd,1:dW_{d,1:d}, whereas the Phase-1 loss and Lemma D.6 seem to require learning additional rows Wd+l−1,:W_{d+l-1,:}. Is the pseudocode incomplete, or should the theorem/proof be modified?

Q3: Can the authors better isolate the mechanism behind OOD degradation? The current OOD construction changes the input marginal distribution and may also change the final-state/class distribution. Reporting per-class accuracy, multiple OOD shifts, or diagnostics of the learned shortcut would help determine whether the degradation reflects algorithmic failure rather than distributional or class-imbalance effects.

Limitations

Partially addressed. The authors acknowledge the OOD degradation, the conjectural nature of the prime-modulus explanation, and the stylized theory setting. I would still ask for a sharper limitation statement that separates what is proven for the simplified transformer from what is empirically observed in GPT2-style transformers, and for a more explicit discussion that current experiments do not establish the phenomenon in natural-language LLM reasoning tasks.

Final justification

The rebuttal resolved my main technical concern: Algorithm 1 should update the entire matrix WW, removing the apparent inconsistency with Lemma D.6 and Theorem 4.1. The authors also clarified that Section 3 studies approximate, distribution-dependent internalization, and I no longer believe class imbalance explains the observed OOD degradation. The remaining limitations are the stylized theoretical setting and its inability to explain the OOD behavior in the GPT-2-style experiments. I view these as limitations of scope rather than correctness, my final rating is 5 (Accept).

Formatting concerns

No

5 comments
Authors · RebuttalOpenReview ↗
Rebuttal

Thank you for your review.

We first briefly comment on the "Weaknesses" section of the review.

W1: The main weakness is that the strongest theoretical result is proved for a highly stylized architecture.

We agree that our theoretical result is established in a highly stylized setting. At the same time, such simplifications are common, and arguably necessary at the current stage of the theoretical literature on transformer training. Most closely related to our setting, [1] analyzes CoT training under similar simplifications, e.g., a one-layer transformer in which the query and key matrices are reparameterized through a single collapsed (QK) matrix, while the value matrix and feedforward layer are fixed. Several other works share most of these limitations [e.g., 2,3,4,5].

The goal of our result is to provide a concrete and, to our knowledge, first provable example in which internalization successfully enables the learning of functions that are believed to be hard to learn directly, such as parities. This is a cruicial promise of internalization that our theoretical result helps ground.

W2: Technical clarity. Algorithm 1 appears to update only the row in every phase, including Phase 1.

Thank you for catching this discrepancy caused by a typographical error. As you pointed out, the issue is fixable by updating the entire matrix WW, i.e., W←W−η∇WL^t(W)W \leftarrow W - \eta \nabla_W \widehat{L}_t(W), rather than only the dthd^{\mathrm{th}} row of WW, in line 12 of the pseudocode (Algorithm 1). This was our intention, as reflected in the informal description (lines 274-285). It is true that, in the first phase, the loss depends on all locations, whereas in the remaining phases it depends only on the dthd^{\mathrm{th}} row. However, once the phase-specific losses are defined, we intended to update the entire matrix WW. This ensures the guarantee of Theorem 4.1, with no changes to the proof.


We now respond to your questions:

Q1: How should the empirical results be interpreted relative to Definition 1?

In the experiments of Section 3, the transformers internalize through a training curriculum, which involves training data. As we show through the OOD metrics, internalization here is often only approximate. Hence, it is clear that we do not have exact internalization. An updated version of the paper will also include the following relaxed definition in the appendix:

Definition Let D\mathcal{D} be a distribution over X×Y\mathcal{X} \times \mathcal{Y} and let l:Y×Y→Rl: \mathcal{Y} \times \mathcal{Y} \to \mathbb{R} be a measurable loss function. Fix θ∈Θ\theta \in \Theta and let ε>0\varepsilon > 0. If there exists θ′∈Θ\theta^\prime \in \Theta with θ′≠θ\theta^\prime \neq \theta such that

  1. Approximate risk agreement: ∣E(x,y)∼D[l(hθ′(x),y)]−E(x,y)∼D[l(P(hθ)(x),y)]∣≤ε.\left| \mathbb{E}_{\left(x, y\right) \sim \mathcal{D}} \left[ l\left(h_{\theta^\prime}(x), y\right) \right] - \mathbb{E}_{(x, y) \sim \mathcal{D}} \left[ l\left(P(h_\theta)(x), y\right) \right] \right| \leq \varepsilon.
  2. hθ′\mathfrak{h}_{\theta^\prime} is faster than P(hθ)\mathfrak{P}(\mathfrak{h}_\theta): For all x∈Xx \in \mathcal{X}, it holds:
Timehθ′(x)<TimeP(hθ)(x),\mathrm{Time}_{\mathfrak{h}_{\theta^\prime}}(x) < \mathrm{Time}_{\mathfrak{P}(\mathfrak{h}_\theta)}(x),
then we say that $\mathfrak{h}_{\theta^\prime}$ $\left(\varepsilon, \mathcal{D}\right)$-**distributionally internalizes** $\mathfrak{P}(\mathfrak{h}_\theta)$.

Most of the training runs reported in Section 3 show distributional internalization with respect to the training distribution (uniform input symbols).

Note that the theoretical result of Section 4 (Theorem 2) proves exact internalization, in the sense of Definition 1.

Q2: Can the authors clarify the relationship between Algorithm 1 and Theorem 4.1?

As noted above, we thank the reviewer for catching this typo. Please see our explanation above in W2: After fixing the typo in line 12 of the algorithm so that the entire W is updated (instead of only its dthd^\mathrm{th} row), the guarantee of Theorem 4.1 holds with no changes to the proof. Thank you for catching this.

Q3: Can the authors better isolate the mechanism behind OOD degradation? The current OOD construction changes the input marginal distribution and may also change the final-state/class distribution.

Indeed, our covariate distribution shift changes the distribution of the total sum of the input tokens and hence changes the distribution of the final-state. In particular, for counter automata Cn,n>2C_n, n > 2, we sample each input token σt\sigma_t from a binomial distribution Bin(n−1,p)\mathrm{Bin}(n-1, p) where pp is a hyperparameter. As a result, the sum of these random variables follows a binomial distribution Bin((n−1)T,p)\mathrm{Bin}((n-1)T, p) which differs from the training distribution of the input sum (distribution of the sum of TT uniformly sampled random variables). For example, the expected sum of the TT input tokens under the shift is by the linearity of expectation: TE[σi]=T(n−1)pT \mathbb{E}[\sigma_i] = T \left(n-1\right)p. In contrast, the expected sum of the TT input tokens under the uniform training distribution is n−12T\frac{n-1}{2}T. Hence, we see that for p≠1/2p \neq 1/2, each input sequence from the shifted distribution has shifted expected sum, and the distribution of the final state (defined as the sum modulo nn) also changes. Our results show degradation of test accuracy for p=0.8p=0.8. The situation is similar for other values of pp away from 0.50.5. We can add these additional results for p=0.,0.2,0.4,0.6,1.p = 0., 0.2, 0.4, 0.6, 1. in the appendix.

The reason we chose this particular shift is that the shallow transformer constructions capable of representing the target function need to represent the sum of the input tokens and then apply a  ⁣ mod n\!\bmod n non-linear operation through the MLP. We hypothesized that an internalization process using uniformly sampled input tokens might fail to robustly teach the MLP to implement this non-linear operation over the entire input range. Our experiments confirm this hypothesis. We will add this explanation in the revised version.

Limitations: Partially addressed. [...] I would still ask for a sharper limitation statement that separates what is proven for the simplified transformer from what is empirically observed in GPT2-style transformers, and for a more explicit discussion that current experiments do not establish the phenomenon in natural-language LLM reasoning tasks.

Thank you for the suggestion. We will make sure to discuss the limitations of our study and include concrete directions for future work. For example: (1) our current theory considers a highly stylized architecture with a fixed MLP and does not capture the OOD degradation observed in GPT-2-style architectures when the attention and MLP layers are trained jointly; and (2) some exciting empirical directions, on both synthetic and natural-language reasoning tasks, for further understanding what makes internalization easy or difficult.


References:

[1] Juno Kim and Taiji Suzuki. “Transformers Provably Solve Parity Efficiently with Chain of Thought.” ICLR 2025.

[2] Johannes von Oswald, Eyvind Niklasson, Ettore Randazzo, João Sacramento, Alexander Mordvintsev, Andrey Zhmoginov, and Max Vladymyrov. “Transformers Learn In-Context by Gradient Descent.” ICML 2023.

[3] Kwangjun Ahn, Xiang Cheng, Hadi Daneshmand, and Suvrit Sra. “Transformers Learn to Implement Preconditioned Gradient Descent for In-Context Learning.” NeurIPS 2023.

[4] Yu Huang, Yuan Cheng, and Yingbin Liang. “In-Context Convergence of Transformers.” ICML 2024.

[5] Zihao Li, Yuan Cao, Cheng Gao, Yihan He, Han Liu, Jason M. Klusowski, Jianqing Fan, and Mengdi Wang. “One-Layer Transformer Provably Learns One-Nearest Neighbor In Context.” NeurIPS 2024.

Authors · CommentOpenReview ↗

Rendering the definition

Please see below for the Definition mentioned above:

Definition Let D\mathcal{D} be a distribution over X×Y\mathcal{X} \times \mathcal{Y} and let l:Y×Y→Rl: \mathcal{Y} \times \mathcal{Y} \to \mathbb{R} be a measurable loss function. Fix θ∈Θ\theta \in \Theta and let ε>0\varepsilon > 0. If there exists θ′∈Θ\theta^\prime \in \Theta with θ′≠θ\theta^\prime \neq \theta such that

  1. Approximate risk agreement:
∣E(x,y)∼D[l(hθ′(x),y)]∣≤ε.\left| \mathbb{E}_{\left(x, y\right) \sim \mathcal{D}} \left[ l\left(h_{\theta^\prime}(x), y\right) \right] \right| \leq \varepsilon.
  1. hθ′\mathfrak{h}_{\theta^\prime} is faster than P(hθ)\mathfrak{P}(\mathfrak{h}_\theta): For all x∈Xx \in \mathcal{X}, it holds:
Timehθ′(x)<TimeP(hθ)(x),\mathrm{Time}_{\mathfrak{h}_{\theta^\prime}}(x) < \mathrm{Time}_{\mathfrak{P}(\mathfrak{h}_\theta)}(x),

then we say that hθ′\mathfrak{h}_{\theta^\prime} (ε,D)\left(\varepsilon, \mathcal{D}\right)-distributionally internalizes P(hθ)\mathfrak{P}(\mathfrak{h}_\theta).

Authors · CommentOpenReview ↗

Dear Reviewer, As the author-reviewer discussion period is ending very soon, could you please review and respond to the rebuttal? Thanks.

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

Missing a submission?

Loading the discussion…