{"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/adjointdeis-efficient-gradients-for-diffusion","title":"AdjointDEIS: Efficient Gradients for Diffusion Models","arxiv_id":"2405.15020","date":"2024-05-23","proceeding":null,"authors":["Zander W. Blasingame","Chen Liu"],"abstract":"The optimization of the latents and parameters of diffusion models with respect to some differentiable metric defined on the output of the model is a challenging and complex problem. The sampling for diffusion models is done by solving either the probability flow ODE or diffusion SDE wherein a neural network approximates the score function allowing a numerical ODE/SDE solver to be used. However, naive backpropagation techniques are memory intensive, requiring the storage of all intermediate states, and face additional complexity in handling the injected noise from the diffusion term of the diffusion SDE. We propose a novel family of bespoke ODE solvers to the continuous adjoint equations for diffusion models, which we call AdjointDEIS. We exploit the unique construction of diffusion SDEs to further simplify the formulation of the continuous adjoint equations using exponential integrators. Moreover, we provide convergence order guarantees for our bespoke solvers. Significantly, we show that continuous adjoint equations for diffusion SDEs actually simplify to a simple ODE. Lastly, we demonstrate the effectiveness of AdjointDEIS for guided generation with an adversarial attack in the form of the face morphing problem. Our code will be released at https: //github.com/zblasingame/AdjointDEIS.","url_abs":"https://arxiv.org/abs/2405.15020v3","url_pdf":"https://arxiv.org/pdf/2405.15020v3.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":"adjointdeis-efficient-gradients-for-diffusion","repo_url":"https://github.com/zblasingame/adjointdeis","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"MIT"}}],"tasks":[{"task_slug":"adversarial-attack","task_name":"Adversarial Attack"}],"methods":[{"method_slug":"diffusion","method_name":"Diffusion"}],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2405.15020","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2405.15020"}},"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/zblasingame/AdjointDEIS","reach":{"status":"ok","spdx":"MIT"}},{"provenance":"deterministic:regex_extraction","url":"https://github.com/deepinsight/insightface","reach":{"status":"ok"}},{"provenance":"deterministic:regex_extraction","url":"https://github.com/fdbtrs/ElasticFace","reach":{"status":"ok"}},{"provenance":"deterministic:regex_extraction","url":"https://github.com/mk-minchul/AdaFace","reach":{"status":"ok","spdx":"MIT"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/zblasingame/adjointdeis","reach":{"status":"ok","spdx":"MIT"}}],"summary":{"ran":14,"ran_honours":3,"ran_draft_wrong":3,"unverified":3},"by_repo_kind":{"found_in_text":{"samples":23,"ran":20,"repositories":2}},"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":13,"samples":[{"code_sha256_prefix":"934a10e4aa8e3fc7","entry":"add_task_arguments","repo":"mk-minchul/AdaFace","repo_kind":"found_in_text","path":"config.py","file_url":"https://github.com/mk-minchul/AdaFace/blob/HEAD/config.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"934a10e4aa8e3fc7"}},{"code_sha256_prefix":"63e31804a718f935","entry":"all_gather","repo":"mk-minchul/AdaFace","repo_kind":"found_in_text","path":"utils.py","file_url":"https://github.com/mk-minchul/AdaFace/blob/HEAD/utils.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"63e31804a718f935"}},{"code_sha256_prefix":"43edde19d28891aa","entry":"build_head","repo":"mk-minchul/AdaFace","repo_kind":"found_in_text","path":"head.py","file_url":"https://github.com/mk-minchul/AdaFace/blob/HEAD/head.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"43edde19d28891aa"}},{"code_sha256_prefix":"f975336b5d5f1a80","entry":"calculate_accuracy","repo":"fdbtrs/ElasticFace","repo_kind":"found_in_text","path":"eval/verification.py","file_url":"https://github.com/fdbtrs/ElasticFace/blob/HEAD/eval/verification.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":"f975336b5d5f1a80"}},{"code_sha256_prefix":"075d6cd5e0436c87","entry":"calculate_roc","repo":"fdbtrs/ElasticFace","repo_kind":"found_in_text","path":"eval/verification.py","file_url":"https://github.com/fdbtrs/ElasticFace/blob/HEAD/eval/verification.py","link_basis":"first_harvest_node","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":"075d6cd5e0436c87"}},{"code_sha256_prefix":"158bf4c3a5f11f04","entry":"conv1x1","repo":"fdbtrs/ElasticFace","repo_kind":"found_in_text","path":"backbones/iresnet.py","file_url":"https://github.com/fdbtrs/ElasticFace/blob/HEAD/backbones/iresnet.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":"158bf4c3a5f11f04"}},{"code_sha256_prefix":"9fd654ad680f6c6e","entry":"conv1x1","repo":"fdbtrs/ElasticFace","repo_kind":"found_in_text","path":"backbones/utils.py","file_url":"https://github.com/fdbtrs/ElasticFace/blob/HEAD/backbones/utils.py","link_basis":"first_harvest_node","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":"9fd654ad680f6c6e"}},{"code_sha256_prefix":"29df79c9fdb0cee8","entry":"conv3x3","repo":"fdbtrs/ElasticFace","repo_kind":"found_in_text","path":"backbones/iresnet.py","file_url":"https://github.com/fdbtrs/ElasticFace/blob/HEAD/backbones/iresnet.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":"29df79c9fdb0cee8"}},{"code_sha256_prefix":"be7e40142c49c8be","entry":"conv3x3","repo":"fdbtrs/ElasticFace","repo_kind":"found_in_text","path":"backbones/utils.py","file_url":"https://github.com/fdbtrs/ElasticFace/blob/HEAD/backbones/utils.py","link_basis":"first_harvest_node","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":"be7e40142c49c8be"}},{"code_sha256_prefix":"ddabbebf3d53cffd","entry":"count_model_flops","repo":"fdbtrs/ElasticFace","repo_kind":"found_in_text","path":"utils/countFLOPS.py","file_url":"https://github.com/fdbtrs/ElasticFace/blob/HEAD/utils/countFLOPS.py","link_basis":"first_harvest_node","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":"ddabbebf3d53cffd"}},{"code_sha256_prefix":"79dc6e46e55db7f3","entry":"flops_to_string","repo":"fdbtrs/ElasticFace","repo_kind":"found_in_text","path":"utils/countFLOPS.py","file_url":"https://github.com/fdbtrs/ElasticFace/blob/HEAD/utils/countFLOPS.py","link_basis":"first_harvest_node","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":"79dc6e46e55db7f3"}},{"code_sha256_prefix":"2f1464d858027854","entry":"fuse_features_with_norm","repo":"mk-minchul/AdaFace","repo_kind":"found_in_text","path":"utils.py","file_url":"https://github.com/mk-minchul/AdaFace/blob/HEAD/utils.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":"2f1464d858027854"}},{"code_sha256_prefix":"4c9000726845f1ba","entry":"get_activation_layer","repo":"fdbtrs/ElasticFace","repo_kind":"found_in_text","path":"backbones/activation.py","file_url":"https://github.com/fdbtrs/ElasticFace/blob/HEAD/backbones/activation.py","link_basis":"first_harvest_node","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":"4c9000726845f1ba"}},{"code_sha256_prefix":"ad5dbf57f3ea2633","entry":"get_block","repo":"mk-minchul/AdaFace","repo_kind":"found_in_text","path":"net.py","file_url":"https://github.com/mk-minchul/AdaFace/blob/HEAD/net.py","link_basis":"harvester_set","language":"python","status":"ran_honours","verification_level":1,"contract_check":"HONOURS","metamorphic_tier":"well_formed","behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"ad5dbf57f3ea2633"}},{"code_sha256_prefix":"e82dfb7d2386721b","entry":"get_blocks","repo":"mk-minchul/AdaFace","repo_kind":"found_in_text","path":"net.py","file_url":"https://github.com/mk-minchul/AdaFace/blob/HEAD/net.py","link_basis":"harvester_set","language":"python","status":"ran_honours","verification_level":1,"contract_check":"HONOURS","metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"e82dfb7d2386721b"}},{"code_sha256_prefix":"c54fea429589425d","entry":"l2_norm","repo":"fdbtrs/ElasticFace","repo_kind":"found_in_text","path":"utils/losses.py","file_url":"https://github.com/fdbtrs/ElasticFace/blob/HEAD/utils/losses.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":"c54fea429589425d"}},{"code_sha256_prefix":"1aa71e8a5cfa042d","entry":"l2_norm","repo":"mk-minchul/AdaFace","repo_kind":"found_in_text","path":"utils.py","file_url":"https://github.com/mk-minchul/AdaFace/blob/HEAD/utils.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":"1aa71e8a5cfa042d"}},{"code_sha256_prefix":"4269ef237488148f","entry":"make_memmap","repo":"mk-minchul/AdaFace","repo_kind":"found_in_text","path":"evaluate_utils.py","file_url":"https://github.com/mk-minchul/AdaFace/blob/HEAD/evaluate_utils.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"4269ef237488148f"}},{"code_sha256_prefix":"dd12981b28dec323","entry":"round_channels","repo":"fdbtrs/ElasticFace","repo_kind":"found_in_text","path":"backbones/utils.py","file_url":"https://github.com/fdbtrs/ElasticFace/blob/HEAD/backbones/utils.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"dd12981b28dec323"}},{"code_sha256_prefix":"732bb4b645edf94a","entry":"to_input","repo":"mk-minchul/AdaFace","repo_kind":"found_in_text","path":"inference.py","file_url":"https://github.com/mk-minchul/AdaFace/blob/HEAD/inference.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"732bb4b645edf94a"}},{"code_sha256_prefix":"5ac43e0b338068fe","entry":"build_model","repo":"mk-minchul/AdaFace","repo_kind":"found_in_text","path":"net.py","file_url":"https://github.com/mk-minchul/AdaFace/blob/HEAD/net.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"5ac43e0b338068fe"}},{"code_sha256_prefix":"640d55c5cdb97874","entry":"calculate_val","repo":"fdbtrs/ElasticFace","repo_kind":"found_in_text","path":"eval/verification.py","file_url":"https://github.com/fdbtrs/ElasticFace/blob/HEAD/eval/verification.py","link_basis":"first_harvest_node","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":"640d55c5cdb97874"}},{"code_sha256_prefix":"318ed28c665f6714","entry":"iresnet18","repo":"fdbtrs/ElasticFace","repo_kind":"found_in_text","path":"backbones/iresnet.py","file_url":"https://github.com/fdbtrs/ElasticFace/blob/HEAD/backbones/iresnet.py","link_basis":"first_harvest_node","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":"318ed28c665f6714"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}