Skip a Layer or Loop it? Test-Time Depth Adaptation of Pretrained LLMs
Not on the map. Why?
Abstract (arXiv)
Can a pretrained neural network adapt its architecture to different inputs without any finetuning? Do we need all layers for simple tasks, and are they adequate for challenging tasks? We found that the layers of a pretrained large language model (LLM) can be manipulated as separate modules to build a better and even shallower model customized for each test sample. In particular, each layer from the pretrained model can be skipped/pruned or repeated multiple times as recurrent neural networks (RNN), and stacked with others in arbitrary orders, yielding a chain-of-layers (CoLa) per sample. This compositional space greatly expands the scope of existing works on looped/recurrent pretrained modules, layer pruning, or early-exit networks. We develop a Monte Carlo Tree Search (MCTS) protocol to explore and identify the optimal CoLa for each sample from math and commonsense reasoning benchmarks. Compared to a static model of a fixed depth, CoLa allows shortcut paths (fast thinking), recurrence of the same layer(s) (slow thinking), and combining both, offering more flexible, dynamic architectures for different inputs. We conduct an extensive analysis of the MCTS-optimized CoLa, which leads to two key findings: (1) For >75% of samples with correct predictions by the original LLM, we can find shorter CoLa, suggesting a large space for improving inference efficiency; (2) For >60% of samples with originally incorrect predictions, we can identify CoLa achieving correct predictions, suggesting a large space of performance enhancement. Our results highlight the shortcomings of using a fixed architecture of pre-trained LLMs for inference on different samples and pave the way to unlock the generalization power of test-time depth adaptation.
Key facts. Cited by 16 papers in the map (data through 14 Oct 2026). Builds on 21 of its 26 references that are in the map. First posted on arXiv 10 Jul 2025.
Builds on
21 of 26 references.
References · 21
- 2018Think you have Solved Question Answering? Try ARC, the AI2 Reasoning Challengecited by 4,886
- 2021Scaling Language Models: Methods, Analysis & Insights from Training Gophercited by 1,202
- 2017BranchyNet: Fast Inference via Early Exiting from Deep Neural Networkscited by 596
- 2023Faith and Fate: Limits of Transformers on Compositionalitycited by 503
- 2019Reducing Transformer Depth on Demand with Structured Dropoutcited by 439
- 2025Scaling up Test-Time Compute with Latent Reasoning: A Recurrent Depth Approachcited by 415
- 2015Neural Module Networkscited by 376
- 2020DeeBERT: Dynamic Early Exiting for Accelerating BERT Inferencecited by 332
- 2020BERT Loses Patience: Fast and Robust Inference with Early Exitcited by 273
- 2020FastBERT: a Self-distilling BERT with Adaptive Inference Timecited by 226
- 2020Compressing BERT: Studying the Effects of Weight Pruning on Transfer Learningcited by 185
- 2023Looped Transformers are Better at Learning Learning Algorithmscited by 149
9 more
- 2024Looped Transformers for Length Generalizationcited by 99
- 2024DART-Math: Difficulty-Aware Rejection Tuning for Mathematical Problem-Solvingcited by 95
- 2024On Limitations of the Transformer Architecturecited by 63
- 2025Inner Thinking Transformer: Leveraging Dynamic Depth Scaling to Foster Adaptive Internal Thinkingcited by 57
- 2022You Need Multiple Exiting: Dynamic Early Exiting for Accelerating Unified Vision Language Modelcited by 43
- 2023LGViT: Dynamic Early Exiting for Accelerating Vision Transformercited by 31
- 2024Mixture of Nested Experts: Adaptive Processing of Visual Tokenscited by 25
- 2021Anytime Dense Prediction with Confidence Adaptivitycited by 18
- 2021DACT-BERT: Differentiable Adaptive Computation Time for an Efficient BERT Inferencecited by 9
Built on by
Citing papers per year: 2025: 4; 2026: 12.
16 papers.
Sort:
By area:
- 2026Memory-Efficient Looped Transformer: Decoupling Compute from Memory in Looped Language Modelscited by 14
- 2025Dr.LLM: Dynamic Layer Routing in LLMscited by 12
- 2026Skip a Layer or Loop It? Learning Program-of-Layers in LLMscited by 9
- 2026Allocating Recurrent Compute in Looped Language Modelscited by 4
- 2026The Topological Trouble With Transformerscited by 3
- 2025Catch Your Breath: Adaptive Computation for Self-Paced Sequence Productioncited by 2
- 2026MACRO: Markov Chain Routing of Transformer Layerscited by 2
- 2025Towards Understanding Layer Contributions in Tabular In-Context Learning Modelscited by 1
- 2026Programs-of-Layers in LLMs through the Lens of Cortical Areascited by 1
- 2026Architectural Sampling: Test-Time Scaling via Computational Diversity in Frozen Vision-Language Modelscited by 1
- 2025Ladder Up, Memory Down: Low-Cost Fine-Tuning With Side Netscited by 0
- 2026When LLM Meets Tree Search: A Systematic View of Inference as Search in Large Language Modelscited by 0
4 more
- 2026Write Back the Delta: Revisiting the Same Tokens with Fresh Representationscited by 0
- 2026Random Recursive Modelscited by 0
- 2026Dynamic Routing as a New Dimension for Test-time Versatility of LLMscited by 0
- 2026Input-Blind Controls Produce Substantial Oracle Headroom for Layer Programs in Multiple-Choice Evaluationcited by 0
- 2026Input-Blind Controls Produce Substantial Oracle Headroom for Layer Programs in Multiple-Choice Evaluation7 Oct 2026
- 2026Dynamic Routing as a New Dimension for Test-time Versatility of LLMs3 Oct 2026
- 2026Architectural Sampling: Test-Time Scaling via Computational Diversity in Frozen Vision-Language Models1 Oct 2026
- 2026Random Recursive Models30 Sep 2026
- 2026Write Back the Delta: Revisiting the Same Tokens with Fresh Representations26 Sep 2026
- 2026Programs-of-Layers in LLMs through the Lens of Cortical Areas25 Sep 2026
- 2026When LLM Meets Tree Search: A Systematic View of Inference as Search in Large Language Models31 Aug 2026
- 2026Allocating Recurrent Compute in Looped Language Models18 Aug 2026
- 2026MACRO: Markov Chain Routing of Transformer Layers6 Aug 2026
- 2026Skip a Layer or Loop It? Learning Program-of-Layers in LLMs4 Jun 2026
- 2026Memory-Efficient Looped Transformer: Decoupling Compute from Memory in Looped Language Models8 May 2026
- 2026The Topological Trouble With Transformers18 Apr 2026
4 more
- 2025Ladder Up, Memory Down: Low-Cost Fine-Tuning With Side Nets16 Dec 2025
- 2025Towards Understanding Layer Contributions in Tabular In-Context Learning Models19 Nov 2025
- 2025Dr.LLM: Dynamic Layer Routing in LLMs14 Oct 2025
- 2025Catch Your Breath: Adaptive Computation for Self-Paced Sequence Production13 Oct 2025
- 2026Allocating Recurrent Compute in Looped Language Modelscited by 4
- 2025Catch Your Breath: Adaptive Computation for Self-Paced Sequence Productioncited by 2
- 2026Architectural Sampling: Test-Time Scaling via Computational Diversity in Frozen Vision-Language Modelscited by 1
- 2026When LLM Meets Tree Search: A Systematic View of Inference as Search in Large Language Modelscited by 0
- 2026Dynamic Routing as a New Dimension for Test-time Versatility of LLMscited by 0
- 2026Dynamic Routing as a New Dimension for Test-time Versatility of LLMs3 Oct 2026
- 2026Architectural Sampling: Test-Time Scaling via Computational Diversity in Frozen Vision-Language Models1 Oct 2026
- 2026When LLM Meets Tree Search: A Systematic View of Inference as Search in Large Language Models31 Aug 2026
- 2026Allocating Recurrent Compute in Looped Language Models18 Aug 2026
- 2025Catch Your Breath: Adaptive Computation for Self-Paced Sequence Production13 Oct 2025
- 2025Dr.LLM: Dynamic Layer Routing in LLMscited by 12
- 2026Skip a Layer or Loop It? Learning Program-of-Layers in LLMscited by 9
- 2026The Topological Trouble With Transformerscited by 3
- 2026MACRO: Markov Chain Routing of Transformer Layerscited by 2
- 2025Towards Understanding Layer Contributions in Tabular In-Context Learning Modelscited by 1
- 2026Programs-of-Layers in LLMs through the Lens of Cortical Areascited by 1
- 2025Ladder Up, Memory Down: Low-Cost Fine-Tuning With Side Netscited by 0
- 2026Write Back the Delta: Revisiting the Same Tokens with Fresh Representationscited by 0
- 2026Random Recursive Modelscited by 0
- 2026Input-Blind Controls Produce Substantial Oracle Headroom for Layer Programs in Multiple-Choice Evaluationcited by 0
- 2026Input-Blind Controls Produce Substantial Oracle Headroom for Layer Programs in Multiple-Choice Evaluation7 Oct 2026
- 2026Random Recursive Models30 Sep 2026
- 2026Write Back the Delta: Revisiting the Same Tokens with Fresh Representations26 Sep 2026
- 2026Programs-of-Layers in LLMs through the Lens of Cortical Areas25 Sep 2026
- 2026MACRO: Markov Chain Routing of Transformer Layers6 Aug 2026
- 2026Skip a Layer or Loop It? Learning Program-of-Layers in LLMs4 Jun 2026
- 2026The Topological Trouble With Transformers18 Apr 2026
- 2025Ladder Up, Memory Down: Low-Cost Fine-Tuning With Side Nets16 Dec 2025
- 2025Towards Understanding Layer Contributions in Tabular In-Context Learning Models19 Nov 2025
- 2025Dr.LLM: Dynamic Layer Routing in LLMs14 Oct 2025
Similar, not cited
Close in wording, no citation either way
- 2025When Fewer Layers Break More Chains: Layer Pruning Harms Test-Time Scaling in LLMs
- 2024What Happened in LLMs Layers when Trained for Fast vs. Slow Thinking: A Gradient Perspective
- 2025LLM Post-Training: A Deep Dive into Reasoning Large Language Models
- 2025Where to Begin: Efficient Pretraining via Subnetwork Selection and Distillation
- 2025Teaching Pretrained Language Models to Think Deeper with Retrofitted Recurrence
- 2026Rethinking Layer Redundancy: Calibration Matters More Than Search in LLM Depth Pruning
- 2025Distilled Pretraining: A modern lens of Data, In-Context Learning and Test-Time Scaling
- 2024Skipping Computations in Multimodal LLMs