{"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/guiding-energy-based-models-via-contrastive","title":"Guiding Energy-based Models via Contrastive Latent Variables","arxiv_id":"2303.03023","date":"2023-03-06","proceeding":null,"authors":["Hankook Lee","Jongheon Jeong","Sejun Park","Jinwoo Shin"],"abstract":"An energy-based model (EBM) is a popular generative framework that offers both explicit density and architectural flexibility, but training them is difficult since it is often unstable and time-consuming. In recent years, various training techniques have been developed, e.g., better divergence measures or stabilization in MCMC sampling, but there often exists a large gap between EBMs and other generative frameworks like GANs in terms of generation quality. In this paper, we propose a novel and effective framework for improving EBMs via contrastive representation learning (CRL). To be specific, we consider representations learned by contrastive methods as the true underlying latent variable. This contrastive latent variable could guide EBMs to understand the data structure better, so it can improve and accelerate EBM training significantly. To enable the joint training of EBM and CRL, we also design a new class of latent-variable EBMs for learning the joint density of data and the contrastive latent variable. Our experimental results demonstrate that our scheme achieves lower FID scores, compared to prior-art EBM methods (e.g., additionally using variational autoencoders or diffusion techniques), even with significantly faster and more memory-efficient training. We also show conditional and compositional generation abilities of our latent-variable EBMs as their additional benefits, even without explicit conditional training. The code is available at https://github.com/hankook/CLEL.","url_abs":"https://arxiv.org/abs/2303.03023v1","url_pdf":"https://arxiv.org/pdf/2303.03023v1.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":"guiding-energy-based-models-via-contrastive","repo_url":"https://github.com/hankook/clel","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":0,"framework":"pytorch","reach":{"status":"ok"}}],"tasks":[{"task_slug":"representation-learning","task_name":"Representation Learning"}],"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/2303.03023","atlas_url":"https://app.syntology.ai/?focus=2303.03023","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2303.03023"}},"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/hankook/CLEL","reach":{"status":"ok"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/hankook/clel","reach":{"status":"ok"}}],"summary":{"ran":1,"ran_draft_wrong":1,"unverified":3},"by_repo_kind":{"official":{"samples":5,"ran":2,"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":5,"samples":[{"code_sha256_prefix":"fc7e91db7bb02ae4","entry":"BaseModel","repo":"hankook/clel","repo_kind":"official","path":"models/ebm.py","file_url":"https://github.com/hankook/clel/blob/HEAD/models/ebm.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"fc7e91db7bb02ae4"}},{"code_sha256_prefix":"50304764a3238d65","entry":"simclr","repo":"hankook/clel","repo_kind":"official","path":"models/ebm.py","file_url":"https://github.com/hankook/clel/blob/HEAD/models/ebm.py","link_basis":"first_harvest_node","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":"50304764a3238d65"}},{"code_sha256_prefix":"e2548307738e2bbf","entry":"JointModel","repo":"hankook/clel","repo_kind":"official","path":"models/ebm.py","file_url":"https://github.com/hankook/clel/blob/HEAD/models/ebm.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":"e2548307738e2bbf"}},{"code_sha256_prefix":"4f411de8765f652a","entry":"Sampler","repo":"hankook/clel","repo_kind":"official","path":"models/ebm.py","file_url":"https://github.com/hankook/clel/blob/HEAD/models/ebm.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":"4f411de8765f652a"}},{"code_sha256_prefix":"5dc69665e9d5ac66","entry":"get_augmentation","repo":"hankook/clel","repo_kind":"official","path":"models/ebm.py","file_url":"https://github.com/hankook/clel/blob/HEAD/models/ebm.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":"5dc69665e9d5ac66"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}