{"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/diffit-diffusion-vision-transformers-for","title":"DiffiT: Diffusion Vision Transformers for Image Generation","arxiv_id":"2312.02139","date":"2023-12-04","proceeding":null,"authors":["Ali Hatamizadeh","Jiaming Song","Guilin Liu","Jan Kautz","Arash Vahdat"],"abstract":"Diffusion models with their powerful expressivity and high sample quality have achieved State-Of-The-Art (SOTA) performance in the generative domain. The pioneering Vision Transformer (ViT) has also demonstrated strong modeling capabilities and scalability, especially for recognition tasks. In this paper, we study the effectiveness of ViTs in diffusion-based generative learning and propose a new model denoted as Diffusion Vision Transformers (DiffiT). Specifically, we propose a methodology for finegrained control of the denoising process and introduce the Time-dependant Multihead Self Attention (TMSA) mechanism. DiffiT is surprisingly effective in generating high-fidelity images with significantly better parameter efficiency. We also propose latent and image space DiffiT models and show SOTA performance on a variety of class-conditional and unconditional synthesis tasks at different resolutions. The Latent DiffiT model achieves a new SOTA FID score of 1.73 on ImageNet256 dataset while having 19.85%, 16.88% less parameters than other Transformer-based diffusion models such as MDT and DiT,respectively. Code: https://github.com/NVlabs/DiffiT","url_abs":"https://arxiv.org/abs/2312.02139v3","url_pdf":"https://arxiv.org/pdf/2312.02139v3.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":"diffit-diffusion-vision-transformers-for","repo_url":"https://github.com/nvlabs/diffit","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"NOASSERTION"}}],"tasks":[{"task_slug":"denoising","task_name":"Denoising"},{"task_slug":"image-generation","task_name":"Image Generation"}],"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"},{"method_slug":"vision-transformer","method_name":"Vision Transformer"}],"datasets_introduced":[],"methods_introduced":[],"results":[{"leaderboard":"/sota/image-generation-on-imagenet-256x256","task":"Image Generation","dataset":"ImageNet 256x256","model":"DiffiT","rank_in_archive_order":36,"of":94,"metrics":{"FID":"1.73"},"uses_additional_data":false},{"leaderboard":"/sota/image-generation-on-imagenet-512x512","task":"Image Generation","dataset":"ImageNet 512x512","model":"DiffiT","rank_in_archive_order":35,"of":52,"metrics":{"FID":"2.67","Inception score":"252.12"},"uses_additional_data":false}],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2312.02139","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2312.02139"}},"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/nvlabs/diffit","reach":{"status":"ok","spdx":"NOASSERTION"}}],"summary":{"ran_draft_wrong":6,"ran":7,"ran_honours":3,"ran_fixture":1,"ran_violates":1,"unverified":7},"by_repo_kind":{"official":{"samples":25,"ran":18,"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":25,"samples":[{"code_sha256_prefix":"8ab9a97df8161f31","entry":"center_crop_arr","repo":"nvlabs/diffit","repo_kind":"official","path":"diffit/image_datasets.py","file_url":"https://github.com/nvlabs/diffit/blob/HEAD/diffit/image_datasets.py","link_basis":"harvester_set","language":"python","status":"ran_draft_wrong","verification_level":2,"contract_check":"MISDECLARED","metamorphic_tier":"well_formed","behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"8ab9a97df8161f31"}},{"code_sha256_prefix":"d6a68e210556f857","entry":"approx_standard_normal_cdf","repo":"nvlabs/diffit","repo_kind":"official","path":"diffit/diffusion_utils.py","file_url":"https://github.com/nvlabs/diffit/blob/HEAD/diffit/diffusion_utils.py","link_basis":"harvester_set","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"MISDECLARED","metamorphic_tier":"invariant","behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"d6a68e210556f857"}},{"code_sha256_prefix":"4e2ac192b520c457","entry":"args_to_dict","repo":"nvlabs/diffit","repo_kind":"official","path":"diffit/script_util.py","file_url":"https://github.com/nvlabs/diffit/blob/HEAD/diffit/script_util.py","link_basis":"harvester_set","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":"4e2ac192b520c457"}},{"code_sha256_prefix":"ab1c9568b4e13899","entry":"continuous_gaussian_log_likelihood","repo":"nvlabs/diffit","repo_kind":"official","path":"diffit/diffusion_utils.py","file_url":"https://github.com/nvlabs/diffit/blob/HEAD/diffit/diffusion_utils.py","link_basis":"harvester_set","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"MISDECLARED","metamorphic_tier":"invariant","behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"ab1c9568b4e13899"}},{"code_sha256_prefix":"35572566acf61c78","entry":"create_named_schedule_sampler","repo":"nvlabs/diffit","repo_kind":"official","path":"diffit/resample.py","file_url":"https://github.com/nvlabs/diffit/blob/HEAD/diffit/resample.py","link_basis":"harvester_set","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"35572566acf61c78"}},{"code_sha256_prefix":"aa58f30251e59c74","entry":"get_1d_sincos_pos_embed_from_grid","repo":"nvlabs/diffit","repo_kind":"official","path":"diffit/diffit.py","file_url":"https://github.com/nvlabs/diffit/blob/HEAD/diffit/diffit.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"NOASSERTION","inline_ok":false,"mcp_get_code":{"code_sha256":"aa58f30251e59c74"}},{"code_sha256_prefix":"d77775e45836dc1a","entry":"get_2d_sincos_pos_embed","repo":"nvlabs/diffit","repo_kind":"official","path":"diffit/diffit.py","file_url":"https://github.com/nvlabs/diffit/blob/HEAD/diffit/diffit.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NOASSERTION","inline_ok":false,"mcp_get_code":{"code_sha256":"d77775e45836dc1a"}},{"code_sha256_prefix":"3e0fa4efc22272d4","entry":"get_beta_schedule","repo":"nvlabs/diffit","repo_kind":"official","path":"diffit/gaussian_diffusion.py","file_url":"https://github.com/nvlabs/diffit/blob/HEAD/diffit/gaussian_diffusion.py","link_basis":"harvester_set","language":"python","status":"ran_honours","verification_level":1,"contract_check":"HONOURS","metamorphic_tier":"well_formed","behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"3e0fa4efc22272d4"}},{"code_sha256_prefix":"36e30c7fb679ec78","entry":"get_named_beta_schedule","repo":"nvlabs/diffit","repo_kind":"official","path":"diffit/gaussian_diffusion.py","file_url":"https://github.com/nvlabs/diffit/blob/HEAD/diffit/gaussian_diffusion.py","link_basis":"harvester_set","language":"python","status":"ran_honours","verification_level":1,"contract_check":"HONOURS","metamorphic_tier":"well_formed","behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"36e30c7fb679ec78"}},{"code_sha256_prefix":"e41367ad14ff58fd","entry":"get_param_groups_and_shapes","repo":"nvlabs/diffit","repo_kind":"official","path":"diffit/fp16_util.py","file_url":"https://github.com/nvlabs/diffit/blob/HEAD/diffit/fp16_util.py","link_basis":"harvester_set","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":"e41367ad14ff58fd"}},{"code_sha256_prefix":"e20dd5102da3b050","entry":"make_master_params","repo":"nvlabs/diffit","repo_kind":"official","path":"diffit/fp16_util.py","file_url":"https://github.com/nvlabs/diffit/blob/HEAD/diffit/fp16_util.py","link_basis":"harvester_set","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":"e20dd5102da3b050"}},{"code_sha256_prefix":"bcd8b4acab199405","entry":"make_output_format","repo":"nvlabs/diffit","repo_kind":"official","path":"diffit/logger.py","file_url":"https://github.com/nvlabs/diffit/blob/HEAD/diffit/logger.py","link_basis":"harvester_set","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":"bcd8b4acab199405"}},{"code_sha256_prefix":"f6d7c009a8efb8b7","entry":"mean_flat","repo":"nvlabs/diffit","repo_kind":"official","path":"diffit/gaussian_diffusion.py","file_url":"https://github.com/nvlabs/diffit/blob/HEAD/diffit/gaussian_diffusion.py","link_basis":"harvester_set","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"MISDECLARED","metamorphic_tier":"invariant","behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"f6d7c009a8efb8b7"}},{"code_sha256_prefix":"8afbfc42c6ea0448","entry":"normal_kl","repo":"nvlabs/diffit","repo_kind":"official","path":"diffit/diffusion_utils.py","file_url":"https://github.com/nvlabs/diffit/blob/HEAD/diffit/diffusion_utils.py","link_basis":"harvester_set","language":"python","status":"ran_honours","verification_level":1,"contract_check":"HONOURS","metamorphic_tier":"invariant","behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"8afbfc42c6ea0448"}},{"code_sha256_prefix":"ea9dbc131adf582e","entry":"space_timesteps","repo":"nvlabs/diffit","repo_kind":"official","path":"diffit/respace.py","file_url":"https://github.com/nvlabs/diffit/blob/HEAD/diffit/respace.py","link_basis":"harvester_set","language":"python","status":"ran_fixture","verification_level":1,"contract_check":"RAISES","metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"ea9dbc131adf582e"}},{"code_sha256_prefix":"721eef93e7a633a1","entry":"str2bool","repo":"nvlabs/diffit","repo_kind":"official","path":"diffit/script_util.py","file_url":"https://github.com/nvlabs/diffit/blob/HEAD/diffit/script_util.py","link_basis":"plan_row","language":"python","status":"ran_violates","verification_level":1,"contract_check":"VIOLATES","metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"721eef93e7a633a1"}},{"code_sha256_prefix":"64fff1e30802b815","entry":"unflatten_master_params","repo":"nvlabs/diffit","repo_kind":"official","path":"diffit/fp16_util.py","file_url":"https://github.com/nvlabs/diffit/blob/HEAD/diffit/fp16_util.py","link_basis":"harvester_set","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":"64fff1e30802b815"}},{"code_sha256_prefix":"129b804760b3115f","entry":"zero_module","repo":"nvlabs/diffit","repo_kind":"official","path":"diffit/nn.py","file_url":"https://github.com/nvlabs/diffit/blob/HEAD/diffit/nn.py","link_basis":"harvester_set","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":"129b804760b3115f"}},{"code_sha256_prefix":"ecd0fc28815b65ae","entry":"avg_pool_nd","repo":"nvlabs/diffit","repo_kind":"official","path":"diffit/nn.py","file_url":"https://github.com/nvlabs/diffit/blob/HEAD/diffit/nn.py","link_basis":"harvester_set","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":"ecd0fc28815b65ae"}},{"code_sha256_prefix":"fe4eb545bbb728e0","entry":"conv_nd","repo":"nvlabs/diffit","repo_kind":"official","path":"diffit/nn.py","file_url":"https://github.com/nvlabs/diffit/blob/HEAD/diffit/nn.py","link_basis":"harvester_set","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":"fe4eb545bbb728e0"}},{"code_sha256_prefix":"5f78ec79ce3ed0a3","entry":"get_2d_sincos_pos_embed_from_grid","repo":"nvlabs/diffit","repo_kind":"official","path":"diffit/diffit.py","file_url":"https://github.com/nvlabs/diffit/blob/HEAD/diffit/diffit.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NOASSERTION","inline_ok":false,"mcp_get_code":{"code_sha256":"5f78ec79ce3ed0a3"}},{"code_sha256_prefix":"bd2d797cf36610b5","entry":"load_state_dict","repo":"nvlabs/diffit","repo_kind":"official","path":"diffit/dist_util.py","file_url":"https://github.com/nvlabs/diffit/blob/HEAD/diffit/dist_util.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NOASSERTION","inline_ok":false,"mcp_get_code":{"code_sha256":"bd2d797cf36610b5"}},{"code_sha256_prefix":"e515a67f7f32e76d","entry":"mpi_weighted_mean","repo":"nvlabs/diffit","repo_kind":"official","path":"diffit/logger.py","file_url":"https://github.com/nvlabs/diffit/blob/HEAD/diffit/logger.py","link_basis":"harvester_set","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":"e515a67f7f32e76d"}},{"code_sha256_prefix":"7065e4d5f1f47817","entry":"profile","repo":"nvlabs/diffit","repo_kind":"official","path":"diffit/logger.py","file_url":"https://github.com/nvlabs/diffit/blob/HEAD/diffit/logger.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NOASSERTION","inline_ok":false,"mcp_get_code":{"code_sha256":"7065e4d5f1f47817"}},{"code_sha256_prefix":"53d5be4fdbcfac23","entry":"random_crop_arr","repo":"nvlabs/diffit","repo_kind":"official","path":"diffit/image_datasets.py","file_url":"https://github.com/nvlabs/diffit/blob/HEAD/diffit/image_datasets.py","link_basis":"harvester_set","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":"53d5be4fdbcfac23"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}