{"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/trajectory-balance-improved-credit-assignment","title":"Trajectory balance: Improved credit assignment in GFlowNets","arxiv_id":"2201.13259","date":"2022-01-31","proceeding":null,"authors":["Nikolay Malkin","Moksh Jain","Emmanuel Bengio","Chen Sun","Yoshua Bengio"],"abstract":"Generative flow networks (GFlowNets) are a method for learning a stochastic policy for generating compositional objects, such as graphs or strings, from a given unnormalized density by sequences of actions, where many possible action sequences may lead to the same object. We find previously proposed learning objectives for GFlowNets, flow matching and detailed balance, which are analogous to temporal difference learning, to be prone to inefficient credit propagation across long action sequences. We thus propose a new learning objective for GFlowNets, trajectory balance, as a more efficient alternative to previously used objectives. We prove that any global minimizer of the trajectory balance objective can define a policy that samples exactly from the target distribution. In experiments on four distinct domains, we empirically demonstrate the benefits of the trajectory balance objective for GFlowNet convergence, diversity of generated samples, and robustness to long action sequences and large action spaces.","url_abs":"https://arxiv.org/abs/2201.13259v3","url_pdf":"https://arxiv.org/pdf/2201.13259v3.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":"trajectory-balance-improved-credit-assignment","repo_url":"https://github.com/gfnorg/gflownet","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":0,"framework":"pytorch","reach":null},{"paper_slug":"trajectory-balance-improved-credit-assignment","repo_url":"https://github.com/hsjang0/Pessimistic-Backward-Policy-for-GFlowNets","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok"}},{"paper_slug":"trajectory-balance-improved-credit-assignment","repo_url":"https://github.com/lazaratan/gflownet-generalization","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":null},{"paper_slug":"trajectory-balance-improved-credit-assignment","repo_url":"https://github.com/recursionpharma/gflownet","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":null}],"tasks":[{"task_slug":"diversity","task_name":"Diversity"}],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2201.13259","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2201.13259"}},"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/lazaratan/gflownet-generalization","reach":null},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/recursionpharma/gflownet","reach":null},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/gfnorg/gflownet","reach":null},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/hsjang0/Pessimistic-Backward-Policy-for-GFlowNets","reach":{"status":"ok"}}],"summary":{"ran":1,"ran_draft_wrong":2,"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":1,"samples":[{"code_sha256_prefix":"644b5f0c8372a611","entry":"FlowNet_TBAgent","repo":"gfnorg/gflownet","repo_kind":"official","path":"grid/cond_grid_dag.py","file_url":"https://github.com/gfnorg/gflownet/blob/HEAD/grid/cond_grid_dag.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":"644b5f0c8372a611"}},{"code_sha256_prefix":"c59313aa188e63c6","entry":"make_mlp","repo":"gfnorg/gflownet","repo_kind":"official","path":"grid/cond_grid_dag.py","file_url":"https://github.com/gfnorg/gflownet/blob/HEAD/grid/cond_grid_dag.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":"c59313aa188e63c6"}},{"code_sha256_prefix":"2b63a9198ca42b4e","entry":"make_mlp","repo":null,"repo_kind":null,"path":null,"file_url":null,"link_basis":"identical_code_first_harvested_elsewhere","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"MISDECLARED","metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":null,"inline_ok":false,"mcp_get_code":{"code_sha256":"2b63a9198ca42b4e"}},{"code_sha256_prefix":"e81128bd6b1cab12","entry":"branin","repo":"gfnorg/gflownet","repo_kind":"official","path":"grid/cond_grid_dag.py","file_url":"https://github.com/gfnorg/gflownet/blob/HEAD/grid/cond_grid_dag.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":"HONOURS","metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"e81128bd6b1cab12"}},{"code_sha256_prefix":"9c972ac9b931bb9e","entry":"currin","repo":"gfnorg/gflownet","repo_kind":"official","path":"grid/cond_grid_dag.py","file_url":"https://github.com/gfnorg/gflownet/blob/HEAD/grid/cond_grid_dag.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":"HONOURS","metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"9c972ac9b931bb9e"}},{"code_sha256_prefix":"df792b9c5dae7a48","entry":"train_model_with_proxy","repo":"gfnorg/gflownet","repo_kind":"official","path":"mols/gflownet.py","file_url":"https://github.com/gfnorg/gflownet/blob/HEAD/mols/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":"df792b9c5dae7a48"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}