Source-linked AI summary

LayerRoute: Adaptive Layer-Skipping with LoRA-Preserved Quality for Efficient LLM Inference

Prateek Kumar Sikdar

arXiv:2609.13682v1cs.CLcs.AI

TL;DR

LLM inference applies uniform compute regardless of input needs, motivating adaptive layer skipping. LayerRoute jointly trains hard-gated per-layer routing with LoRA; across 10 seeds it yields consistent skip patterns, quality preservation, verified input-dependent routing, and positive speedup.

  • Problem

    LLM inference applies uniform compute to every input token and sequence regardless of how much computation each input requires.

    Source: §1 · p. 1
  • Method

    LayerRoute jointly trains per-layer hard binary skip routing with LoRA fine-tuning and gate regularization.

    Source: §1 · p. 1, §3.3 · p. 4
  • Results

    Across 10 seeds, LayerRoute achieves 1.02–1.06× wall-clock speedup, consistent skip-pattern structure and quality preservation, with directly verified input-dependent routing.

    Source: §6 · p. 6, §8 · p. 7
  • Takeaways & Limitations

    The authors present reproducibility and transparent reporting of unresolved router signals as contributions alongside the positive results.

    Source: §8 · p. 7

    Evaluation covers Qwen2.5-0.5B only; generalization of skip patterns, speedup, and router behavior to larger models remains untested.

    Source: §7 · p. 6

Abstract

from arXiv · show

We introduce LayerRoute, a parameter-efficient method for adaptive transformer layer-skipping that combines per-layer hard-gated routing (trained via a straight-through estimator) with joint LoRA fine-tuning. LayerRoute augments each of the 24 transformer blocks in Qwen2.5-0.5B-Instruct with a lightweight per-layer router (~21.5K parameters) and LoRA adapters (rank 8, ~1.08M parameters), training both jointly under a gate-regularized language-modeling objective. Across 10 independently-seeded training runs, LayerRoute converges to an identical skip-pattern structure in every run - a consistent set of 9 middle layers (8-16) becomes skip-eligible in all 10 seeds - and delivers genuine, verified wallclock speedup in every run (1.02x-1.06x, mean 1.04x). Quality is preserved or improved in every configuration tested: joint LoRA adaptation yields a perplexity improvement over the unmodified backbone in all 10 seeds (mean delta = -1.16 and -1.11 across the two evaluation splits used). We further verify the router performs genuine, non-trivial per-input computation: gate decisions in skip-eligible layers change the actual skip/run outcome for 87-100% of held-out samples, confirming real input-dependent routing rather than a fixed pruning pattern. LayerRoute trains in under 7 minutes on a single A100 and adds negligible overhead beyond the routing decision itself. We report our full reproducibility methodology, including a systematic diagnostic investigation into what determines the router's per-input decisions, as part of this work.

1 Introduction

LayerRoute targets uniform LLM inference compute with per-input layer skipping jointly adapted with LoRA. The paper emphasizes reproducibility, direct verification of input-dependent routing, and transparent diagnostics.

1 Introduction

  • LayerRoute combines per-layer hard-gated skipping with jointly trained LoRA adapters, gate regularization, and biased middle-layer initialization.The regularization and initialization are described as necessary to escape an all-open equilibrium and reach genuine skip behavior.Source: §1 · p. 1
  • Across 10 independently seeded runs, the study reports reproducible skip-pattern structure, wall-clock speedup, and quality preservation, while directly checking that routing is input-dependent.The authors also distinguish stable properties from those that do not reproduce reliably.Source: §1 · pp. 1–2
  • The hard-gated architecture is jointly trained with LoRA adapters in under 7 minutes on a single A100.Source: §1 · p. 2
  • The paper directly verifies that the trained router performs substantial per-input computation rather than acting as a fixed pruning pattern.Source: §1 · p. 2
  • The authors report a systematic diagnostic methodology for investigating what signals drive router decisions, including negative results.Source: §1 · p. 2

2 Related Work

Related work situates LayerRoute among adaptive depth, conditional-computation, parameter-efficient fine-tuning, and inference-efficiency approaches, highlighting differences in routing granularity and training strategy.

2 Related Work

3 Method

LayerRoute combines per-layer hard-gated skipping with jointly trained LoRA adapters. Its method uses a straight-through estimator, gate regularization, and layer-position-dependent initialization to train the routing policy.

3.1 Architecture

  • Each of the 24 blocks receives a lightweight per-layer router and LoRA adapters on its attention projections.The routers total 21,528 parameters; the rank-8 LoRA adapters total 1,081,344 parameters.Source: §3.1 · p. 3

3.2 Straight-Through Estimator

  • The straight-through estimator uses hard gates in both forward passes while routing gradients through the corresponding continuous sigmoid values.At inference, blocks with gate value 0 are not computed, enabling genuine computation skipping rather than computing and discarding their outputs.Source: §3.2 · p. 3

3.3 Training Objective

  • The joint objective adds gate regularization with λ = 1.0 to autoregressive cross-entropy, penalizing uniformly high soft gate values.The regularizer is intended to prevent collapse to an all-open equilibrium.Source: §3.3 · p. 4

3.4 Biased Initialization

  • Layer-position-dependent bias initialization breaks the symmetry of gates initialized near 0.5 by starting middle layers below threshold.Those middle layers skip from step 1, exposing their contribution to the language-model loss gradient.Source: §3.4 · p. 4

4 Experimental Setup

The experiments evaluate LayerRoute on a 24-block Qwen2.5-0.5B-Instruct backbone using mixed tool-call and reasoning/planning training data. Ten seeded training runs are assessed on held-out samples for latency, perplexity, and gate non-triviality.

Base model

  • Qwen2.5-0.5B-Instruct is the 24-block, hidden-size-896 backbone used in the experiments.It has grouped-query attention with 14 query heads and 2 KV heads, a SwiGLU feed-forward network, and a vocabulary of 151,936.Source: §4 · p. 4

Training data

  • The mixed agentic training dataset contains 10,749 training and 1,194 validation samples from tool-call and reasoning/planning sources.The named sources are Hermes Function Calling v1, Glaive Function Calling v2, GSM8K, and Turing Open Reasoning.Source: §4 · p. 4

Training

  • Ten independently seeded runs use 3,000 training steps and take 382 seconds on a single A100 40GB.Each run seeds weight initialization, dropout, and batch ordering; evaluation sample selection is separately seeded per run using the training seed.Source: §4 · p. 4

Evaluation

  • Each seed is evaluated on 100 held-out samples, measuring real wall-clock inference latency, gated-model versus full-layer-baseline perplexity, and gate non-triviality.The samples comprise 50 from each of two evaluation sources representing tool-call-style short structured generation and longer-form reasoning.Source: §4 · p. 4

5 Results

Across ten seeds, LayerRoute yields positive measured speedups and lower perplexity than the full-layer baseline, while converging to the same skip-eligible layers and making non-trivial input-dependent decisions.

5.1 Skip-Pattern Structure Is Reproducible

  • Layers 8–16 were skip-eligible in every seed, while layers 0–7 and 17–23 remained open, with across-seed standard deviation below 0.004 at every layer.The converged mean gate values were 0.27–0.28 in layers 8–16 and 0.72–0.73 elsewhere.Source: §5.1 · p. 4, Table 1 · p. 5

5.2 Genuine, Measured Wall-Clock Speedup

  • 1.02×–1.06× speedup (mean 1.04×) across all ten seeds was measured against a genuine full-model baseline with real inference-time skipping.The baseline forced every gate open and was verified to execute all 24 layers.Source: Table 2 · p. 5, §5.2 · p. 5

5.3 Quality Preservation via Joint LoRA Adaptation

  • Across all ten seeds and both evaluation splits, gated-model perplexity was lower than the full-layer baseline’s using the same jointly trained LoRA weights.Table 3 reports the gated-minus-full perplexity delta; negative values indicate the gated model outperforms the baseline.Source: Table 3 · p. 5, §5.3 · p. 5

5.4 The Router Is Non-Trivial

  • In the nine skip-eligible layers, the input-dependent weight term changed actual skip/run decisions for 87–100% of held-out samples.Outside that band, the weight term rarely changed decisions, consistent with gates already being decisively open.Source: §5.4 · p. 5, Table 4 · p. 6

6 Discussion

Across ten independent runs, LayerRoute reliably reproduces its skip pattern, positive wall-clock speedup, and quality preservation, but the specific signal driving router decisions remains unidentified.

  • Across ten independent runs, LayerRoute reliably reproduces the skip-pattern architecture, positive wall-clock speedup, and quality preservation via joint LoRA adaptation.The authors directly verify that the router’s input-dependent weight term substantially and consistently changes realized computation.Source: §6 · p. 6
  • The authors investigated candidate signals but do not claim a specific interpretable signal for skip-eligible-layer decisions because their evidence does not meet their stated rigor threshold.The investigation included linear probes, gradient analyses, an explicit-supervision ablation, and feature correlations.Source: §6 · p. 6

7 Limitations

The reported scope is limited to one model scale and one architecture family, and the router’s specific per-input decision signal is not established.

  • The router’s per-input decisions are verified as real, but the specific signal they track is unknown and is not the training-data source split.Sequence length correlates more strongly with decisions than source labels, but their independent contributions could not be statistically separated with confidence.Source: §7 · p. 6
  • Experiments use Qwen2.5-0.5B only, so generalization of skip patterns, speedup magnitude, or router behavior to larger models is untested.Source: §7 · p. 6
  • All experiments use the Qwen2.5 architecture, leaving generalization to other model families untested.Source: §7 · p. 6

8 Conclusion

LayerRoute is evaluated across 10 independently seeded runs to distinguish reproducible properties from run-to-run variance. It delivers consistent skip patterns, measured speedups, and quality preservation, while the specific input property driving routing remains unconfirmed.

8 Conclusion

  • Across 10 seeds, LayerRoute reliably produces a consistent skip-pattern architecture.The evaluation protocol separates stable properties from run-to-run variance.Source: §8 · pp. 6–7
  • 1.02–1.06× wall-clock speedup and quality preservation via joint LoRA fine-tuning hold across every seed tested.The router also performs substantial, non-trivial per-input computation.Source: §8 · p. 7
  • The specific input property driving the router’s decisions remains unconfirmed despite testing and ruling out several natural candidates.The authors report this uncertainty alongside the positive results.Source: §8 · p. 7

A Architecture Diagram

LayerRoute combines a frozen backbone layer, a per-layer LoRA adapter, and a gate head. A hard straight-through gate selects either the adapted layer output or a pure residual skip, with routing based on the incoming hidden state.

A Architecture Diagram

  • A hard straight-through gate selects either the adapted layer output or a pure residual skip.The diagram combines a frozen backbone layer, per-layer LoRA adapter, and gate head.Source: A Architecture Diagram · p. 9
  • The per-layer router computes its gate from the mean-pooled hidden state entering that layer.Its input-dependent weight term changes realized skip/run decisions for 87–100% of held-out samples in the skip-eligible band.Source: Figure 1 · p. 10
  • Layers 8–16 become skip-favored in all 10 seeds, while layers 0–7 and 17–23 remain execute-favored.The router's decisions change actual skip/run outcomes for held-out samples within the skip-eligible band.Source: Figure 1 · p. 10
Loading 2609.13682v1…