{"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/generative-flow-networks-for-discrete","title":"Generative Flow Networks for Discrete Probabilistic Modeling","arxiv_id":"2202.01361","date":"2022-02-03","proceeding":null,"authors":["Dinghuai Zhang","Nikolay Malkin","Zhen Liu","Alexandra Volokhova","Aaron Courville","Yoshua Bengio"],"abstract":"We present energy-based generative flow networks (EB-GFN), a novel probabilistic modeling algorithm for high-dimensional discrete data. Building upon the theory of generative flow networks (GFlowNets), we model the generation process by a stochastic data construction policy and thus amortize expensive MCMC exploration into a fixed number of actions sampled from a GFlowNet. We show how GFlowNets can approximately perform large-block Gibbs sampling to mix between modes. We propose a framework to jointly train a GFlowNet with an energy function, so that the GFlowNet learns to sample from the energy distribution, while the energy learns with an approximate MLE objective with negative samples from the GFlowNet. We demonstrate EB-GFN's effectiveness on various probabilistic modeling tasks. Code is publicly available at https://github.com/zdhNarsil/EB_GFN.","url_abs":"https://arxiv.org/abs/2202.01361v2","url_pdf":"https://arxiv.org/pdf/2202.01361v2.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":"generative-flow-networks-for-discrete","repo_url":"https://github.com/zdhnarsil/eb_gfn","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"MIT"}},{"paper_slug":"generative-flow-networks-for-discrete","repo_url":"https://github.com/gfnorg/eb_gfn","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":null}],"tasks":[],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2202.01361","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2202.01361"}},"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/zdhNarsil/EB","reach":{"status":"gone","observed_at":"2026-09-17","how":"tree_404+repo_404"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/zdhnarsil/eb_gfn","reach":{"status":"ok","spdx":"MIT"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/gfnorg/eb_gfn","reach":null}],"summary":{"ran":2,"ran_draft_wrong":1,"ran_fixture":1,"unverified":7},"by_repo_kind":{"official":{"samples":8,"ran":1,"repositories":1},"listed":{"samples":3,"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":"a9eee1bd24b1e137","entry":"GFlowNet_Randf_TB","repo":"gfnorg/eb_gfn","repo_kind":"listed","path":"gflownet.py","file_url":"https://github.com/gfnorg/eb_gfn/blob/HEAD/gflownet.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":"a9eee1bd24b1e137"}},{"code_sha256_prefix":"748e67c13d4d482f","entry":"make_mlp","repo":"gfnorg/eb_gfn","repo_kind":"listed","path":"gflownet.py","file_url":"https://github.com/gfnorg/eb_gfn/blob/HEAD/gflownet.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":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"748e67c13d4d482f"}},{"code_sha256_prefix":"646a9f9fd82940a8","entry":"mlp_ebm","repo":"zdhnarsil/eb_gfn","repo_kind":"official","path":"network.py","file_url":"https://github.com/zdhnarsil/eb_gfn/blob/HEAD/network.py","link_basis":"harvester_set","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":"646a9f9fd82940a8"}},{"code_sha256_prefix":"15b88275b738f13f","entry":"tb_mle_randf_loss","repo":"gfnorg/eb_gfn","repo_kind":"listed","path":"gflownet.py","file_url":"https://github.com/gfnorg/eb_gfn/blob/HEAD/gflownet.py","link_basis":"first_harvest_node","language":"python","status":"ran_fixture","verification_level":1,"contract_check":"RAISES","metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"15b88275b738f13f"}},{"code_sha256_prefix":"77c8c9154ca9862d","entry":"estimate_ll","repo":"zdhnarsil/eb_gfn","repo_kind":"official","path":"synthetic/synthetic_utils.py","file_url":"https://github.com/zdhnarsil/eb_gfn/blob/HEAD/synthetic/synthetic_utils.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":"77c8c9154ca9862d"}},{"code_sha256_prefix":"fb6f740cc2299d77","entry":"get_ebm_samples","repo":"zdhnarsil/eb_gfn","repo_kind":"official","path":"synthetic/synthetic_utils.py","file_url":"https://github.com/zdhnarsil/eb_gfn/blob/HEAD/synthetic/synthetic_utils.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":"fb6f740cc2299d77"}},{"code_sha256_prefix":"395de5d1a0676567","entry":"get_true_samples","repo":"zdhnarsil/eb_gfn","repo_kind":"official","path":"synthetic/synthetic_utils.py","file_url":"https://github.com/zdhnarsil/eb_gfn/blob/HEAD/synthetic/synthetic_utils.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":"395de5d1a0676567"}},{"code_sha256_prefix":"94ec778ec432087a","entry":"inf_train_gen","repo":"zdhnarsil/eb_gfn","repo_kind":"official","path":"synthetic/synthetic_data.py","file_url":"https://github.com/zdhnarsil/eb_gfn/blob/HEAD/synthetic/synthetic_data.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":"94ec778ec432087a"}},{"code_sha256_prefix":"5b4889200346ea70","entry":"load_dataset","repo":"zdhnarsil/eb_gfn","repo_kind":"official","path":"utils_data.py","file_url":"https://github.com/zdhnarsil/eb_gfn/blob/HEAD/utils_data.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":"5b4889200346ea70"}},{"code_sha256_prefix":"e3e34d78cb795ec1","entry":"load_dynamic_mnist","repo":"zdhnarsil/eb_gfn","repo_kind":"official","path":"utils_data.py","file_url":"https://github.com/zdhnarsil/eb_gfn/blob/HEAD/utils_data.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":"e3e34d78cb795ec1"}},{"code_sha256_prefix":"17e1040599b7fde6","entry":"tb_mle_learnedpb_loss","repo":"zdhnarsil/eb_gfn","repo_kind":"official","path":"gflownet.py","file_url":"https://github.com/zdhnarsil/eb_gfn/blob/HEAD/gflownet.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":"17e1040599b7fde6"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}