← Latest papers
🤖 machine learning

Adaptive Computation Depth via Learned Token Routing in Transformers

The paper introduces Token-Selective Attention (TSA), a lightweight, end-to-end differentiable gating mechanism that enables transformers to dynamically skip redundant layer computations for individual tokens based on contextual difficulty, achieving significant efficiency gains with minimal quality loss and no need for explicit depth regularization.

Original authors: Ahmed Abdelmuniem Abdalla Mohammed

Published 2026-05-08
📖 4 min read☕ Coffee break read

Original authors: Ahmed Abdelmuniem Abdalla Mohammed

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 are running a factory where every single product that comes down the assembly line gets the exact same treatment. Whether it's a simple, perfect widget or a complex, broken one, every item spends exactly the same amount of time at every single station. This is how standard AI models (Transformers) currently work: they process every word in a sentence through the exact same number of "thinking layers," regardless of how easy or hard that word is to understand.

This paper introduces a new system called Token-Selective Attention (TSA). Think of TSA as installing a smart, automatic gatekeeper at every single station in the factory.

The Problem: The "One-Size-Fits-All" Factory

In a standard AI model, if you ask it to write "To be, or not to be," the model treats the word "To" and the word "question" with the same amount of brainpower.

  • Easy words (like "the" or "is") are like simple widgets. They don't need much processing.
  • Hard words (like complex concepts or rare names) are like broken widgets. They need extra time and attention to fix.

Currently, the factory wastes energy processing the easy widgets with the same intensity as the hard ones.

The Solution: The Smart Gatekeeper (TSA)

The authors added a tiny, lightweight "gatekeeper" (a small neural network) between every layer of the AI. This gatekeeper looks at each word (token) individually and asks: "Does this word need to go through the next processing station, or can it skip it?"

  • The Decision: The gatekeeper doesn't just say "Yes" or "No." It gives a probability score (like a dimmer switch). If a word is easy, the gatekeeper might say, "You can skip the next step," or "You only need to do half the work." If a word is hard, it says, "Go all the way through."
  • The Magic: The best part is that the gatekeeper teaches itself. It doesn't need a human to tell it which words are hard. It learns purely by trying to minimize mistakes. If skipping a step for a specific word causes an error, the gatekeeper learns to keep that word active next time. If skipping it works fine, it learns to save energy.

How It Works in Practice

The paper tested this on two main things:

  1. Simple Logic Puzzles: When the AI had to copy a list of numbers, the gatekeeper realized, "This is easy," and skipped about 65% of the work. When it had to sort numbers (which is harder), it only skipped about 27% of the work. It naturally figured out that harder tasks need more steps.
  2. Writing Stories: When asked to write like Shakespeare or summarize Wikipedia articles, the AI saved 14% to 23% of its computing power.
    • It learned that punctuation marks, spaces, and common words are easy and can be processed quickly.
    • It learned that unique content words need the full "factory" treatment.

The Results: Faster and Smarter

  • No Quality Loss: The AI wrote just as well as the standard model, but it used significantly less energy (computing power).
  • Better than "Early Exit": Other methods try to stop the whole sentence early if the AI feels "confident." TSA is smarter; it stops individual words from going through unnecessary steps while letting hard words keep going. The paper found TSA produced better results than these older methods when they were set to save the same amount of energy.
  • Real Speed: When the researchers actually ran the code on a computer, they saw a real speedup (about 2.3% faster) because the computer literally didn't have to do the math for the words that were skipped.

The Bottom Line

This paper presents a way to make AI models "lazy" in the smartest way possible. Instead of forcing every word to do the same amount of work, TSA lets the AI decide, on the fly, which words are easy and which need extra help. It's like having a factory where the easy products zip through the line, while the difficult ones get the full VIP treatment, saving time and energy without sacrificing quality.

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 →