Manuscript Offprint
arXiv:2610.41648On the Generation Order in GFlowNets
ABSTRACT
Sampling from discrete distributions specified by unnormalised probability functions is a classical statistical problem. GFlowNets address this problem by constructing objects sequentially, adding one discrete component at a time in either a predefined or a learned order. The choice of order determines which conditional distributions the neural network must learn, some of which may be easier to learn than others. Yet whether existing GFlowNet algorithms discover interpretable generation orders and make use of them during training remains unexplored. We introduce controlled problems where generation order is experimentally shown to affect convergence and standard GFlowNet training struggles to discover useful orders. To address this difficulty, we develop Learning-Order GFlowNet, a training recipe that learns interpretable generation orders without order annotations and improves convergence on these problems. Finally, we investigate gradient signal-to-noise ratio (SNR) as a possible explanation for order emergence: orders associated with faster convergence exhibit higher SNR at comparable validation loss, suggesting both a mechanism favouring their emergence and an SNR-based characterisation of a good generation order.
1 INTRODUCTION
We consider the problem of sampling from a discrete space . Given an unnormalised probability function , also called a reward function, our goal is to sample from
where is the target distribution and is its normalisation constant. The space consists of complete discrete objects, and is generally intractable to compute. This is a classical problem with many applications, for example, in drug discovery (Bengio et al., 2021; Cretu et al., 2025) and graph combinatorial optimisation (Zhang et al., 2023).
Many discrete objects admit a hierarchical decomposition, and GFlowNets (Bengio et al., 2021; Malkin et al., 2022) provide an amortised approach to sampling based on this decomposition. Backward, or decomposing, actions define a directed acyclic graph (DAG) in which complete objects from are progressively decomposed to an empty state. Reversing these edges gives the forward, or generative, actions and associated DAG: objects are constructed from the empty state through a sequence of intermediate states. The backward policy determines the distribution over decomposition orders. It can be fixed, for example by selecting uniformly among removable components or by following a predefined order, as in autoregressive generation. Alternatively, Malkin et al. (2022) parameterise the backward policy alongside the forward policy and learn them jointly. However, which generation orders emerge from this joint learning, and why they emerge, remain insufficiently understood.
In the generative modelling, it was shown that generation order can change the performance of a trained model (Vinyals et al., 2015). While some domains have common orders, for example, text is
*Equal contribution.
often generated from left to right, some domains, like graphs, do not have a preferred ordering (Chen et al., 2021; Wang et al., 2025). Any-order autoregressive models avoid a fixed order by training over uniformly sampled permutations of the data dimensions (Uria et al., 2014), but such order-agnostic models can underperform fixed-order autoregressive models (Hoogeboom et al., 2022). A possible explanation is that a neural network is trained to fit conditional distributions across all reveal orders, including difficult prediction problems, without learning a preference for more suitable orders (Wang et al., 2025; Kim et al., 2025). This motivates learning generation orders that expose tractable conditionals for the target distribution.
In this work, we study interpretable and learnable order in sequential sampling via GFlowNets framework. We outline our main contributions as follows:
-
We introduce discrete sampling problems in which the generation order changes the difficulty of conditional prediction, and study the effect of the choice of generation order on sampler performance.
-
We introduce and ablate Learning-Order GFlowNet (LO-GFlowNet) – a training recipe that allows learning generation orders reflecting the underlying dependencies of the problems.
-
We suggest a possible explanation for the emergence of interpretable orders through the analysis of gradient signal-to-noise ratio (SNR).
2.1 PROBLEMS
We consider strings over an alphabet . A forward action fills one empty position with a symbol, and a backward action erases one filled position.
Markov-chain strings. We consider strings drawn from a first-order Markov chain with a high probability of repeating the preceding symbol. The first symbol is uniform, and each subsequent symbol copies its predecessor with high probability ; otherwise, it is drawn uniformly from the other symbols:
Generating in left-to-right position order exposes a one-step conditional at every move. Other orders can require predictions conditioned on observations on both sides of an empty position.
Checksum dependencies. A string consists of a prefix where each symbol is uniformly sampled from the vocabulary and a dependent suffix . For fixed functions , the target is
Similarly to Markov-chain strings, we replace suffix symbols with random ones with probability . In the linear-checksum construction, for a fixed integer matrix . In the half-sum construction, each sums a specified collection of prefix symbols modulo ; for pairwise dependencies, . Generating the required inputs before a suffix symbol turns its prediction into evaluating the corresponding arithmetic rule.
DAG checksum dependencies. We consider a directed acyclic graph , with alphabet and root set . The roots are sampled independently and uniformly. Each other node is assigned the sum of its parents modulo with probability ; otherwise, one of the remaining values is chosen uniformly. Writing , we define the reward as
This environment generalizes checksum dependencies from sequences to directed acyclic graphs. The graph structure is provided to the sampler, but no generation order is prescribed.
Sudoku. We also consider conditional generation of Sudoku boards. Each puzzle specifies a set of fixed clues, and the sampler fills the remaining cells with digits from . A valid completion contains each digit exactly once in every row, column, and block. Forward actions choose an empty cell and a digit; backward actions erase a generated digit while leaving the original clues unchanged. Each puzzle defines a separate conditional target problem over complete boards consistent with its clues:
Here counts duplicate digits across the 27 rows, columns, and blocks: a digit appearing times in a unit contributes . Consequently, precisely for valid complete boards. Incorrect completions retain a positive reward, providing a graded signal instead of rewarding only fully solved puzzles.
Appendix E includes additional discussion and illustrations of these problems, and environment hyperparameters.
2.2 LEARNING-ORDER GFLOWNETS
First, we remind how a GFlowNet can be trained with the loss from Malkin et al. (2022) and then show how to modify the recipe so that the model automatically learns an interpretable order related to a target problem. Note that LO-GFlowNet does not use hand-designed labels of any orders, which suggests that it is able to uncover meaningful structures in new problems.
Training a GFlowNet with Trajectory Balance Malkin et al. (2022) introduce the Trajectory Balance (TB) loss to match forward and backward trajectory distributions:
where is the forward trajectory probability, and is the corresponding backward trajectory weight, with a learned normalising constant. If the expected loss is zero under any full-support trajectory distribution, the forward and backward distributions match, and equals the reward partition function. By the data-processing inequality (Kullback & Leibler, 1951), the terminal marginals also match, hence, the model samples exactly from the target distribution. For any valid backward policy, there is a unique matching forward policy on states with positive flow (Malkin et al., 2022; Bengio et al., 2023). The backward policy is usually fixed to be uniform or to follow a predefined order; less often, it is also parametrised by and learned jointly with the forward policy. Since GFlowNets are usually trained without a dataset of target samples, is minimised over trajectories sampled from the current forward policy, possibly augmented with epsilon-greedy exploration.
Training choices that promote order emergence. We find that standard GFlowNet training does not reliably produce structured generation orders. To encourage their emergence, we investigate the following design choices: factorising the forward policy into position and symbol distributions, regularising backward-policy entropy, uniformly initialising the forward-position and backward-policy heads, reducing their learning rates, branching multiple continuations from shared states.
Forward policy factorisation. A common parametrisation of the forward policy predicts an matrix of logits, masks invalid actions, and applies a softmax over all position-symbol pairs. Following Emelianenko et al. (2019); Wang et al. (2025), we instead factorise the policy as . We find that this parametrisation promotes order emergence. In practice, two linear heads predict a length- vector of position logits and an matrix of symbol logits. These are normalised separately: over valid positions for the position policy and over symbols at each position for the conditional symbol policy.
Backward policy entropy regularisation. For each valid backward policy, there is a unique matching forward policy on states with positive flow that achieves zero TB loss and samples from the target distribution. Thus, the TB objective alone does not select a particular decomposition order. We seek structured solutions with a consistent choice of which position to erase at each state. To encourage such solutions, we add a backward-policy entropy penalty to the training loss, weighted by . Minimising this term favours low-entropy, increasingly deterministic backward policies.
Uniform order-policy initialisation and reduced learning rates. We initialise the weights and biases of the final forward-position and backward-policy layers to zero, yielding uniform distributions over valid positions while retaining random initialisation for the symbol head. We also multiply both order-head learning rates by . These choices are intended to prevent arbitrary initial order preferences from being reinforced before the symbol predictor learns useful dependencies. Related techniques have been used previously: Gritsaev et al. (2025) initialise the backward policy uniformly and use a smaller backward-policy learning rate to stabilize GFlowNet training. We extend these choices to the forward-position head of our factorised policy. Uniform-order pretraining has also been used in order-learning models (Vinyals et al., 2015; Emelianenko et al., 2019); our approach instead starts from uniform position policies and learns them jointly with symbol prediction from the first update, without a separate pretraining phase.
Branching continuations. We sample multiple continuations from shared intermediate states, allowing the model to explore different subsequent position and symbol choices from the same context. Our branching variant uses four descendants per shared prefix while keeping the total number of fresh trajectories per iteration unchanged. Branching is less critical than the other components: our recipe already learns structured orders and often converges without it.
3 EXPERIMENTS
Ablation study experiments. Table 1 shows that the components of our training recipe contribute jointly to reliable convergence. On checksum dependencies, the full recipe converges in four of five runs, with an average of 72 900 iterations when non-converged runs are assigned 100 000 iterations. Removing backward entropy regularisation reduces convergence to one of five runs; removing policy factorisation or the reduced order-head learning rate yields two of five converged runs. Uniform initialisation also helps: with the same reduced learning rates, replacing it with the default initialisation reduces convergence from four to three runs and increases the average to 88 650 iterations. These comparisons suggest that both the initial order distribution and its rate of adaptation matter.
The optimal entropy coefficient depends on the problem. On checksum dependencies, increasing from 1 to 3 reduces the number of converged runs from four to two. On Markov-chain strings, both coefficients yield four converged runs, while gives a lower average iteration count (Appendix B, Table 3). Branching provides an additional, but less essential, improvement.
Our training recipe learns interpretable generation orders that reflect the dependencies of each problem: locally consecutive generation on Markov-chain strings and a preference for generating prefix symbols early on checksum dependencies. Appendix B illustrates and quantifies these patterns across ablation configurations and traces their emergence during training. Importantly, the training is split in two phases: an initial order-search phase, followed by learning symbol prediction under a largely stable order. Appendix B also extends the ablation study to Markov-chain strings, where we observe essentially the same results for each design choice.
Generation order significantly affects convergence. For checksum dependencies, we consider GFlowNets with fixed generation orders: is the identity permutation, and is obtained by applying swaps, each exchanging a previously unswapped prefix position with a previously unswapped suffix position. As increases, the fraction of converged runs decreases and the average
Table 1: Ablation study on Checksum dependencies. Each configuration uses 5 random seeds. Average iterations include all seeds, assigning 100 000 iterations to each non-converged run.
| Setup | Converged | Avg. iterations | |
|---|---|---|---|
| w/o logits factorisation | 2/5 | 96 700 | |
| w/o backward entropy | 1/5 | 95 000 | |
| w/o reduced order-head lr | 2/5 | 84 200 | |
| w/o uniform initialization | 1/5 | 95 100 | |
| 3/5 | 88 650 | ||
| Our training recipe | 4/5 | 72 900 | |
| 2/5 | 77 050 | ||
| with branching | 4/5 | 67 800 |
Figure 1: Results on checksum dependencies. Left: number of converged runs and average number of iterations, assigning 100 000 iterations to non-converged runs. Fixed orders with disjoint prefix–suffix swaps, random fixed orders, and uniform use ten seeds each. LO-GFlowNet uses the best configuration from Table 1: our training recipe with branching, , and , evaluated over five seeds. Right: ELBO (top) and EUBO (bottom) for , LO-GFlowNet, and uniform . Curves show the 50th percentile and shaded bands the 20th–80th percentiles, computed in log-space for –ELBO and EUBO, with the ELBO sign restored.
| Sampler | Avg. | |
|---|---|---|
| Converged | iterations | |
| Fixed order | ||
| 10/10 | 8 575 | |
| 10/10 | 13 475 | |
| 9/10 | 29 550 | |
| 7/10 | 43 750 | |
| 6/10 | 58 750 | |
| 3/10 | 82 225 | |
| 2/10 | 91 525 | |
| 1/10 | 97 275 | |
| Random fixed order | 2/10 | 87 225 |
| Uniform | 0/10 | 100 000 |
| LO-GFlowNet | 4/5 | 67 800 |

number of training iterations increases (Figure 1). Uniformly sampled fixed random orders converge in only two out of ten runs.
Backward policy choice matters beyond fixed orders. A uniform backward policy yields no converged runs within the allocated training budget. This is consistent with the hypothesis that learning symbol distributions across many generation orders is harder than learning those associated with a single fixed order. In contrast, LO-GFlowNet converges in four out of five runs, averaging 67 800 iterations when non-converged runs are counted as 100 000 iterations. Unlike fixed-order samplers, LO-GFlowNet spends part of this budget learning a generation order, before improving symbol prediction under a largely stable order. Figure 6 shows that it learns structured, prefix-early generation orders, consistent with the dependencies of the problem and the advantage of prefix-first generation observed in the fixed-order experiments.
Our findings extend to graph-generation. We next consider DAG checksum dependencies, where the dependencies between nodes vary across graphs. We compare LO-GFlowNet with an autoregressive GFlowNet that uses a fixed random generation order. Both methods use the same network architecture and are trained on 4,000 graphs, with evaluation on 500 unseen graphs. LO-GFlowNet outperforms the fixed-order baseline across all five runs (Table 2). This is consistent with the advantage of generating parents before their children: while a fixed random order often requires predicting node values before their parents are known, LO-GFlowNet can adapt its generation order to the structure of each graph.
Table 2: Results on DAG checksum dependencies. Mean and standard deviation over five seeds, evaluated on 500 unseen graphs.
| Sampler | Converged | ELBO ↑ | EUBO ↓ |
|---|---|---|---|
| Random fixed order | 0/5 | ||
| LO-GFlowNet | 5/5 |
4 A POSSIBLE EXPLANATION OF ORDER EMERGENCE: GRADIENTS SNR
Since a GFlowNet can occasionally converge even under suboptimal orders, it is not obvious why the training leads to non-random orders. In this section, we suggest a possible explanation for the emergence of interpretable orders. Our hypothesis is that some orders expose dependencies that the symbol network can learn more easily through more consistent gradient directions. To measure this, we evaluate gradients SNR (also called GNR in Fan et al. (2022)).
We fix a dataset of terminal strings sampled from the exact target distribution and use it to evaluate the validation TB loss. For fixed orders, each terminal defines a deterministic trajectory; for LO-GFlowNet, we construct a trajectory using its current backward policy. This validation loss serves as a diagnostic of convergence. Separately, at each checkpoint saved every 500 iterations, we sample fresh trajectories from the current forward policy without exploration to measure gradient signal and noise. We define the reference gradient over the dataset, signal, noise, and SNR, respectively:
A higher SNR at a fixed loss indicates for a more consistent gradient direction. Here we independently sample minibatches of 256 trajectories each, with replacement, and is the gradient over the minibatch . Target terminal samples for validation and minibatch index draws are reused across models within each problem; the forward-policy trajectories used for gradient diagnostics are sampled anew at each checkpoint.


Figure 2: Squared gradient SNR on current-policy trajectories versus target-based validation TB loss for checksum dependencies. Panels show individual runs (left) and pooled measurements (right) for and LO-GFlowNet, retaining only converged runs. All valid checkpoints are displayed, including those with loss above . The left panel uses the first converged seed per configuration. The right panel pools 10, 7, 3, and 4 converged seeds, respectively. Individual checkpoints are connected in training order. Dashed lines are separate least-squares regressions in log-log space, fitted using validation loss below .
Figure 2 compares individual training trajectories and pooled measurements for checksum dependencies. Among converged runs, LO-GFlowNet reaches SNR comparable to , and both show higher SNR than and . As demonstrated experimentally in Section 3, increasing generally produces less useful generation orders in terms of convergence. Together, these observations suggest a more formal characterisation of a good generation order: one that provides a higher gradient SNR at comparable loss values, enabling more consistent updates.
We hypothesise that higher SNR favours the emergence of good orders during training: gradients associated with good orders provide a consistent signal, whereas those associated with poor orders exhibit stronger cancellation, making the useful update harder to distinguish from noise. Individual results for all ten seeds are shown in Appendix D.
5 RELATED WORK
Generative Flow Networks. Bengio et al. (2021) introduced GFlowNets trained with a flow matching loss. This formulation does not explicitly parameterise a backward policy and generally admits infinitely many solutions. Later objectives (Malkin et al., 2022; Bengio et al., 2023; Madan et al., 2023; Tiapkin et al., 2024; Zykova-Myzina et al., 2026) introduce an explicit backward policy that, together with the reward function, defines a target distribution over trajectories for the forward policy to match. For each fixed backward policy, there is a unique matching forward policy on states with positive flow, and these training objectives using a backward policy generally outperform the flow matching loss. Another finding of Tiapkin et al. (2024); Deleu et al. (2024) is that GFlowNet training is equivalent to entropy-regularised reinforcement learning (RL) when the backward policy is fixed. From this perspective, the GFlowNet backward policy is equivalent to the RL reward, and the forward policy is an RL agent. A learnable backward policy is a unique feature of GFlowNets that distinguishes it from RL and defines the generation order. It was originally introduced in Malkin et al. (2022). Subsequent works (Mohammadpour et al., 2024; Gritsaev et al., 2025) proposed backward policy training approaches that improve convergence: Mohammadpour et al. (2024) derive a backward policy whose matching forward policy maximises trajectory entropy, and Gritsaev et al. (2025) propose a backward policy loss that minimises the KL divergence between forward and backward trajectory distributions, together with practical stabilization techniques that accelerate GFlowNet training. How learned generation orders reflect the target's dependencies, and which mechanisms drive their emergence, remain insufficiently understood. To the best of our knowledge, this work is the first to construct the discrete sampling problems where order matters, adapt GFlowNets algorithms so that meaningful order emerges and explore why it emerges.
Order in Data-based Generative Models. Early work studied generation order in autoregressive models. Vinyals et al. (2015) show that input and output order can noticeably affect learning in graphical models, combinatorial problems, and language modelling. They also propose likelihood-based output-order search, alternating model-guided selection of output permutations with updates to the sequence model. Crucially, they find that immediately selecting the highest-likelihood order can reinforce an arbitrary initial preference. To mitigate this, they pretrain with uniformly sampled orders and subsequently sample orders according to their likelihood under the current model. These findings highlight the importance of exploration before order specialisation, which is also relevant to our use of uniform position-policy initialisation and stochastic order sampling. Although their fixed-order comparisons cover several domains, their experiments with learned generation orders are limited to five-gram modelling. Emelianenko et al. (2019) introduce an insertion-based sequence model that learns input-dependent generation orders without order annotations, with applications to machine translation, image-to-LaTeX conversion, and image captioning. Their training objective uses a sampled likelihood bound designed to concentrate probability on one or a few convenient insertion trajectories. They find that sampled trajectory selection is more robust than approximate argmax selection, and that pretraining with uniformly sampled valid trajectories improves performance and training robustness. Their analysis is consistent with an easy-first strategy: tokens that are predictable from the input tend to be generated early, while choices requiring more output context are deferred. The preferred orders vary across examples and tasks. Chen et al. (2021) treat node order as a latent variable and jointly train an autoregressive graph generator and a variational order distribution by maximising a likelihood lower bound. Their learned order preferences reflect graph structure, including generating communities one at a time. Wang et al. (2025) learn flexi-ble generation orders over data dimensions, including both node and edge attributes in molecular graphs. Their model jointly learns a state-dependent position policy and a value predictor by maximising a likelihood lower bound, using a learned auxiliary variational order distribution conditioned on complete training examples. The learned policies exhibit interpretable preferences: generating bonds before atom types in molecular graphs and border pixels before the central digit in MNIST images. Their analysis suggests a preference for high-certainty predictions. They also show that prescribing an edges-first policy with uniform sampling within edge and node groups does not recover the performance of the learned policy. Both Emelianenko et al. (2019) and Wang et al. (2025) parameterise each generation step as position selection followed by value prediction, a choice that our ablations also find beneficial. More recent advances in generative modelling have also brought attention to discrete diffusion models and its generation order. We discuss relevant literature in Appendix A. While providing useful insights into order modelling, the data-based methods discussed above rely on target samples for training, whereas our focus is on sampling and order emergence under GFlowNet training without such samples. Additionally, we suggest a possible explanation for why order emerges, and our analysis method may also be applied to the models discussed above.
6 CONCLUSION
In this paper, we introduced three synthetic generation tasks: Markov-chain strings and string-based and graph-based checksum dependencies. We also formulated Sudoku as a sampling problem. On these tasks, we showed that the choice of backward policy and decomposition order affects sampler convergence. We proposed LO-GFlowNets, a training recipe that encourages the emergence of interpretable and useful generation orders without order annotations or problem-specific ordering rules. These findings suggest that LO-GFlowNets may uncover similar dependencies in new problems. On checksum dependencies, our recipe converges more often than fixed random generation orders and the ablated learned backward policy configurations. Finally, we proposed a possible explanation for the emergence of meaningful, non-random orders: orders associated with faster convergence exhibit higher gradient SNR at comparable loss values. This hypothesis suggests an operational criterion for a “good” order: one that provides a higher SNR under a matched evaluation protocol.
Limitations. LO-GFlowNets do not converge faster than naive autoregressive GFlowNets on the most complex among the considered tasks, Sudoku. While the proposed method is useful for checksum dependencies and its extension to graphs, it is required to demonstrate a convergence advantage on more complex problems. This would show a potential of LO-GFlowNets broad applicability. Our work should be extended with controlled problems where an optimal order is state-dependent, unlike Markov-chain strings and checksum dependencies, which exhibit “global” order independence from the state.
REFERENCES
Grigory Bartosh, Teodora Pandeva, Sushrut Karmalkar, and Javier Zazo. Forward-learned discrete diffusion: Learning how to noise to denoise faster. In International Conference on Learning Representations, 2026. URL https://openreview.net/forum?id=45EtKUDgbJ.
Emmanuel Bengio, Moksh Jain, Maksym Korablyov, Doina Precup, and Yoshua Bengio. Flow network based generative models for non-iterative diverse candidate generation. Advances in neural information processing systems, 34:27381–27394, 2021.
Yoshua Bengio, Salem Lahlou, Tristan Deleu, Edward J Hu, Mo Tiwari, and Emmanuel Bengio. Gflownet foundations. Journal of Machine Learning Research, 24(210):1–55, 2023.
Denis Blessing, Xiaogang Jia, Johannes Esslinger, Francisco Vargas, and Gerhard Neumann. Beyond ELBOs: A large-scale evaluation of variational methods for sampling. arXiv preprint arXiv:2406.07423, 2024.
Arran Carter, Sanghyeok Choi, Kirill Tamogashev, Víctor Elvira, and Esmeralda S. Whitammer. Discrete diffusion samplers and bridges: Off-policy algorithms and applications in latent spaces. In Tong Zhang, Miroslav Dudik, Martin Jaggi, Alekh Agarwal, Sharon Li, Dale Schuurmans, Jerry Zhu, Felix Berkenkamp, Hanze Dong, and Alberto Bietti (eds.), Proceedings of the 43rd International Conference on Machine Learning, volume 306 of Proceedings of Machine Learning
Research, pp. 11895–11921. PMLR, 06–11 Jul 2026. URL https://proceedings.mlr.press/v306/carter26a.html.
Huiwen Chang, Han Zhang, Lu Jiang, Ce Liu, and William T Freeman. Maskgit: Masked generative image transformer. In 2022 IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), pp. 11305–11315. IEEE, 2022.
Xiaohui Chen, Xu Han, Jiajing Hu, Francisco J. R. Ruiz, and Liping Liu. Order matters: Probabilistic modeling of node sequence for graph generation. In International Conference on Machine Learning, 2021. URL https://arxiv.org/abs/2106.06189.
Miruna Cretu, Charles Harris, Ilia Igashov, Arne Schneuing, Marwin Segler, Bruno Correia, Julien Roy, Emmanuel Bengio, and Pietro Liò. Synflownet: Design of diverse and novel molecules with synthesis constraints. In International Conference on Learning Representations, volume 2025, pp. 47101–47126, 2025.
Tristan Deleu, Padideh Nouri, Nikolay Malkin, Doina Precup, and Yoshua Bengio. Discrete probabilistic inference as control in multi-path environments. In Proceedings of the Fortieth Conference on Uncertainty in Artificial Intelligence, UAI '24. JMLR.org, 2024.
Tom Dillon. Tdoku: A fast sudoku solver and generator. https://github.com/t-dillon/tdoku, 2019. Companion documentation available at https://t-dillon.github.io/tdoku/.
Dmitrii Emelianenko, Elena Voita, and Pavel Serdyukov. Sequence modeling with unconstrained generation order. In Advances in Neural Information Processing Systems, 2019. URL https://arxiv.org/abs/1911.00176.
Caoyun Fan, Wenqing Chen, Jidong Tian, Yitian Li, Hao He, and Yaohui Jin. Maxgnr: A dynamic weight strategy via maximizing gradient-to-noise ratio for multi-task learning. In Asian Conference on Computer Vision, pp. 523–538. Springer, 2022.
Prateek Garg, Bhavya Kohli, and Sunita Sarawagi. Masked diffusion models are secretly learned-order autoregressive models. arXiv preprint arXiv:2511.19152, 2025. URL https://arxiv.org/abs/2511.19152.
Timofei Gritsaev, Nikita Morozov, Sergey Samsonov, and Daniil Tiapkin. Optimizing backward policies in gflownets via trajectory likelihood maximization. In International Conference on Learning Representations, volume 2025, pp. 98281–98301, 2025.
Wei Guo, Jaemoo Choi, Yuchen Zhu, Molei Tao, and Yongxin Chen. Proximal diffusion neural sampler. In The Fourteenth International Conference on Learning Representations, 2026. URL https://openreview.net/forum?id=XTHQqS7ObC.
Emiel Hoogeboom, Alexey A. Gritsenko, Jasmijn Bastings, Ben Poole, Rianne van den Berg, and Tim Salimans. Autoregressive diffusion models. In International Conference on Learning Representations, 2022. URL https://arxiv.org/abs/2110.02037.
Jaeyeon Kim, Kulin Shah, Vasilis Kontonis, Sham Kakade, and Sitan Chen. Train for the worst, plan for the best: Understanding token ordering in masked diffusions. In International Conference on Machine Learning, 2025. URL https://arxiv.org/abs/2502.06768.
Jaeyeon Kim, Jonathan Geuter, David Alvarez-Melis, Sham Kakade, and Sitan Chen. Stop training for the worst: Progressive unmasking accelerates masked diffusion training. arXiv preprint arXiv:2602.10314, 2026a. URL https://arxiv.org/abs/2602.10314.
Jaeyeon Kim, Lee Kit, Carles Domingo i Enrich, Yilun Du, Sham Kakade, Timothy Ngotiaoco, Sitan Chen, and Michael Albergo. Any-order flexible length masked diffusion. In International Conference on Learning Representations, volume 2026, pp. 40151–40183, 2026b.
Solomon Kullback and Richard A Leibler. On information and sufficiency. The annals of mathematical statistics, 22(1):79–86, 1951.
Kanika Madan, Jarrid Rector-Brooks, Maksym Korablyov, Emmanuel Bengio, Moksh Jain, Andrei Cristian Nica, Tom Bosc, Yoshua Bengio, and Nikolay Malkin. Learning gflownets from partial episodes for improved convergence and stability. In International Conference on Machine Learning, pp. 23467–23483. PMLR, 2023.
Nikolay Malkin, Moksh Jain, Emmanuel Bengio, Chen Sun, and Yoshua Bengio. Trajectory balance: Improved credit assignment in GFlowNets. In Advances in Neural Information Processing Systems, 2022. URL https://arxiv.org/abs/2201.13259.
Sobhan Mohammadpour, Emmanuel Bengio, Emma Frejinger, and Pierre-Luc Bacon. Maximum entropy gflownets with soft q-learning. In International Conference on Artificial Intelligence and Statistics, pp. 2593–2601. PMLR, 2024.
Dhruvesh Patel, Benjamin Rozonoyer, Gaurav Pandey, Tahira Naseem, Ramón Fernandez Asudillo, and Andrew McCallum. Insertion based sequence generation with learnable order dynamics. In Forty-third International Conference on Machine Learning, 2026. URL https://openreview.net/forum?id=gPxxn38tAK.
David Radcliffe. 3 million sudoku puzzles with ratings, 3.
Litu Rout, Constantine Caramanis, and Sanjay Shakkottai. Anchored diffusion language model. Advances in Neural Information Processing Systems, 38:89607–89661, 2026.
Sebastian Sanokowski, Wilhelm Franz Berghammer, Haoyu Peter Wang, Martin Ennemoser, Sepp Hochreiter, and Sebastian Lehner. Scalable discrete diffusion samplers: Combinatorial optimization and statistical physics. In The Thirteenth International Conference on Learning Representations, 2025. URL https://openreview.net/forum?id=peNgxpbdxB.
Kulin Shah, Nishanth Dikkala, Xin Wang, and Rina Panigrahy. Causal language modeling can elicit search and reasoning capabilities on logic puzzles. Advances in Neural Information Processing Systems, 37:56674–56702, 2024.
Daniil Tiapkin, Nikita Morozov, Alexey Naumov, and Dmitry P Vetrov. Generative flow networks as entropy-regularized rl. In International Conference on Artificial Intelligence and Statistics, pp. 4213–4221. PMLR, 2024.
Daniil Tiapkin, Artem Agarkov, Nikita Morozov, Ian Maksimov, Askar Tsyganov, Timofei Gritsaev, and Sergey Samsonov. gfinx: Fast and scalable library for generative flow networks in jax. arXiv preprint arXiv:2511.16592, 2025.
Benigno Uria, Iain Murray, and Hugo Larochelle. A deep and tractable density estimator. In International Conference on Machine Learning, pp. 467–475. PMLR, 2014.
Oriol Vinyals, Samy Bengio, and Manjunath Kudlur. Order matters: Sequence to sequence for sets. CoRR, abs/1511.06391, 2015. URL https://api.semanticscholar.org/CorpusID:260429228.
Zhe Wang, Jiaxin Shi, Nicolas Heess, Arthur Gretton, and Michalis K. Titsias. Learning-order autoregressive models with application to molecular graph generation. In International Conference on Machine Learning, 2025. URL https://arxiv.org/abs/2503.05979.
Jiacheng Ye, Jiahui Gao, Shansan Gong, Lin Zheng, Xin Jiang, Zhenguo Li, and Lingpeng Kong. Beyond autoregression: Discrete diffusion for complex reasoning and planning. In International Conference on Learning Representations, volume 2025, pp. 77875–77898, 2025.
Dinghuai Zhang, Hanjun Dai, Nikolay Malkin, Aaron C Courville, Yoshua Bengio, and Ling Pan. Let the flows tell: Solving graph combinatorial problems with gflownets. Advances in neural information processing systems, 36:11952–11969, 2023.
Yuchen Zhu, Wei Guo, Jaemoo Choi, Guan-Horng Liu, Yongxin Chen, and Molei Tao. MDNS: Masked diffusion neural sampler via stochastic optimal control. In The Thirty-ninth Annual Conference on Neural Information Processing Systems, 2025. URL https://openreview.net/forum?id=xIH95kXNR2.
Anna Zykova-Myzina, Timofei Gritsaev, Daniil Tiapkin, and Nikita Morozov. Proximal policy optimization for amortized discrete sampling. arXiv preprint arXiv:2606.15793, 2026.
A RELATED WORK IN DISCRETE DIFFUSION MODELLING
In this section, we discuss discrete diffusion models and their adaptation to sampling from unnormalised distributions. Masked diffusion is closely related to any-order autoregressive modelling (Hoogeboom et al., 2022). While considered autoregressive samplers fill one position per step, discrete diffusion samplers can update multiple positions per neural network evaluation. However, factorised parallel predictions can introduce approximation error by ignoring dependencies among simultaneously updated tokens. Both model families admit likelihood-based training, with diffusion models commonly trained through variational lower bounds.
Order in discrete diffusion models. Kim et al. (2025) show that standard masked-diffusion training averages over reveal orders and can encounter computationally difficult conditional prediction problems. Confidence-based unmasking can exploit more tractable conditionals at inference (Chang et al., 2022; Ye et al., 2025; Kim et al., 2025). A complementary approach is proposed by Rout et al. (2026), who predict distributions over informative anchor tokens and condition denoising on these predictions, providing useful context without an explicit position-selection policy.
To learn order preferences during training, Garg et al. (2025) optimise coordinate-specific masking schedules, which induce a state-independent distribution over reveal orders. Bartosh et al. (2026) learn a data-dependent noising process to make few-step reverse generation easier. Addressing the training-inference mismatch, Kim et al. (2026a) construct training contexts by following an inference-time unmasking policy while revealing ground-truth tokens, improving training efficiency.
For variable-length generation, Kim et al. (2026b) combine token insertion with unmasking while retaining flexibility in the unmasking order. Building on this formulation, Patel et al. (2026) jointly train the generator and data-dependent insertion and unmasking dynamics, demonstrating that generation order can also be learned through diffusion transition rates.
Discrete diffusion samplers. The discrete diffusion modelling paradigm also extends to sampling from unnormalised distributions without a dataset of target samples (Sanokowski et al., 2025; Zhu et al., 2025; Guo et al., 2026; Carter et al., 2026). Sanokowski et al. (2025) develop memory-efficient training objectives, while Zhu et al. (2025) formulate masked diffusion sampling through stochastic optimal control. Guo et al. (2026) introduce proximal updates on path measures to improve training stability and mode coverage, and Carter et al. (2026) develop off-policy training strategies for discrete diffusion samplers. These methods share with GFlowNets a path-space formulation of sampling, but differ in their corruption kernels, transition structure, and training objectives. Our experiments focus on single-position construction actions. Extending our analysis to learned transition or unmasking schedules in discrete diffusion samplers is a promising direction for future work.
B EXTENDED ABLATION STUDY
In this section, we revalidate our training recipe and repeat ablation study on Markov-chain strings. Additionally, we analyse learned generation orders by Learning-Order GFlowNet on Markov-chain strings and checksum dependencies.
B.1 MARKOV-CHAIN STRINGS
Table 3 presents ablation study on Markov-chain strings. The results are essentially the same as on checksum dependencies, presented in the main section: our training recipe converges more often and faster than runs where some techniques are disabled.
Table 3: Ablation study on Markov-chain strings. Each configuration is launched with 5 random seeds. Average iterations include all seeds, assigning 100 000 iterations to each non-converged run.
| Setup | Converged | Avg. iterations | |
|---|---|---|---|
| w/o logits factorisation | 1/5 | 99 100 | |
| 0/5 | 100 000 | ||
| w/o backward entropy | 0/5 | 100 000 | |
| w/o reduced order-head lr | 1/5 | 95 500 | |
| 1/5 | 98 950 | ||
| w/o uniform initialization | 3/5 | 81 600 | |
| 3/5 | 96 300 | ||
| 0/5 | 100 000 | ||
| 3/5 | 81 650 | ||
| Our training recipe | 4/5 | 79 700 | |
| 4/5 | 71 850 | ||
| 4/5 | 75 450 | ||
| with branching | 5/5 | 73 450 |
Figure 3 shows final generation orders for the selected Markov-chain string ablations. Overall, the samplers tend to generate strings block by block, choosing positions close to the previously generated symbol. Table 4 quantifies this tendency: the average distance between consecutive generated positions is generally smaller than under a uniformly random permutation. However, this statistic does not clearly distinguish our full training recipe from the ablated variants.
Figure 4 shows how generation orders evolve under our training recipe with . Training appears to involve an initial order-search phase, followed by improved symbol prediction under a largely stable order: the same pattern is seen on LO-GFlowNet on checksum dependencies, which we discuss later in this section. Block-wise patterns emerge within roughly the first 20 000–40 000 iterations, well before convergence.

Figure 3: Final generation orders for selected Markov-chain string ablations in Table 3. Each row is one configuration and each column is one seed. Within each panel, eight horizontal strips show independently sampled forward trajectories without exploration; the horizontal axis indexes the 40 string positions. Dark purple denotes the first generated position and yellow the last. Orders are sampled from each run's final available checkpoint. Panel titles indicate whether the run converged (dark green) or did not converge (red). The horizontal dashed line separates the ablated configurations from our training recipe and its variants.

Figure 4: Evolution of generation orders for our training recipe on Markov-chain strings, with , uniform initialization, and . Columns correspond to seeds and rows to training iterations, shown at initialization and every 10 000 iterations. For seeds 0–2, intermediate snapshots are one iteration after the row labels. The bottom row shows each run's final checkpoint, with its exact iteration and convergence status. Each panel contains eight forward trajectories sampled without exploration across the 40 string positions. Dark purple denotes earlier generation and yellow later generation. Dashes indicate checkpoints beyond a run's stopping iteration.
Table 4: Average distance between consecutive generated positions for the Markov-chain string ablations in Figure 3. For a generation order , we compute and average over five seeds and eight forward trajectories per seed, sampled without exploration, including non-converged runs. Smaller values indicate more local generation orders. Reference rows give the expected distance for a uniformly random permutation, , and the distance for the identity order.
| Setup | Average distance | |
|---|---|---|
| w/o logits factorisation | 8.26 | |
| w/o backward entropy | 13.36 | |
| w/o reduced order-head lr | 10.18 | |
| w/o uniform initialization | 11.9010.97 | |
| Our training recipe | 9.49 | |
| 11.39 | ||
| with branching | 9.03 | |
| Uniformly random order | Reference | 13.67 |
| Identity order | Reference | 1.00 |
B.2 CHECKSUM DEPENDENCIES
Figure 5 shows generation orders sampled from the final checkpoint of each checksum ablation run: darker colors reflect earlier generation time. Overall, the converged runs tend to generate the prefix earlier. A configuration without logits factorisation sometimes learn prefix-first order, but more often than our training recipe. A configuration with disable backward entropy also tends to generate the prefix first, but it still does not converge within the allocated training budget. Our training recipe tends to follow prefix-order more often than configurations without uniform initialisation and reduced order-head learning rate.
Table 5 quantifies the average generation step of prefix and suffix symbols for these trajectories, quantitatively showing that our training recipe leads to prefix-early generation order.
Figure 6 shows the evolution of generation orders under our training recipe with across random seeds. As on Markov-chain strings, training appears to follow two phases: order search during roughly the first 40 000 iterations, followed by improved symbol prediction under a largely stable order until convergence: LO-GFlowNet initially exhibits convergence speed close to that of the GFlowNet with the uniform backward policy. Another interesting observation is that seeds 0 and 3 converge later than seeds 1 and 2. The orders of the former retain bright, late-generated positions within the prefix (Figure 6), suggesting that these orders are less favourable than those learned by seeds 1 and 2.

Figure 5: Final generation orders for the checksum dependencies ablations in Table 1. Each row is one configuration and each column is one seed. Within each panel, eight horizontal strips show independently sampled forward trajectories without exploration; the horizontal axis indexes the 30 string positions. Dark purple denotes the first generated position and yellow the last. The red dashed line separates the seven-position prefix from the suffix. Panel titles indicate whether the run converged (dark green) or did not converge (red); non-converged runs reached the 100 000-iteration limit. The horizontal dashed line separates the ablated configurations from our training recipe and its variants.

Figure 6: Evolution of generation orders for our training recipe on checksum dependencies, with , uniform initialization, and . Columns correspond to seeds and rows to training iterations, shown at initialization and every 10000 iterations. The bottom row shows each run's final checkpoint, with its iteration and convergence status. Each panel contains eight forward trajectories sampled without exploration. Dark purple denotes earlier generation and yellow later generation; the red dashed line separates the seven-position prefix from the suffix. Dashes indicate checkpoints beyond a run's stopping iteration.
Table 5: Average generation step for prefix and suffix symbols for the checksum dependencies ablations in Table 1. Steps are numbered from 1 to 30. Each configuration averages over five seeds and eight forward trajectories per seed, sampled without exploration, including non-converged runs. Prefix positions are 1–7 and suffix positions are 8–30. The last column is the suffix average minus the prefix average; larger values indicate a stronger average preference for generating prefix symbols earlier. Reference rows give the expected averages under uniformly random orders and the averages when all prefix symbols precede all suffix symbols.
| Setup | Prefix avg. | Suffix avg. | Difference | |
|---|---|---|---|---|
| w/o logits factorisation | 10.52 | 17.02 | 6.50 | |
| w/o backward entropy | 7.68 | 17.88 | 10.21 | |
| w/o reduced order-head lr | 12.51 | 16.41 | 3.89 | |
| w/o uniform initialization | 12.40 | 16.44 | 4.04 | |
| 9.49 | 17.33 | 7.84 | ||
| Our training recipe with branching | 10.36 | 17.06 | 6.70 | |
| 11.80 | 16.63 | 4.83 | ||
| 11.66 | 16.67 | 5.01 | ||
| Uniformly random order | Reference | 15.50 | 15.50 | 0.00 |
| All prefix symbols first | Reference | 4.00 | 19.00 | 15.00 |
C EXPERIMENTS
C.1 MARKOV-CHAIN STRINGS
As for checksum dependencies, we also consider samplers with fixed generation orders during training. To construct a progression of less suitable orders, define as the identity permutation and as a permutation with applied random swaps. Figure 7 (left) shows that average number of training iterations to convergence increases with . Figure 7 (right) compares ELBO and EUBO for , uniform , and LO-GFlowNet. As with checksum dependencies, higher leads to later convergence. However, any order can converge in Markov-chain strings, and only uniform is suboptimal. LO-GFlowNet starts with the uniform backward policy and spends initial budget to find a suitable order as shown in Figure 4, hence, it converges later than the GFlowNet with -order.
Figure 7: Results on Markov-chain strings. Left: number of converged runs and average number of iterations, assigning 100000 iterations to non-converged runs. Fixed orders with random swaps, random fixed orders, and uniform use ten seeds each. LO-GFlowNet uses our training recipe with branching, , and , evaluated over five seeds (Table 3). Right: ELBO (top) and EUBO (bottom) for , uniform , and LO-GFlowNet. Curves show the 50th percentile and shaded bands the 20th–80th percentiles, computed in base-10 log-space for –ELBO and EUBO, with the ELBO sign restored. Converged runs retain their final metrics at later iterations; dashed black lines mark the convergence thresholds.
| Sampler | Converged | Avg. iterations |
|---|---|---|
| Fixed order | ||
| K = 0 | 10/10 | 7 275 |
| K = 5 | 10/10 | 21 275 |
| K = 10 | 10/10 | 29 250 |
| K = 20 | 10/10 | 37 475 |
| K = 40 | 10/10 | 50 600 |
| Random | ||
| fixed order | 10/10 | 42 825 |
| Uniform P_B | 0/10 | 100 000 |
| LO-GFlowNet | 5/5 | 73 450 |

C.2 SUDOKU
We study conditional Sudoku generation at two simplification levels, and , where is the fraction of originally empty cells revealed before training and evaluation. Each puzzle defines a separate sampling problem, and its clues remain fixed. We compare raster-order autoregression, autoregression with a uniformly sampled fixed random order, solver-guided autoregression, and learned generation orders. As a solver-guided order, we use TDoku (Dillon, 2019), an efficient non-neural Sudoku solver combining constraint propagation with search. We recompute its cell choice on the current board; the neural network still predicts the digit. We report correct-digit accuracy, ELBO, and dataset-based IW-EUBO (Appendix F) on the first 50 000 held-out puzzles. Correct-digit accuracy uses greedy digit prediction, whereas ELBO and IW-EUBO use categorical digit sampling.
Order in Sudoku matters: TDoku-order GFlowNets converge faster. Figure 8 compares generation-order strategies on both difficulty levels. TDoku-guided generation achieves higher correct-digit accuracy and improves ELBO and IW-EUBO earlier in training than raster and fixed random orders. For example, on at iteration 901, TDoku order achieves 98.60% correct digits, compared with 96.46% for raster order and 96.70% for fixed random order. These results show that the choice of generation order affects convergence in Sudoku and that a solver-guided order can accelerate training.

Figure 8: Sudoku with ordinary decoding. Correct digits, ELBO, and dataset-based IW-EUBO for (top) and (bottom), using each model's original generation-order policy. For , curves show means and bands show one standard deviation across three seeds, except TDoku, which has one seed; statistics use shared evaluation iterations within each configuration. For , each configuration has one seed. For each difficulty, all curves are truncated at the latest evaluation shared by the configurations and seed cohorts: iteration 896 for and 1 473 for , without interpolation or extrapolation. ELBO and IW-EUBO axes use a symmetric logarithmic scale with a linear region around zero.
Confidence sampling improves performance, but learning a useful generation order remains challenging. The learned-order model uses branching but does not achieve the same convergence advantage as TDoku under its own position policy. To assess whether its digit predictions support more effective orders, we evaluate confidence-based ordering: at each step, it chooses the empty cell whose most probable digit has the highest predicted probability. This changes only the evaluation-time position choice and does not retrain the model. Figure 9 shows that this rule substantially improves the learned-order model's correct-digit accuracy and sampling metrics at both difficulty levels. A model trained with a fixed random order also benefits from this intervention. Thus, the digit network can support better generation orders than those selected by the learned position policy, but learning to exploit this information remains a limitation of our approach.
Alignment with a solver order. In a separate diagnostic run, we evaluate agreement with TDoku on 1 024 fixed held-out puzzles. At every step, we sample a position from the model, insert its correct reference digit, and recompute the solver's next position. Agreement is scored using the model's original position probabilities, without confidence-based ordering. Figure 10 shows the probability assigned to TDoku's next position and top-1 and top-5 agreement as puzzles are filled, at selected training checkpoints. The top row summarises alignment over training, while the remaining rows group measurements by the actual number of empty positions remaining before each move. The drop in top-5 agreement and the cosine-like oscillations that appear around iteration 1 000 reflect the sampler settling into block-by-block generation. It continues to follow this block order throughout the remaining observed training period. The learned policy can therefore exhibit nontrivial solver alignment without reproducing the solver's order. This diagnostic uses correct-digit trajectories and does not measure behaviour after the model makes a digit error.

Figure 9: Sudoku with confidence-based ordering. The same models and metrics as in Figure 8, evaluated by selecting the empty cell whose most probable digit has the highest predicted probability. Rows correspond to (top) and (bottom). Correct-digit accuracy uses greedy digit prediction; ELBO and IW-EUBO use categorical digit sampling. Models are not retrained. Seed cohorts, averaging, and axis scales match Figure 8.
Learned position policy -- Uniform position policy

Figure 10: TDoku alignment while filling Sudoku puzzles, . The top row shows aggregate alignment over training, evaluated every 100 iterations. The remaining rows show training checkpoints at iterations 200, 400, 600, 800, 1000, and 2500. Columns show the probability assigned to TDoku's next position (left), top-1 agreement (middle), and top-5 agreement (right), all in percent. In the top row, the horizontal axis is training iteration; in the remaining rows, it is the actual number of positions remaining before the move, decreasing from left to right. Each checkpoint uses 1 024 fixed held-out puzzles; positions are sampled from the model, correct reference digits are inserted, and TDoku is recomputed at every move. Dashed curves show uniform-position references, for probability and top-1, and for top-5, where is the number of remaining positions. Results are averaged over states with the same , without smoothing. This separate diagnostic run differs from the three-seed quality comparison.
D ADDITIONAL RESULTS ON GRADIENTS SNR
Markov-chain strings. Figure 11 extends the Markov-chain string comparison in Figure 2 to all ten seeds for , showing squared SNR over training iterations and against validation loss. At each checkpoint, the reference gradient is computed from 131 072 fresh trajectories sampled from the current forward policy without exploration. Noise is estimated using 128 minibatches of 256 trajectories, independently sampled with replacement from this trajectory dataset. The validation loss is evaluated separately on a fixed dataset of exact-target terminals, with trajectories constructed using the current backward policy. Thus, SNR describes gradients on the model's own trajectories, while the loss axis measures progress against the target distribution.
Checksum dependencies. Figure 12 shows squared SNR against validation loss for checksum dependencies with and LO-GFlowNet. Within each two-row block, the upper row includes all runs and the lower row retains only converged runs, using matching axis limits for each seed. The converged subset contains ten runs for , seven for , three for , and four for LO-GFlowNet. All valid checkpoints are shown; the loss threshold of applies only to the regression fits in Figure 2. LO-GFlowNet uses our training recipe without branching, with uniform initialization, , and .

Figure 11: Markov-chain strings: squared SNR on current-policy trajectories. Gradients are measured on pure forward-policy samples; the loss axis retains the original target-based full-dataset TB loss. The first two rows show seeds 0–4 and the last two show seeds 5–9. Within each block, the upper row plots squared SNR against training iterations and the lower row against validation loss. All checkpoints after initialization are connected in training order, without smoothing or regression fits.

Figure 12: Checksum dependencies: squared SNR versus validation loss, with and without convergence-based selection. Gradients are evaluated on current-policy trajectories, while the horizontal axis uses the separate target-based validation TB loss. The first two rows show seeds 0–4 and the last two show seeds 5–9. Within each block, the upper row includes all runs and the lower row includes only converged runs. Each seed's paired panels use the same axis limits. LO-GFlowNet was trained on seeds 0–4 only. All valid checkpoints after initialization are connected in training order, without smoothing, loss-based filtering, or regression fits.
E IMPLEMENTATION DETAILS
In all experiments, we use a jax-based library for GFlowNets, gfnx (Tiapkin et al., 2025), that enables fast experimentation.
E.1 ENVIRONMENTS
General intuition. One useful feature of the environments we consider is that their difficulty can be tuned. For Markov-chain strings and checksum dependencies, the length and alphabet size control the size of the state space, while the noise level controls the concentration of the target distribution: smaller makes it sharper. For Sudoku, the board size is fixed at , but the initial puzzles can be simplified. We construct easier variants by revealing the -percent correct digits of the initially unfilled cells. As our experiments show, increasing leads to significantly faster convergence, yielding easier problems.
Markov-chain strings. We use string length , alphabet size , and transition noise . Thus, the first symbol is uniform over the 12 symbols, and each subsequent symbol repeats its predecessor with probability 0.9; each of the other 11 symbols has probability 0.1/11. The exact normalisation constant is . Figure 13 shows the independent samples from the exact target distribution illustrating the local dependencies.

Figure 13: Exact target samples for Markov-chain strings with , , and . Each row is an independently sampled string, and each colour represents a symbol. Long stretches of identical symbols reflect the probability 0.9 of repeating the preceding symbol. The 24 samples are shown without selection or sorting.
Checksum dependencies. We use the pairwise half-sum construction with string length , alphabet size , prefix length , and suffix length . The prefix symbols are independent and uniform. For each suffix position , two prefix indices are sampled independently with replacement at environment initialisation, so the same prefix position may appear twice in a pair. The pairs are fixed throughout all experiments using environment seed 0, and define . Conditional on the prefix, suffix symbols are independent: with probability 0.9 we use , and otherwise sample uniformly from all five symbols. Thus, , the checksum value has probability 0.92, and each other symbol has probability 0.02. We use reward exponent 1, giving the exact normalisation constant . Figure 14 illustrates the prefix-suffix dependencies and the variability of completions conditioned on a fixed prefix.

Prefix 1: eight independent conditional target samples

Prefix 2: eight independent conditional target samples

Figure 14: Checksum dependencies with , , , and . Top: two actual dependencies from environment seed 0, with arrows connecting prefix inputs to their preferred suffix values. Each suffix symbol equals its checksum with probability 0.92 and each other value with probability 0.02. Below: eight independent conditional target samples for each of two uniformly sampled prefixes. Colours encode symbols; red outlines mark deviations from the checksum, and the dashed line separates prefix and suffix.
Sudoku. Our conditional setup uses . We use the puzzles from (Radcliffe, 3; Shah et al., 2024) and construct easier variants by revealing additional -percent of digits, preserving the original training and test splits. Our order-learning experiments use the and variants, which reveal approximately one tenth and three tenths of the originally empty cells, respectively. We train on the train split and measure metrics on the test split. Figure 15 illustrates the nested simplifications of one held-out puzzle and compares training at different simplification levels using the same raster-autoregressive configuration. Revealing more digits substantially increases solved-puzzle accuracy at a given training budget.

Figure 15: Effect of Sudoku difficulty. Left: the same held-out puzzle at (top row), then and its reference solution (bottom row). Original clues are black and additionally revealed digits are blue. Right: raster-order autoregression with the same configuration for . Solved-puzzle accuracy uses greedy decoding on held-out puzzles at the corresponding difficulty. One kuzzle denotes 1 000 training-puzzle presentations.
E.2 ALGORITHM HYPERPARAMETERS
Shared settings for the string problems. We use a Transformer encoder with 3 layers, 8 attention heads, hidden and embedding dimension 64, and feed-forward dimension 64. The dropout rate is 0.1, with no attention dropout. The prediction heads are MLPs with two hidden layers of width 256. In the learned-order model, the symbol, forward-position, and backward-position heads share the forward encoder. The symbol head produces logits, with a separate categorical symbol distribution for each position; the forward-position head produces logits. Fixed-order models also predict a separate symbol distribution for every position, selecting the distribution at the prescribed next position.
We optimise the mean squared TB residual with AdamW, using learning rate for the forward encoder and symbol head, as the default backward-head learning rate, weight decay , and gradient-norm clipping at 1 within each optimiser parameter group. Adam's moment coefficients are and its numerical stabilizer is . The learned scalar log Z starts at zero and has learning rate . These learning rates are constant. Our learned-order recipe uses , giving forward-position and backward-head learning rates and , respectively. We initialise the weights and biases of the final layers of both position heads to zero, giving uniform distributions over valid positions; symbol logits retain their default random initialisation.
Each training iteration samples 512 fresh trajectories. Exploration mixes the forward policy with a uniform distribution over valid actions, with its mixture weight decreasing linearly from 0.3 to 0.01 over the first 50 000 iterations and remaining at 0.01 thereafter. For fixed-order models, exploration changes the symbol but preserves the prescribed position. Where replay is enabled, each iteration additionally performs one separate update on 512 replay trajectories. The buffer holds up to 2 560 000 trajectories and is sampled once it contains at least 12 800. Half of each replay batch is drawn uniformly from the highest-reward 10% of stored trajectories, and the other half from the remaining trajectories. We do not apply importance weights to replay updates. Thus, an iteration denotes a fresh-data cycle and contains two optimiser updates once replay is active. The branching variant preserves the fresh-trajectory budget, using 128 roots with four continuations each.
Markov-chain strings. Our learned-order recipe uses backward-entropy coefficient . We add this positive coefficient times the mean backward-policy entropy over valid trajectory steps to the TB loss, thereby encouraging more deterministic destruction orders. Forward-entropy regularisation is disabled. The fixed-order permutation sweep in Figure 7 uses deterministic backward transitions and no replay buffer; the learned-order ablations use replay unless explicitly stated otherwise. We use ten seeds for the fixed-order sweep and five seeds for each learned-order ablation.
For the fixed-order comparisons, we vary only the generation permutation, using random swaps of the identity order. Each swap exchanges two distinct positions; positions may be reused in subsequent swaps. For each seed, permutations with larger extend the same sequence of swaps. Each resulting generation order remains fixed throughout training and evaluation, and backward transitions erase symbols in the reverse order.
Checksum dependencies. We use the same architecture, optimiser, exploration schedule, and batch sizes. The learned-order recipe uses , with forward-entropy regularisation disabled. Both the fixed-order sweep and the learned-order experiments use replay. We use ten seeds per fixed-order configuration and five seeds per learned-order configuration. Entropy, initialisation, learning-rate, factorisation, and branching ablations change only their specified components. In the joint position–symbol-logit ablation, the forward head retains its default learning rate and only the backward head receives the 0.1 multiplier; uniform initialisation then also makes the initial symbol probabilities uniform.
For the fixed-order comparisons, we use . We sample each prefix–suffix swap uniformly among positions not used in previous swaps. For each seed, larger extends the same sequence of swaps. The resulting order remains fixed throughout training and evaluation, with backward transitions erasing symbols in the reverse order.
Stopping and checkpoints. For both tasks, we train for at most 100 000 iterations and check convergence every 250 iterations. A check estimates each direction of trajectory KL using 2048 trajectories. Both estimates must have absolute value below 0.1 for three successive checks. We then validate with 8 192 trajectories per direction and require each estimate plus twice its standard error to be below 0.1. Since , these criteria correspond to ELBO approaching zero from below and EUBO approaching zero from above. We save resumable checkpoints every 250 iterations and SNR diagnostics every 500 iterations, including a final diagnostic at normal termination. Reported mean convergence iterations assign 100 000 iterations to runs that do not converge within the budget.
F METRICS
We evaluate sampling quality using the evidence lower bound (ELBO) and evidence upper bound (EUBO). We follow the evaluation framework of Blessing et al. (2024), adapted to discrete GFlowNets by Zykova-Myzina et al. (2026). These complementary metrics bound the log normalising constant : ELBO evaluates samples generated by the model, while EUBO evaluates coverage of the target distribution.
ELBO. For trajectories sampled from the forward policy, the evidence lower bound is
Higher values indicate better agreement with the target on trajectories visited by the model. However, ELBO can remain high when the model misses target modes, since those modes are rarely sampled by the forward policy. We estimate the expectation by averaging over sampled trajectories.
EUBO. We sample terminal states from the target distribution and reconstruct trajectories using the backward policy. The evidence upper bound is
Lower values indicate better coverage of the target distribution. Unlike ELBO, EUBO penalises target trajectories to which the forward policy assigns little probability, making it sensitive to missed modes. We estimate the expectation by averaging over target samples and their sampled backward trajectories.
Importance-weighted EUBO (IW-EUBO). EUBO requires terminal samples from the target distribution, which are unavailable for Sudoku. The dataset provides correct solutions, but the reward distribution also assigns probability to incorrect boards. We therefore approximate EUBO using reference solutions and nearby corrupted completions, weighted by their rewards and proposal probabilities.
For each evaluation puzzle, we retain its reference solution and generate two independently corrupted terminal boards. For each corruption, we sample uniformly from , where is the number of originally empty cells. We then choose distinct such positions uniformly and replace each digit by a uniformly chosen different digit. Original clues remain unchanged. This gives one correct completion and two nearby incorrect completions per puzzle. The corresponding proposal is , where is the reference solution. In particular, , and a board differing from in eligible cells has probability .
For a given puzzle, let denote the uniform distribution over its three terminal boards. These boards were constructed using the proposal , rather than sampled from the target distribution. We correct for this difference using importance weights : dividing by accounts for how frequently the proposal generates each board, while multiplying by favours boards according to the target reward. The resulting estimate is
The denominator normalises the importance weights, so the unknown is not needed. We compute these averages over all three boards, sampling a backward trajectory for each, and report the mean of the resulting estimates over all evaluation puzzles. The reference solutions and corruptions are fixed across evaluations. Lower values indicate better coverage of these reward-weighted completions. Unlike EUBO, this metric no longer upper-bounds : self-normalisation introduces finite-sample bias, and the proposal covers only completions within 20 digit changes of the reference solution.
Digit accuracy. For Sudoku, we also evaluate the fraction of originally empty cells filled with the correct reference digit. Let be the evaluation set, the set of initially empty cells in puzzle , its reference solution, and the generated completion. We report
Original clues are excluded, and the counts are pooled across puzzles rather than averaging per-puzzle percentages. Higher values indicate better completion accuracy. For this metric, we decode digits greedily at each chosen position. Ordinary decoding follows the model's generation-order rule; for a learned order, it selects the highest-probability position before selecting the highest-probability digit conditional on that position. Confidence decoding instead selects the empty cell with the largest maximum conditional digit probability. Both variants use the model's own generated digits throughout the trajectory, without reference-digit correction or exploration. Unlike ELBO and IW-EUBO, digit accuracy measures greedy completion quality rather than sampling quality.