← Latest papers
🤖 machine learning

Learning through Internalization

This paper investigates how neural networks, particularly transformers, internalize explicit computational procedures like chain-of-thought into their weights to facilitate learning complex tasks such as parity and semiautomata simulation, while also revealing a trade-off where this process leads to degraded out-of-distribution performance.

Original authors: Nikolaos Tsilivis, Nirmit Joshi, Marko Medvedev, Julia Kempe, Nati Srebro

Published 2026-06-23
📖 7 min read🧠 Deep dive

Original authors: Nikolaos Tsilivis, Nirmit Joshi, Marko Medvedev, Julia Kempe, Nati Srebro

Original paper licensed under CC BY 4.0 (http://creativecommons.org/licenses/by/4.0/). This is an AI-generated explanation of the paper below. It is not written or endorsed by the authors. For technical accuracy, refer to the original paper. Read full disclaimer

The Big Idea: From "Step-by-Step" to "Instinct"

Imagine you are learning to drive a car. At first, a teacher tells you exactly what to do for every single step: "Press the clutch, shift to first gear, release the clutch slowly while pressing the gas." You have to think hard about every intermediate action. This is slow, but it helps you learn the complex task.

Eventually, after lots of practice, you don't need to think about the steps anymore. You just "know" how to drive. You have internalized the process. The complex sequence of actions has been compressed into a single, automatic instinct.

This paper studies how Artificial Intelligence (specifically, a type of AI called a Transformer) does the same thing. It asks: Can we teach an AI to solve hard problems by first making it write out all its work (like a student showing their math homework), and then training it to "forget" the steps and just give the answer instantly?

The paper finds that yes, this works and can help AI learn things it otherwise couldn't. However, there is a catch: when the AI becomes "automatic," it sometimes gets worse at handling new, strange situations.


1. The Two Ways of Learning

The researchers compare two ways an AI can learn a task:

  • Direct Learning (The "Hard Way"): You show the AI a problem and the final answer, and ask it to figure out the connection immediately. For some very tricky logic puzzles (like calculating a specific type of math problem called "parity"), the AI often fails. It's like asking a beginner to drive a car without ever teaching them the steps.
  • Learning through Internalization (The "Smart Way"):
    1. Phase 1 (The Teacher): You teach the AI to solve the problem by forcing it to write out every single step (called "Chain-of-Thought" or CoT). It generates a long list of intermediate answers before the final one. Because it has these hints, it learns the task easily.
    2. Phase 2 (The Internalization): You slowly start removing the hints. First, you remove the last step, then the second-to-last, and so on. The AI is forced to rewire its brain (its "weights") to figure out how to get the answer without the crutches.
    3. The Result: Eventually, the AI can solve the problem in one single step, without writing anything down. It has "internalized" the logic.

The Paper's Claim: This two-step process allows the AI to learn difficult tasks that it would fail to learn if you tried to teach it directly from the start.


2. The "Flip Side": Speed vs. Safety

The paper discovers a surprising downside to this "automatic" mode.

  • The Analogy: Think of a student who memorizes a specific route to school. If they practice driving that exact route every day, they become very fast and efficient. But if you ask them to drive to a new neighborhood they've never seen, they might get lost because they only learned the specific path, not the general rules of driving.
  • The Finding: When the AI internalizes a task (becomes fast and automatic), it often performs worse on Out-of-Distribution (OOD) data. This means if you give it a problem that looks slightly different from what it practiced on, it makes more mistakes than it did when it was still writing out its steps.
  • Why? The paper suggests that when the AI learns to be fast, it might find "shortcuts" or "tricks" that work for the practice data but aren't robust enough for new situations.

3. What Makes a Task Easy or Hard to Internalize?

The researchers tested this on different types of logic puzzles (called "semiautomata"). They found that not all tasks are equally easy to turn into an instinct.

  • Width vs. Depth: They found that making the AI "wider" (giving it more parallel processing power) helped it internalize tasks better than making it "deeper" (adding more layers of thinking). It's like having a wider highway is better for traffic than adding more toll booths.
  • Prime Numbers are Tricky: They discovered that tasks involving "prime numbers" (like counting in groups of 7 or 13) were much harder for the AI to internalize than tasks involving numbers with many factors (like 12 or 16).
    • The Metaphor: Imagine trying to pack a suitcase. If you have items that fit together perfectly (like a 12-piece set), it's easy to pack them efficiently. If you have items that don't divide evenly (like a prime number), it's messy and hard to compress into a small space. The AI struggles to "compress" the logic of prime-number tasks into its internal memory.

4. The Mathematical Proof: Parity

To prove this isn't just luck, the authors did a rigorous mathematical proof using a specific math problem called "Sparse Parity."

  • The Problem: Imagine you have a long list of 0s and 1s, and you need to find out if the total number of 1s is odd or even. But you don't know which numbers in the list matter; you have to figure that out too. This is known to be extremely hard for computers to learn directly.
  • The Proof: They showed that if they first taught the AI to write out the answer step-by-step (calculating the parity of the first number, then the first two, then the first three, etc.), and then slowly removed those steps, the AI could mathematically guarantee that it would learn the solution.
  • The Takeaway: This proves that "learning through internalization" is a valid strategy to solve problems that are theoretically impossible to learn directly.

5. A New Shortcut: The "Mixture" Method

Finally, the paper suggests a way to skip the long, slow training process.

  • The Old Way: You have to train the AI with full steps, then remove one step, train again, remove another, and so on. This is like a strict curriculum.
  • The New Idea (Mixture): Instead of a strict order, you just throw all the different versions of the problem at the AI at once. Some examples have full steps, some have half steps, some have no steps.
  • The Result: The paper shows that training on this "mixed bag" of data works just as well as the strict step-by-step removal. It's like giving a student a practice test that has some easy questions, some medium ones, and some hard ones all mixed together, rather than starting with easy and slowly getting harder. This makes the AI robust enough to answer both directly and with steps, depending on what you ask it to do.

Summary

  • Internalization is teaching AI to think slowly (with steps) so it can eventually think fast (instinctively).
  • It works: It allows AI to learn hard logic puzzles that it couldn't learn otherwise.
  • The Cost: When AI becomes "fast," it sometimes becomes "brittle," meaning it fails more often on new, weird examples.
  • The Secret: Making the AI wider helps more than making it deeper, and mixing different types of training data is a simple, effective way to achieve this learning.

Drowning in papers in your field?

Get daily digests of the most novel papers matching your research keywords — with technical summaries, in your language.

Try Digest →