Average-Depth Variable Execution via Request-Local Token Routing
Authors: Pengjie Zheng, Mengwei Xie, Huan Yang, Si Wu, Pengfei Hu, Feng Li
Organizations: School of Computer Science and Technology, Shandong University, Qingdao 266237, China · College of Computer Science and Technology, Qingdao University, Qingdao 266071, China
Layer skipping can reduce large language model inference costs, but a request budget does not specify how to allocate layer execution across generated tokens. We introduce \method{}, which allows tokens to execute different numbers of layers while matching each request's mean executed depth to a continuous budget. At each routed layer, a router reads the current token state and its request's budget and decides whether to execute the Transformer block. Tokens that skip the block pass through a lightweight residual adapter and write no key/value (K/V) entry at that layer. A single checkpoint serves requests with different budgets in the same batch. Across three LLaMA backbones, six quality metrics, and 13 budgets, AVERT is best or tied for best in 206 of 234 comparisons. Across single- and mixed-budget batches, the mean absolute per-request budget error is at most 1.15 percentage points. When grouping requests by budget leaves batches underfilled, mixing budgets reduces decode time per output token (TPOT) by 4.3--21.2%.
Figures & tables
Figure 1: AVERT. (a) Tokens in one request can execute different numbers of layers while their average tracks Ωb . (b) Tokens selected for block execution are processed together, while skipped tokens pass through SCA. (c) Each layer appends K/V entries only for tokens that execute it.
The budget determines a fixed subset of attention and FFN sublayers shared by all tokens.
No
GateSkip
Batch
The budget selects a quantile of the batch-wide live tokens’ scores to determine which tokens execute each sublayer.
No
D-LLM
Training run
Each token is penalized for deviating from the training target.
No
MoD
Training run
The budget sets each routed layer’s capacity, limiting how many tokens execute it during training.
No
SkipGPT
Training run
The training target sets the fraction of attention and FFN modules to execute on average across tokens in a micro-batch.
No
FlexiDepth
Training run
A penalty coefficient controls the tendency to skip. Users cannot specify a target execution fraction.
No
Table 1: How the methods use compute budgets.
Prom.
ROUGE-L
BLEU-4
GSM8K-Flex
IFEval-SP
IFEval-SI
Model
Method
1.0
0.4
1.0
0.4
1.0
0.4
1.0
0.4
1.0
0.4
1.0
0.4
LLaMA-2-7B (MHA, 32L)
Vanilla
3.39
–
0.278
–
0.116
–
0.116
–
0.246
–
0.354
–
GateSkip-FFT
3.08
1.10
0.261
0.159
0.104
0.022
0.024
0.001
0.142
0.059
0.252
0.182
GateSkip-LoRA
3.32
1.00
0.255
0.000
0.109
0.000
0.033
0.002
0.202
0.046
0.301
0.133
D-LLM
3.40
1.51
0.281
0.190
0.125
0.036
0.120
0.011
0.255
0.081
0.366
0.177
AdaSkip
3.38
1.01
0.277
0.034
0.116
0.002
0.116
0.003
0.244
0.061
0.352
0.131
Table 2: Main results at the near-full target ( Ω=1.0 ) and the aggressive target ( Ω=0.4 ). IFEval-SP/SI are strict prompt/instruction accuracies; GSM8K-Flex is flexible answer-extraction accuracy. Best dynamic result per setting is in bold , using unrounded values.
Figure 2: Quality across the full 13-point budget sweep. Columns are backbones; rows report Prometheus-2 on Alpaca, GSM8K flexible accuracy, and IFEval strict-prompt accuracy. Each curve connects the 13 requested targets, and dashed lines mark Vanilla. Remaining metrics are in Appendix B .
Figure 3: Prometheus-2 versus measured decode TPOT. Each point shows a method’s measured TPOT on the horizontal axis and Prometheus-2 score on the vertical axis at one requested budget. Each curve connects the 13 evaluated budgets for one method on a fixed backbone.
Figure 4: Request-average objective ablation. On LLaMA-3.1-8B, “W/o Request-Average Objective” uses the per-token loss.
Appendix figures & tables35 assets
Supplementary material from the paper’s appendix.
Appendix
Figure 5: Full IFEval strict prompt/instruction sweeps.
Figure 6: LLaMA-2-7B (MHA), Alpaca/GSM8K plus auxiliary PIQA metrics.
Figure 7: LLaMA-3.1-8B (GQA), Alpaca/GSM8K plus auxiliary PIQA metrics.
Figure 8: LLaMA-3.2-1B (GQA, 16L), Alpaca/GSM8K plus auxiliary PIQA metrics.
Evaluation
SP
SI
LP
LI
Vanilla
32.53
43.65
34.94
47.00
AVERT, target 1
36.23
47.12
38.26
50.72
Same AVERT, forced full
36.23
47.00
37.89
50.60
Appendix
Table 3: IFEval full-depth control on LLaMA-3.1-8B. All scores are percentages; SP/SI and LP/LI denote strict and loose prompt/instruction accuracy.
Figure 9: Decode TPOT and peak VRAM with K/V omission and retention across the three LLaMA backbones.
Figure 10: K/V omission versus retention on LLaMA-2-7B (MHA). MHA yields the largest cache-memory benefit from omitted K/V entries.
Figure 11: K/V omission versus retention on LLaMA-3.1-8B (GQA). GQA already compresses K/V, so the memory gap is smaller than for MHA.
Figure 12: K/V omission versus retention on LLaMA-3.2-1B (GQA, 16L).
Figure 13: AVERT quality and decode efficiency by batch size on LLaMA-3.1-8B.
Figure 14: GateSkip-FFT batch-size sensitivity on LLaMA-3.1-8B. Left: Prometheus versus requested Ω . Right: execution fraction versus requested Ω , with the identity line as the calibration target. Both quality and realized compute change sharply with BS because the selector uses a threshold derived from the current batch-wide live-token pool.
Budget
Responses
Routed positions
Mean absolute error (pp)
95th percentile (pp)
Within 2 pp
0.40
160
17,547
1.150
2.000
153/160
0.60
160
18,089
1.150
1.901
154/160
0.80
160
17,984
1.150
1.785
153/160
All
480
53,620
1.150
1.975
460/480
Appendix
Table 4: Token depth and budget error on LLaMA-3.1-8B. Errors are in percentage points (pp). The last column counts responses whose average execution fraction is within two points of their target.
Workload
Model
Total wall-clock (s)
Decode TPOT (ms/token)
Peak decode VRAM (GiB)
Mixed
Split
Mixed
Split
Mixed
Split
Balanced 4/4 batches; 100% fill
LLaMA-2-7B
54.53
54.47
3.263
3.258
17.13
19.01
LLaMA-3.1-8B
57.78
57.91
3.480
3.484
17.89
18.01
LLaMA-3.2-1B
29.61
29.65
1.780
1.781
3.47
4.03
Moderate skew 4/5 batches; 80% fill
LLaMA-2-7B
50.28
53.72
3.003
3.214
17.04
18.13
LLaMA-3.1-8B
54.57
56.88
3.280
3.428
17.88
17.77
Appendix
Table 5: Mixed-budget versus homogeneous split execution. Means over 10 runs using the same AVERT checkpoint and identical request–budget pairs. Batch counts shown as mixed/split; fill is the average split-batch fill ratio.
Figure 15: On-grid and off-grid budgets. Requested budget versus average execution fraction. The diagonal marks equality of these quantities. The five off-grid targets are overlaid on the 13-point grid.
Figure 16: Off-grid operating points within the trained budget interval. The 13 on-grid AVERT points define the requested-budget curves; the five off-grid evaluations are overlaid for Prometheus-2, decode TPOT, and peak decode VRAM.
Model
Keep rate (AVERT/AdaSkip)
Prometheus (AVERT/AdaSkip)
TPOT (AVERT/AdaSkip)
Peak decode VRAM (AVERT/AdaSkip)
LLaMA-2-7B
.80/.95
3.30/3.29
3.714/3.891
17.85/17.43
LLaMA-2-7B
.55/.90
3.02/3.02
3.119/3.678
17.28/16.88
LLaMA-2-7B
.45/.85
2.65/2.61
2.818/3.406
17.05/16.13
LLaMA-3.1-8B
.85/.95
3.60/3.56
4.389/4.419
16.90/16.51
LLaMA-3.1-8B
.75/.90
3.46/3.44
4.111/4.217
16.83/16.23
LLaMA-3.1-8B
.55/.85
2.89/2.85
3.519/3.942
16.68/15.86
Appendix
Table 6: Prometheus-2-matched efficiency against AdaSkip. Each row compares two operating points with similar Prometheus-2 quality. TPOT is in ms/token and peak decode VRAM in GiB.
Figure 17: SCA ablation on LLaMA-3.1-8B. The quality gap between full AVERT and the separately trained no-SCA model widens at lower requested budgets.
Request-average objective
Per-token objective
Epoch
Lreq
Answer-token CE
Ltok
Answer-token CE
1
0.0708
1.2589
0.0880
1.3793
2
0.0236
1.3702
0.0370
1.6000
3
0.0176
1.2397
0.0290
1.4582
4
0.0111
1.0707
0.0204
1.2401
5
0.0070
0.9328
0.0164
1.0786
Appendix
Table 7: Training on LLaMA-3.1-8B. Entries are epoch means. The budget columns report the unweighted objectives used for parameter updates: request-average loss for AVERT and per-token loss for the alternative. CE is computed on supervised answer tokens.
Figure 18: Progressive-routing ablation on LLaMA-3.1-8B. One-shot routing decisions are all computed from the same hidden state before the dynamic-layer stack; AVERT makes each routing decision using the current hidden state at that layer.
Figure 19: Penalty sensitivity on LLaMA-3.1-8B. (a) Mean executed fraction versus requested target. (b) Prometheus-2 versus requested target. (c) Prometheus-2 versus the measured execution fraction. The λ=0 run includes target 1.0 and three lower targets; its nearly coincident points reflect almost full execution.
Target
Execution
Prometheus-2
ROUGE-L
BLEU-4
1.00
0.999988
3.66
0.2813
0.1239
0.90
0.999988
3.66
0.2813
0.1239
0.60
0.996039
3.65
0.2812
0.1233
0.40
0.996227
3.65
0.2809
0.1231
Appendix
Table 8: No-penalty control ( λ=0 ). Execution is the fraction of layers executed.
Model
LoRA params (mergeable)
Router+SCA params
Non-mergeable overhead
LLaMA-2-7B
35.78M
125.91M
≈ 240 MiB
LLaMA-3.1-8B
37.75M
125.91M
≈ 240 MiB
LLaMA-3.2-1B
10.22M
29.40M
≈ 56 MiB
Qwen2.5-3B
27.57M
71.39M
≈ 136 MiB
Appendix
Table 9: Static parameter overhead. LoRA parameters are mergeable into the base model; router+SCA parameters remain at deployment.
Figure 20: Decode component timings on LLaMA-3.1-8B at Ω=0.5 . Bars show instrumented CUDA stream intervals per output token. They cannot be summed to recover the uninstrumented TPOT.
Figure 21: Qualitative logit-lens probe on LLaMA-3.1-8B at Ω=0.70 . Color indicates target-token Δlog(rank) between skip and execute paths; crosses mark router-skipped pairs. Rows begin at zero-indexed layer 2 because the first two Transformer layers always execute and are not plotted. The first two full-execution decode inputs are also excluded.
Figure 22: Aggregate local rank drift by router decision. Across all three architectures and two targets, router-skipped layer–token pairs show distributions of local skip-versus-execute target-rank drift concentrated toward lower values than executed pairs.
Figure 23: Decode efficiency versus measured execution fraction. The top row shows decode TPOT and the bottom row shows peak decode VRAM. Each curve uses the execution fractions measured for that method at the 13 requested budgets.
Figure 24: Measured TPOT and peak decode VRAM across requested targets. GateSkip-FFT and merged GateSkip-LoRA are measured separately.
Baseline
Matched / 39
Lower TPOT
Lower peak decode VRAM
GateSkip-FFT
10
10
10
GateSkip-LoRA
15
15
15
D-LLM
25
20
13
AdaSkip
11
7
3
BUDDY (reimpl.)
15
15
15
Appendix
Table 10: Counts of matched pairs whose Prometheus-2 scores differ by at most 0.05. Several baseline points may match the same AVERT point.
Figure 25: Token uncertainty and execution depth. For each backbone and budget, the plot shows the mean fraction of layers executed in each entropy quartile relative to the lowest-entropy quartile (Q1), in percentage points. We compute Spearman’s ρ across individual tokens using dense-reference next-token entropy and executed depth.
Figure 26: Non-nested selections across requested targets. Each cell compares the same reference text under two budgets. Nonzero NVR means that some dynamically executed low-budget layer–token pairs are absent at the higher budget.
Method
Ω
Prometheus
ROUGE-L
BLEU-4
GSM8K-Flex
IFEval-SP
IFEval-SI
PIQA
Vanilla
1.00
3.460
0.2943
0.1263
0.5747
0.2680
0.3993
0.7552
AVERT
1.00
3.445
0.2948
0.1265
0.5777
0.2847
0.4065
0.7579
AVERT
0.70
3.444
0.2927
0.1253
0.4890
0.2828
0.3957
0.7383
AVERT
0.40
3.133
0.2871
0.1136
0.2115
0.2717
0.3825
0.7116
BUDDY (reimpl.)
1.00
3.289
0.2984
0.1269
0.5489
0.2699
0.3753
0.7563
BUDDY (reimpl.)
0.70
2.653
0.2589
0.0950
0.0735
0.0961
0.1918
0.6834
Appendix
Table 11: Qwen2.5-3B quality. Prometheus is on the 1–5 scale; other metrics are fractions. SP/SI denote strict prompt/instruction accuracy. PIQA is the auxiliary prefill probe.
Method
Ω
TPOT (ms/token)
Peak decode VRAM (GiB)
Vanilla
1.00
3.9012
7.77
AVERT
1.00
4.0402
7.99
AVERT
0.70
3.4792
7.78
AVERT
0.40
2.5997
7.58
BUDDY (reimpl.)
1.00
3.9311
7.80
BUDDY (reimpl.)
0.70
3.4787
7.80
Appendix
Table 12: Qwen2.5-3B decode efficiency. TPOT and peak decode VRAM are measured separately from quality, with 128-token prefill and 128 decode-produced tokens. The prefill bootstrap token is excluded from the decode count.
Decode TPOT
Peak decode VRAM
Prompt length
Ω=1.0
0.7
0.4
Ω=1.0
0.7
0.4
128
4.6728
4.0781
3.0392
17.05
16.88
16.62
256
5.2226
4.6315
3.6883
17.56
17.38
17.11
512
6.0288
5.1887
4.0898
18.57
18.38
18.11
1024
7.1113
6.0759
5.0831
20.58
20.38
20.09
2048
9.0585
7.8505
6.8457
24.57
24.35
24.05
Appendix
Table 13: Prompt-length sensitivity of AVERT on LLaMA-3.1-8B. TPOT is in ms/token; peak decode VRAM is in GiB.
Metric
Ω=1.0
Ω=0.7
Ω=0.4
Prometheus-2
3.644±0.034
3.394±0.021
2.036±0.030
ROUGE-L
0.2807±0.0016
0.2644±0.0018
0.1995±0.0019
BLEU-4
0.1237±0.0019
0.1118±0.0016
0.0607±0.0014
GSM8K-Flex
0.4238±0.0046
0.2177±0.0035
0.0206±0.0035
IFEval strict-prompt
0.3619±0.0058
0.2776±0.0060
0.0943±0.0037
IFEval strict-instruction
0.4712±0.0046
0.3871±0.0049
0.1892±0.0055
Appendix
Table 14: Five independent AVERT training runs on LLaMA-3.1-8B. Entries are mean ± sample SD. Prometheus uses the 1–5 scale; other metrics are fractions.
Method
Target
Execution
Prometheus-2
ROUGE-L
BLEU-4
SkipGPT ( 8×3 )
0.80
0.9744
3.47
0.2705
0.1173
FlexiDepth
—
0.8918
2.541
0.2598
0.1058
AVERT
0.80
0.8070
3.48
0.2723
0.1184
AVERT
0.85
0.8592
3.60
0.2735
0.1261
AVERT
0.90
0.9057
3.63
0.2739
0.1234
Appendix
Table 15: Additional 8B Alpaca comparisons. SkipGPT’s target is set during router training and AVERT’s target is supplied per request at inference. FlexiDepth uses a training penalty. Execution counts attention/FFN modules for SkipGPT and whole blocks for the other methods. The counts exclude prefill and the first two full-depth decode positions.
LLM inference acceleration develops algorithms and systems that reduce language-model latency, memory use, and serving cost while preserving output quality.