mlsanityData to 14 Oct 2026

Skip a Layer or Loop it? Test-Time Depth Adaptation of Pretrained LLMs

arXiv 2507.07996 ↗First posted 10 Jul 2025cs.LGcited by 16

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

  1. 2018Think you have Solved Question Answering? Try ARC, the AI2 Reasoning Challengecited by 4,886
  2. 2021Scaling Language Models: Methods, Analysis & Insights from Training Gophercited by 1,202
  3. 2017BranchyNet: Fast Inference via Early Exiting from Deep Neural Networkscited by 596
  4. 2023Faith and Fate: Limits of Transformers on Compositionalitycited by 503
  5. 2019Reducing Transformer Depth on Demand with Structured Dropoutcited by 439
  6. 2025Scaling up Test-Time Compute with Latent Reasoning: A Recurrent Depth Approachcited by 415
  7. 2015Neural Module Networkscited by 376
  8. 2020DeeBERT: Dynamic Early Exiting for Accelerating BERT Inferencecited by 332
  9. 2020BERT Loses Patience: Fast and Robust Inference with Early Exitcited by 273
  10. 2020FastBERT: a Self-distilling BERT with Adaptive Inference Timecited by 226
  11. 2020Compressing BERT: Studying the Effects of Weight Pruning on Transfer Learningcited by 185
  12. 2023Looped Transformers are Better at Learning Learning Algorithmscited by 149
9 more
  1. 2024Looped Transformers for Length Generalizationcited by 99
  2. 2024DART-Math: Difficulty-Aware Rejection Tuning for Mathematical Problem-Solvingcited by 95
  3. 2024On Limitations of the Transformer Architecturecited by 63
  4. 2025Inner Thinking Transformer: Leveraging Dynamic Depth Scaling to Foster Adaptive Internal Thinkingcited by 57
  5. 2022You Need Multiple Exiting: Dynamic Early Exiting for Accelerating Unified Vision Language Modelcited by 43
  6. 2023LGViT: Dynamic Early Exiting for Accelerating Vision Transformercited by 31
  7. 2024Mixture of Nested Experts: Adaptive Processing of Visual Tokenscited by 25
  8. 2021Anytime Dense Prediction with Confidence Adaptivitycited by 18
  9. 2021DACT-BERT: Differentiable Adaptive Computation Time for an Efficient BERT Inferencecited by 9

Built on by

Cited by year (2026 to 14 Oct)

Citing papers per year: 2025: 4; 2026: 12.

16 papers.

Sort:

By area:

Similar, not cited

Close in wording, no citation either way

  1. 2025When Fewer Layers Break More Chains: Layer Pruning Harms Test-Time Scaling in LLMs
  2. 2024What Happened in LLMs Layers when Trained for Fast vs. Slow Thinking: A Gradient Perspective
  3. 2025LLM Post-Training: A Deep Dive into Reasoning Large Language Models
  4. 2025Where to Begin: Efficient Pretraining via Subnetwork Selection and Distillation
  5. 2025Teaching Pretrained Language Models to Think Deeper with Retrofitted Recurrence
  6. 2026Rethinking Layer Redundancy: Calibration Matters More Than Search in LLM Depth Pruning
  7. 2025Distilled Pretraining: A modern lens of Data, In-Context Learning and Test-Time Scaling
  8. 2024Skipping Computations in Multimodal LLMs