{"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/edt-an-efficient-diffusion-transformer","title":"EDT: An Efficient Diffusion Transformer Framework Inspired by Human-like Sketching","arxiv_id":"2410.23788","date":"2024-10-31","proceeding":null,"authors":["Xinwang Chen","Ning Liu","Yichen Zhu","Feifei Feng","Jian Tang"],"abstract":"Transformer-based Diffusion Probabilistic Models (DPMs) have shown more potential than CNN-based DPMs, yet their extensive computational requirements hinder widespread practical applications. To reduce the computation budget of transformer-based DPMs, this work proposes the Efficient Diffusion Transformer (EDT) framework. The framework includes a lightweight-design diffusion model architecture, and a training-free Attention Modulation Matrix and its alternation arrangement in EDT inspired by human-like sketching. Additionally, we propose a token relation-enhanced masking training strategy tailored explicitly for EDT to augment its token relation learning capability. Our extensive experiments demonstrate the efficacy of EDT. The EDT framework reduces training and inference costs and surpasses existing transformer-based diffusion models in image synthesis performance, thereby achieving a significant overall enhancement. With lower FID, EDT-S, EDT-B, and EDT-XL attained speed-ups of 3.93x, 2.84x, and 1.92x respectively in the training phase, and 2.29x, 2.29x, and 2.22x respectively in inference, compared to the corresponding sizes of MDTv2. The source code is released at https://github.com/xinwangChen/EDT.","url_abs":"https://arxiv.org/abs/2410.23788v1","url_pdf":"https://arxiv.org/pdf/2410.23788v1.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":"edt-an-efficient-diffusion-transformer","repo_url":"https://github.com/xinwangchen/edt","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":null}],"tasks":[{"task_slug":"image-generation","task_name":"Image Generation"},{"task_slug":null,"task_name":"Relation"}],"methods":[{"method_slug":"absolute-position-encodings","method_name":"Absolute Position Encodings"},{"method_slug":"adam","method_name":"Adam"},{"method_slug":"attention","method_name":"Attention"},{"method_slug":"bpe","method_name":"BPE"},{"method_slug":"dense-connections","method_name":"Dense Connections"},{"method_slug":"diffusion","method_name":"Diffusion"},{"method_slug":"dropout","method_name":"Dropout"},{"method_slug":"label-smoothing","method_name":"Label Smoothing"},{"method_slug":"layer-normalization","method_name":"Layer Normalization"},{"method_slug":"linear-layer","method_name":"Linear Layer"},{"method_slug":"multi-head-attention","method_name":"Multi-Head Attention"},{"method_slug":"position-wise-feed-forward-layer","method_name":"Position-Wise Feed-Forward Layer"},{"method_slug":"residual-connection","method_name":"Residual Connection"},{"method_slug":"softmax","method_name":"Softmax"},{"method_slug":"transformer","method_name":"Transformer"}],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"syntology_url":"https://syntology.ai/paper/2410.23788","atlas_url":"https://app.syntology.ai/?focus=2410.23788","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2410.23788"}},"developers":"https://syntology.ai/developers","read_at":"2026-09-25T09:33:49+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/xinwangchen/edt","reach":null}],"summary":{"ran":8,"ran_draft_wrong":3,"ran_honours":1,"unverified":3},"by_repo_kind":{"official":{"samples":13,"ran":10,"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":2,"samples":[{"code_sha256_prefix":"134572c5986fe4b4","entry":"AttentionBlock","repo":"xinwangchen/edt","repo_kind":"official","path":"models_edt.py","file_url":"https://github.com/xinwangchen/edt/blob/HEAD/models_edt.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"134572c5986fe4b4"}},{"code_sha256_prefix":"13a3e1751106ddb0","entry":"ConcatLayer","repo":"xinwangchen/edt","repo_kind":"official","path":"models_edt.py","file_url":"https://github.com/xinwangchen/edt/blob/HEAD/models_edt.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"13a3e1751106ddb0"}},{"code_sha256_prefix":"8f87a045a084b3d9","entry":"DownSample","repo":"xinwangchen/edt","repo_kind":"official","path":"models_edt.py","file_url":"https://github.com/xinwangchen/edt/blob/HEAD/models_edt.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"8f87a045a084b3d9"}},{"code_sha256_prefix":"413ff2ca1aeb13c7","entry":"FinalLayer","repo":"xinwangchen/edt","repo_kind":"official","path":"models_edt.py","file_url":"https://github.com/xinwangchen/edt/blob/HEAD/models_edt.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"413ff2ca1aeb13c7"}},{"code_sha256_prefix":"3da76c6c6b6525e1","entry":"LabelEmbedder","repo":"xinwangchen/edt","repo_kind":"official","path":"models_edt.py","file_url":"https://github.com/xinwangchen/edt/blob/HEAD/models_edt.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"3da76c6c6b6525e1"}},{"code_sha256_prefix":"5f8f1f6855dddcde","entry":"RelativePositionBias","repo":"xinwangchen/edt","repo_kind":"official","path":"models_edt.py","file_url":"https://github.com/xinwangchen/edt/blob/HEAD/models_edt.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"5f8f1f6855dddcde"}},{"code_sha256_prefix":"eaa37c820e8a1833","entry":"TimestepEmbedder","repo":"xinwangchen/edt","repo_kind":"official","path":"models_edt.py","file_url":"https://github.com/xinwangchen/edt/blob/HEAD/models_edt.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"eaa37c820e8a1833"}},{"code_sha256_prefix":"60606b9b68ee5cc9","entry":"UpSample","repo":"xinwangchen/edt","repo_kind":"official","path":"models_edt.py","file_url":"https://github.com/xinwangchen/edt/blob/HEAD/models_edt.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"60606b9b68ee5cc9"}},{"code_sha256_prefix":"1712a07966b542ee","entry":"center_crop_arr","repo":null,"repo_kind":null,"path":null,"file_url":null,"link_basis":"identical_code_first_harvested_elsewhere","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"MISDECLARED","metamorphic_tier":"well_formed","behaviour_fingerprint":false,"licence":null,"inline_ok":false,"mcp_get_code":{"code_sha256":"1712a07966b542ee"}},{"code_sha256_prefix":"b2cc78f4103df806","entry":"create_logger","repo":"xinwangchen/edt","repo_kind":"official","path":"train_mask_adan.py","file_url":"https://github.com/xinwangchen/edt/blob/HEAD/train_mask_adan.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":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"b2cc78f4103df806"}},{"code_sha256_prefix":"7b21a01ae77703a3","entry":"create_npz_from_sample_folder","repo":null,"repo_kind":null,"path":null,"file_url":null,"link_basis":"identical_code_first_harvested_elsewhere","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":null,"inline_ok":false,"mcp_get_code":{"code_sha256":"7b21a01ae77703a3"}},{"code_sha256_prefix":"2862af7287c26735","entry":"euclidean_distances","repo":"xinwangchen/edt","repo_kind":"official","path":"models_edt.py","file_url":"https://github.com/xinwangchen/edt/blob/HEAD/models_edt.py","link_basis":"first_harvest_node","language":"python","status":"ran_honours","verification_level":1,"contract_check":"HONOURS","metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"2862af7287c26735"}},{"code_sha256_prefix":"03be0381bf318157","entry":"EDT","repo":"xinwangchen/edt","repo_kind":"official","path":"models_edt.py","file_url":"https://github.com/xinwangchen/edt/blob/HEAD/models_edt.py","link_basis":"first_harvest_node","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":"03be0381bf318157"}},{"code_sha256_prefix":"dc3f4c792419cf2b","entry":"EDTBlock","repo":"xinwangchen/edt","repo_kind":"official","path":"models_edt.py","file_url":"https://github.com/xinwangchen/edt/blob/HEAD/models_edt.py","link_basis":"first_harvest_node","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":"dc3f4c792419cf2b"}},{"code_sha256_prefix":"f7362f7feea04ab2","entry":"modulation_matrix","repo":"xinwangchen/edt","repo_kind":"official","path":"models_edt.py","file_url":"https://github.com/xinwangchen/edt/blob/HEAD/models_edt.py","link_basis":"first_harvest_node","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":"f7362f7feea04ab2"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}