TL;DR
This paper investigates "internalization"—the process by which a neural network absorbs a multi-step, explicit computational procedure (like Chain-of-Thought) directly into its weights to solve tasks in fewer steps or a single forward pass. The authors provide the first theoretical proof of successful internalization using a sparse parity task and demonstrate empirically that while internalization bypasses direct learning hardness, it introduces a significant trade-off by degrading out-of-distribution generalization.
What Problem Does This Paper Address?
Large Language Models (LLMs) excel at complex reasoning when allowed to generate step-by-step tokens via Chain-of-Thought (CoT). However, direct "end-to-end" (E2E) training without CoT often fails completely on these hard tasks due to optimization bottlenecks (such as Statistical Query hardness). While CoT generation works, it is computationally expensive at inference time because the model must generate many intermediate tokens sequentially.
"Internalization" is a training strategy where a model first learns a task with explicit CoT supervision and then undergoes a curriculum that progressively removes these intermediate tokens. This forces the network to compress multi-step reasoning into a single forward pass. While empirically promising, the underlying mechanics of internalization have remained a black box. This paper addresses several fundamental questions: Which tasks are easy or hard to internalize? How do network representations reconfigure? Does internalization lead to vertical, depth-based reasoning or parallel shortcuts? And can we provide provable guarantees for this process?
Methods
The authors combine empirical experiments on transformers with rigorous mathematical analysis:
- Semiautomata Simulation: They empirically test how autoregressive transformers internalize the simulation of sequential machines (semiautomata) over $T$ timesteps. They compare three training regimes: End-to-End (E2E), full Chain-of-Thought (CoT), and internalization via curricula (progressive token removal from the left or right, or an inductive leap curriculum).
- Mixture Distribution Training: As an alternative to complex step-by-step curricula, they introduce training on a single mixture distribution of varying CoT lengths combined with an explicit "answer length hint" token.
- Theoretical Analysis on Sparse Parities: They provide a formal proof using a simplified one-layer linear-attention transformer paired with a fixed non-linear MLP. They prove that a left-amputated CoT curriculum allows the model to solve the computationally hard sparse parity task directly in one step.
- Positive Distribution Shift (PDS) Framework: They formally connect internalization to the PDS framework, demonstrating how intermediate hints act as a tractable stepping stone to learn otherwise impenetrable target distributions.
Datasets
The paper relies on synthetic, mathematically structured tasks designed to isolate reasoning mechanics:
- Modular Counter Semiautomata ($C_n$): Simulating sequential addition modulo $n$ over $T$ steps.
- Permutation Group Semiautomata ($S_3$): A non-commutative sequential reasoning task based on permutations.
- Sparse Parity Task: A classic computationally hard problem where the target is the XOR sum of a hidden subset of input bits, tested under both clean and noisy conditions.
Key Insights and Ideas
- Width Over Depth: Counterintuitively, successful internalization favors wider architectures over deeper ones. Deeper models ($L=25$) struggled to internalize, suggesting that the model reconfigures its weights to compute intermediate steps horizontally in parallel across the width rather than vertically across sequential layers.
- The OOD Generalization Trade-Off: Internalization has a clear downside: it significantly degrades out-of-distribution (OOD) performance compared to full CoT training. As CoT tokens are removed, the model learns parallel "shortcut" solutions that work perfectly for the training distribution but fail when the input distribution shifts.
- Prime Numbers are Harder: Semiautomata with prime orders ($C_n$ where $n$ is prime, like $C_{11}$ or $C_{13}$) are drastically harder to internalize than those with composite orders (like $C_{12}$ or $C_{14}$). This is tied to the algebraic structure; composite numbers allow the transformer to compactly represent the operation in parallel using the Chinese Remainder Theorem.
- Curriculum Direction Matters: Internalizing from left-to-right (removing early CoT tokens first) succeeds, whereas right-to-left removal fails completely. Because the transformer uses absolute positional embeddings, left-removal keeps the final complex operation at a fixed position ($T+1$), while right-removal creates a moving target for the shared MLP weights.
Key Results
- E2E Failure vs. CoT Success: In all semiautomata experiments, direct end-to-end training achieved 0% success. Full CoT training achieved near 100% success both in-distribution (IID) and out-of-distribution (OOD).
- Internalization Performance: Internalization curricula successfully achieved high IID accuracy (>95%) using shallow (even depth-1 or depth-4) transformers, eliminating the need for intermediate tokens at inference. However, OOD success rates dropped sharply (e.g., from 100% down to 10-30% for tasks like $C_7$).
- Mixture Training Benefits: Training on a mixture of CoT lengths with length hints allowed a single model to either answer directly or generate full CoT, recovering the superior OOD performance when full CoT was enabled.
- Provable Parity: Theorem 2 guarantees that the proposed 1-layer transformer architecture will exactly internalize the hidden parity support with high probability, providing a concrete counterexample to direct learning hardness.
Limitations and Future Work
- MLP Mismatch: The theoretical proof guarantees exact internalization without OOD degradation because it uses a simplified, fixed MLP. In practice, the local operations must be learned, which drives the observed OOD performance drop.
- Synthetic Scope: The study is restricted to well-defined algorithmic tasks (semiautomata, parities). How these insights translate to natural language reasoning in massive LLMs remains an open question.
- Positional Embedding Constraints: The failure of right-to-left curricula highlights a strict dependency on absolute positional embeddings; future work could explore if relative positional encodings or mixture-of-experts alleviate this constraint.
Summary updated