{"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/think-while-you-generate-discrete-diffusion","title":"Think While You Generate: Discrete Diffusion with Planned Denoising","arxiv_id":"2410.06264","date":"2024-10-08","proceeding":null,"authors":["Sulin Liu","Juno Nam","Andrew Campbell","Hannes Stärk","Yilun Xu","Tommi Jaakkola","Rafael Gómez-Bombarelli"],"abstract":"Discrete diffusion has achieved state-of-the-art performance, outperforming or approaching autoregressive models on standard benchmarks. In this work, we introduce Discrete Diffusion with Planned Denoising (DDPD), a novel framework that separates the generation process into two models: a planner and a denoiser. At inference time, the planner selects which positions to denoise next by identifying the most corrupted positions in need of denoising, including both initially corrupted and those requiring additional refinement. This plan-and-denoise approach enables more efficient reconstruction during generation by iteratively identifying and denoising corruptions in the optimal order. DDPD outperforms traditional denoiser-only mask diffusion methods, achieving superior results on language modeling benchmarks such as text8, OpenWebText, and token-based image generation on ImageNet $256 \\times 256$. Notably, in language modeling, DDPD significantly reduces the performance gap between diffusion-based and autoregressive methods in terms of generative perplexity. Code is available at https://github.com/liusulin/DDPD.","url_abs":"https://arxiv.org/abs/2410.06264v2","url_pdf":"https://arxiv.org/pdf/2410.06264v2.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":"think-while-you-generate-discrete-diffusion","repo_url":"https://github.com/liusulin/ddpd","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":null}],"tasks":[{"task_slug":"denoising","task_name":"Denoising"},{"task_slug":"image-generation","task_name":"Image Generation"},{"task_slug":"language-modeling","task_name":"Language Modeling"},{"task_slug":"language-modelling","task_name":"Language Modelling"}],"methods":[{"method_slug":"diffusion","method_name":"Diffusion"}],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2410.06264","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2410.06264"}},"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/liusulin/DDPD","reach":null},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/liusulin/ddpd","reach":null}],"summary":{"ran":3,"ran_draft_wrong":3,"ran_fixture":1},"by_repo_kind":{"official":{"samples":7,"ran":7,"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":"c8762b0d2a4014cd","entry":"Block","repo":"liusulin/ddpd","repo_kind":"official","path":"text8/model_planner.py","file_url":"https://github.com/liusulin/ddpd/blob/HEAD/text8/model_planner.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"c8762b0d2a4014cd"}},{"code_sha256_prefix":"bb75b8f81f09f0fe","entry":"GPT","repo":"liusulin/ddpd","repo_kind":"official","path":"text8/model_planner.py","file_url":"https://github.com/liusulin/ddpd/blob/HEAD/text8/model_planner.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"bb75b8f81f09f0fe"}},{"code_sha256_prefix":"ab7bf8223903c9b6","entry":"SelfAttention","repo":"liusulin/ddpd","repo_kind":"official","path":"text8/model_planner.py","file_url":"https://github.com/liusulin/ddpd/blob/HEAD/text8/model_planner.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"ab7bf8223903c9b6"}},{"code_sha256_prefix":"1712a07966b542ee","entry":"center_crop_arr","repo":"liusulin/DDPD","repo_kind":"official","path":"imagenet/train_planner.py","file_url":"https://github.com/liusulin/DDPD/blob/HEAD/imagenet/train_planner.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"MISDECLARED","metamorphic_tier":"well_formed","behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"1712a07966b542ee"}},{"code_sha256_prefix":"ebd7d305597af132","entry":"create_logger","repo":"liusulin/DDPD","repo_kind":"official","path":"imagenet/train_planner.py","file_url":"https://github.com/liusulin/DDPD/blob/HEAD/imagenet/train_planner.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"ebd7d305597af132"}},{"code_sha256_prefix":"ef8d9a0b717d3cb0","entry":"flatten_omega_conf","repo":"liusulin/DDPD","repo_kind":"official","path":"imagenet/train_planner.py","file_url":"https://github.com/liusulin/DDPD/blob/HEAD/imagenet/train_planner.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"ef8d9a0b717d3cb0"}},{"code_sha256_prefix":"2947e15ec51fe668","entry":"transformer_timestep_embedding","repo":"liusulin/ddpd","repo_kind":"official","path":"text8/model_planner.py","file_url":"https://github.com/liusulin/ddpd/blob/HEAD/text8/model_planner.py","link_basis":"first_harvest_node","language":"python","status":"ran_fixture","verification_level":1,"contract_check":"RAISES","metamorphic_tier":"invariant","behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"2947e15ec51fe668"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}