← Latest papers
💬 NLP

MACRO: Markov Chain Routing of Transformer Layers

The paper introduces MACRO, a framework that enhances Large Language Models by learning task-specific, dynamic layer routing policies via Markov chains without modifying model weights, achieving significant accuracy improvements and faster search times compared to existing methods.

Original authors: Paweł Batorski, Abtin Pourhadi, Akylgali Aitaza, Przemysław Spurek, Paul Swoboda

Published 2026-08-07
📖 3 min read☕ Coffee break read

Original authors: Paweł Batorski, Abtin Pourhadi, Akylgali Aitaza, Przemysław Spurek, Paul Swoboda

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 super-smart robot that reads books and answers questions. To do its job, the robot has a long assembly line of 28 or 32 tiny workers (called "layers"). In a standard setup, every single piece of information must walk past every single worker, from the very first to the very last, in a strict, unchangeable line. It's like a school bus that must stop at every single house on the street, even if the passenger only needs to get off three blocks down. This is how most AI models work today: they follow a rigid schedule, no matter how easy or hard the question is.

But what if the robot could be a little more flexible? What if, instead of marching in a straight line, it could decide to skip a worker who isn't needed, or even go back and ask a previous worker to double-check their math? This idea is called "dynamic routing." Think of it like a GPS that doesn't just follow a pre-printed map but can instantly reroute around traffic or take a shortcut. Scientists have been trying to teach AI to do this, but most attempts are like trying to teach a bus driver to drive by rewiring the engine every time they hit a new road, or by hiring a separate, expensive guide to shout directions for every single passenger. It's slow, costly, and often breaks the robot's brain.

This is where a new study called MACRO comes in. The researchers asked a simple question: Can we teach a frozen robot (one whose brain we aren't allowed to change) to find a better path through its own workers without breaking anything? They discovered that by treating the robot's path like a game of "choose your own adventure" based on a set of simple probability rules (called a Markov chain), they could find a much smarter route. Instead of retraining the robot or using expensive guides, they let the robot explore different paths on a few practice questions, learned a single, task-specific set of rules for navigating its workers, and then used a clever math trick to identify the absolute best route for that specific task. This best route is then used uniformly for all questions in that task, rather than calculating a new path for every single new question.

The results are surprisingly effective. On a variety of tricky math and science tests, MACRO helped the robot get significantly smarter. For example, on a difficult math benchmark called GSM8K, a small robot model jumped from getting 43.4% of the answers right to 69.5%—a massive leap—just by changing the order in which it visited its workers. The researchers found that this method was much faster to set up than previous methods. While other approaches took nearly 15 hours to figure out the best path for a task, MACRO did it in just 1.6 hours.

The key insight is that the robot already knew the answers; it just needed a better way to "listen" to its own internal thoughts. By allowing the robot to skip unnecessary steps or loop back to review its work, the researchers unlocked hidden potential without changing a single weight in the robot's brain. It's as if they didn't teach the robot new facts, but simply taught it how to think more efficiently. The study suggests that for many complex tasks, the answer was already inside the model; we just needed a better map to find it.

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 →