{"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/improved-contrastive-divergence-training-of-1","title":"Improved Contrastive Divergence Training of Energy Based Models","arxiv_id":"2012.01316","date":"2020-12-02","proceeding":null,"authors":["Yilun Du","Shuang Li","Joshua Tenenbaum","Igor Mordatch"],"abstract":"Contrastive divergence is a popular method of training energy-based models, but is known to have difficulties with training stability. We propose an adaptation to improve contrastive divergence training by scrutinizing a gradient term that is difficult to calculate and is often left out for convenience. We show that this gradient term is numerically significant and in practice is important to avoid training instabilities, while being tractable to estimate. We further highlight how data augmentation and multi-scale processing can be used to improve model robustness and generation quality. Finally, we empirically evaluate stability of model architectures and show improved performance on a host of benchmarks and use cases,such as image generation, OOD detection, and compositional generation.","url_abs":"https://arxiv.org/abs/2012.01316v4","url_pdf":"https://arxiv.org/pdf/2012.01316v4.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":"improved-contrastive-divergence-training-of-1","repo_url":"https://github.com/mbordyuh/Contrastive_Divergence","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"unanswered"}},{"paper_slug":"improved-contrastive-divergence-training-of-1","repo_url":"https://github.com/mbordyuh/ebm","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":null},{"paper_slug":"improved-contrastive-divergence-training-of-1","repo_url":"https://github.com/yilundu/ebm_compositionality","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"tf","reach":null},{"paper_slug":"improved-contrastive-divergence-training-of-1","repo_url":"https://github.com/yilundu/improved_contrastive_divergence","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"tf","reach":null},{"paper_slug":"improved-contrastive-divergence-training-of-1","repo_url":"https://github.com/zzzx1224/ebtsa-iclr2023","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":null},{"paper_slug":"improved-contrastive-divergence-training-of-1","repo_url":"https://github.com/soran-ghaderi/torchebm","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":0,"framework":"pytorch","reach":{"status":"unanswered"}}],"tasks":[{"task_slug":"data-augmentation","task_name":"Data Augmentation"},{"task_slug":"image-generation","task_name":"Image Generation"},{"task_slug":"ood-detection","task_name":"Out of Distribution (OOD) Detection"}],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"syntology_url":"https://syntology.ai/paper/2012.01316","atlas_url":"https://app.syntology.ai/?focus=2012.01316","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2012.01316"}},"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/zzzx1224/ebtsa-iclr2023","reach":null},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/mbordyuh/Contrastive_Divergence","reach":{"status":"unanswered"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/mbordyuh/ebm","reach":null},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/yilundu/improved_contrastive_divergence","reach":null},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/soran-ghaderi/torchebm","reach":{"status":"unanswered"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/yilundu/ebm_compositionality","reach":null}],"summary":{"ran_draft_wrong":2,"unverified":1},"by_repo_kind":{"listed":{"samples":3,"ran":2,"repositories":3}},"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":3,"samples":[{"code_sha256_prefix":"d020c80bf3b4e139","entry":"leapfrog_step","repo":"yilundu/improved_contrastive_divergence","repo_kind":"listed","path":"hmc.py","file_url":"https://github.com/yilundu/improved_contrastive_divergence/blob/HEAD/hmc.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"MISDECLARED","metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"d020c80bf3b4e139"}},{"code_sha256_prefix":"890be8882a54b034","entry":"leapfrog_step","repo":"mbordyuh/ebm","repo_kind":"listed","path":"hmc.py","file_url":"https://github.com/mbordyuh/ebm/blob/HEAD/hmc.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"MISDECLARED","metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"890be8882a54b034"}},{"code_sha256_prefix":"79372dd379ae10e6","entry":"construct_steps","repo":"yilundu/ebm_compositionality","repo_kind":"listed","path":"ebm_sandbox.py","file_url":"https://github.com/yilundu/ebm_compositionality/blob/HEAD/ebm_sandbox.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":"79372dd379ae10e6"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}