English

torchgfn: A PyTorch GFlowNet library

Machine Learning 2026-03-23 v4

Abstract

The growing popularity of generative flow networks (GFlowNets or GFNs) from a range of researchers with diverse backgrounds and areas of expertise necessitates a library that facilitates the testing of new features (e.g., training losses and training policies) against standard benchmark implementations, or on a set of common environments. We present torchgfn, a PyTorch library that aims to address this need. Its core contribution is a modular and decoupled architecture which treats environments, neural network modules, and training objectives as interchangeable components. This provides users with a simple yet powerful API to facilitate rapid prototyping and novel research. Multiple examples are provided, replicating and unifying published results. The library is available on GitHub (https://github.com/GFNOrg/torchgfn) and on pypi (https://pypi.org/project/torchgfn/).

Keywords

Cite

@article{arxiv.2305.14594,
  title  = {torchgfn: A PyTorch GFlowNet library},
  author = {Joseph D. Viviano and Omar G. Younis and Sanghyeok Choi and Victor Schmidt and Yoshua Bengio and Salem Lahlou},
  journal= {arXiv preprint arXiv:2305.14594},
  year   = {2026}
}

Comments

15 pages, 3 figures, 3 tables. Submitted

R2 v1 2026-06-28T10:43:47.527Z