← Latest papers
💬 NLP

Dr.LLM: Dynamic Layer Routing in LLMs

Dr. LLM is a retrofittable framework that equips pretrained LLMs with lightweight, MCTS-supervised routers to dynamically skip, execute, or repeat transformer layers, achieving significant compute savings while improving or maintaining accuracy across diverse tasks without altering the base model weights.

Original authors: Ahmed Heakl, Martin Gubri, Salman Khan, Sangdoo Yun, Seong Joon Oh

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

Original authors: Ahmed Heakl, Martin Gubri, Salman Khan, Sangdoo Yun, Seong Joon Oh

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 brilliant, overworked librarian (the Large Language Model, or LLM) who answers your questions. Right now, no matter how simple your question is ("What is 2+2?") or how complex it is ("Solve this advanced physics problem"), this librarian is forced to walk through every single room in their massive library, checking every bookshelf, before giving you an answer.

This is inefficient. For simple questions, they waste time walking through rooms they don't need. For hard questions, they might not have enough time to dig deep enough because they are stuck on a rigid schedule.

Dr.LLM is like giving this librarian a smart, lightweight traffic controller for each room in the library.

How It Works: The "Traffic Controller" Analogy

Instead of the librarian blindly walking through every room, Dr.LLM installs a tiny, fast decision-maker (a "router") at the entrance of every room. When the librarian arrives at a specific room, the router looks at the current situation and makes one of three quick decisions:

  1. Skip: "This room isn't needed for this question. Let's walk right past it to save time."
  2. Execute: "We need to do our work here. Go in, read the books, and come out."
  3. Repeat: "This is a tricky part. We need to go in, do the work, and then go in again to double-check or refine the answer."

How They Trained the Traffic Controllers

The tricky part is teaching these routers what to do without hiring a new team of experts to rewrite the whole library (which would be expensive and slow).

The authors used a method called MCTS (Monte Carlo Tree Search). Think of this as a super-smart simulation team that ran thousands of "what-if" scenarios offline. They asked: "If we skip this room, does the answer get worse? If we repeat this room, does the answer get better?"

They found the perfect "paths" through the library for different types of questions. They then used these perfect paths to train the tiny routers. Once trained, the routers know exactly when to skip, go, or repeat, without needing to run simulations while answering your questions.

The Results: Faster and Smarter

The paper claims that this system does two amazing things at once:

  • It saves energy (Compute): On average, the librarian skips about 5 rooms per question. This makes the system faster and cheaper to run.
  • It gets smarter (Accuracy): Surprisingly, by skipping the boring parts and repeating the hard parts, the librarian actually gives better answers than before.
    • On logic puzzles (ARC), accuracy went up by about 1%.
    • On math problems (DART), accuracy jumped by up to 3.4%.

Does It Work on New Questions?

The authors tested these routers on questions they had never seen before (like general knowledge, reading comprehension, or different types of math). Even though the routers were trained on specific logic and math puzzles, they generalized well. The accuracy only dropped by a tiny fraction (0.85%), proving that the routers learned a general "style" of thinking rather than just memorizing specific answers.

The "Secret Sauce"

The paper highlights a few key features that make this work:

  • No Rebuilding: You don't have to tear down the library or rebuild the librarian. You just add these tiny routers on top of the existing system.
  • Windowed Pooling: The routers don't look at every single word one by one (which would be slow). Instead, they look at "chunks" or windows of the conversation to make stable decisions.
  • Smart Training: They used a special math trick (Focal Loss) to make sure the routers didn't just always say "Execute" (which is the safe, lazy choice). They forced the routers to learn when to actually skip or repeat.

In a Nutshell

Dr.LLM is like giving a rigid, one-size-fits-all robot a pair of smart glasses. Now, the robot can see which tasks are easy and which are hard, allowing it to skip the easy steps and double-check the hard ones. The result is a system that is faster, cheaper, and surprisingly more accurate than the original, without needing to be completely rebuilt.

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 →