Papers › Online Speculative Decoding

Online Speculative Decoding

11 Oct 2023arXiv:2310.07177archive 2025-07-28

Xiaoxuan Liu, Lanxiang Hu, Peter Bailis, Alvin Cheung, Zhijie Deng, Ion Stoica, Hao Zhang

Speculative decoding is a pivotal technique to accelerate the inference of large language models (LLMs) by employing a smaller draft model to predict the target model's outputs. However, its efficacy can be limited due to the low predictive accuracy of the draft model, particularly when faced with diverse text inputs and a significant capability gap between the draft and target models. We introduce online speculative decoding to address this challenge. The main idea is to continuously update the (multiple) draft model(s) on observed user query data. Adapting to query distribution mitigates the shifts between the training distribution of the draft model and the query distribution, enabling the draft model to more accurately predict the target model's outputs. We develop a prototype of online speculative decoding based on knowledge distillation and evaluate it using both synthetic and real query data. The results show a substantial increase in the token acceptance rate by 0.1 to 0.65, bringing 1.42x to 2.17x latency reduction. Our code is available at https://github.com/LiuXiaoxuanPKU/OSD.

PaperPDFCodeCode Syntology ran

In Syntology Open this paper in Syntology's Atlas, the map of the papers in Syntology's graph and their citations.

For agents, Syntology's MCP tool lists every function and class Syntology harvested from this paper and whether it ran (how to connect): get_harvested_code_for_paper(arxiv_id="2310.07177")

Code

Syntology Ran 11 of 13 code samples harvested from 1 repository linked to this paper; 2 have no recorded run. Of those that ran: 2 ran · our draft was wrong; 9 ran with no contract checked.

By repository: official repository: 13 samples from 1 repository, 11 ran. The run record, sample by sample. “Ran” means executed on a synthesized input, not that the code is correct or reproduces the paper.

liuxiaoxuanpku/osd officialmentioned in papermentioned on GitHubpytorch report

Repository list and official/mentioned flags are the archive's, frozen 2025-07-28. Reachability, where shown, is from one Syntology probe window (2026-09-16 to 2026-09-18); repositories not probed show nothing. GitHub stars are not tracked.

Code Syntology ran Syntology

13 samples harvested; 11 ran; 0 honoured the contract we drafted; 2 have no recorded run. Read from Syntology's graph 2026-09-24; that is when this build read the record, not when the samples ran.

2ran · our draft was wrong
9ran
2unverified

Licence: 13 of the 13 samples are pointer only, meaning Syntology does not serve that copy's text. This page shows no code text for any sample; each one links to its file in the repository.

Harvested from liuxiaoxuanpku/osd. “Ran” means the sample executed on a synthesized input. It does not mean the output is correct, and nothing here reproduces the paper's results. “Honoured” and “violated” refer to a contract Syntology drafted from the code itself; “our draft was wrong” and “fixture could not drive it” are failures of Syntology's instrument, not of the code.

Each sample ends with its code_sha256, Syntology's identity for that exact code. An agent fetches the stored sample with Syntology's MCP tool get_code(code_sha256="…") (how to connect); click an identity to copy that call.

Repository labels, per sample. official repository: The archive marks this repository official for the paper. named in the paper: The archive records that the paper mentions this repository; it is not marked official. community (archive-listed): In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper. found in paper text by Syntology: Syntology found this repository in the paper's own text; whether it is the authors' implementation is not asserted. community: Not in the archive's code links for this paper; a community repository Syntology harvested. Samples from a repository marked official are listed first. Licence labels name the repository's licence as recorded at harvest. “Pointer only” means Syntology does not serve that copy's text, for one of four reasons: no licence file was found; the licence was not identified; the licence is recorded as permissive but that copy's record is not marked cleared; or the licence is outside the permissive list Syntology serves text under (MIT, Apache-2.0, BSD and similar). Some licences outside that list permit redistribution, such as WTFPL, and GPL-3.0 under its conditions; they are simply not on the list. Hover a licence label for the reason. File links open the file on GitHub at the default branch, which may have changed since the harvest.

acc_rate_to_acc_count liuxiaoxuanpku/osd/distill/cost_model.py official repository ran fingerprinted no licence file found · pointer only · e98f1e98fbfaaf55 · report
estimate_speedup_from_acc_count liuxiaoxuanpku/osd/distill/cost_model.py official repository ran fingerprinted no licence file found · pointer only · 34835c30e916c84e · report
extract_answer liuxiaoxuanpku/osd/distill/data.py official repository ran · our draft was wrong fingerprinted no licence file found · pointer only · d95f990735eba145 · report
get_examples liuxiaoxuanpku/osd/distill/data.py official repository ran no licence file found · pointer only · cfda031d44778d32 · report
preprocess_function_generic liuxiaoxuanpku/osd/distill/experiment/compare_model_t5.py official repository ran no licence file found · pointer only · 9835f44aa570459e · report
preprocess_function_spider liuxiaoxuanpku/osd/distill/experiment/compare_model_t5.py official repository ran no licence file found · pointer only · 7176f7d7a27e3c0d · report
read_jsonl liuxiaoxuanpku/osd/distill/data.py official repository ran · our draft was wrong no licence file found · pointer only · 951d55a786237f31 · report
search_best_spec_count liuxiaoxuanpku/osd/distill/cost_model.py official repository ran no licence file found · pointer only · 17363e810e97d511 · report
slice_past_key_values liuxiaoxuanpku/osd/distill/specInfer/common.py official repository ran no licence file found · pointer only · 287256fce57ec17e · report
slice_past_key_values_seq2seq liuxiaoxuanpku/osd/distill/specInfer/common.py official repository ran no licence file found · pointer only · 49ea3af49091879c · report
target_sample_from_distribution liuxiaoxuanpku/osd/distill/specInfer/common.py official repository ran no licence file found · pointer only · 23212f8f0cb67fc0 · report
load_model liuxiaoxuanpku/osd/distill/experiment/compare_model.py official repository unverified no licence file found · pointer only · 44894fa300cbe47f · report
load_model liuxiaoxuanpku/osd/distill/experiment/compare_model_t5.py official repository unverified no licence file found · pointer only · 9e8be6f2c54dac94 · report

Tasks

Knowledge Distillation

Results from the paper archive 2025-07-28

No leaderboard rows for this paper in the archive.

Methods

Knowledge Distillation

Report a problem or propose a change · a person checks every report against the paper or source before anything changes; decisions are listed on /corrections