SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2502.02789 · ICML · 2025

Speculative Prefill: Turbocharging TTFT with Lightweight and Training-Free Token Importance Estimation

Ce Zhang, Beidi Chen, M Lewis, Jingyu Liu, L Van Der Maaten, L Chen, De Oliveira, M Hassan, K Li, M Singh, M Lennie

arXiv · PDF · Open in the Atlas

Code that ran

We lifted 3 functions out of this paper's own repositories and ran 2 of them in a sandbox. "Ran" means the function executed on a synthesized input and returned a value. It is not a reproduction of the paper's results.

RepositoryRoleRan
Jingyu6/speculative_prefill canonical 2 of 3
FunctionStatusWhere it lives
send_query Ran Jingyu6/speculative_prefill/eval/qps_client.py
code served (permissive licence) · get_code("cbf40a92b65b6d6f")
split_num_cache_blocks_evenly Ran Jingyu6/speculative_prefill/speculative_prefill/vllm_patch/worker/spec_prefill_worker.py
code served (permissive licence) · get_code("751ed5bbbe3108f7")
prepare_datasets Not yet run Jingyu6/speculative_prefill/eval/qps_client.py
code served (permissive licence) · get_code("ec827626111b4b80")

Repositories linked to this paper

Some links come from the archived Papers with Code dataset (CC BY-SA 4.0): attribution and licence.

Abstract

Improving time-to-first-token (TTFT) is an essentially important objective in modern large language model (LLM) inference engines. Optimizing TTFT directly results in higher maximal QPS and meets the requirements of many critical applications. However, boosting TTFT is notoriously challenging since it is computebounded and the performance bottleneck shifts from the self-attention to the MLP part. We present SPECPREFILL 1 , a training free framework that accelerates the inference TTFT for both long and medium context queries based on the following insight: LLMs are generalized enough to preserve the quality given only a carefully chosen subset of prompt tokens. At its core, SPECPREFILL leverages a lightweight model to speculate locally important tokens based on the context. These tokens, along with the necessary positional information, are then sent to the main model for processing. We evaluate SPECPRE-FILL with a diverse set of tasks, followed by a comprehensive benchmarking of performance improvement both in a real end-to-end setting and ablation studies. SPECPREFILL manages to serve Llama-3.1-405B-Instruct-FP8 with up to 7× maximal end-to-end QPS on real downstream tasks and 7.66× TTFT improvement.

For agents

The same record, over MCP at https://syntology.ai/mcp:

get_harvested_code_for_paper("2502.02789")
get_code_for_paper("2502.02789")
have("2502.02789")

Connect an agent — have() is free.