{"about":{"site":"https://codewithpapers.app","non_affiliation":"Code with Papers and Syntology are not affiliated with, endorsed by, or sponsored by Papers with Code, Meta, or the pwc-archive mirror.","licence":"CC BY-SA 4.0","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","attribution":"https://codewithpapers.app/attribution","modified":"archive material modified by Syntology; see the attribution page"},"url":"/paper/spechub-provable-acceleration-to-multi-draft","title":"SpecHub: Provable Acceleration to Multi-Draft Speculative Decoding","arxiv_id":"2411.05289","date":"2024-11-08","proceeding":null,"authors":["Ryan Sun","Tianyi Zhou","Xun Chen","Lichao Sun"],"abstract":"Large Language Models (LLMs) have become essential in advancing natural language processing (NLP) tasks, but their sequential token generation limits inference speed. Multi-Draft Speculative Decoding (MDSD) offers a promising solution by using a smaller draft model to generate multiple token sequences, which the target LLM verifies in parallel. However, current heuristic approaches, such as Recursive Rejection Sampling (RRS), suffer from low acceptance rates in subsequent drafts, limiting the advantages of using multiple drafts. Meanwhile, Optimal Transport with Membership Cost (OTM) can theoretically improve acceptance rates, but its computational cost is too high for real-time use. We present SpecHub, a novel, efficient sampling-verification method for MDSD that improves acceptance rates with only linear computational overhead. By simplifying the OTM problem into a compact Linear Programming model, SpecHub significantly reduces computational complexity. It further accelerates sampling by leveraging a sparse joint distribution, focusing computation on high-probability token sequences. In extensive experiments, Spechub consistently generates 0.05-0.27 and 0.02-0.16 more tokens per step than RRS and RRS without replacement. We attach our code at \\url{https://github.com/MasterGodzilla/Speculative_decoding_OT}.","url_abs":"https://arxiv.org/abs/2411.05289v1","url_pdf":"https://arxiv.org/pdf/2411.05289v1.pdf","source":{"archive":"pwc-archive (Hugging Face), CC BY-SA 4.0","snapshot":"2025-07-28","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","row_kind":"abstracts"},"code_links":[{"paper_slug":"spechub-provable-acceleration-to-multi-draft","repo_url":"https://github.com/mastergodzilla/speculative_decoding_ot","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":0,"framework":"pytorch","reach":null}],"tasks":[],"methods":[{"method_slug":"otm","method_name":"OTM"}],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2411.05289","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2411.05289"}},"developers":"https://syntology.ai/developers","read_at":"2026-09-24T18:15:14+00:00","read_at_is":"when the build read Syntology's graph, not when any sample ran","claim":"Per-sample execution status on synthesized fixtures; not a correctness claim about the paper. Samples come from repositories linked to the paper, official or community; repo_kind says which.","repos":[{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/mastergodzilla/speculative_decoding_ot","reach":null}],"summary":{"ran":7,"ran_fixture":2,"unverified":12},"by_repo_kind":{"official":{"samples":21,"ran":9,"repositories":1}},"repo_kind_vocabulary":{"official":"The archive marks this repository official for the paper","named_in_paper":"The archive records that the paper mentions this repository; it is not marked official","listed":"In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper","found_in_text":"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"},"n_pointer_only_for_licence":21,"samples":[{"code_sha256_prefix":"1080bbf045764637","entry":"KV_Cache","repo":"mastergodzilla/speculative_decoding_ot","repo_kind":"official","path":"Sequoia/Tree/SpecTree.py","file_url":"https://github.com/mastergodzilla/speculative_decoding_ot/blob/HEAD/Sequoia/Tree/SpecTree.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"1080bbf045764637"}},{"code_sha256_prefix":"0f36d7967c772ba7","entry":"LlamaAttention_FI","repo":"mastergodzilla/speculative_decoding_ot","repo_kind":"official","path":"Sequoia/Tree/SpecTree.py","file_url":"https://github.com/mastergodzilla/speculative_decoding_ot/blob/HEAD/Sequoia/Tree/SpecTree.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"0f36d7967c772ba7"}},{"code_sha256_prefix":"a7975bacb53acbd6","entry":"LlamaAttention_TG","repo":"mastergodzilla/speculative_decoding_ot","repo_kind":"official","path":"Sequoia/Tree/SpecTree.py","file_url":"https://github.com/mastergodzilla/speculative_decoding_ot/blob/HEAD/Sequoia/Tree/SpecTree.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"a7975bacb53acbd6"}},{"code_sha256_prefix":"4d241e71f8a7a763","entry":"LlamaMLP_FI","repo":"mastergodzilla/speculative_decoding_ot","repo_kind":"official","path":"Sequoia/Tree/SpecTree.py","file_url":"https://github.com/mastergodzilla/speculative_decoding_ot/blob/HEAD/Sequoia/Tree/SpecTree.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"4d241e71f8a7a763"}},{"code_sha256_prefix":"6240a83f9a6521cf","entry":"LlamaRMSNorm_FI","repo":"mastergodzilla/speculative_decoding_ot","repo_kind":"official","path":"Sequoia/Tree/SpecTree.py","file_url":"https://github.com/mastergodzilla/speculative_decoding_ot/blob/HEAD/Sequoia/Tree/SpecTree.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"6240a83f9a6521cf"}},{"code_sha256_prefix":"39802465997cc25d","entry":"LlamaRotaryEmbedding_FI","repo":"mastergodzilla/speculative_decoding_ot","repo_kind":"official","path":"Sequoia/Tree/SpecTree.py","file_url":"https://github.com/mastergodzilla/speculative_decoding_ot/blob/HEAD/Sequoia/Tree/SpecTree.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"39802465997cc25d"}},{"code_sha256_prefix":"6c730d4a44e0ced5","entry":"Tree","repo":"mastergodzilla/speculative_decoding_ot","repo_kind":"official","path":"Sequoia/Tree/SpecTree.py","file_url":"https://github.com/mastergodzilla/speculative_decoding_ot/blob/HEAD/Sequoia/Tree/SpecTree.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"6c730d4a44e0ced5"}},{"code_sha256_prefix":"3d5d12b34c6bc8f3","entry":"_make_causal_mask","repo":"mastergodzilla/speculative_decoding_ot","repo_kind":"official","path":"Sequoia/Tree/SpecTree.py","file_url":"https://github.com/mastergodzilla/speculative_decoding_ot/blob/HEAD/Sequoia/Tree/SpecTree.py","link_basis":"first_harvest_node","language":"python","status":"ran_fixture","verification_level":1,"contract_check":"RAISES","metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"3d5d12b34c6bc8f3"}},{"code_sha256_prefix":"1823e59e5f171174","entry":"get_sampling_logits","repo":"mastergodzilla/speculative_decoding_ot","repo_kind":"official","path":"Sequoia/Tree/SpecTree.py","file_url":"https://github.com/mastergodzilla/speculative_decoding_ot/blob/HEAD/Sequoia/Tree/SpecTree.py","link_basis":"first_harvest_node","language":"python","status":"ran_fixture","verification_level":1,"contract_check":"RAISES","metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"1823e59e5f171174"}},{"code_sha256_prefix":"b706495d45bf74dd","entry":"GraphInferenceEngine","repo":"mastergodzilla/speculative_decoding_ot","repo_kind":"official","path":"Sequoia/Tree/SpecTree.py","file_url":"https://github.com/mastergodzilla/speculative_decoding_ot/blob/HEAD/Sequoia/Tree/SpecTree.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"b706495d45bf74dd"}},{"code_sha256_prefix":"b251248cec118216","entry":"GraphInferenceEngineTG","repo":"mastergodzilla/speculative_decoding_ot","repo_kind":"official","path":"Sequoia/Tree/SpecTree.py","file_url":"https://github.com/mastergodzilla/speculative_decoding_ot/blob/HEAD/Sequoia/Tree/SpecTree.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"b251248cec118216"}},{"code_sha256_prefix":"85a9b61d47defe2d","entry":"InferenceEngine","repo":"mastergodzilla/speculative_decoding_ot","repo_kind":"official","path":"Sequoia/Tree/SpecTree.py","file_url":"https://github.com/mastergodzilla/speculative_decoding_ot/blob/HEAD/Sequoia/Tree/SpecTree.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"85a9b61d47defe2d"}},{"code_sha256_prefix":"c652c9e8d68d727a","entry":"InferenceEngineTG","repo":"mastergodzilla/speculative_decoding_ot","repo_kind":"official","path":"Sequoia/Tree/SpecTree.py","file_url":"https://github.com/mastergodzilla/speculative_decoding_ot/blob/HEAD/Sequoia/Tree/SpecTree.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"c652c9e8d68d727a"}},{"code_sha256_prefix":"774786e151f678c0","entry":"LlamaDecoderLayer_FI","repo":"mastergodzilla/speculative_decoding_ot","repo_kind":"official","path":"Sequoia/Tree/SpecTree.py","file_url":"https://github.com/mastergodzilla/speculative_decoding_ot/blob/HEAD/Sequoia/Tree/SpecTree.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"774786e151f678c0"}},{"code_sha256_prefix":"dc6a8ea4f5fcee7a","entry":"LlamaDecoderLayer_TG","repo":"mastergodzilla/speculative_decoding_ot","repo_kind":"official","path":"Sequoia/Tree/SpecTree.py","file_url":"https://github.com/mastergodzilla/speculative_decoding_ot/blob/HEAD/Sequoia/Tree/SpecTree.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"dc6a8ea4f5fcee7a"}},{"code_sha256_prefix":"8653a0e682ed6728","entry":"LlamaForCausalLM_FI","repo":"mastergodzilla/speculative_decoding_ot","repo_kind":"official","path":"Sequoia/Tree/SpecTree.py","file_url":"https://github.com/mastergodzilla/speculative_decoding_ot/blob/HEAD/Sequoia/Tree/SpecTree.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"8653a0e682ed6728"}},{"code_sha256_prefix":"e6b7a28738c8bd31","entry":"LlamaForCausalLM_TG","repo":"mastergodzilla/speculative_decoding_ot","repo_kind":"official","path":"Sequoia/Tree/SpecTree.py","file_url":"https://github.com/mastergodzilla/speculative_decoding_ot/blob/HEAD/Sequoia/Tree/SpecTree.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"e6b7a28738c8bd31"}},{"code_sha256_prefix":"4580bc94dbaf3361","entry":"LlamaModel_FI","repo":"mastergodzilla/speculative_decoding_ot","repo_kind":"official","path":"Sequoia/Tree/SpecTree.py","file_url":"https://github.com/mastergodzilla/speculative_decoding_ot/blob/HEAD/Sequoia/Tree/SpecTree.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"4580bc94dbaf3361"}},{"code_sha256_prefix":"68e76f48680e026b","entry":"LlamaModel_TG","repo":"mastergodzilla/speculative_decoding_ot","repo_kind":"official","path":"Sequoia/Tree/SpecTree.py","file_url":"https://github.com/mastergodzilla/speculative_decoding_ot/blob/HEAD/Sequoia/Tree/SpecTree.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"68e76f48680e026b"}},{"code_sha256_prefix":"718aa0b1a1a6203e","entry":"SpecTree","repo":"mastergodzilla/speculative_decoding_ot","repo_kind":"official","path":"Sequoia/Tree/SpecTree.py","file_url":"https://github.com/mastergodzilla/speculative_decoding_ot/blob/HEAD/Sequoia/Tree/SpecTree.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"718aa0b1a1a6203e"}},{"code_sha256_prefix":"c07e4861bb7ab066","entry":"capture_graph","repo":"mastergodzilla/speculative_decoding_ot","repo_kind":"official","path":"Sequoia/Tree/SpecTree.py","file_url":"https://github.com/mastergodzilla/speculative_decoding_ot/blob/HEAD/Sequoia/Tree/SpecTree.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"c07e4861bb7ab066"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}