Manuscript Offprint

arXiv:2610.07780

APEX: Speculate smarter, not deeper

Manvi Jha, Zach Zhang, Zhichao Xu, Linbo Liu, Sai Muralidhar Jayanthi, Vinayak Arannil

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Manvi Jha ∗^{*}

University of Illinois Urbana-Champaign

AWS AI

manvij2@illinois.edu

Zach Zhang

AWS AI

zhiang@amazon.com

Zhichao Xu

AWS AI

Linbo Liu

AWS AI

Sai Muralidhar Jayanthi

AWS AI

Vinayak Arannil

AWS AI

varannil@amazon.com

ABSTRACT

Speculative decoding reduces large language model inference latency by drafting multiple tokens before target-model verification, but its effectiveness depends on both the proposal mechanism and draft depth. Fixed configurations cannot respond to changes in predictability, repetition, and acceptance during generation, so deeper drafting can increase wasted computation without proportional speedup. We introduce APEX, a learned controller that balances decoding speed and draft-token waste through request-level expert selection and block-level depth adaptation. APEX-Router selects among EAGLE-3, n-gram, and draft-model speculation for each request, while APEX-Depth adjusts draft length at each verification block using causal decoding signals and recent verifier feedback. APEX models accepted draft length as censored survival feedback, learning position-wise rejection hazards, block execution costs, and an action utility that balances throughput, accepted progress, and wasted tokens. This allows the controller to adapt speculation while retaining the target model's verification procedure. We integrate APEX into vLLM and evaluate it with Qwen3-8B across six workloads, achieving up to 5.24×5.24\times speedup over autoregressive decoding. Across the aggregate evaluation, APEX-S achieves 4.27×4.27\times speedup, while APEX-B achieves 3.27×3.27\times speedup with a 41.0% relative reduction in wasted-token percentage compared with fixed n-gram speculation at k=16k = 16, providing distinct operating points for balancing acceleration and draft-token utilization.

1 INTRODUCTION

Large language models (LLMs) increasingly serve interactive and long-form workloads such as code generation, mathematical reasoning, and conversational assistance. In these settings, inference latency is not merely a backend cost, it directly affects user-perceived responsiveness and the feasibility of deploying capable models at scale Kwon et al. (2023b); Agrawal et al. (2024). Yet acceleration must preserve the behavior of the target model. The systems challenge is therefore not simply to generate more tokens per second, but to convert additional computation into verified output progress without changing the target model's generation semantics.

Autoregressive decoding Schuurmans et al. (2024) produces each token conditioned on the preceding prefix. Speculative decoding (SD) Xia et al. (2023) reduces the number of sequential target-model invocations by using a cheaper mechanism to propose multiple tokens, which the target model then verifies. Accepting a long draft prefix allows generation to advance several positions in one verification step. However, an early rejection leaves much of the proposed draft unused. Increasing draft depth consequently offers more potential progress while also increasing the amount of speculative work exposed to rejection. High speedup can coexist with substantial draft-token waste, and low waste can coexist with slow execution. Both wall-clock latency and draft-token utilization are therefore needed to assess the resulting trade-off.

∗^{*}Work was done during an internship at AWS AI.

The proposal mechanism also shapes this trade-off. Learned speculators such as EAGLE-3 Li et al. (2025a) can provide useful drafts when upcoming tokens are predictable. Retrieval-based approaches like n-gram reuse available text He et al. (2024), making inexpensive matching methods attractive when repeated structure is present. A separate draft model can produce plausible continuations across varied inputs, but its execution cost may offset the benefit of accepting additional tokens. These mechanisms therefore differ in both the drafts they produce and the cost of producing them. The same acceptance rate or wasted-token percentage can have different latency consequences across mechanisms.

The value of speculation depends jointly on the proposal mechanism, draft depth, and decoding state. A mechanism that proposes tokens cheaply may still discard a large fraction of its drafts, while a more accurate mechanism may incur enough proposal latency to offset its acceptance gains. Selecting an appropriate mechanism and depth requires accounting for the progress and cost of verification. This motivates our central research question:

References (24)