# Dr.LLM: Dynamic Layer Routing in LLMs

- **ID:** 542
- **Kind:** paper
- **URL:** https://arxiv.org/abs/2510.12773
- **Authors:** Ahmed Heakl, Martin Gubri, Salman Khan, Sangdoo Yun, Seong Joon Oh
- **Venue:** arXiv / Parameter Lab / MBZUAI / NAVER AI Lab
- **Published:** 2025
- **Tags:** dr-llm, layer-routing, mcts, adaptive-depth, skip-repeat, iclr, mbzuai, naver
- **Topics:** adaptive depth, layer routing, efficient inference
- **Added:** 2026-10-01
- **Research status:** done
- **Page:** https://papers.projxon.ai/entries/542

## Summary

Attaches a tiny MLP router to each frozen block; routers are supervised on 4k length-aware MCTS paths (skip/execute/repeat) from ARC and DART-Math, then run search-free at inference. On six LLaMA-3.2/Qwen-2.5 models, in-domain accuracy rises in all cases (up to +3.4%p / +4.0%p on DART) with ~3–11 fewer layers per query; OOD drop 0.85%p average. Beats LayerSkip/ShortGPT/MindSkip/FlexiDepth by up to +7.7%p avg on GSM8k/MMLU/HellaSwag/HumanEval. Code https://github.com/parameterlab/dr-llm.

## Attributes

- **Purpose:** Retrofit frozen LLMs with per-layer skip/execute/repeat routers trained from offline MCTS paths
- **Scale:** 4k MCTS paths (961k offline forwards); routers 11M/16.8M params (0.14–0.56% of 3B/8B); six backbones 3B–8B; 1k-token gen 15.3% wall-time cut; router overhead <1%
- **Time period:** 2025-10-14 (arXiv 2510.12773 v1); last revised 2026-05-18 (v2). Published at ICLR 2026. HF paper publishedAt 2025-10-14.

## From the source (fetched 2026-10-03)

- **Published:** Oct 14, 2025 (arXiv)
- **Last revised:** May 18, 2026 (arXiv)
- **arXiv categories:** cs.CL, cs.AI, cs.LG (arXiv)
- **Author comment:** Published at ICLR 2026 (arXiv)
- **Citations:** 11 (2 influential) (Semantic Scholar)
- **References:** 34 (Semantic Scholar)

## Abstract

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.

## Research notes

- Primary: arxiv abs (cs.CL; also cs.AI, cs.LG). License not stated on abs/HTML at check. Parameter Lab / MBZUAI / NAVER AI Lab / University of Tübingen / Tübingen AI Center. Heakl corresponding. Code https://github.com/parameterlab/dr-llm (57 stars at check). HF paper page 32 upvotes; githubRepo linked; no linked models/datasets. Discord posted abs (Substack UTM). MCTS supervision is derived from public ARC/DART-Math, not a hosted corpus, so no datasets_local row. License field left blank per catalog convention.

## Cites, within this collection

- [Mixture-of-Depths: Dynamically allocating compute in transformer-based language models](https://papers.projxon.ai/entries/563) (paper 2024, #563)
- [Mixture-of-Recursions: Learning Dynamic Recursive Depths for Adaptive Token-Level Computation](https://papers.projxon.ai/entries/735) (paper 2025, #735)

## Similar entries

- [Dynamic Mixture of Experts: An Auto-Tuning Approach for Efficient Transformer Models](https://papers.projxon.ai/entries/523) (paper, #523)
- [SageAttention: Accurate 8-Bit Attention for Plug-and-play Inference Acceleration](https://papers.projxon.ai/entries/570) (paper, #570)
- [Depth Hybrid Attention (DHA): Depth-Wise Value Mixing for Hybrid Attention Architectures](https://papers.projxon.ai/entries/1505) (post, #1505)
- [TokenGate: Adapting LLMs for Fast and Memory-Efficient Prefill with Learned Token Pruning](https://papers.projxon.ai/entries/1430) (paper, #1430)
- [Adaptive Reward Routing: Dynamic Multi-Reward Optimization for Joint Audio-Video Diffusion via Forward-Process RL](https://papers.projxon.ai/entries/1199) (paper, #1199)
- [Tuning Language Models by Mixture-of-Depths Ensemble](https://papers.projxon.ai/entries/557) (paper, #557)
