{"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/dllm-cache-accelerating-diffusion-large","title":"dLLM-Cache: Accelerating Diffusion Large Language Models with Adaptive Caching","arxiv_id":"2506.06295","date":"2025-05-17","proceeding":null,"authors":["Zhiyuan Liu","Yicun Yang","Yaojie Zhang","Junjie Chen","Chang Zou","Qingyuan Wei","Shaobo Wang","Linfeng Zhang"],"abstract":"Autoregressive Models (ARMs) have long dominated the landscape of Large Language Models. Recently, a new paradigm has emerged in the form of diffusion-based Large Language Models (dLLMs), which generate text by iteratively denoising masked segments. This approach has shown significant advantages and potential. However, dLLMs suffer from high inference latency. Traditional ARM acceleration techniques, such as Key-Value caching, are incompatible with dLLMs due to their bidirectional attention mechanism. To address this specific challenge, our work begins with a key observation that dLLM inference involves a static prompt and a partially dynamic response, where most tokens remain stable across adjacent denoising steps. Based on this, we propose dLLM-Cache, a training-free adaptive caching framework that combines long-interval prompt caching with partial response updates guided by feature similarity. This design enables efficient reuse of intermediate computations without compromising model performance. Extensive experiments on representative dLLMs, including LLaDA 8B and Dream 7B, show that dLLM-Cache achieves up to 9.1 x speedup over standard inference without compromising output quality. Notably, our method brings dLLM inference latency close to that of ARMs under many settings. Codes are provided in the supplementary material and will be released publicly on GitHub.","url_abs":"https://arxiv.org/abs/2506.06295v1","url_pdf":"https://arxiv.org/pdf/2506.06295v1.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":"dllm-cache-accelerating-diffusion-large","repo_url":"https://github.com/maomaocun/dllm-cache","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"jax","reach":{"status":"ok","spdx":"Apache-2.0"}}],"tasks":[{"task_slug":"denoising","task_name":"Denoising"}],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2506.06295","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2506.06295"}},"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":"deterministic:regex_extraction","url":"https://github.com/maomaocun/dLLM-cache","reach":{"status":"ok","spdx":"Apache-2.0"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/maomaocun/dllm-cache","reach":{"status":"ok","spdx":"Apache-2.0"}}],"summary":{"ran_draft_wrong":1,"unverified":12},"by_repo_kind":{"listed":{"samples":13,"ran":1,"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":0,"samples":[{"code_sha256_prefix":"e03d53ba9d4f9ae5","entry":"rotate_half","repo":"maomaocun/dLLM-cache","repo_kind":"listed","path":"dllm_cache/hooks/cache_hook_LLaDA_V.py","file_url":"https://github.com/maomaocun/dLLM-cache/blob/HEAD/dllm_cache/hooks/cache_hook_LLaDA_V.py","link_basis":"harvester_set","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"MISDECLARED","metamorphic_tier":"invariant","behaviour_fingerprint":true,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"e03d53ba9d4f9ae5"}},{"code_sha256_prefix":"2af6f8d97abc409f","entry":"RoPe_forward","repo":"maomaocun/dLLM-cache","repo_kind":"listed","path":"dllm_cache/hooks/cache_hook_LLaDA.py","file_url":"https://github.com/maomaocun/dLLM-cache/blob/HEAD/dllm_cache/hooks/cache_hook_LLaDA.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"2af6f8d97abc409f"}},{"code_sha256_prefix":"008ab2cfccca5ac2","entry":"add_gumbel_noise","repo":"maomaocun/dLLM-cache","repo_kind":"listed","path":"demo_MMada_cache.py","file_url":"https://github.com/maomaocun/dLLM-cache/blob/HEAD/demo_MMada_cache.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"008ab2cfccca5ac2"}},{"code_sha256_prefix":"22cb8c51f0a9038f","entry":"add_gumbel_noise","repo":"maomaocun/dLLM-cache","repo_kind":"listed","path":"demo_MMada_mmu_cache.py","file_url":"https://github.com/maomaocun/dLLM-cache/blob/HEAD/demo_MMada_mmu_cache.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"22cb8c51f0a9038f"}},{"code_sha256_prefix":"ebbbedae1f60f76d","entry":"apply_rotary_pos_emb","repo":"maomaocun/dLLM-cache","repo_kind":"listed","path":"dllm_cache/hooks/cache_hook_LLaDA_V.py","file_url":"https://github.com/maomaocun/dLLM-cache/blob/HEAD/dllm_cache/hooks/cache_hook_LLaDA_V.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"ebbbedae1f60f76d"}},{"code_sha256_prefix":"e23dc4567306b759","entry":"attention","repo":"maomaocun/dLLM-cache","repo_kind":"listed","path":"dllm_cache/hooks/cache_hook_Dream.py","file_url":"https://github.com/maomaocun/dLLM-cache/blob/HEAD/dllm_cache/hooks/cache_hook_Dream.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"e23dc4567306b759"}},{"code_sha256_prefix":"3822a0903091ccc2","entry":"convert_to_float","repo":"maomaocun/dLLM-cache","repo_kind":"listed","path":"Dream_test_flops_script.py","file_url":"https://github.com/maomaocun/dLLM-cache/blob/HEAD/Dream_test_flops_script.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"3822a0903091ccc2"}},{"code_sha256_prefix":"0976b0b29f8d1d22","entry":"create_prompt","repo":"maomaocun/dLLM-cache","repo_kind":"listed","path":"LLama_test_flops_script.py","file_url":"https://github.com/maomaocun/dLLM-cache/blob/HEAD/LLama_test_flops_script.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"0976b0b29f8d1d22"}},{"code_sha256_prefix":"89ffc142130a4ab0","entry":"generate_with_cache","repo":"maomaocun/dLLM-cache","repo_kind":"listed","path":"demo_MMada_cache.py","file_url":"https://github.com/maomaocun/dLLM-cache/blob/HEAD/demo_MMada_cache.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"89ffc142130a4ab0"}},{"code_sha256_prefix":"ab0375db4fa54d7c","entry":"get_num_transfer_tokens","repo":"maomaocun/dLLM-cache","repo_kind":"listed","path":"demo_MMada_cache.py","file_url":"https://github.com/maomaocun/dLLM-cache/blob/HEAD/demo_MMada_cache.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"ab0375db4fa54d7c"}},{"code_sha256_prefix":"c35f5a7a8c404548","entry":"llada_attention_hook_for_cache","repo":"maomaocun/dLLM-cache","repo_kind":"listed","path":"dllm_cache/hooks/cache_hook_LLaDA_V.py","file_url":"https://github.com/maomaocun/dLLM-cache/blob/HEAD/dllm_cache/hooks/cache_hook_LLaDA_V.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"c35f5a7a8c404548"}},{"code_sha256_prefix":"5e2dc62c98e4c717","entry":"mmu_generate_with_cache","repo":"maomaocun/dLLM-cache","repo_kind":"listed","path":"demo_MMada_mmu_cache.py","file_url":"https://github.com/maomaocun/dLLM-cache/blob/HEAD/demo_MMada_mmu_cache.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"5e2dc62c98e4c717"}},{"code_sha256_prefix":"17ea12936141556f","entry":"refresh_index","repo":"maomaocun/dLLM-cache","repo_kind":"listed","path":"dllm_cache/hooks/cache_hook_Dream.py","file_url":"https://github.com/maomaocun/dLLM-cache/blob/HEAD/dllm_cache/hooks/cache_hook_Dream.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"17ea12936141556f"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}