{"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/maximum-entropy-inverse-reinforcement-1","title":"Maximum Entropy Inverse Reinforcement Learning of Diffusion Models with Energy-Based Models","arxiv_id":"2407.00626","date":"2024-06-30","proceeding":null,"authors":["Sangwoong Yoon","Himchan Hwang","Dohyun Kwon","Yung-Kyun Noh","Frank C. Park"],"abstract":"We present a maximum entropy inverse reinforcement learning (IRL) approach for improving the sample quality of diffusion generative models, especially when the number of generation time steps is small. Similar to how IRL trains a policy based on the reward function learned from expert demonstrations, we train (or fine-tune) a diffusion model using the log probability density estimated from training data. Since we employ an energy-based model (EBM) to represent the log density, our approach boils down to the joint training of a diffusion model and an EBM. Our IRL formulation, named Diffusion by Maximum Entropy IRL (DxMI), is a minimax problem that reaches equilibrium when both models converge to the data distribution. The entropy maximization plays a key role in DxMI, facilitating the exploration of the diffusion model and ensuring the convergence of the EBM. We also propose Diffusion by Dynamic Programming (DxDP), a novel reinforcement learning algorithm for diffusion models, as a subroutine in DxMI. DxDP makes the diffusion model update in DxMI efficient by transforming the original problem into an optimal control formulation where value functions replace back-propagation in time. Our empirical studies show that diffusion models fine-tuned using DxMI can generate high-quality samples in as few as 4 and 10 steps. Additionally, DxMI enables the training of an EBM without MCMC, stabilizing EBM training dynamics and enhancing anomaly detection performance.","url_abs":"https://arxiv.org/abs/2407.00626v2","url_pdf":"https://arxiv.org/pdf/2407.00626v2.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":"maximum-entropy-inverse-reinforcement-1","repo_url":"https://github.com/swyoon/diffusion-by-maxentirl","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"MIT"}}],"tasks":[{"task_slug":"anomaly-detection","task_name":"Anomaly Detection"}],"methods":[{"method_slug":"diffusion","method_name":"Diffusion"},{"method_slug":"ebm","method_name":"EBM"}],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"syntology_url":"https://syntology.ai/paper/2407.00626","atlas_url":"https://app.syntology.ai/?focus=2407.00626","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2407.00626"}},"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":"deterministic:regex_extraction","url":"https://github.com/swyoon/Diffusion-by-MaxEntIRL","reach":{"status":"ok","spdx":"MIT"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/swyoon/diffusion-by-maxentirl","reach":{"status":"ok","spdx":"MIT"}}],"summary":{"ran":6,"ran_honours":2,"ran_violates":1,"unverified":9},"by_repo_kind":{"official":{"samples":18,"ran":9,"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":"6c1e362234350951","entry":"get_activation","repo":"swyoon/Diffusion-by-MaxEntIRL","repo_kind":"official","path":"models/modules.py","file_url":"https://github.com/swyoon/Diffusion-by-MaxEntIRL/blob/HEAD/models/modules.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":"6c1e362234350951"}},{"code_sha256_prefix":"01baa8e1e4e273e2","entry":"make_beta_schedule","repo":"swyoon/diffusion-by-maxentirl","repo_kind":"official","path":"models/DxMI/trainer.py","file_url":"https://github.com/swyoon/diffusion-by-maxentirl/blob/HEAD/models/DxMI/trainer.py","link_basis":"first_harvest_node","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":"01baa8e1e4e273e2"}},{"code_sha256_prefix":"3a94534d8de246ee","entry":"parse_arg_type","repo":"swyoon/Diffusion-by-MaxEntIRL","repo_kind":"official","path":"cmd_utils.py","file_url":"https://github.com/swyoon/Diffusion-by-MaxEntIRL/blob/HEAD/cmd_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":"3a94534d8de246ee"}},{"code_sha256_prefix":"2312bb33e056cfa7","entry":"parse_nested_args","repo":"swyoon/Diffusion-by-MaxEntIRL","repo_kind":"official","path":"cmd_utils.py","file_url":"https://github.com/swyoon/Diffusion-by-MaxEntIRL/blob/HEAD/cmd_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":"2312bb33e056cfa7"}},{"code_sha256_prefix":"24050cdd9df51454","entry":"parse_unknown_args","repo":"swyoon/Diffusion-by-MaxEntIRL","repo_kind":"official","path":"cmd_utils.py","file_url":"https://github.com/swyoon/Diffusion-by-MaxEntIRL/blob/HEAD/cmd_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":"24050cdd9df51454"}},{"code_sha256_prefix":"64a941eba4950213","entry":"process_single_t","repo":"swyoon/diffusion-by-maxentirl","repo_kind":"official","path":"models/DxMI/trainer.py","file_url":"https://github.com/swyoon/diffusion-by-maxentirl/blob/HEAD/models/DxMI/trainer.py","link_basis":"first_harvest_node","language":"python","status":"ran_violates","verification_level":1,"contract_check":"VIOLATES","metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"64a941eba4950213"}},{"code_sha256_prefix":"90f2942b737cb482","entry":"remove_module","repo":"swyoon/Diffusion-by-MaxEntIRL","repo_kind":"official","path":"models/utils.py","file_url":"https://github.com/swyoon/Diffusion-by-MaxEntIRL/blob/HEAD/models/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":"90f2942b737cb482"}},{"code_sha256_prefix":"4e07246a19ae09b7","entry":"rescale","repo":"swyoon/Diffusion-by-MaxEntIRL","repo_kind":"official","path":"generate_cifar10.py","file_url":"https://github.com/swyoon/Diffusion-by-MaxEntIRL/blob/HEAD/generate_cifar10.py","link_basis":"plan_row","language":"python","status":"ran_honours","verification_level":1,"contract_check":"HONOURS","metamorphic_tier":"invariant","behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"4e07246a19ae09b7"}},{"code_sha256_prefix":"ffd7b0f9be1df615","entry":"weight_norm","repo":"swyoon/Diffusion-by-MaxEntIRL","repo_kind":"official","path":"models/utils.py","file_url":"https://github.com/swyoon/Diffusion-by-MaxEntIRL/blob/HEAD/models/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":"ffd7b0f9be1df615"}},{"code_sha256_prefix":"2feb70fa82de3bb5","entry":"DxMI_Trainer","repo":"swyoon/diffusion-by-maxentirl","repo_kind":"official","path":"models/DxMI/trainer.py","file_url":"https://github.com/swyoon/diffusion-by-maxentirl/blob/HEAD/models/DxMI/trainer.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":"2feb70fa82de3bb5"}},{"code_sha256_prefix":"fcdc92d3d2e8edc1","entry":"calculate_frechet_distance","repo":"swyoon/Diffusion-by-MaxEntIRL","repo_kind":"official","path":"pytorch_fid/fid_score.py","file_url":"https://github.com/swyoon/Diffusion-by-MaxEntIRL/blob/HEAD/pytorch_fid/fid_score.py","link_basis":"harvester_set","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":"fcdc92d3d2e8edc1"}},{"code_sha256_prefix":"30e33c6c36337446","entry":"extract","repo":"swyoon/diffusion-by-maxentirl","repo_kind":"official","path":"models/DxMI/trainer.py","file_url":"https://github.com/swyoon/diffusion-by-maxentirl/blob/HEAD/models/DxMI/trainer.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":"30e33c6c36337446"}},{"code_sha256_prefix":"995510dd78052fbc","entry":"fix_legacy_dict","repo":"swyoon/Diffusion-by-MaxEntIRL","repo_kind":"official","path":"models/utils.py","file_url":"https://github.com/swyoon/Diffusion-by-MaxEntIRL/blob/HEAD/models/utils.py","link_basis":"plan_row","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":"995510dd78052fbc"}},{"code_sha256_prefix":"26edbd4467e04bec","entry":"get_activations","repo":"swyoon/Diffusion-by-MaxEntIRL","repo_kind":"official","path":"pytorch_fid/fid_score.py","file_url":"https://github.com/swyoon/Diffusion-by-MaxEntIRL/blob/HEAD/pytorch_fid/fid_score.py","link_basis":"harvester_set","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":"26edbd4467e04bec"}},{"code_sha256_prefix":"9226d84ff74e8d9f","entry":"get_activations_from_tensor","repo":"swyoon/Diffusion-by-MaxEntIRL","repo_kind":"official","path":"pytorch_fid/fid_score.py","file_url":"https://github.com/swyoon/Diffusion-by-MaxEntIRL/blob/HEAD/pytorch_fid/fid_score.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":"9226d84ff74e8d9f"}},{"code_sha256_prefix":"00611e9feba0f93d","entry":"get_sigmas_karras","repo":"swyoon/Diffusion-by-MaxEntIRL","repo_kind":"official","path":"models/cm/karras_diffusion.py","file_url":"https://github.com/swyoon/Diffusion-by-MaxEntIRL/blob/HEAD/models/cm/karras_diffusion.py","link_basis":"harvester_set","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":"00611e9feba0f93d"}},{"code_sha256_prefix":"b50e02eda098b1ea","entry":"get_weightings","repo":"swyoon/Diffusion-by-MaxEntIRL","repo_kind":"official","path":"models/cm/karras_diffusion.py","file_url":"https://github.com/swyoon/Diffusion-by-MaxEntIRL/blob/HEAD/models/cm/karras_diffusion.py","link_basis":"harvester_set","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":"b50e02eda098b1ea"}},{"code_sha256_prefix":"0caab2b1bad90636","entry":"karras_sample","repo":"swyoon/Diffusion-by-MaxEntIRL","repo_kind":"official","path":"models/cm/karras_diffusion.py","file_url":"https://github.com/swyoon/Diffusion-by-MaxEntIRL/blob/HEAD/models/cm/karras_diffusion.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":"0caab2b1bad90636"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}