MACRO: Markov Chain Routing of Transformer Layers

Standard Large Language Models (LLMs) execute layers sequentially. Dynamic layer routing, i.e. search for a different execution path through layers involving layer repetitions, skips and other moves, can improve performance. Existing routing approaches often require updating model weights, running expensive search loops per test instance, or demand ground-truth labels during inference. In this work, we propose Markov Chain Routing of Transformer Layers (MACRO), a framework that learns task-specific routes over LLM architectures without modifying underlying parameters. MACRO models layer routing as a context-dependent Markov policy conditioned on layer indices, computation budget phases, directional displacements, and operator context, supporting skip, repeat, and residual hidden-state addition operations. The Markov route distribution is updated via feedback on training data and decoded using a top-k Viterbi algorithm to isolate high-probability candidate programs. We evaluate MACRO across diverse reasoning and knowledge benchmarks on multiple open-weight LLMs. MACRO achieves a +5.0% average accuracy improvement over the unrouted baselines, with largest gains on small models. We outperform the best dynamic routing approach Dr. LLM by +7.2%, while reducing route-search time 9.4x (from 14.8 to 1.6 hours). Our code is publicly available at https://github.com/Batorskq/MACRO.

Link
https://www.semanticscholar.org/paper/4960b31077cd43c7d39a805f918dada573d482ce
Found by
Semantic Scholar
Authors
Paweł Batorski, Abtin Pourhadi, Akylgali Aitaza, P. Spurek, Paul Swoboda
Categories
benchmark, evaluation, dataset
Published
2026-08-06
Last seen by the radar
2026-08-07
Citations
0
Influential citations
0
Radar score
48.59 / 100 (how it is scored)
Why it scored so
Matched: benchmark, evaluat, training data; Primary record: Semantic Scholar
Related links
https://arxiv.org/abs/2608.05872
Is this record right? If you made this work and something here is wrong or missing, tell us what to fix.

More records found by Semantic Scholar