{"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/simple-and-effective-masked-diffusion","title":"Simple and Effective Masked Diffusion Language Models","arxiv_id":"2406.07524","date":"2024-06-11","proceeding":null,"authors":["Subham Sekhar Sahoo","Marianne Arriola","Yair Schiff","Aaron Gokaslan","Edgar Marroquin","Justin T Chiu","Alexander Rush","Volodymyr Kuleshov"],"abstract":"While diffusion models excel at generating high-quality images, prior work reports a significant performance gap between diffusion and autoregressive (AR) methods in language modeling. In this work, we show that simple masked discrete diffusion is more performant than previously thought. We apply an effective training recipe that improves the performance of masked diffusion models and derive a simplified, Rao-Blackwellized objective that results in additional improvements. Our objective has a simple form -- it is a mixture of classical masked language modeling losses -- and can be used to train encoder-only language models that admit efficient samplers, including ones that can generate arbitrary lengths of text semi-autoregressively like a traditional language model. On language modeling benchmarks, a range of masked diffusion models trained with modern engineering practices achieves a new state-of-the-art among diffusion models, and approaches AR perplexity. We provide the code, along with a blog post and video tutorial on the project page: https://s-sahoo.com/mdlm","url_abs":"https://arxiv.org/abs/2406.07524v2","url_pdf":"https://arxiv.org/pdf/2406.07524v2.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":"simple-and-effective-masked-diffusion","repo_url":"https://github.com/kuleshov-group/mdlm","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"Apache-2.0"}},{"paper_slug":"simple-and-effective-masked-diffusion","repo_url":"https://github.com/masa-ue/svdd","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":null}],"tasks":[{"task_slug":"language-modeling","task_name":"Language Modeling"},{"task_slug":"language-modelling","task_name":"Language Modelling"},{"task_slug":"masked-language-modeling","task_name":"Masked Language Modeling"}],"methods":[{"method_slug":"diffusion","method_name":"Diffusion"}],"datasets_introduced":[],"methods_introduced":[],"results":[{"leaderboard":"/sota/language-modelling-on-one-billion-word","task":"Language Modelling","dataset":"One Billion Word","model":"MDLM (AR baseline)","rank_in_archive_order":1,"of":27,"metrics":{"Number of params":"110M","PPL":"20.09"},"uses_additional_data":false},{"leaderboard":"/sota/language-modelling-on-one-billion-word","task":"Language Modelling","dataset":"One Billion Word","model":"MDLM","rank_in_archive_order":6,"of":27,"metrics":{"Number of params":"110M","PPL":"23.00"},"uses_additional_data":false},{"leaderboard":"/sota/language-modelling-on-openwebtext","task":"Language Modelling","dataset":"OpenWebText","model":"ARM","rank_in_archive_order":2,"of":12,"metrics":{"eval_perplexity":"17.54","parameters":"131M"},"uses_additional_data":false},{"leaderboard":"/sota/language-modelling-on-openwebtext","task":"Language Modelling","dataset":"OpenWebText","model":"MDLM","rank_in_archive_order":11,"of":12,"metrics":{"eval_perplexity":"22.98","parameters":"131M"},"uses_additional_data":false}],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2406.07524","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2406.07524"}},"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/kuleshov-group/mdlm","reach":{"status":"ok","spdx":"Apache-2.0"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/masa-ue/svdd","reach":null}],"summary":{"ran_draft_wrong":1},"by_repo_kind":{"listed":{"samples":1,"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":1,"samples":[{"code_sha256_prefix":"6cdca5ee86893cc5","entry":"load_dataset_from_files","repo":"masa-ue/svdd","repo_kind":"listed","path":"decode.py","file_url":"https://github.com/masa-ue/svdd/blob/HEAD/decode.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":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"6cdca5ee86893cc5"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}