{"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/gflownet-em-for-learning-compositional-latent","title":"GFlowNet-EM for learning compositional latent variable models","arxiv_id":"2302.06576","date":"2023-02-13","proceeding":null,"authors":["Edward J. Hu","Nikolay Malkin","Moksh Jain","Katie Everett","Alexandros Graikos","Yoshua Bengio"],"abstract":"Latent variable models (LVMs) with discrete compositional latents are an important but challenging setting due to a combinatorially large number of possible configurations of the latents. A key tradeoff in modeling the posteriors over latents is between expressivity and tractable optimization. For algorithms based on expectation-maximization (EM), the E-step is often intractable without restrictive approximations to the posterior. We propose the use of GFlowNets, algorithms for sampling from an unnormalized density by learning a stochastic policy for sequential construction of samples, for this intractable E-step. By training GFlowNets to sample from the posterior over latents, we take advantage of their strengths as amortized variational inference algorithms for complex distributions over discrete structures. Our approach, GFlowNet-EM, enables the training of expressive LVMs with discrete compositional latents, as shown by experiments on non-context-free grammar induction and on images using discrete variational autoencoders (VAEs) without conditional independence enforced in the encoder.","url_abs":"https://arxiv.org/abs/2302.06576v2","url_pdf":"https://arxiv.org/pdf/2302.06576v2.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":"gflownet-em-for-learning-compositional-latent","repo_url":"https://github.com/gfnorg/gflownet-em","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":null}],"tasks":[{"task_slug":"variational-inference","task_name":"Variational Inference"}],"methods":[{"method_slug":"variational-inference","method_name":"Variational Inference"}],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"syntology_url":null,"atlas_url":"https://app.syntology.ai/?focus=2302.06576","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2302.06576"}},"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/gfnorg/gflownet-em","reach":null}],"summary":{"ran_draft_wrong":3,"unverified":1},"by_repo_kind":{"official":{"samples":4,"ran":3,"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":"4e16af7e5dbea818","entry":"binarize_static","repo":"GFNOrg/GFlowNet-EM","repo_kind":"official","path":"discrete_vae/gfn/train_gfn.py","file_url":"https://github.com/GFNOrg/GFlowNet-EM/blob/HEAD/discrete_vae/gfn/train_gfn.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":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"4e16af7e5dbea818"}},{"code_sha256_prefix":"bf574d554afe6839","entry":"sample","repo":"GFNOrg/GFlowNet-EM","repo_kind":"official","path":"discrete_vae/gfn/train_gfn.py","file_url":"https://github.com/GFNOrg/GFlowNet-EM/blob/HEAD/discrete_vae/gfn/train_gfn.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"MISDECLARED","metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"bf574d554afe6839"}},{"code_sha256_prefix":"0461df5888f82edd","entry":"sleep_step","repo":"GFNOrg/GFlowNet-EM","repo_kind":"official","path":"discrete_vae/gfn/train_gfn.py","file_url":"https://github.com/GFNOrg/GFlowNet-EM/blob/HEAD/discrete_vae/gfn/train_gfn.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"0461df5888f82edd"}},{"code_sha256_prefix":"0fde1f9c55d73261","entry":"GFN_controller","repo":"gfnorg/gflownet-em","repo_kind":"official","path":"grammars/gflownet.py","file_url":"https://github.com/gfnorg/gflownet-em/blob/HEAD/grammars/gflownet.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":"0fde1f9c55d73261"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}