Streaming Bayes GFlowNets

Authors: tiago  da silva
daniel  augusto de souza
diego  mesquita
Venue: NeurIPS_cc_2024_Conference
Published: 2024-05-13 14:32:59

Abstract: Bayes' rule naturally allows for inference refinement in a streaming fashion, without the need to recompute posteriors from scratch whenever new data arrives. In principle, Bayesian streaming is straightforward: we update our prior with the available data and use the resulting posterior as a prior when processing the next data chunk. In practice, however, this recipe entails i) approximating an intractable posterior at each time step; and ii) encapsulating results appropriately to allow for posterior propagation. For continuous state spaces, variational inference (VI) is particularly convenient due to its scalability and the tractability of variational posteriors, For discrete state spaces, however, state-of-the-art VI results in analytically intractable approximations that are ill-suited for streaming settings. To enable streaming Bayesian inference over discrete parameter spaces, we propose streaming Bayes GFlowNets (abbreviated as SB-GFlowNets) by leveraging the recently proposed GFlowNets --- a powerful class of amortized samplers for discrete compositional objects. Notably, SB-GFlowNet approximates the initial posterior using a standard GFlowNet and subsequently updates it using a tailored procedure that requires only the newly observed data. Our case studies in linear preference learning and phylogenetic inference showcase the effectiveness of SB-GFlowNets in sampling from an unnormalized posterior in a streaming setting. As expected, we also observe that SB-GFlowNets is significantly faster than repeatedly training a GFlowNet from scratch to sample from the full posterior.

Main paper: 
 introduction: 
 One of the foundations of the Big Data revolution in the sciences and engineering is the use of streaming data that is continuously collected and meant to be processed as it arrives. Many of the large statistical models in use were first formulated for the batched i.i.d. data setting and updating such models in this setting is a challenge of its own, as it would naively require us to revisit all past data at each update to avoid forgetting. [19, 39] In this context, Bayesian inference appears as a natural starting point to learning in the streaming data setting due to its innate property of coherence [5] , which allows learning can happen continuously, independently of how the data is chunked into packages or ordered. More specifically, given a prior distribution p(θ) and a data generating likelihood p(y i | θ), the posterior distribution over a set of data p(θ | y 1 , y 2 ) ∝ p(y 2 | θ)p(y 1 | θ)p(θ), can be written as p(y 2 | θ)p(θ | y 1 ), where first we compute the posterior over y 1 and then used as a prior to compute the posterior over y 2 . As conveniently summarized by Lindley [33] : "Today's posterior is tomorrow's prior".Nonetheless, Bayesian inference is notoriously known for being hard to obtain closed-form solutions. The gold standard of approximate methods, Markov chain Monte Carlo (MCMC), requires that the prior and likelihood distributions probability density/mass functions can be evaluated, however, as it can only obtain samples from posterior, using the previous posterior as the prior of the next time-step requires additional work [6] . Thus, variational inference (VI), another popular approximate Bayes method, appears as the best fit as its foundation lies in directly parameterizing the approximate posterior distribution instead of relying on empirical distributions of samples.Importantly, many problems of interest are built upon a discrete set of parameters. In Bayesian phylogenetic inference (BPI), for example, we are concerned with topologies of phylogenetic trees describing the evolutionary genetic history of a population. This is a especially compelling application of streaming Bayes, allowing researchers to update posteriors over the phylogenetic trees as they decode new nucleobases in genetic sequences -without reprocessing previously decoded nucleobases. In practice, phylogenetic analyses might involve hundreds of thousands of nucleobases.Nonetheless, popular methods for VI over discrete posteriors typically rely on gradient-based optimization (e.g., to maximize evidence lower bounds), requiring the modeling of discrete parameters as transformed versions of latent continuous ones [20, 25, 36] . For methods using VI, a discrete posterior distribution with support over a set of size N would require variational posteriors of dimension N , implying either the storage of large covariance matrices of order N 2 , in the case of continuous reparameterizations, or the use of massively simplifying assumptions such as mean-field, reducing the expressivity of the variational posterior. As an example of support size for discrete distributions, the number of graphs with N nodes grows asymptotically as√ 2 N (N -1)/N! [16] . In this work, we leverage Generative Flow Networks (GFlowNets) [2, 3, 30] to efficiently address the implementation of approximate Bayesian models defined on a discrete set of parameters within a streaming data setting. In summary, GFlowNets are a family of amortized VI methods for highdimensional discrete parameter spaces, that learn the policies of a finite-horizon Markov decision process (MDP) by minimizing a loss function enforcing a balance condition. The condition, in turn, provably ensures that the samples generated from the MDP are correctly distributed. Notably, despite their successful deployment in solving a wide range of problems ([11, 12, 22-24, 32, 34, 63] ), previous approaches assumed that the target (posterior) distribution did not change in time. Hence, this is the first work handling the training of GFlowNets in dynamic environments.More specifically, we propose two novel training schemes to enable GFlowNets on streaming settings. The first consists of directly enforcing a streaming balance condition, which induces a least-squares loss that can be optimized in an off-policy fashion, potentially avoiding issues such as mode collapse. Alternatively, we leverage the well-known relationship between GFlowNets and VI to develop an on-policy divergence-minimizing algorithm that often exhibits faster training convergence when the target distribution is not very sparse. We also analyze theoretically how local errors accumulate through posterior propagation, providing upper bounds on the approximation quality of models learned using both of our update schemes.In summary, our main contributions are:1. We propose a streaming balance condition and a corresponding provably correct algorithm enabling the training of GFlowNets in a streaming data setting (Algorithm 1), without the need to revisit past data;2. We devise an alternative VI algorithm employing low-variance gradient estimators to train to update GFlowNets in streaming fashion (Section 3). ;3. We theoretically analyze how inaccuracies of individual updates propagate to subsequent posterior approximations, bounding the approximation errors accumulated through repeated streaming updates of the model (Section 4); 4. We demonstrate the correctness and effectiveness of our method in a series of streaming tasks, such as Bayesian linear preference learning with integer-valued features (Section 5.2) and online Bayesian phylogenetic inference (Section 5.3). 
preliminaries: 
 Notation and definitions. Let X be a set of compositional objects (e.g., trees with nine nodes) and S ⊇ X be an extension of X (e.g., forests with nine nodes). Define G = (S, A) as a directed acyclic graph (DAG) with nodes in S, adjacency matrix A, and the following properties: (i) G is weakly connected; (ii) there is an unique state s o ∈ S \ X without any incoming edges; and (iii) there are no edges leaving x for every x ∈ X . We call S the set of states, G the state graph, and X the set of terminal states; s o is called the initial state. A forward policy over G is a function p F (v, w) : S × S → R + such that it defines a probability distribution over S with support on v's children in G. A backward policy is a forward policy over G ⊺ = (S, A ⊺ ). To alleviate notation, we denote the set of trajectories that ends in x as {τ | τ ⇝ x}, and define a probability distribution in this set as p F (τ ) = i p F (s i , s i+1 ) and the probability of the backwards trajectory condition on the end point x as p B (τ | x) = i p B (s i+1 , s i ).GFlowNets. We define a GFlowNet as a tuple G = (G, p F , p B , Z) specifying a state graph G, forward p F and backward p B policies, and an estimate Z of a normalizing constant. A GFlowNet induces a probability distribution over X through its forward policy, p ⊤ (x) := τ ⇝x p F (τ ). When there is no risk of ambiguity, we will generally omit G from this notation. We also drop Z when training the GFlowNet with a criterion that does not require it. Following the common convention, we parameterize the forward network by a neural network, and the backward policy at each state is left fixed as a uniform distribution.The task a GFlowNet is trained for is to match its induced distribution p ⊤ (x) with a target distribution π(x) ∝ π(x), where π(x) is an unnormalized distribution. In practice, the agreement between p ⊤ and π can be enforced by a balance condition over trajectories, avoiding references to p ⊤ . For instance, we may enforce trajectory balance (TB) condition, Zp F (τ ) = p B (τ | x)π(x) for all τ ⇝ x, to estimate the parameters of the GFlowNet by minimizingEQUATION)where ξ is a base policy with full support on the space of complete trajectories, i.e., trajectories starting at s o and terminating at s f . Then, we can use the following unbiased estimate to compute the GFlowNet's marginal distribution over terminal states p ⊤ :EQUATIONFor a thorough review of GFlowNets, please refer to [3] .GFlowNets and VI. Malkin et al. [38] showed that the training of GFlowNets may be framed as a variational inference on the target p B (τ ) ∝ π(x)p B (τ |x) with p F as the proposal distribution.Through the data processing inequality, they showed that the minimization of the Kullback-Leibler (KL) divergence between trajectory-level distributions p F and p B incurred in a marginal p ⊤ over X matching the target, namely,D KL [p F ||p B ] ≥ D KL [p ⊤ ||π].Then, they demonstrated the equivalence between the gradients of the on-policy TB loss and the KL divergence, and that the latter is a sound learning objective for GFlowNets. Here, we build upon this construction to design a KL divergence-based algorithm for updating GFlowNets in a streaming context.Problem description. We assume that the data is drawn from a distribution f (•|x) indexed by a parameter x ∈ X and we define π(x) as a prior distribution over X . Let (D i ) i≥1 be a sequence of continually collected independent data sets and π t (x|D 1 , . . . , D t ) ∝ f (D 1 , . . . , D t |x)π(x) := πt (x) be the posterior conditioned on the first t data sets. Note that, due to coherence, we can also writeπt (x) = f (D t |x)π t-1 (x).Question: Does the paper discuss the limitations of the work performed by the authors?Answer: [Yes]Justification: The middle paragraph in Section 7 discusses limitations.Guidelines:• The answer NA means that the paper has no limitation while the answer No means that the paper has limitations, but those are not discussed in the paper.• The authors are encouraged to create a separate "Limitations" section in their paper.• The paper should point out any strong assumptions and how robust the results are to violations of these assumptions (e.g., independence assumptions, noiseless settings, model well-specification, asymptotic approximations only holding locally). The authors should reflect on how these assumptions might be violated in practice and what the implications would be.• The authors should reflect on the scope of the claims made, e.g., if the approach was only tested on a few datasets or with a few runs. In general, empirical results often depend on implicit assumptions, which should be articulated.• The authors should reflect on the factors that influence the performance of the approach. For example, a facial recognition algorithm may perform poorly when image resolution is low or images are taken in low lighting. Or a speech-to-text system might not be used reliably to provide closed captions for online lectures because it fails to handle technical jargon.• The authors should discuss the computational efficiency of the proposed algorithms and how they scale with dataset size.• If applicable, the authors should discuss possible limitations of their approach to address problems of privacy and fairness.• While the authors might fear that complete honesty about limitations might be used by reviewers as grounds for rejection, a worse outcome might be that reviewers discover limitations that aren't acknowledged in the paper. The authors should use their best judgment and recognize that individual actions in favor of transparency play an important role in developing norms that preserve the integrity of the community. Reviewers will be specifically instructed to not penalize honesty concerning limitations.Question: Does the paper report error bars suitably and correctly defined or other appropriate information about the statistical significance of the experiments?Answer: [Yes] Justification: In general, plots count on error bars and tables count on standard deviation.Guidelines:• The answer NA means that the paper does not include experiments.• The authors should answer "Yes" if the results are accompanied by error bars, confidence intervals, or statistical significance tests, at least for the experiments that support the main claims of the paper.• The factors of variability that the error bars are capturing should be clearly stated (for example, train/test split, initialization, random drawing of some parameter, or overall run with given experimental conditions).• The method for calculating the error bars should be explained (closed form formula, call to a library function, bootstrap, etc.)• The assumptions made should be given (e.g., Normally distributed errors).• It should be clear whether the error bar is the standard deviation or the standard error of the mean.• It is OK to report 1-sigma error bars, but one should state it. The authors should preferably report a 2-sigma error bar than state that they have a 96% CI, if the hypothesis of Normality of errors is not verified.• For asymmetric distributions, the authors should be careful not to show in tables or figures symmetric error bars that would yield results that are out of range (e.g. negative error rates).• If error bars are reported in tables or plots, The authors should explain in the text how they were calculated and reference the corresponding figures or tables in the text. 
streaming bayes gflownets: 
 In this section, we propose streaming Bayes GFlowNets (SB-GFlowNets) as an extension of GFlowNets to handle streaming data. In essence, an SB-GFlowNet G t+1 avoids evaluating πt+1 (x), which would require revisiting all the previous data, by maintaining an SB-GFlowNet G t which targets previous posterior πt (x), allowing the target distribution of G t+1 to be f (D t+1 |x)p(t) ⊺ (x), where p (t)⊺ (x) is the induced distribution of G t , thus avoiding the storage of previous data sets. We propose two strategies for matching the target distribution, enforcing the streaming balance (SB) condition (Section 3.1) and applying KL streaming updates (Section 3.2). Importantly, both methods require only newly observed data D t+1 and the previously trained model, G t to update the posterior approximation, without revisiting past data batches D 1:t . These conditions are extensions of TB condition and KL criterion proposed for the batched data case, each with its own strengths and weaknesses. Subsequently, we provide both a theoretical analysis (Section 4) and experimental validation (Section 5) for SB-GFLowNets.In streaming settings,training a GFlowNet to sample from πt+1 ∝ f (D t , . . . , D 1 |x)π(x) by naively enforcing the TB condition entails numerous evaluations of the complete likelihood. However, assuming we have previously trained a GFlowNet to sample from πt (x), we propose a more convenient balance condition that does not refer explicitly to previously-seen data.EQUATIONB , Z t ) be a GFlowNet trained to sample proportionally to the posterior πt (x). The streaming balance (SB) condition for the GFlowNetEQUATIONin which f (D t+1 |x) is the model's likelihood. When the backward policy does not depend on t, e.g., is fixed as an uniform policy, Equation 3 reduces to Z t+1 p(t+1) F (τ ) = Z t p (t) F (τ )f (D t+1 |x).Intuitively, if we consider the TB conditions for the GFlowNets G t and G t+1 :Z t p (t) F (τ ) = πt (x)p (t) B (τ |x) and Z t+1 p (t+1) F (τ ) = f (D t+1 |x)π t (x)p (t+1) B (τ |x),we can re-arrange the identity for G t to obtain the unnormalized posterior a time t, i.e., πt = Ztp (t) F /p (t) B and, then, apply this to the TB condition of G t+1 yielding Equation 3.Naturally, the SB condition gives rise to a loss function by considering the log-squared ratio between the left-and right-hand sides of Equation 3, namely:EQUATIONfor a distribution ξ of full-support over trajectories. Importantly, Proposition 1 ensures that this approach results in a model sampling proportionally to πt+1 (x).Proposition 1 (Soundness of L SB ). Assume p (t) ⊤ (x) ∝ πt (x). Then, if L SB (G t+1 ; G t ) = 0, then p (t+1) ⊤ (x) samples objects from X proportionally to πt+1 (x). Please refer to Algorithm 1 in the supplement for a detailed description of the training of a SB-GFlowNet by minimizing L SB .In practice, estimating log Z t by learning is not straight-forward and, if not done properly, may severely damage the quality of the approximation. Divergence-based objectives provide ways to train GFlowNets without relying on estimates of log Z t . Indeed, as we show in our experimental results (Section 5), minimizing a divergence-based objective often leads to a better approximation than conventional approaches. However, unlike TB which allows the use of arbitrary base policies, these approaches normally require the use of p ⊺ (x) as the base policy which may lead to mode collapse depending on target distributions [6, 38] .So, as discussed in Section 2, recall that a GFlowNet may equivalently be interpreted as a hierarchical variational model using p F (τ ) as an approximation to p B (τ ) ∝ π(x)p B (τ |x) allowing GFlowNets to be trained by minimizing any divergence between p F and p B [38] . Based on this insight, we propose the following divergence-based training criterion for streaming GFlowNets:Definition 2 (Divergence-based streaming update). Let G t = (G, p (t) F , p (t)B ) be a GFlowNet balanced sampling proportional to πt . For G t+1 = (G, p ) and target distribution π t+1 , define the unnormalized distribution p(τ ) ∝ p EQUATIONis called the KL's streaming criterion.Note that when L KL vanishes, p(t+1) F (τ ) ∝ p (t) F (τ )f (D t+1 |x) for all τ ⇝ x and x ∈ X . Then, p (t+1) ⊤ (x) = τ →x p (t+1) F (τ ) ∝ p (t) ⊤ (x)f (D t |x).Consequently, minimizing L KL is a sound objective for learning to sample from π t+1 when p (t) ⊤ (x) = π t (x). In Section 4, we quantitatively relate the accuracy of p (t+1) ⊤ with that of p (t) ⊤ when using either Equation (4) or Equation (5) as learning objectives for the SB-GFlowNet.Low-variance gradient estimators for D KL . Score matching estimates of the divergence's gradients, ∇ θ D KL , are of high variance, negatively affecting the convergence speed of the trained model [42, 46, 57] . To circumvent this issue, we rely upon the REINFORCE leave-one-out (RLOO) gradient estimator [41] , which employs a sample-dependent control variate to significantly reduce the noiseness of the estimated gradients. More specifically, define γ(τ ) = log p (t+1)F (τ ) /p (t) F (τ )f (Dt+1|x)and let τ 1 , . . . , τ k be independently sampled trajectories from p (t+1) F. Also, denote by θ the parameters of p (t+1) F. In this context, the RLOO estimator for the gradient of KL's streaming criterion isEQUATIONwhich is an unbiased estimate for∇ θ E τ ∼p t+1 F [γ(τ )].Importantly, RLOO is straightforwardly represented as a vector-Jacobian product. Thus, it can be swiftly computed in standard reverse-mode autodifferentiation packages [47] , adding a negligible computational overhead to the algorithm. 
theoretical analysis: 
 While posterior propagation is computationally convenient, preventing training from scratch repeatedly, we should also expect errors to propagate through updates. To better understand the behavior of SB-GFlowNets, we analyze how choosing sub-optimal SB-GFlowNet at time t influences our approximation's quality at time t + 1. We quantify goodness-of-fit of SB-GFlowNets' sampling distribution wrt target both in terms of TV and of their expected distance in log space. Since the SB loss and KL updates incur different parameterizations, we analyze separately the cases in which SB-GFlowNets are trained using each loss.Overall, we establish that the accuracy of a SB-GFlowNet's sampling distribution p (t+1) ⊤ at time t + 1 depends on how close the new forward policy p (t+1) F is from being optimal, on the size of the new data chunk D t+1 , and on the goodness-of-fit of the previous estimate p (t) ⊤ . As expected, our analysis suggests that the negative effects of poorly learned p (t) ⊤ are negligible when the size of a data chunk is relatively large. Also, when the previous SB-GFlowNet G t is a poor approximation to the true posterior π t , we discuss the benefits of using an earlier and potentially more accurate checkpoint G s with s < t as a reference for training G t+1 .We first analyze how errors propagate when training SB-GFlowNets by directly enforcing the SB condition, i.e., minimizing Equation 4. To this effect, recall using the SB loss implies learning an estimate of the partition function Z t as well as the forward policy p (t) F at each time step t. In particular, Proposition 2 measures the consequences of an inaccurately learned p (t) F and of insufficiently minimizing the SB loss on the (t + 1)th approximation.Proposition 2. Let G t = (G, p (t) F , p (t) B , Z t ) and G t+1 = (G, p (t+1) F , p (t+1) B , Z t+1 ) be pair of GFlowNets. Let also π t+1 (x) ∝ π t (x)f (D t+1 |x) and recall that π : X → R + is our prior dis- tribution. Defining Z ⋆ k := x π(x) k i=1 f (D i |x)for any k > 0, and letting (pEQUATIONB , Ẑt+1 ) be the optimal solution to Equation 4 satisfying the SB condition. Then,δ πt+1 LS p (t+1) ⊤ , π t+1 ≤ δ πt+1 LS p (t+1) ⊤ , pt+1 ⊺ + log Ẑt+1 Z ⋆ t+1 Estimation error + δ πt+1 LS p (t) ⊤ , π t + log Z t Z ⋆ t Accuracy of p (t) ⊤, where δ ξ LS (p, q) := E x∼ξ [log p(x)log q(x)] 2 1 /2 . As expected, Proposition 2 underlines the importance of starting with a good approximation from the tth stage and of properly solving the learning problem at the (t + 1)th stage in order to obtain an accurate approximation to π t+1 . In particular, this result reveals the detrimental effect of an inadequately estimated partition function on the quality of GFlowNet's streaming updates.Complementary, Proposition 3 provides an upper bound the TV distance between p ⊤ becomes negligible to the overall approximation of the full posterior when the newly observed data set D t+1 is relatively large and the second term in Proposition 3 approximately vanishes.Proposition 3. Let T V (p, q) := 1 2 x∈X |p(x) -q(x)| be the TV distance between probability distributions p and q. Then, under the same setting of Proposition 2,T V p (t+1) ⊤ , π t+1 ≤ T V p (t+1) ⊤ , p(t+1) ⊺ + 1 2 • f (D t+1 |x) • x∈X Z t Z t+1 p (t) ⊤ (x) - Z ⋆ t Z ⋆ t+1 π t (x) , in which x ∈ arg max x∈X f (D t+1 |x) is the maximum likelihood instance in X for D t+1 .We now turn to the case in which SB-GFlowNets are trained with KL streaming updates, sequentially minimizing Equation 5-in which case we only learn the forward a backward policy networks. More specifically, Proposition 4 provides an upper bound on the TV distance between pEQUATION⊤ 's closeness to π t , and the learning objective. EQUATIONIn spite of considering a different learning objective compared to Proposition 3, Proposition 4 reinforces the importance of properly optimizing the loss in each time step -due to its compounding impact on SB-GFlowNet's accuracy. Nonetheless, the quality of π t is roughly negligible when the observed data set f (D t+1 |•) dominates the shape of p(t) ⊤ (•)f (D t+1 |•) -and of π t (•)f (D t+1 |•). 
experiments: 
 We show that SB-GFlowNets can accurately learn the posterior distribution conditioned on the streaming data for one toy and two practically relevant applications. To start with, Section 5.1 illustrates the applicability of SB-GFlowNets in the context of set generation. Nextly, Section 5.2 showcases the correctness of SB-GFlowNets in the problem of Bayesian linear preference learning with integervalued features [8] . Then, Section 5.3 indicates the potential of SB-GFlowNets for carrying out online Bayesian inference over phylogenetic trees [13, 15, 58] . Finally, Section 5.4 touches on the problem of Bayesian structure learning with streaming data. To the best of our knowledge, SB-GFlowNets are the first method enabling variational inference over discrete parameter spaces within a streaming setting, as previous approaches either relied on intractable continuous relaxations [20, 25, 36] or scaled poorly in the size of the target's support [55] . We provide further implementation details regarding model configurations and experimental settings in Appendix C.Problem description. We first remark that, if R 1 , . . . , R k+1 are positive functions on X , the problem of streaming Bayesian inference may be generalized to the problem of sampling from -2 0.6 1.2 ×10 -2 0.6 1.2 ×10 -2 1 2 ×10 -2 1 2 ×10 -2 1 2 ×10 -2 1 2 ×10 -2 1.5 3.0 ×10 -2 1.5 3.0 ×10 -2 p (t) (x) πt(x)R i (x) := f (D i |x) for i > 1 and R 1 (x) = f (D 1 |x)π(x). Thus, to demonstrate the effectiveness of SB-GFlowNets and highlight the benefits and pitfalls of each proposed training scheme, we consider the set generation task -a popular toy experiment in the GFlowNet literature [3, 44, 53] . In this task, X is the space of sets with S elements extracted from a fixed deposit I = {1, . . . , d}. Then, for i ∈ {1, . . . , K}, we define f i : I → R and let log R i (x) = e∈x f i (e) be the ith log-reward of a set x.Experimental setup. We fix d = 24 and S = 18. To define R i , we independently sample f i (d) from an uniform distribution on [-5, 5] . Correspondingly, we define R(α) i := R 1 /α ias the tempered reward, noting that R (α) i becomes increasingly sparse as α → 0. 1 highlights the differences between our two training schemes in terms of the target's temperature. For relatively sparse targets (with α < 1), the benefits of off-policy sampling enacted by the minimization of the TB loss lead to a better performance relatively to the KL-minimizing algorithm. Indeed, the on-policy exploration employed by the latter potentially hinders the model's capabilities of finding the sparsely distributed high-probability regions of the target, slowing down the training convergence and potentially leading to mode collapse [38] . Also, albeit one could implement an IS estimator for off-policy training under the KL criterion, our early experiments suggested that the increased gradient variance outweighed the gains from enhanced exploration. Ultimately, the choice of an appropriate learning objective for training GFlowNets will depend on the application. For training SB-GFlowNets, Figure 1 shows that both TB and KL minimization result in accurate approximations to the changing posterior.Problem description. Consider a collection of instances {y i } endowed with a transitive and complete preference relation ⪰; we assume that each y i ∈ {1, 0} d is a binary feature vector. Naturally, the preference relation ⪰ is represented as a mapping u such that y ≻ y ′ if and only if u(y) > u(y ′ ); uncovering u is the major goal of preference learning methods. Similarly to [8, 21] , we here assume that u is a linear function, u(y) = x T y, for a integer-valued vector x and that we have access to a data set y = {(y i1 , y i2 , p i )} i denoting whether y i1 is preferred to y i2 (p i = 1) or otherwise (p i = 0) for a fixed individual. Subsequently, we define the probabilistic modelEQUATIONin which σ is the sigmoid function, and a prior distribution π(x) over x [18] ; the intuition is that a larger difference between y i1 and y i2 's utilities makes the event in which y i1 is preferred over y i2 more likely. Our goal is to infer the individual's preferences based on the posterior π(x|y) for some unseen pair (ỹ 1 , ỹj ), i.e., to estimate the predictive distribution p(ỹ|(ỹ 1 , ỹ2 ), y). Results. Figure 2 shows SB-GFlowNet correctly samples form the posterior in a streaming setting. Note, in particular, that the GFlowNet maintains a high distributional accuracy throughout the streaming iterations. Correspondingly, the predictive log-likelihood of a fixed held out data set monotonically increases as a function of the amount of data consumed by the SB-GFlowNet, as shown in Figure 3 ; this behavior, also exhibited by the true posterior [54] , emphasizes the similarity between the learned and targeted distributions.Problem description. Bayesian phylogenetic inference (BPI) [29, 59] aims to infer structural properties of evolutionary trees given molecular sequences such as DNA and RNA. Formally, let {S 1 , . . . , S N } be a collection of N DNA sequences of size M , S i ∈ {A, T, C, G} M , one for each biological species. We define a phylogeny as a tuple T = (t, b) comprising a rooted tree topology t and its non-negative branch lengths b. In this context, a rooted tree topology is a complete binary tree having N labeled leaves corresponding to the considered species and N -1 unlabeled internal nodes corresponding to their ancestors. To carry out Bayesian inference over the space of phylogenies, we adopt Jukes & Cantor's nucleotide substitution model (JC69; [26] ) to define a observational model over the observed DNA sequences; to calculate the likelihood, we use Felsenstein's algorithm [15] .Crucially, despite the popularity of BPI methods, the development of new sequencing technologies has swiftly led to the enlargement of already sizeable sequence databases. In this scenario, maintaining an up-to-date estimate of the posterior became an increasingly difficult task due to the necessity of re-estimating the full posterior from scratch every time a new batch of data is collected. In the following, we show that GFlowNets, which have recently shown SOTA performance in BPI [63] , can also accurately update the posterior on phylogenetic trees given additional sequences.Experimental setup. We generate the data by simulating JC69's model for a collection of N = 7 species and a substitution rate of λ = 5•10 -1 (see [58] , Chapter 1). At each iteration, we sample a new DNA subsequence of size 10 2 for each species and update SB-GFlowNet according to Algorithm 1. For Table 2 , |D 1 | = 10 3 and |D 2 | = 10 2 . The prior is an uniform distibution over phylogenies. Results. Figure 4 (left) shows that the learned posterior distribution gets increasingly concentrated on the true phylogenetic tree; this behavior, which is inherent to posteriors over phylogenies under uniform priors [50] , emphasizes the similarity between the learned and targeted distributions for SB-GFlowNets. Figure 4 (right), on the other hand, also suggets that the model's accuracy decreases as a function of the number of streaming updates. Nonetheless, we believe that this is predominantly caused by the posterior's increasing sparsity due to the expanding data sets [50] , which makes it more difficult for the GFlowNet to learn a good approximation [11] , instead of by an intrinsic limitation of SB-GFlowNets. An investigation of this phenomenon and of the conditions upon which re-train the SB-GFlowNet based on an earlier checkpoint due to the accumulated unreliability of the streaming updates, as described by Proposition 4, is left application-dependent and is thereby left to future endeavors. Finally, Table 2 shows that SB-GFlowNets, which avoids evaluating the full posterior, more than halve the training time required by a standard GFlowNet, while achieving a similar performance in terms of the total variation (T V ) distance between the learned and target distributions. In this case, the linear Gaussian SEM represents a Bayesian network, and it is the goal of Bayesian structure learning algorithms to find such a network based on the observed X [11] . Although this problem has been studied beyond the constraints of linear models governed by Gaussian distributions [12] , we focus on a simplified setting in this section. In particular, given a sequence {X t } t≥1 of i.i.d. realizations of a linear Gaussian SEM, we define a belief distribution over Bayesian networks N = ({1, . . . , d}, A) on variables {1, . . . , d} and adjacency matrix A asEQUATIONin which ℓ(β|X t ) is the log-likelihood of X t under the linear Gaussian SEM parameterized by β. SB-GFlowNets can naturally handle streaming inference for this model by casting each R t as a subposterior distribution -in the same fashion of the set generation task in Section 5.1. Results. Our results corroborate the findings of Section 5.3. On the one hand, Figure 5 highlights that our SB-GFlowNet can accurately learn a distribution over DAGs across a range of streaming updates. On the other hand, Figure 5 shows that the probability mass assigned by the SB-GFlowNet to the true DAG responsible for the data-generating process increases as more samples are incorporated into the belief distribution. Hence, SB-GFlowNets abide by the desiradata of a streaming algorithm for Bayesian inference. 
related works: 
 Applications of GFlowNets. GFlowNets [2, 3, 30] were originally proposed as reinforcement learning algorithms to train a stochastic policy to sample states proportionally to a prescribed reward function, From this point on, GFlowNets were widely applied to problems as diverse as probabilistic modeling [23, 60] , combinatorial optimization [61] , Bayesian causal discovery [11, 12] and phylogenetic inference [63] , symbolic regression [32] , stochastic control [30] , language modeling [22] , and Bayesian deep learning [34] . Recently, there is an increasing literature concerned with the possibility of composing multiple pre-trained GFlowNets to fit them to specific applications [17] and to accelerate training convergence [31] . In this context, we show how the composition of two GFlowNets through the SB condition leads to an efficient learning algorithm for Bayesian inference under a streaming setting.Streaming Variational Bayes. Streaming, Distributed, Asynchronous (SDA) Bayes [6] was originally presented as a general framework for implementing variational inference algorithms in a streaming setting. Similarly to our work, it was based upon the principle that, if the variational distribution q (t) (x) is a good approximation to the unnormalized posterior πt (x), then q (t+1) (x) may be optimized to approximate q (t) (x)f (D t |x) instead of f (D t |x)π t (x). This framework was instantiated to accommodate, for example, the learning of Gaussian processes [7] , of tensor factorization [14] , of feature models [51] and, jointly with SMC, nonlinear state-space models [62] . Nonetheless, our work is the first one to enable the training of GFlowNets in a streaming setting and, due to the relationship between GFlowNets and variational inference algorithms presented by [38] , may be viewed as an instance of SDA-Bayes tailored to inferential problems on a combinatorial support. In the realm of approximate Bayesian inference, Akhound-Sadegh et al. [1] , Berner et al. [4] , Sendera et al. [52] , Zhang and Matsen [59] propose advancements in diffusion-based sampling methods, which we believe could be extended to the context of approximate streaming Bayesian inference via the techniques presented in this work. On the other hand, Mittal et al. [40] introduces an neural network-based approach for approximate Bayesian inference that amortizes over exchangeable data sets to handle posterior inference in novel data. Also, Richter and Berner [48] , Richter et al. [49] develop a low-variance gradient estimator for carrying out variational inference derived from the log-variance loss, which could be employed as an alternative to our KL-based objective for streaming updates of GFlowNets. On a broader scale, Cranmer et al. [9] reviews approximate Bayesian methodology under the lens of simulation-based inference. 
conclusions, limitations, and outlook: 
 Conclusions. We proposed the first method for carrying out approximate Bayesian inference over discrete distributions within a streaming setting, called SB-GFlowNet. We proposed two training/update schemes for SB-GFlowNet, as well as a theoretical analysis accounting for the compounding effect of errors due to posterior propagation. Our experimental evaluation showcases SB-GFlowNet's effectiveness in accurately sampling from the target posterior -while still achieving a significant reduction in training time relative to standard GFlowNets.Limitations. Proposition 2 and Proposition 4 suggest that an inappropriate approximation to π t may be propagated through time and lead to increasingly inaccurate models. This phenomenon, known as catasthropic forgetting in the online literature [19, 39] , may eventually demand retraining of the current SB-GFlowNet based on an earlier checkpoint or on the full posterior. We also note that unlike traditional variational methods, where the expressiveness of the approximation family is explicitly chosen, the expressiveness implied by different parametrizations of GFlowNets is not clear. We believe this is a fruitful avenue for future investigation.Outlook and future works As our proposal provides generic and efficient streaming variational inference solution for discrete parameters, we believe it will allow the use of streaming discrete Bayesian inference to more datasets and to less explored research domains. In this work, we proposed two training criteria based on the trajectory balance condition and the KL criterion, nonetheless, these are not the only training schemes for GFlowNets, we believe other proposed criteria such as detailed balance [3] or the sub-trajectory balance [35] could be adapted for the streaming setting as well. Additionally, due to the flexibility of GFlowNets in sampling unnormalized distributions, our proposal can be extended to different divergences and generalized likelihoods to improve the predictive quality of the learned posteriors [28] . Finally, the problem of updating a GFlowNet when the size of the generated object changes, e.g., when a new species is observed during BPI, remains open. 
experiments compute resources: 
 Question: For each experiment, does the paper provide sufficient information on the computer resources (type of compute workers, memory, time of execution) needed to reproduce the experiments?Answer: [Yes]Justification: First paragraph of Appendix C.Guidelines:• The answer NA means that the paper does not include experiments.• The paper should indicate the type of compute workers CPU or GPU, internal cluster, or cloud provider, including relevant memory and storage.• The paper should provide the amount of compute required for each of the individual experimental runs as well as estimate the total compute.• The paper should disclose whether the full research project required more compute than the experiments reported in the paper (e.g., preliminary or failed experiments that didn't make it into the paper). 
code of ethics: 
 Question: Does the research conducted in the paper conform, in every respect, with the NeurIPS Code of Ethics https://neurips.cc/public/EthicsGuidelines? 
broader impacts: 
 Question: Does the paper discuss both potential positive societal impacts and negative societal impacts of the work performed?Answer: [Yes]Justification: We provide a perspective on broader impacts in Section 7, but do not foresee any direct negative societal impact.Guidelines:• The answer NA means that there is no societal impact of the work performed.• If the authors answer NA or No, they should explain why their work has no societal impact or why the paper does not address societal impact.• Examples of negative societal impacts include potential malicious or unintended uses (e.g., disinformation, generating fake profiles, surveillance), fairness considerations (e.g., deployment of technologies that could make decisions that unfairly impact specific groups), privacy considerations, and security considerations.• The conference expects that many papers will be foundational research and not tied to particular applications, let alone deployments. However, if there is a direct path to any negative applications, the authors should point it out. For example, it is legitimate to point out that an improvement in the quality of generative models could be used to generate deepfakes for disinformation. On the other hand, it is not needed to point out that a generic algorithm for optimizing neural networks could enable people to train models that generate Deepfakes faster.• The authors should consider possible harms that could arise when the technology is being used as intended and functioning correctly, harms that could arise when the technology is being used as intended but gives incorrect results, and harms following from (intentional or unintentional) misuse of the technology.• If there are negative societal impacts, the authors could also discuss possible mitigation strategies (e.g., gated release of models, providing defenses in addition to attacks, mechanisms for monitoring misuse, mechanisms to monitor how a system learns from feedback over time, improving the efficiency and accessibility of ML). 
safeguards: 
 Question: Does the paper describe safeguards that have been put in place for responsible release of data or models that have a high risk for misuse (e.g., pretrained language models, image generators, or scraped datasets)?Answer: [NA] Justification: We do not foresee any direct risk stemming from our work.Guidelines:• The answer NA means that the paper poses no such risks.• Released models that have a high risk for misuse or dual-use should be released with necessary safeguards to allow for controlled use of the model, for example by requiring that users adhere to usage guidelines or restrictions to access the model or implementing safety filters.• Datasets that have been scraped from the Internet could pose safety risks. The authors should describe how they avoided releasing unsafe images.Guidelines:• The answer NA means that the paper does not involve crowdsourcing nor research with human subjects.• Including this information in the supplemental material is fine, but if the main contribution of the paper involves human subjects, then as much detail as possible should be included in the main paper.• According to the NeurIPS Code of Ethics, workers involved in data collection, curation, or other labor should be paid at least the minimum wage in the country of the data collector.15. Institutional Review Board (IRB) Approvals or Equivalent for Research with Human Subjects Question: Does the paper describe potential risks incurred by study participants, whether such risks were disclosed to the subjects, and whether Institutional Review Board (IRB) approvals (or an equivalent approval/review based on the requirements of your country or institution) were obtained?Answer: [NA]Justification: No experiments with human subjects.Guidelines:• The answer NA means that the paper does not involve crowdsourcing nor research with human subjects.• Depending on the country in which research is conducted, IRB approval (or equivalent) may be required for any human subjects research. If you obtained IRB approval, you should clearly state this in the paper.• We recognize that the procedures for this may vary significantly between institutions and locations, and we expect authors to adhere to the NeurIPS Code of Ethics and the guidelines for their institution.• For initial submissions, do not include any information that would break anonymity (if applicable), such as the institution conducting the review. 
 
 Appendix: Require: (D t ) T ≥t≥1 streaming data sets, f (•|x) a likelihood model parametrized by x, π(x) a prior distribution over X Ensure: G T samples proportionally toT t=1 f (D t |x) π(x) G 1 ← (p 1 F , p 1 B , Z 1 ) := arg min p F ,p B ,Z E τ ∼ξ [L T B (τ ; p F , p B , Z)] ▷ Roughly minimize L T B via SGD for t in {2, . . . , T } do ▷ Roughly minimize L SB via SGD G t ← (p (t) F , p (t) B , Z t ) := arg min p F ,p B ,Z E τ ∼p (t-1) ⊤ [L SB (τ ; p F , p B , Z; G t-1 )] end forAlgorithm 1 outlines the training of a SB-GFlowNet by minimizing the SB loss. As we described in the text, the first GFlowNet is trained conventionally by approximately minimizing either the TB loss or the KL divergence between the forward and backward policies. Then, the subsequent models are trained by the approximate minimization of either the SB loss or streaming balance criterion. Notably, the problem of streaming update may be framed as the learning of GFlowNets with stochastic rewards [45] , which are not determistically associated to the terminal states.We are assuming that p (t) ⊤ ∝ π t and that E τ ∼ξ [L SB (τ )] = 0 for a distribution ξ of full support. Thus, L SB (τ ) = 0 for all τ . As a consequence,EQUATIONEQUATIONBy assumption, (pEQUATIONB , Z t ) satisfy the trajectory balance condition with respect to π t , therefore,EQUATIONFinally, by summing over τ ⇝ x:EQUATION∝ π t+1 (x).Firstly, we note that δ ξ LS (p, q) is a metric. Thus, by the triangle inequality,EQUATIONEQUATIONThe first term of the right-hand-side of the preceding equation corresponds to the estimation error associated to the GFlowNet's learning problem. For the second term, note that p(t+1)⊤ (x) = Zt Ẑt+1 p (t) ⊤ (x)f (D t+1 |x) by assumption (p (t+1) ⊤satisfies the SB condition). Thus,log p(t+1) ⊤ (x) -log π t+1 (x) = log Z t Ẑt+1 + log p (t) ⊤ (x)f (D t+1 |x) -log Z ⋆ t π t (x) Z ⋆ t+1 f (D t+1 |x) = log Z ⋆ t+1 Ẑt+1 + log Z t Z ⋆ t + log p (t) ⊤ (x) π t (x) .The result follows by a further application of the triangle inequality to δEQUATIONProposition 2 is obtained by plugging Equation 15 into Equation 14.This result, which follows from reasoning similar to the one in Proposition 2 above, aims to show the dependence of the model's performance on the newly observed dataset. In this sense, notice that T V pEQUATIONEQUATIONThus, since p(t+1)EQUATIONThe result follows by plugging Equation 17 into Equation 16.This result follows from the successive application of the triangle, Pinsker's [10] and Jensen's inequality applied to the KL divergence. More specifically, first note that the optimal distribution under the KL streaming criterion satisfies p(t+1)⊤ ∝ p (t)⊤ f (D t+1 |x). Then, by the triangle inequality,EQUATIONEQUATIONFor the first term, note thatEQUATIONEQUATIONF ∝ p by definition; recall that p(τ ) = p (t)F (τ )f (D t+1 |x).Here, the first inequality follows from Pinsker's inequality and the second one, from the data-processing inequality. For the second term, note thatEQUATIONwith a corresponding representation of π t+1 as a function of π t and f (D t+1 |x). The result follows by pluggin Equation 20and Equation 19 into Equation 18.We provide below details for reproducing our experiments for each considered generative task. To approximately solve the optimization problem outlined in Algorithm 1, we employed the Adam optimizer [27] with a learning rate of 10 -3 for the p F 's parameters and 10 -1 for log Z t , following recommendations from [37] . Also, we linearly decreased the learning rate during training. Experiments were run in a cluster equipped with A100 and V100 GPUs, using a single GPU per run. is observed; a small value of α entails a more sparse and harder-to-sample-from distribution. Terminal states X are illustrated in green and non-terminal states are depicted in blue. At the tth iteration, we learn a generative model p(t) ⊤ sampling S ∈ X proportionally to 1≤i≤t R (α) t (S).C.1 Set generation Experimental setup. We fixed d = 24 and S = 18. To parameterize the forward policy, we implemented an two-layer neural network with a 128-dimensional latent embedding. For the streaming updates, we fixed α = 1 and randomly sampled the objects' utilities at each novel iteration. We trained the model by minimizing the KL streaming criterion.GFlowNet's design. To generate a set x ∈ X , we iteratively add elements randomly sampled from I to an initially empty x until x has size S; see Figure 7 . The forward policy is parameterized as a two-layer neural network and the backward policy is fixed as an uniform distribution.C.2 Linear preference learning with integer-valued features Experimental setup. We assume that x ∈ [[0, 4]] d and d = 24 and that the data was simulated from the observational model. At each streaming round, a novel and independent data set was simulated and the model was trained by minimizing the SB loss. To parameterize the forward policy, we implemented an MLP with 2 64-dimensional layers receiving the padded parameter x as an input and returning a probability distribution over [[0, 4] ].GFlowNet's design. The generative process implemented by the GFlowNet consists of, starting at an initially empty state x o , iteratively sampling a value from [[0, 10] ] and appending this value to the current state until its length reaches d. To parameterize the forward policy, we use an MLP with two 64-dimensional layers that receives the padded state as a fixed-size input.Experimental setup. We assume the observational data follow the J&C69 mutation model with an instantaneous mutation rate of λ = 5 • 10 -3 . The data was synthetically generated from the corresponding observational model conditioned on a randomly sampled tree with 7 leaves, and this process was repeated at each streaming round. To illustrate the computational gains enacted by the implementation of SB-GFlowNets in Table 2 , we considered updating a GFlowNet trained on an initially large data set according to the newly observed and relatively small biological sequences, which is a common challenge faced by practitioners. Then, by avoiding the additional log-likelihood evaluations, we achieved significantly faster inference.GFlowNet's design. A state consists of a forest of complete binary trees. Initially, all leaves are roots of their own singleton trees and, at each iteration of the generative process, we select two trees and join their roots to a newly added unlabelled node. This procedure is finished when all leaves are connected; see [63, Figure 1] for an illustration of this generative process. To parameterize p F , we use a graph isomorphism network (GIN; [56] ); the backward policy is fixed as uniform.C.4 Bayesian structure learning Experimental setup. We sample each component of the error terms ϵ from a zero-centered Gaussian distribution with standard deviation σ = 5 • 10 -2 . Also, we select a random Bayesian network from a directed configuration model [43] and draw the components β from a corresponding standard Gaussian distribution to define the true data-generating process. To parameterize the policy network, we use an MLP with 2 128-dimensional layers receiving the DAG's flattened adjacency matrix as input.GFlowNet's design. We adopt Deleu et al. [11] 's DAG-GFlowNet. In a nutshell, the generative process starts at an edgeless graph and each transition either adds an edge to the current state or triggers a stop. To ensure the acyclicity of the generated samples, we follow [11, Appendix C] and iteratively update a binary vector m ∈ {1, 0} d×d indicating which edges in the adjacency matrix can be safely added to the current state without forming cycles. Exchangeability is a natural property of each case study we presented in the main text. We thus ask: are SB-GFlowNets permutation invariant? Clearly, the distribution learned by a SB-GFlowNet does not depend on the order in which the data sets are observed when the SB condition is satisfied at each streaming update; this is a direct consequence of Proposition 1. On the other hand, permutation invariance is not guaranteed when the learning objectives are only imperfectly minimized; see Figure 8 for an extreme example. To the best of our knowledge, however, this sensibility to data ordering is a property of every approximate streaming Bayesian inference method, e.g., [6, 13] .NeurIPS Paper Checklist Guidelines:• The answer NA means that the abstract and introduction do not include the claims made in the paper.• The abstract and/or introduction should clearly state the claims made, including the contributions made in the paper and important assumptions and limitations. A No or NA answer to this question will not be perceived well by the reviewers.• The claims made should match theoretical and experimental results, and reflect how much the results can be expected to generalize to other settings.• It is fine to include aspirational goals as motivation as long as it is clear that these goals are not attained by the paper.Justification: Our submission follows the NeurIPS ethical guidelines.Guidelines:• The answer NA means that the authors have not reviewed the NeurIPS Code of Ethics.• If the authors answer No, they should explain the special circumstances that require a deviation from the Code of Ethics.• The authors should make sure to preserve anonymity (e.g., if there is a special consideration due to laws or regulations in their jurisdiction).38th Conference on Neural Information Processing Systems (NeurIPS 2024). 


Decision: This paper considers the setting of streaming Bayesian inference with discrete state spaces. A streaming Bayesian GFlownet (SB-GFlowNet) framework is introduced that uses a GFlowNet and sequentially updates it using new data. Theoretical analysis is provided to understand error propagation in the updates. Empirical studies are performed using SB-GFlowNets for problems involving set generation, linear preference learning, and phylogentic inference. 

Overall, reviewers found that the contributions of the paper were novel and that the experimental results were convincing. Several reviewers commented on clarity-related issues, such as notation, definitions, conditions used for the proposition(s), and typos. During the rebuttal phase, these concerns were mostly clarified and addressed, but these revisions still need to be corrected/added in the final manuscript. In particular, after the discussion phase, reviewers unanimously recommended accepting this paper. 

Thus, I am happy to recommend acceptance, and strongly encourage the authors to revise the manuscript according to the feedback from reviewers.

Reviews: review: paper_summary: paper_summary: The paper introduces a method for Bayesian inference in streaming data scenarios, particularly for discrete parameter spaces, called Streaming Bayes GFlowNets (SB-GFlowNets). The main contributions are:

* Bayesian Streaming Inference: SB-GFlowNets enable the continuous updating of posterior distributions as new data arrives, without needing to recompute from scratch.

* Addressing Intractability: The method addresses the challenge of approximating intractable posteriors in discrete state spaces, which is a limitation of existing variational inference (VI) techniques.

* GFlowNet Utilization: SB-GFlowNets leverage GFlowNets, a class of amortized samplers, to approximate the initial posterior and update it incrementally with new data.

* Case Studies: The effectiveness of SB-GFlowNets is demonstrated in linear preference learning and phylogenetic inference, showing its ability to sample from unnormalized posteriors efficiently in a streaming context.

* Performance: The method is significantly faster compared to repeatedly training a GFlowNet from scratch for the full posterior.
strength_weakness: strength_weakness: A weakness of the paper is that it may not sufficiently highlight the significance of streaming inference compared to batch inference. This may be apparent to Bayesian practitioners but not so to a general ML audience. Are there more compelling applications of streaming inference?
questions: questions: Sentence in lines 58-59 trails off.
limitations: limitations: Yes, limitations have been addressed.
paper_summary: paper_summary: This paper introduces Streaming Bayes GFlowNets, a method for performing approximate Bayesian inference over discrete parameter spaces in streaming data settings.

SB-GFlowNets allow efficient updating of posterior approximations as new data arrives. The method reduces training time compared to retraining GFlowNets from scratch and maintains comparable accuracy. 

In conclusion, SB-GFlowNets enable streaming variational inference for discrete parameters, opening up new applications of Bayesian methods to large-scale streaming data problems.
strength_weakness: strength_weakness: - As mentioned in the paper's limitations section, inappropriate approximations to earlier posteriors may propagate through time, potentially leading to increasingly inaccurate models. This is a form of catastrophic forgetting
- Due to the error accumulation issue, there may sometimes need to retrain the model from an earlier checkpoint or using the full posterior
- As the paper mentioned, for very sparse target distributions, the performance can degrade, particularly when using the KL-based training scheme
questions: questions: - Do you think the accumulative error issue can be solved by cache previous gradient (borrowing tricks from continual learning)?
- It would be great if you can just compare with some continual learning method as baselines.
- In sparse target distributions, if not using KL-based training scheme, what are the possible schemes?
limitations: limitations: The authors have adequately addressed the limitations
paper_summary: paper_summary: This paper introduces Streaming Bayes GFlowNets (SB-GFlowNets), which enables streaming Bayesian inference over discrete parameter spaces, relying on the expressive power of GFlowNets as amortized samplers over discrete compositional objects. The process is akin to Bayesian streaming, where the posterior updates with each new data stream and the posterior from the batch before acts as a prior for the current batch. The authors use a GFlowNet to fit the initial posterior and update it training only on new data stream batches. To do so, the authors propose two different solutions: enforcing a streaming balance condition at each streaming step, or relying on direct divergence-based updates (letting go of the estimation of the normalizing constant). For the latter, the authors show how to obtain low-variance estimators for the gradient of the proposed KL divergence loss. Finally, the authors provide a theoretical performance analysis of their two proposed variants along with a diverse set of experiments to showcase the performance in each case, and show the gain in training time in the streaming setting compared to retraining for all the data at once at each step.
strength_weakness: strength_weakness: - I'm not sure where equation (9) comes from. Equating \$\mathcal{L}\_{SB}(\tau)\$ to 0 would result in
\\[
p\_F^{(t+1)}(\tau) = \frac{Z\_t}{Z\_{t+1}} \cdot \frac{p\_B^{(t+1)}(\tau \vert x)}{p\_B^{(t)}(\tau \vert x)} \cdot p\_F^{(t)}(\tau) \cdot f(\mathcal{D}\_{t+1} \vert x)
\\]
Even by assuming \$(p\_F^t, p\_B^t, Z\_t)\$ satisfy TB \$(\mathcal{L}\_{TB} \rightarrow 0)\$, I'm not sure how that would directly yield equation (10). The proofs for proposition 2 also seem to start from (9). Can you elaborate on that? 

- To what extent is the assumption that new data is independent of past data under the posterior predictive? This question is especially important in cases where you try to sample from the marginal likelihood over some object (for instance for structure learning), where you lose that independence under the posterior given only the structure (and not parameters for example). I suspect this might be the reason for performance degradation across streaming steps in the Bayesian phylogenetic inference case, given that Felsenstein's algorithm assigns a marginal likelihood. 

**Minor Comments** 
- Line 30, $\{y_i\}_{i=1}^2$ should be defined/introduced better.
- Line 134, space after comma. 
- In line 142, in the second TB condition, it should be $p_F^{(t+1)}(\tau)$ instead of $p_F^{(t)}(\tau)$.
- $p_F^{(t+1)}$ should be evaluated at $\tau$ in equation (10).
questions: questions: See weaknesses.
limitations: limitations: - The authors adequately addressed limitations throughout the paper (for instance posterior error propagation etc) and through a separate section in the conclusion.
paper_summary: paper_summary: The authors provide a framework that allows training of GFlowNet models with streaming data by checkpointing a previously trained GFlowNet model and proposing the streaming balance condition. The problem as well as the approach is well motivated and theoretically sound and this work would be a valuable contribution to the research community. The authors conduct experiments on synthetic tasks and phylogenetic inference, and show improved scalability. Additionally, there is some theory that describes and bounds the approximation error based on errors on the checkpointed GFlowNet model and current estimation problem. Overall, I think the work is quite interesting but it would be nice to consider another experiment since currently most of the experiments are based on synthetic data.
strength_weakness: strength_weakness: - I found Definition 2 to be quite confusing to read and it is still not clear to me how the equivalence holds. Could the authors clarify what the KL divergence is between, why is it valid and how does it circumvent the problem of parameterizing a partition function?
- The original setup proposed by the authors follows from a trivial extension of the GFlowNets framework which begs to question the novelty of the work.
- It is unclear how their formulation solves the problem of permutation invariance / iid treatment of observations. In particular, given two sets $D_1$ and $D_2$, we know that the posterior distribution $p(x | D_1, D_2)$ can be equivalently written as
$$
p(x | D_1, D_2) = \frac{p(D_1, D_2 | x) p(x)}{p(D_1, D_2)} = \frac{p(D_1 | x) p(D_2 | x) p(x)}{p(D_1, D_2)} = \frac{p(D_1 | x) p(x|D_2)}{p(D_1 | D_2)} = \frac{p(D_2 | x) p(x|D_1)}{p(D_2 | D_1)}
$$
Then, in particular, how is it maintained that given any split of the data $D$ into $D_1$ and $D_2$, the final GFN trained leads to the same solution. If the GFN learns the right solution, then it will follow simply, but it would be nice if the model could satisfy this permutation invariance inherently. Could the authors provide some ablations and control experiments to show to what extent is this constraint satisfied over $t$?
- The authors should add an experiment on discovering causal graphs conditioned on observational samples, which would strengthen their paper considerably.
- The authors should consider the following related work, which are either connected to GFlowNets, sampling from an unnormalized density, or modeling Bayesian posterior inference:

Cranmer, Kyle, Johann Brehmer, and Gilles Louppe. "The frontier of simulation-based inference." Proceedings of the National Academy of Sciences 117.48 (2020): 30055-30062.

Mittal, Sarthak, et al. "Exploring Exchangeable Dataset Amortization for Bayesian Posterior Inference." ICML 2023 Workshop on Structured Probabilistic Inference {\&} Generative Modeling. 2023.

Zhang, Qinsheng, and Yongxin Chen. "Path integral sampler: a stochastic control approach for sampling." arXiv preprint arXiv:2111.15141 (2021).

Richter, Lorenz, et al. "VarGrad: a low-variance gradient estimator for variational inference." Advances in Neural Information Processing Systems 33 (2020): 13481-13492.

Sendera, Marcin, et al. "On diffusion models for amortized inference: Benchmarking and improving stochastic control and sampling." arXiv preprint arXiv:2402.05098 (2024).

Berner, Julius, Lorenz Richter, and Karen Ullrich. "An optimal control perspective on diffusion-based generative modeling." arXiv preprint arXiv:2211.01364 (2022).

Akhound-Sadegh, Tara, et al. "Iterated denoising energy matching for sampling from Boltzmann densities." arXiv preprint arXiv:2402.06121 (2024).

Richter, Lorenz, Julius Berner, and Guan-Horng Liu. "Improved sampling via learned diffusions." arXiv preprint arXiv:2307.01198 (2023).
questions: questions: - It is not clear what do the authors mean by $\mathbf{A}$ in their notation at the start of Section 2.
- The authors seem to have a typo in the equation under Line 142, essentially the right hand equation should have $p_F^{t+1}$.
- Can the authors provide a visualization of the Set generation task? If I understand correctly, the authors first sample $d$ points randomly and the corresponding $f_i(j)$ randomly as well where $i = 1, ..., K+1$ and $j = 1, ..., d$. Then they define $R_i$ over each set, and a tempered version of $R_i$ with temperature $\alpha$. Is that it?
limitations: limitations: The authors have adequately talked about the limitations and impacts of their work.
paper_summary: paper_summary: Generative flow nets are extended to streaming inference by using the prediction of the previous network as the prior for the current one. Two training methods are proposed: streaming balance which uses squared difference of target and learned log posteriors, and VI which uses KL divergence. Analytic results for both methods bound the error in terms of updating error and error from the previous step. Three experiments show the method can accurately track the true posterior across updating steps.
strength_weakness: strength_weakness: Not a major weakness, but the extension to the streaming case (this paper's main contribution) is fairly straightforward. It was clear from the beginning that the predicted distribution from the previous step would provide the prior for the next, with the obvious adaptations of the balance and VI objectives.

Both $p_B$ terms in the streaming balance condition (3) appear to be unnecessary. Prop 1 will hold without them. We just need a joint distribution over $(x,\tau)$ (equivalently, a distribution over $\tau$) with the desired marginal on $x$, and $f(\mathcal{D}_{t+1}|x) p^t_F(\tau)$ already has that property. Compare to the definition of the target distribution $p(\tau)$ in (5).

Sec 3.2 just gives the objective and doesn’t explain how $p_F$ and $Z$ are learned (likewise with the argmax lines in Algo 1). Is it just SGD on $\mathcal{L}_{SB}$?

The main text says nothing about how to construct the graph ($\mathcal{S}$ and $\boldsymbol{A}$). Details are given in the appendix -- in all cases the allowable paths build the desired objects from simpler ones -- but a sentence in the main text would help.
questions: questions: (2): why do we need to sample from $p_B$ and importance weight, rather than sampling directly from $p_F$?

(5),170,178: $\pi_{t+1}$ should be $f(\mathcal{D}_{t+1}|x)$, yes? The derivations all look correct if so.

181: what is $\delta$?

$Z_{(t+1)}$ at 205 and $\hat{Z}_{t+1}$ are the same?

More of a suggestion: could the method be extended to cases where the target objects grow at each time step? For example, phylogenetic trees would grow as new species are observed. It seems like a natural application of flow nets since you can expand the graph by appending a new terminal layer.
limitations: limitations: The set generation task is degenerate because the objective is additive. A model only needs to track the posterior on individual $x$s.

Comments: title: Thanks for your service
Response to Rebuttal
Reviewer Response
comment: Dear reviewers and conference chairs, 

We are thankful for your service and commitment to the peer-reviewing process. Also, we greatly appreciate the reviewers’ input, which helped to significantly strengthen and clarify our work. All experiments and discussions will be included in the revised manuscript. 

Best regards, 

The authors.
Thanks for addressing my comments. I have raised my score to 7.
Thanks for the clear responses. Great paper.
I thank the authors for their thoughtful response to my questions and suggestions. That combined with the discussion with other reviewers below, I am glad to increase my score.
Thanks to the authors for providing a detailed and compelling rebuttal. While most of my concerns have been addressed, I would additionally like to point out that the work would be considerably stronger if the authors could consider a Bayesian linear regression model, with increasing number of observations seen on the X-axis and the KL divergence with the true posterior, which is available in closed form, on the Y-axis.

However, I do understand that the discussion period is coming to an end soon and the authors might not have enough time to run this experiment for the discussion. Since all my other concerns have been addressed, I have updated the score accordingly.
Thanks for addressing my question. I am happy to improve my score.