ImageNet classification with deep convolutional neural networks
Alex Krizhevsky, Ilya Sutskever et al.
6
Citations
1
Influential Citations
arXiv.org
Venue
2025
Year
Large Language Models (LLMs) process every token through all layers of a transformer stack, causing wasted computation on simple queries and insufficient flexibility for harder ones that need deeper reasoning. Adaptive-depth methods can improve efficiency, but prior approaches rely on costly inference-time search, architectural changes, or large-scale retraining, and in practice often degrade accuracy despite efficiency gains. We introduce Dr. LLM, Dynamic routing of Layers for LLMs, a retrofittable framework that equips pretrained models with lightweight per-layer routers deciding to skip, execute, or repeat a block. Routers are trained with explicit supervision: using Monte Carlo Tree Search (MCTS), we derive high-quality layer configurations that preserve or improve accuracy under a compute budget. Our design, windowed pooling for stable routing, focal loss with class balancing, and bottleneck MLP routers, ensures robustness under class imbalance and long sequences. On ARC (logic) and DART (math), Dr. LLM improves accuracy by up to +3.4%p while saving 5 layers per example on average. Routers generalize to out-of-domain tasks (MMLU, GSM8k, AIME, TruthfulQA, SQuADv2, GPQA, PIQA, AGIEval) with only 0.85% accuracy drop while retaining efficiency, and outperform prior routing methods by up to +7.7%p. Overall, Dr. LLM shows that explicitly supervised routers retrofit frozen LLMs for budget-aware, accuracy-driven inference without altering base weights. Code is available at https://github.com/parameterlab/dr-llm.
Large Language Models (LLMs) have become ubiquitous, but their standard practice of processing every token through all layers leads to significant computational waste. Simple queries receive the same depth of processing as complex reasoning tasks, while harder problems may still lack sufficient depth. Prior adaptive-depth methods often required costly inference-time search, architectural changes, or large-scale retraining, and frequently traded accuracy for efficiency gains. Dr. LLM addresses this gap by introducing a retrofittable framework that can be applied to frozen pretrained models, preserving their original weights while enabling dynamic layer routing. This is particularly important for practitioners who need to deploy existing LLMs more efficiently without the expense of retraining or modifying the base architecture.
The paper's use of Monte Carlo Tree Search (MCTS) to derive high-quality layer configurations is a key innovation. MCTS provides explicit supervision for training lightweight routers, ensuring that routing decisions are both accuracy-preserving and compute-budget-aware. This approach avoids the common pitfall of accuracy degradation seen in prior methods, as evidenced by the +3.4%p improvement on ARC and DART benchmarks. The ability to save 5 layers per example on average while improving accuracy is a strong practical result.
Dr. LLM achieves concrete improvements on key benchmarks:
These results show that Dr. LLM not only maintains but can improve accuracy while reducing computational cost, a rare combination in adaptive-depth literature.
Dr. LLM has broad implications for efficient LLM deployment. By enabling dynamic layer routing on frozen models, it offers a practical, low-cost solution for organizations that need to run large models on limited hardware or reduce latency in production. The framework's generalizability to out-of-domain tasks suggests that the learned routing policies capture fundamental properties of layer utility, not just dataset-specific patterns. This work opens the door to further research on retrofitting existing models with lightweight control mechanisms, potentially extending to other forms of dynamic computation such as token pruning or attention head selection. The code release further accelerates adoption and reproducibility.
Alex Krizhevsky, Ilya Sutskever et al.
Ashish Vaswani, Noam Shazeer et al.
Douglas M. Bates, Martin Mächler et al.
Diederik P. Kingma, Jimmy Ba