← Latest papers
💬 NLP

From Expressivity to Sample Complexity: Narrow Teachers for Transformers via C-RASP

This paper advances the theoretical understanding of Transformer learnability by proposing preliminary sample complexity bounds for learning C-RASP constructions, addressing the gap between existing expressivity analyses and the practical feasibility of learning such solutions.

Original authors: Michael Rizvi-Martel, Satwik Bhattamishra, Guillaume Rabusseau, Michael Hahn

Published 2026-07-14
📖 5 min read🧠 Deep dive

Original authors: Michael Rizvi-Martel, Satwik Bhattamishra, Guillaume Rabusseau, Michael Hahn

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

Imagine you have a giant, super-smart robot brain called a Transformer. For a long time, scientists have been asking: "What kind of puzzles can this robot solve?" They found that if you hand-craft the robot's brain with very specific, tiny instructions (like a secret code called C-RASP), it can solve tricky logic games, like checking if parentheses are balanced or counting things in a sentence.

But here's the big mystery the paper tackles: Just because the robot can solve the puzzle with the right code, does that mean it can actually learn that code by studying examples? Or is it like finding a needle in a haystack?

The "Narrow Teacher" Secret

The authors suggest a clever way to answer this. They imagine a scenario where a tiny, super-efficient robot (a "Narrow Teacher") already knows the secret code to solve a puzzle perfectly. Now, imagine a much bigger, clumsier robot (the "Student") that is trying to learn from scratch.

The paper argues that if the Student is big enough, it can accidentally "stumble" into the exact same brain structure as the tiny Teacher. Think of it like this: If you have a massive, empty warehouse (the Student) and a tiny, perfect toy car (the Teacher), and you randomly fill the warehouse with millions of random toy parts, there's a chance that somewhere in that mess, the parts just happen to fit together to build that exact tiny car.

The paper proves that for these specific C-RASP puzzles, the "warehouse" (the Student) doesn't need to be infinitely huge to find the "toy car" (the Teacher). In fact, the math shows that the bigger the Student is compared to the Teacher, the easier it is to find that perfect solution just by random chance.

The "Guess and Check" Game

How does the learning happen? The authors describe a simple, almost silly method called "Guess and Check."

  1. You randomly pick a set of weights (the robot's brain settings).
  2. You test it on a few examples.
  3. If it gets everything right, you stop! You found the solution.

The paper suggests that because there are so many ways to build a "good" solution inside a big network, you don't need to be a genius to find one; you just need to try enough random guesses. The more examples you have (the sample complexity), the more likely you are to hit the jackpot.

The Magic Numbers

The authors did the math to tell us exactly how many examples are needed to make this work. They found that if you want to be very sure (with a probability of at least 1δ1 - \delta) that your robot learns the puzzle with an error rate less than ϵ\epsilon, you need a specific number of training examples, NN.

The formula they derived is roughly:
N1ϵ(MC-RASPlogQ+3log(2/δ))N \ge \frac{1}{\epsilon} \left( MC\text{-}RASP \cdot \log Q + 3 \log(2/\delta) \right)

Don't let the letters scare you! Here is what they mean in plain English:

  • NN: The number of practice examples you need.
  • ϵ\epsilon: How close to perfect you want the robot to be (smaller is better).
  • QQ: How precise the robot's brain settings are (like how many decimal places it can use).
  • MC-RASPMC\text{-}RASP: This is a big number that depends on how complicated the puzzle is (how many steps or variables, nn and mm) and how big your Student robot is (width dd and depth LL).

The paper shows that for simple puzzles like Dyck-1 (checking balanced parentheses), which has 7 steps and 9 variables, a student robot with at least 7 layers and a width of dd can learn it with roughly O(Ldϵ)O(\frac{Ld}{\epsilon}) examples. This is actually better (fewer examples needed) than older theories that suggested you'd need O(Ld2)O(Ld^2) examples.

What This Doesn't Say

It's important to know what this paper doesn't claim. The authors are very careful to say they haven't actually run these experiments on real computers yet. They haven't shown a robot learning this in a lab. They have only done the mathematical proof to show that it should work in theory.

They also don't claim this works for every possible task a Transformer can do. They are specifically talking about tasks that can be written in the C-RASP language. If a task is too messy or doesn't fit this specific "counting and logic" style, this math might not apply.

The Bottom Line

So, what's the takeaway? The paper suggests that the reason Transformers are so good at learning is that they are so big and flexible that they can easily "hide" a perfect, tiny solution inside their massive brain. If you give them enough examples to practice on, they are likely to stumble upon that perfect solution just by guessing. It's a bit like finding a perfect snowflake in a blizzard: if the blizzard is big enough and you wait long enough, you'll eventually find one that fits your hand perfectly.

The authors propose this as a new way to understand why these models learn so well, moving beyond just asking "what can they do?" to asking "how hard is it to teach them to do it?" And the answer, according to their math, is: "Not as hard as we thought, as long as the student is big enough."

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 →