[KongchangAI]
· 2 min read· 1,222 words

AVERT: Skipping Layers on Demand to Slash LLM Inference Costs

AVERT: Skipping Layers on Demand to Slash LLM Inference Costs

AVERT lets each token dynamically skip Transformer layers on demand, improving throughput while precisely controlling request average depth.

AVERT is a dynamic layer-skipping method for LLM inference. Under a request-level average depth budget, each token decides how many layers to execute based on its state and the request budget. Skipped tokens pass through a lightweight residual adapter and write no K/V cache, saving compute and memory; one checkpoint serves mixed budgets in a batch. It was best or tied for best in 206 of 234 comparisons.

The inference cost of large language models (LLMs) has long been a bottleneck for deployment. Layer skipping reduces computation by cutting the number of Transformer layers executed per token, but a fundamental question remains unresolved: when a request is allotted an average depth budget, how should layer execution be allocated to each token in the generated sequence?

Conventional approaches tend to apply a uniform skipping strategy to the entire request, but the complexity of different tokens varies significantly—some tokens need more layers to model accurately, others do not. A recent paper proposes AVERT (Average-Depth Variable Execution via Request-Local Token Routing), which lets tokens dynamically decide how many layers to execute based on their own state and the request budget, while ensuring the request-level average depth meets the budget.

Core Mechanism: Request-Local Token Routing

The core idea of AVERT is "request-local" routing: each request has a continuous average depth budget, and routing decisions are made at each layer that requires routing. Specifically, the router reads the current token's state and the request's budget to decide whether to execute the corresponding Transformer block.

AVERT architecture diagram

If a token skips a block, it does not simply discard information; instead, it passes through a lightweight residual adapter and writes no key/value (K/V) entries at that layer. This is crucial—skipped layers produce no K/V cache, thereby saving memory and the overhead of subsequent attention computation.

This design allows a single checkpoint to serve requests with different budgets within the same batch. This means the serving system does not need to maintain multiple model copies for different budgets, significantly improving deployment flexibility.

The Relationship Between K/V Cache and Layer Skipping

In autoregressive decoding of Transformers, each layer computes and caches key and value matrices for the generated tokens so they can be reused in attention computation for subsequent tokens. The size of this K/V cache is proportional to sequence length, number of layers, number of attention heads, and hidden dimension, and is often the main source of GPU memory usage during long-context inference. If conventional layer skipping still lets skipped layers participate in cache writes, it creates the awkward situation of "saving compute but not memory." AVERT ensures that skipped tokens write no K/V entries at that layer, meaning the cache slots for that layer remain empty, thereby reducing both GPU memory usage and subsequent attention computation. This also explains why skipping a layer cannot simply be equated with an "identity mapping"—it requires a residual adapter to compensate for the interruption in information flow.

Experimental Performance: Robust Advantages Across Models and Budgets

The paper evaluates AVERT on three LLaMA backbone models, covering six quality metrics and 13 budget settings. Out of a total of 234 comparisons, AVERT was best or tied for best in 206. This result shows that dynamic layer skipping does not come at the expense of quality—in the vast majority of configurations, it maintains output quality comparable to or even better than the baseline.

More critically, the precision of budget control. In both single-budget and mixed-budget batches, the average absolute budget error per request is at most 1.15 percentage points. This means users can control computation fairly precisely, providing a reliable basis for cost management.

Budget error and TPOT gains

TPOT and Batch Fill Rate

TPOT (Time Per Output Token) refers to the average time spent generating each output token during the decoding phase. It is one of the core metrics for measuring LLM serving interaction latency and directly determines the "typing speed" perceived by users. In continuous batching serving systems, GPU utilization depends on the number of active requests in the current batch: if requests are grouped and scheduled by budget, each group may contain only a few requests, and insufficient batch filling causes a large amount of GPU compute to sit idle, which in turn slows down per-token decoding. AVERT allows requests with different budgets to share the same batch, maintaining a high batch fill rate while letting low-budget requests actually compute fewer layers. The combination of these two benefits manifests as a significant reduction in TPOT.

Throughput Advantages of Mixed-Budget Batching

In actual serving, grouping requests by budget can lead to underfilled batches, wasting GPU resources. AVERT supports mixing requests with different budgets in the same batch, directly solving this problem. Experiments show that when grouping leads to underfilled batches, mixed budgeting reduces the decoding time per output token (TPOT) by 4.3%–21.2%.

This gain comes from two aspects: first, improved batch utilization; second, compute resources saved by skipping layers. For high-concurrency scenarios, this throughput improvement means lower cost per token and a better user experience.

Implications for LLM Serving Architecture

The emergence of AVERT suggests that LLM inference optimization is moving from "static compression" to "dynamic adaptation." Traditional methods such as quantization and pruning determine the computation graph before deployment, whereas AVERT flexibly adjusts the computation path at runtime according to the needs of each token.

This request-local routing approach has room for further extension: for example, combining token importance prediction, adaptively adjusting the capacity of the residual adapter, or refining budget allocation from the request level to finer-grained stages. For enterprises building LLM serving platforms, the ability to support mixed-budget batches can simplify resource scheduling and avoid maintaining multiple model sets for different SLAs.

Of course, AVERT also introduces additional routing overhead and implementation complexity. The paper does not discuss in detail the computational cost of the router itself, which needs to be weighed in actual deployment. Overall, however, by achieving precise budget control and throughput improvement with minimal quality loss, AVERT offers a promising direction for variable-depth inference.

The Trade-off Between Static Compression and Dynamic Adaptation

Static compression methods such as quantization, pruning, and distillation fix the model's computation graph before deployment. At inference time, all tokens follow the same path, which is simple to implement and hardware-friendly, but cannot distinguish the compute requirements of "easy tokens" and "hard tokens." Dynamic adaptation defers computation decisions to runtime, allocating layers based on token state. In theory, this better matches the actual complexity distribution, at the cost of introducing routing decisions, control-flow branches, and potentially kernel launch overhead, placing higher demands on the inference engine's graph optimization and batch scheduling. AVERT belongs to the latter category: it treats "budget" as a request-level contract and "routing" as a token-level decision, striking a balance between the two—which is also the key to its ability to integrate with existing serving systems.

One-line Summary

AVERT lets each token dynamically skip Transformer layers on demand, improving throughput while precisely controlling the request's average depth.

Paragraph Summary

AVERT is a dynamic layer-skipping method for LLM inference. Its core idea is that, under the constraint of a request-level average depth budget, each token decides how many layers to execute based on its own state and the request budget. Skipped tokens pass through a lightweight residual adapter and write no K/V cache, saving both compute and GPU memory; a single checkpoint can serve requests with different budgets in the same batch. Across 234 comparisons on three LLaMA models, six quality metrics, and 13 budget settings, AVERT was best or tied for best in 206, with an average absolute budget error per request of at most 1.15 percentage points. Mixed-budget batching reduces TPOT by 4.3%–21.2%, alleviating the underfilled-batch problem caused by grouping by budget.

#AVERT#layer skipping#LLM inference#token routing#TPOT#Transformer#budget control
Share:

Related articles