Title: Expressive probabilistic sampling in recurrent neural networks
Venue: NeurIPS 2023
Accepted: yes
Keywords: neural coding

probabilistic sampling

neural dynamics

recurrent neural network
Abstract: In sampling-based Bayesian models of brain function, neural activities are assumed to be samples from probability distributions that the brain uses for probabilistic computation. However, a comprehensive understanding of how mechanistic models of neural dynamics can sample from arbitrary distributions is still lacking. We use tools from functional analysis and stochastic differential equations to explore the minimum architectural requirements for $\textit{recurrent}$ neural circuits to sample from complex distributions. We first consider the traditional sampling model consisting of a network of neurons whose outputs directly represent the samples ($\textit{sampler-only}$ network). We argue that synaptic current and firing-rate dynamics in the traditional model have limited capacity to sample from a complex probability distribution. We show that the firing rate dynamics of a recurrent neural circuit with a separate set of output units can sample from an arbitrary probability distribution. We call such circuits $\textit{reservoir-sampler networks}$ (RSNs). We propose an efficient training procedure based on denoising score matching that finds recurrent and output weights such that the RSN implements Langevin sampling. We empirically demonstrate our model's ability to sample from several complex data distributions using the proposed neural dynamics and discuss its applicability to developing the next generation of sampling-based Bayesian brain models.

Expressive probabilistic sampling in recurrent neural networks

Abstract

In sampling-based Bayesian models of brain function, neural activities are assumed to be samples from probability distributions that the brain uses for probabilistic computation. However, a comprehensive understanding of how mechanistic models of neural dynamics can sample from arbitrary distributions is still lacking. We use tools from functional analysis and stochastic differential equations to explore the minimum architectural requirements for recurrent neural circuits to sample from complex distributions. We first consider the traditional sampling model consisting of a network of neurons whose outputs directly represent the samples ( sampler-only network). We argue that synaptic current and firing-rate dynamics in the traditional model have limited capacity to sample from a complex probability distribution. We show that the firing rate dynamics of a recurrent neural circuit with a separate set of output units can sample from an arbitrary probability distribution. We call such circuits reservoir-sampler networks (RSNs). We propose an efficient training procedure based on denoising score matching that finds recurrent and output weights such that the RSN implements Langevin sampling. We empirically demonstrate our model's ability to sample from several complex data distributions using the proposed neural dynamics and discuss its applicability to developing the next generation of sampling-based Bayesian brain models.

1 Introduction

There is growing evidence that humans and other animals make decisions by representing uncertainty internally and carrying out probabilistic computations that approximate Bayesian inference [42, 30, 18, 23, 34]. How networks of neurons in the brain represent probability distributions for Bayesian inference has remained a major open question. There exist two major theories: one assumes that the neural activities encode the parameters of the underlying posterior distributions over sensory stimuli [5, 35, 52]. The other is the sampling-based hypothesis, which assumes that the neural responses can be interpreted as samples from a posterior distribution [28]. Under this hypothesis, recurrent neural circuits make use of their inherent stochasticity to produce samples from posterior distributions. The

Department of Applied Mathematics Computational Neuroscience Center University of Washington, Seattle etsb@uw.edu

sampling-based theory has explained various experimental observations regarding neural variability [19, 20, 40], perceptual decision-making [24] and spontaneous cortical activity [7].

Many studies have proposed biologically plausible spiking rules and membrane dynamics models to implement sampling-based probabilistic inference. However, most of these studies mainly consider sampling from discrete Boltzmann distributions [12] and multivariate Gaussian distributions [17, 1, 38, 25], only match the first two moments of the distribution [19], or employ a Monte-Carlo approximation [29]. Although these studies use algorithmic substrates that can sample from any distribution with a density function in theory , it is not clear whether the underlying neural dynamics are capable of implementing a sufficiently expressive version of these sampling methods. Furthermore, natural image statistics are strongly non-Gaussian [39], and experimental evidence shows that humans use non-Gaussian prior representations to support cognitive judgments [27, 22]. It is known that deep artificial neural networks can be used to generate samples from complex data distributions [48, 49] using a 'U-net' [43] backbone. However, the neural circuits in the cortex are highly coupled with an abundance of recurrent synapses. Therefore, an outstanding question for probabilistic computation in the brain is: what kind of recurrent neural network is capable of efficiently learning to produce samples from an arbitrarily complex posterior distribution?

In this paper, we study this question under the basic assumption that the dynamics of recurrent neural circuits can be described by stochastic differential equations (SDEs). Note that this assumption is common to a broad range of past research that uses rate-based neural dynamics to implement sampling-based coding[1, 19, 17]. Moreover, spike-based models [46, 45, 38] that implement balanced spiking networks (BSNs) [11, 13] essentially train spiking networks to follow underlying continuous-time SDEs, so our work applies to this line of research as well (details in Appendix G).

The contributions of this paper are as follows (Figure 1):

We establish the relationship between the sampling power of the neural dynamics and the ability of the dynamics to approximate the score function, which is the gradient of the log probability density function. (Section 3.1)

We show that the synaptic current dynamics of a network of neurons whose outputs directly represent the samples (traditional sampler-only network) is only able to approximate score functions that are in a finite-dimensional function space. (Section 3.2, Proposition 2)

We prove that the firing rate dynamics of our proposed reservoir-sampler network can sample from a distribution whose score function can approximate that of arbitrary target distributions (with mild restrictions) to arbitrary precision (Section 3.3, Theorem 3).

We derive a computationally efficient and biologically-plausible learning rule for our proposed model (Section 3.4) that sidesteps the demands of backpropagation through time, and we empirically demonstrate how our model can sample from several complex data distributions (Section 4).

And interpretation of our contributions in biological terms is as follows: 1. Flexible synaptic connectivity within a circuit itself is not enough to allow that circuit to flexibly produce arbitrary patterns of variability involving all of its neurons. 2. In order for circuit to achieve full flexibility in its output patterns, there need to be hidden variables involved, e.g. states of neurons in an upstream brain area or possibly non-synaptic signalling. If this condition is met, concrete and fairly efficient plasticity rules may be capable of shaping the output patterns as desired.

2 Background

2.1 Fokker-Planck equation and stationary distribution

We consider a general time-homogeneous SDE with drift vector b ( X t ) and diffusion matrix Σ = 1 2 σσ T :

where σ ∈ R n × m is the diffusion coefficient, and B t is an m -dimensional standard Wiener process. The Fokker-Planck equation of this SDE describes the time evolution of the probability density p ( x, t ) for a given SDE, assuming the initial density p ( x, 0) is known:

Reservoir-SamplerNetwork

Neural Dynamics in SDE

Neural Samples

Reservoir

Wout

Firing rate dynamics:

dr = D [-r + Φ(Wreer + I)] dt + odB,

1

7

7

x = Woutr

9

Wrecl

Approximationpower

49

#Func.basis

Fixed?

Closed?

95

Noise

nneurons

》m neurons

SO-FR

0(m)

No

No

SO-SC

0(m)

Yes

Yes

Sampler-Only Network

RS-FR

(u)o

No

Yes

RS-SC

Intractable

Intractable

Intractable

SO:Sampler-Only Architecture

SC:Synaptic Current

Noise

Wrec

RS: Reservoir-Sampler Architecture

FR: Firing Rate

Synaptic current dynamics:

dv = D [-v + WrecΦ(v) + 1] dt + odB,

V:current

Firing rate dynamics:

r :firing rate

dr = D [-r + Φ(Wrecr + I)] dt + odB,

mneurons

where ∂ t = ∂/∂t , ∇· is the divergence operator, and ∇ is the gradient operator. A stationary probability density function is one for which the right-hand-side of equation (2) is 0. Mild regularity conditions guaranteeing the existence and uniqueness of a stationary density function are discussed in, for example, Cerrai [14]. We assume these are satisfied by the SDEs considered in this paper. Moreover, to ensure ergodicity and a well-defined score function, we assume that p is supported on R n , i.e. p ( x ) > 0 for all x ∈ R n .

As a special case, consider the following Langevin dynamics, in which the drift term is given by the gradient of the log stationary probability density ∇ p ( x ) ,

It can be verified through the Fokker-Planck equation that p ( x ) in the dynamics above is indeed a stationary probability density function of the dynamics. Therefore the Langevin dynamics can sample from the distribution p ( x ) as t → ∞ . While the drift term in the Langevin dynamics is a gradient vector field, this is not true in general and is often not the case for recurrent neural dynamics (Proposition 5 in Appendix B).

2.2 Score-based generative modeling

If we would like a particular dynamics to implement Langevin dynamics, we need to fit the drift term of an SDE to the score s θ ( x ) = ∇ log p ( x ) of the probability distribution that we are trying to sample from. This procedure of fitting the score function s θ ( x ) is called score matching. In this section, we give a brief summary of one of the major methods of score matching that we will use in this paper, denoising score matching (DSM) [51]. The general idea of DSM is to match the score of a noise-perturbed version of the target distribution. More specifically, the explicit score matching loss

(left-hand side) and the denoising score matching loss (right-hand side) are related to each other as follows [51]:

where ˜ x is a noise-perturbed version of x , so q σ (˜ x | x ) = N ( x , σ ) , and C is a constant depending on σ but not on θ . When the noise is 0, i.e. ˜ x = x , the left-hand side of the equation above is the explicit score matching loss. Although in theory we can start from extremely small Gaussian noise, and directly optimize the right hand of equation (4), empirically it is beneficial to start with large Gaussian noise and gradually decrease the noise magnitude until q σ ( x ) ≈ p ( x ) and s θ ( x ) ≈ ∇ x log q σ ( x ) ≈ ∇ x log p ( x ) . Specifically, this has been shown to stabilize the training and improve score estimation [48].

3 Methods

3.1 Do we really need to match the score?

The Langevin dynamics provides an elegant way to construct an SDE given a specific stationary distribution. However, as noted above, the neural network dynamics seldom have a drift term that is a gradient field (Appendix B). A natural question is therefore whether an SDE with a drift term that is not a gradient field (also known as irreversibility) also gives rise to a specific stationary distribution. The answer requires us to look at the Fokker-Planck equation:

where p ( v , t ) is the probability density function of the variable of interest v at time t , F θ ( v ) is the drift term of the neural dynamics parametrized by θ , and Σ = 1 2 σσ T is the diffusion matrix. Since the right-hand side of (5) needs to be 0 for a given stationary distribution p ( v ) , we have

Therefore G := -Σ ∇ p + pF θ ( v ) needs to be a divergence-free (DF) vector field. In other words, pF θ ( v ) is unique up to a DF field given a fixed stationary distribution p . Maet al. [36] shows that there exists a skew-symmetric matrix Q such that the DF field can be written as G = Q ∇ p + p ∑ j ∂ ∂ v j Q ij , however, this does not shed more light on how expressive { F θ } θ needs to be without more knowledge of Q and its derivative. We show below that under certain conditions, the DF field G can be regarded as a component that is orthogonal to the score function. Therefore the function space { F θ } θ needs to have enough basis functions so that (when projected) it is able to approximate the score function of the target distribution.

We first note that it would be convenient if F θ ( v ) could approximate the gradient fields Σ -1 ∇ log p for any p , in which case G = 0 . To find out if this is a necessary condition for the dynamics to sample from an arbitrary target distribution p , we let Σ = I and invoke the Helmholtz-Hodge decomposition (HHD) [8, 37]. The decomposition theorem states that any sufficiently smooth vector field in L 2 ( R n ; R n ) can be uniquely decomposed into a DF vector field and a pure gradient field. In other words, the function space of all DF fields G and the function space of all gradient fields ∇ p are the orthogonal complement of each other. Therefore the projection of pF θ ( v ) onto the subspace of smooth gradient fields still needs to be able to approximate ∇ p despite the freedom to choose arbitrary DF field G .

For example, in the 1-D case, if we assume that both pF θ ( v ) and ∇ p are square-integrable (so they vanish at infinity), then the divergence-free vector field G (which must be constant in 1-D) is 0, therefore F θ ( v ) = ∇ log p . As a result, { F θ } θ indeed needs to be able to approximate ∇ log p for every p . In higher dimensions, the same conclusion holds under the assumption of a strict orthogonality constraint:

Proposition 1. Let p be the stationary distribution of the neural dynamics, and the diffusion matrix be the identity matrix. If the DF field G is strictly orthogonal to the gradient field ∇ p , meaning that G ( v ) · ∇ p ( v ) = 0 for all v , then the drift term F θ ( v ) can be written as the sum of a divergence-free field p -1 G and a gradient field ∇ log p .

The proof and further detail is in Appendix A. The form of the above decomposition coincides with that of the HHD [8, 9]. Therefore if we enforce the normal-parallel boundary condition [15] for the gradient component, the HHD theorem [8] says that the orthogonal projection of the function space { F θ } θ onto the space of gradient fields is the function space of gradient fields {∇ log p } p satisfying the boundary condition given the strict orthogonality constraint on G . The upshot is that { F θ } θ needs to admit enough basis functions (Appendix A). Note that the boundary condition will not be restrictive if we take a sufficiently large bounded region. Therefore it is essential for the neural dynamics to have an expressive functional form that is able to approximate complex score functions, even if their dynamics are not gradient fields.

Previous work has rigorously established that the strict orthogonality constraint holds, in particular, when the nonlinear dynamics is linearized around fixed points of v (where the drift term is zero [2, 31, 41]). As a consequence, the conditions of Proposition 1 are true locally around fixed points.

In what follows, we assume that the conditions of the Proposition 1 hold. Under this assumption, without loss of generality, we set G to be 0 in the following text and explore whether Σ -1 F θ , which is determined by the specific neural dynamics (Figure 1), is able to approximate complex score function ∇ log p .

3.2 Synaptic current dynamics: sampler-only networks with limited capacity

We consider the following stochastic synaptic current dynamics [16] (cf. eq. 7.39) that describe a recurrent neural network in terms of the synaptic current that each neuron receives:

where F SC θ ( v ) := D ( -v + Wϕ ( v ) + I ) , v = [ v 1 , · · · , v m ] T ∈ R m is the synaptic current of the m neurons in the recurrent network, D ∈ R m × m is a diagonal matrix where diagonal elements are the decay constants, d i = τ -1 i , W ∈ R m × m is the connection matrix, ϕ ( · ) is a nonlinear transfer function 2 , I ∈ R m is the external input, σ ∈ R m × l is the diffusion coefficient and B t is an l -dimensional standard Wiener process. The diffusion term can be interpreted as input from other brain areas (due to the large number of incoming connections, the assumption of Gaussianity can be justified by the central limit theorem [21]). We assume that θ = { D,W,I } are tunable parameters through biological learning. To show the limited expressivity of F SC θ , we have the following corollary from the Hilbert projection theorem showing that F SC θ is only able to approximate functions in a finite-dimensional function space.

Proposition 2. Let H : R m → R m , a function in the Hilbert space L 2 ( R m , R m ; p ) . Let Π be the orthogonal projection operator onto the vector subspace

Proof of the proposition is given in Appendix B.1. The proposition says that no matter how the parameter of F SC θ is tuned, the difference between F SC θ and the target function cannot approach 0, and the lower bound of the error is given by the norm of the component in the target function that is orthogonal to the finite-dimensional function space E . Therefore, synaptic current dynamics have a limited ability to match the score function and hence limited ability to sample from complex probability distributions under the strict orthogonality constraint in Section 3.1. The conclusion holds even if we let the diffusion coefficient σ be tunable. Since Σ -1 is linear, { F SC θ } θ share the same set of basis functions as { Σ -1 F SC θ } θ,σ . As we will see in the next section, the firing rate dynamics of a recurrent neural circuit with a separate output layer (a reservoir-sampler network) and a learnable diffusion coefficient σ can sample from arbitrary stationary distributions.

3.3 Firing-rate dynamics could be a universal sampler

3.3.1 Sampler-only networks

In this section, we consider the firing rate dynamics [16] (cf. eq. 7.11) that describe a recurrent neural circuit in terms of firing rates of the neurons. We first consider the sampler-only network:

Here, F FR θ ( v ) = D ( -r + ϕ ( W rec r + I )) and D is a diagonal matrix with decay constants as its diagonal elements. The stationary solution of the corresponding Fokker-Planck equation satisfies

where Σ := 1 2 σσ T is symmetric positive definite (SPD) and F FR θ = D ( -r + ϕ ( W rec r + I )) . Here θ = { D,W rec , I } are tunable parameters. If Σ is invertible, equation (9) becomes ∇· (Σ( ∇ p -p Σ -1 F FR θ )) . Therefore if Σ -1 F FR θ = ∇ log p is a gradient field, then the stochastic dynamics of the recurrent neural network described by equation (8) have a stationary distribution p ∗ such that the score of this distribution ∇ log p ∗ = Σ -1 F FR θ .

Compared to the synaptic current dynamics where we could only have functional basis v i and ϕ ( v ) i , we can now freely choose the functional basis spanning { F FR θ } θ depending on W rec and I , but since there is no linear term before the nonlinear transformation ϕ , the function set { F FR θ } θ is not closed under addition. If we view Σ -1 F FR θ as a neural network with one hidden layer, the number of hidden neurons must be the same as the input dimension, and the diffusion matrix Σ (hence Σ -1 ) is restricted to be an SPD matrix. Therefore, we do not get universal approximation power from Σ -1 F FR θ , and combined with results in Section 3.2, we see that an RNN by itself does not intrinsically produce samples from arbitrary distributions. As we will see below, if we let a population of output neurons receive inputs from a large reservoir of recurrently connected neurons (a reservoir-sampler network), we are able to obtain samples from complex distributions from the output neurons.

3.3.2 Reservoir-sampler networks

Now we consider the reservoir-sampler network where there is a linear readout layer W out ∈ R m × n of the reservoir whose dynamics is given by equation (8) (see also the upper row of Figure 1). As a special case of Ito's lemma, we have

Now we assume that W rec is the product of ˜ W rec and W out , i.e. W rec = ˜ W rec W out and D = α I is a scaled identity matrix. If we denote the output of the recurrent neural network as x := W out r ∈ R m , we derive the following stochastic dynamics for output neurons:

where ˜ F FR θ ( x ) = ( -α x + αW out ϕ ( ˜ W rec x + I )) and ˜ σ = W out σ . Therefore in order for the output neurons to sample from a stationary distribution p , we need s β ( x ) = ( 1 2 ˜ σ ˜ σ T ) -1 ˜ F FR θ ( x ) := ˜ Σ -1 ˜ F FR θ ( x ) to match the score ∇ log p ( x ) . Here β = { ˜ W rec , W out , I, σ } are tunable parameters.

Additionally, we assume that ˜ F FR θ is 0 outside a reasonable range of x . This assumption is used to prevent s β ( x ) from behaving wildly outside the bounded region on which s β ( x ) has the expressivity to match the score. The following theorem proves that with a large enough number of reservoir neurons, the score-matching loss can be arbitrarily small. The proof is given in Appendix C.

Theorem 3. Suppose that we are given a probability distribution with continuously differentiable density function p ( x ) : R m → R + and score function ∇ log p ( x ) for which there exist constants M 1 , M 2 , a, k > 0 such that

when ∥ x ∥ > L for large enough L . Then for any ε > 0 , there exists a recurrent neural network whose firing-rate dynamics are given by (11) , whose recurrent weights, output weights and the diffusion coefficient are given by W rec ∈ R n × n of rank m , W out ∈ R m × n , and σ ∈ R n × m respectively, such that, for a large enough n , the score of the stationary distribution of the output units s θ ( x ) satisfies E x ∼ p ( x ) [ ∥∇ log p ( x ) -s θ ( x ) ∥ 2 ] < ε .

This theorem says that for any realistic data distribution with a smooth positive density function, there always exists a reservoir of recurrently-connected neurons whose output units give samples from a

distribution whose score function approximates that of the data distribution to arbitrary precision. Given the bound on the score matching error, Block et al. [10] (cf. Theorem 13) gives bounds in Wasserstein 2-distance between the stationary distribution of the trained recurrent dynamics and the true data distribution. It is also worth noting that the recurrent weight matrix of the neural circuit in the theorem is of low-rank, so regardless of how many neurons there are in the reservoir, we can always find a low-rank recurrent weight matrix such that the output neurons sample from a correspondingly low-dimensional distribution.

3.4 An efficient RNN weight learning algorithm

The training procedure is derived from the proof of Theorem 3. The main idea is to first train an auxiliary neural network with one hidden layer, then transfer the weights of the auxiliary neural network to the weights of the recurrent network that we are considering. More specifically, we first optimize an auxiliary feedforward neural network with one hidden layer W out ϕ ( ˜ W rec x + I ) using backpropagation with the denoising score matching loss (4) such that

Then we can calculate the diffusion coefficient σ = W T out ( W out W T out ) -1 and the real recurrent weights W rec = ˜ W rec W out accordingly. The noise magnitude added to the data samples is decreased exponentially over the entire training period. Figure 2 illustrates how the network can gradually learn the score function during training. We refer the readers to Appendix D for more details.

Note that this method of using an auxiliary neural network is much more computationally efficient than directly matching the score of the stationary distribution of the dynamics (11), for which the score function, which involves the matrix inverse (˜ σ ˜ σ T ) -1 , needs to be recomputed at each optimization step. Furthermore, since the entire training procedure is equivalent to training a feedforward network with one hidden layer, it sidesteps the often challenging temporal computations associated with the Backpropagation Through Time (BPTT) algorithm used to train deterministic RNNs.

Although we assumed that the divergence free field G = 0 for the purpose of theoretical analysis, in practice, fast sampling is a major concern for implementing sampling-based inference models of the brain [25, 1, 19, 38], and reversible stochastic dynamics, i.e. if G = 0 , are known for their slow sampling speed. Fortunately, there is a straightforward way to extend our framework and train RSNs to implement irreversible dynamics with a non-zero divergence-free field G . This results in improvements in sampling speed (see Appendix E for details).

4 Experimental results

In this section, we present the results from two tasks. First, we try to let the recurrent neural network learn and generate samples from a 1-D double-mode Gaussian mixture distribution and a 2-D mixture of heavy-tailed Laplace distributions. For the second task, we explore whether a reservoir-sample network with firing rate dynamics is able to sample from the distribution of internal representations computed from PCA filtering of image inputs. All dynamics are simulated with the Euler-Maruyama method. See Appendix H for hyperparameters used and other training details.

4.1 Learning mixture distributions

We consider a 1-D Gaussian mixture distribution whose density function is the average of two Gaussian distributions centered at ± 1 , i.e. p data ( x ) = 1 2 ( N ( -1 , 0 . 25) + N (1 , 0 . 25)) . We artificially generate 10000 data points from this distribution and minimize the denoising score-matching loss:

We use ϕ ( · ) = ReLU ( · ) and set α = 1 / 2 . See Figure 2 for the numerical results. It is worth noting that if we use tanh as the transfer function, the sampler-only networks are able to learn the score function perfectly, as the score function of the Gaussian mixture distribution we considered is exactly spanned by f 1 ( x ) = x and f 2 ( x ) = tanh(2 x ) . See Appendix F.1 for an example where sampler-only networks fail to learn the score function even if hyperbolic tangent nonlinearity is used.

SO-SC

SO-FR

RS-FR

a)

b)

c)

100

5.0

truescore

5.0

true score

5.0

true score

2.5

2.5

2.5

Noise

score

0.0

0.0

0.0

-2.5

-2.5

-2.5

10-1

-5.0

-5.0

-5.0

(p

-2

0

2

e）

-2

0

2

f）

-2

0

2

Ipoints

200F

200F

200

Scaled density

Sampled points

150

150

150

sampled

100

100

100

50

50

50

#

0

-2

0

2

0

-2

0

2

0

-2

0

2

V

r

x

Next, we show that the model can learn mixtures of heavy-tailed distributions that are evident in natural image statistics and the neural representations in the primary visual cortex [47, 39]. We trained the Reservoir-Sampler network with FR dynamics (RS-FR) model on 20000 sampled data points from a 2-D Laplace mixture distribution, whose density is given by

variate Laplace distribution. The model successfully learned the probability density of the mixture distribution (Figure 3 left vs. middle), and captured the heavy tails of the distribution as measured by the kurtosis (Figure 3 right).

4.2 MNIST generation task

We also tested the sampling ability of our model using the MNIST dataset [32] which contains 60,000 handwritten digits from 0 to 9. We projected MNIST images to a 300-D latent space spanned by the first 300 principal components, and trained the weights of the recurrent neural network as described in Section 3.4 so that the RNN can sample from the latent distribution. To test the model, we generated images by applying inverse PCA projection to samples generated by the model. The schematics and generated images are shown in Figure 4. Note that since we are essentially using a shallow network to match the score, we should not expect comparable performance to generative models that use deep ANNs. Our main goal is to illustrate that the reservoir-sampler network using firing rate dynamics is qualitatively more expressive than other traditional neural sampling models (Appendix G). Finally we also note that it is highly nontrivial for recurrent neural dynamics to complete such a generative task, and to the best of our knowledge, no previous work has achieved such results.

x

x

2

x

x

1

x

2

True

Generated

True sample

Generated sample

2.5

7

2.0

Kurtosis

0

1.5

1.0

0.5

4

-2

2

4

4

-2

2

4

0.0

1

1

a)

Training

c)

e)

Reservoir

Sampling

RS-FR

Training Samples

Wout

X

PCA

9112

68

.

..

.

7

1

20

6

2

9

Wrec

9

1

238

8

8

/

T

3 6

g

1

Inv. PCA

1

16

3y308

Noise

b)

(p

f)

SO-SC

SO-FR

105

SO-FR

SO-SC

2

104

RS-FR

0

Loss

103

3

2 × 10°

102

9

101

100

6 × 10#

6

店

0

200

400

600

800

1000

Epoch

5 Discussion

From the perspective of functional analysis and SDE theory, we prove that under the strict orthogonality constraint, it is essential for neural circuits to have a drift term that has the expressivity to approximate complex score functions, despite the fact that the dynamics do not have to exactly implement the Langevin dynamics. We investigated whether a population of neurons can sample from an arbitrary distribution directly and proved that the drift term of the synaptic current dynamics can only sample from a finite-dimensional function space. Although the drift term of the firing

rate dynamics can approximate functions spanned by different basis functions, the number of basis functions is limited. To address this problem, we proposed the reservoir-sampler network for firing rate dynamics. We found that with learnable diffusion coefficients and a sufficiently large reservoir of hidden neurons, the output neurons described using the firing rate dynamics are able to sample from arbitrary data distributions. Our results partly answer the question of what architecture recurrent neural circuits need so that they are able to sample from complex data distributions.

Our analysis and empirical experiments affirm the universality of stochastic RNNs. However, this universality comes with limitations. First, we have only analytically shown the existence of weights that enable sampling from complex data distributions; there is no guarantee that one will find such weights through backpropagation. Additionally, in order to obtain the tunable diffusion coefficient during training, a matrix inverse is needed (likewise in the FORCE algorithm [50]). Further, the question of how biological circuits compute the specific gradient and implement the denoising scorematching algorithm remains an open question. Moreover, in our current formulation, we are only able to approximate the score function with a shallow network with one hidden layer. Our preliminary experiments show that one-hidden-layer RSNs cannot readily approximate high-dimensional heavytailed distributions ( e.g. , those of overcomplete sparse coding representations [39]). It is unclear if this is because of insufficient number of reservoir neurons. Due to the limitation of the GPU memory, we did not try higher number of reservoir neurons.

Our model differs from recent diffusion models [26, 49], which can be seen as time-inhomogeneous SDEs, and has the advantage of being able to run indefinitely in time, making it a suitable candidate for modeling spontaneous activity in the brain. Moreover, while Song and Ermon [48] optimizes the denoising score matching loss at different noise levels jointly, we adopt a sequential learning procedure by gradually decreasing the noise level of the training samples. This procedure is more aligned with the developmental processes involved in forming visual representations in the infant brain, where the distribution of visual representations are thought to be noisier (less linearly separable) initially [4]. Our study therefore serves as a starting point for building a mechanistic model for probabilistic computation in the brain that has similar generative power to current AI generative models.

Biologically, there are multiple ways to interpret the reservoir neurons and sampler neurons in an RSN. First, reservoir and sampler neurons could be seen as different types of neurons in a single brain area, where the dynamics of sampler neurons converge quickly to the equilibrium point. Second, even more straightforwardly, the sampler neurons could be seen as a more separate set of neurons located downstream of the reservoir. We also wish to suggest an alternative interpretation. Biological neural networks are known to have non-synaptic signaling networks (e.g. pervasive neuropeptidergic signaling [3], extensive aminergic signaling [6] or potential extrasynaptic signaling [53]) in addition to the synaptic connectivity that is typically modeled (i.e., via connection weights). We suggest that it is possible that the computations of the reservoir may be implemented by non-synaptic networks, and then 'read out' by certain neurons' spikes. This possibility is supported by the recent finding of a low correlation between functional activity and the synaptic ('structural') connectome in C.elegans [53]. Morever, if we only take the structural connectome into consideration, then the resulting model of C. elegans would correspond to the sampler-only network, which, as our theory predicts, will have limited sampling capability.

6 Conclusion

In this paper, we explore how a recurrent neural circuit can sample from complex probability distributions, an important functional motif in probabilistic brain models. We start from a basic assumption that the recurrent neural circuit could be described as an SDE. We show that a recurrentlyconnected neural population by itself has a limited capability to implement stochastic dynamics that can sample from complex data distributions. In contrast, we prove that firing rate dynamics of the output units of a recurrent neural circuit (a reservoir-sampler network) can sample from a richer range of probability distributions. These theoretical results, together with our preliminary experimental results, provide a sufficient condition for neural sampling-based models to exhibit universal sampling capability. Our results therefore provide a foundation for the next generation of sampling-based probabilistic brain models that can explain a wider range of cognitive behaviors.

References

Laurence Aitchison and M´ at´ e Lengyel. The Hamiltonian Brain: Efficient Probabilistic Inference with Excitatory-Inhibitory Neural Circuit Dynamics. PLOS Computational Biology , 12(12):e1005186, December 2016. ISSN 1553-7358. doi: 10.1371/journal.pcbi. 1005186. URL https://journals.plos.org/ploscompbiol/article?id=10.1371/ journal.pcbi.1005186 . Publisher: Public Library of Science.

P. Ao. Potential in stochastic differential equations: novel construction. Journal of Physics A: Mathematical and General , 37(3):L25, January 2004. ISSN 0305-4470. doi: 10.1088/ 0305-4470/37/3/L01. URL https://dx.doi.org/10.1088/0305-4470/37/3/L01 .

Cornelia I Bargmann and Eve Marder. From the connectome to brain function. Nature methods , 10(6):483-490, 2013.

Laurie Bayet, Benjamin D. Zinszer, Emily Reilly, Julia K. Cataldo, Zoe Pruitt, Radoslaw M. Cichy, Charles A. Nelson, and Richard N. Aslin. Temporal dynamics of visual representations in the infant brain, August 2020. URL https://www.biorxiv.org/content/10.1101/2020. 02.26.947911v3 . Pages: 2020.02.26.947911 Section: New Results.

Jeffrey M. Beck, Wei Ji Ma, Roozbeh Kiani, Tim Hanks, Anne K. Churchland, Jamie Roitman, Michael N. Shadlen, Peter E. Latham, and Alexandre Pouget. Probabilistic population codes for Bayesian decision making. Neuron , 60(6):1142-1152, December 2008. ISSN 0896-6273. doi: 10.1016/j.neuron.2008.09.021. URL https://www.ncbi.nlm.nih.gov/pmc/articles/ PMC2742921/ .

Barry Bentley, Robyn Branicky, Christopher L Barnes, Yee Lian Chew, Eviatar Yemini, Edward T Bullmore, Petra E V´ ertes, and William R Schafer. The multilayer connectome of caenorhabditis elegans. PLoS computational biology , 12(12):e1005283, 2016.

Pietro Berkes, Gergo Orban, M´ at´ e Lengyel, and J´ ozsef Fiser. Spontaneous Cortical Activity Reveals Hallmarks of an Optimal Internal Model of the Environment. Science , 331(6013): 83-87, January 2011. ISSN 0036-8075, 1095-9203. doi: 10.1126/science.1195870. URL https://www.science.org/doi/10.1126/science.1195870 .

Harsh Bhatia, Gregory Norgard, Valerio Pascucci, and Peer-Timo Bremer. The HelmholtzHodge Decomposition-A Survey. IEEE Transactions on Visualization and Computer Graphics , 19(8):1386-1404, August 2013. ISSN 1941-0506. doi: 10.1109/TVCG.2012.316. Conference Name: IEEE Transactions on Visualization and Computer Graphics.

Harsh Bhatia, Valerio Pascucci, and Peer-Timo Bremer. The Natural Helmholtz-Hodge Decomposition for Open-Boundary Flow Analysis. IEEE Transactions on Visualization and Computer Graphics , 20(11):1566-1578, November 2014. ISSN 1941-0506. doi: 10.1109/TVCG.2014.2312012. Conference Name: IEEE Transactions on Visualization and Computer Graphics.

Adam Block, Youssef Mroueh, and Alexander Rakhlin. Generative Modeling with Denoising Auto-Encoders and Langevin Sampling, October 2022. URL http://arxiv.org/abs/2002. 00107 . arXiv:2002.00107 [cs, math, stat].

Martin Boerlin, Christian K. Machens, and Sophie Den` eve. Predictive Coding of Dynamical Variables in Balanced Spiking Networks. PLOS Computational Biology , 9(11):e1003258, November 2013. ISSN 1553-7358. doi: 10.1371/journal.pcbi. 1003258. URL https://journals.plos.org/ploscompbiol/article?id=10.1371/ journal.pcbi.1003258 . Publisher: Public Library of Science.

Lars Buesing, Johannes Bill, Bernhard Nessler, and Wolfgang Maass. Neural Dynamics as Sampling: A Model for Stochastic Computation in Recurrent Networks of Spiking Neurons. PLOS Computational Biology , 7(11):e1002211, November 2011. ISSN 1553-7358. doi: 10.1371/journal.pcbi.1002211. URL https://journals.plos.org/ploscompbiol/ article?id=10.1371/journal.pcbi.1002211 . Publisher: Public Library of Science.

Camille E. Rull´ an Bux´ o and Jonathan W. Pillow. Poisson balanced spiking networks. PLOS Computational Biology , 16(11):e1008261, November 2020. ISSN 1553-7358. doi: 10.1371/ journal.pcbi.1008261. URL https://journals.plos.org/ploscompbiol/article?id= 10.1371/journal.pcbi.1008261 . Publisher: Public Library of Science.

S. Cerrai. Second Order PDE's in Finite and Infinite Dimension: A Probabilistic Approach . Number no. 1762 in Lecture Notes in Mathematics. Springer, 2001. ISBN 978-3-540-42136-8. URL https://books.google.com/books?id=pD-JeUpKrXMC .

Alexandre J. Chorin and Jerrold E. Marsden. A Mathematical Introduction to Fluid Mechanics , volume 4 of Texts in Applied Mathematics . Springer, New York, NY, 1993. ISBN 978-14612-6934-2 978-1-4612-0883-9. doi: 10.1007/978-1-4612-0883-9. URL http://link. springer.com/10.1007/978-1-4612-0883-9 .

Peter Dayan and Laurence F. Abbott. Theoretical Neuroscience: Computational and Mathematical Modeling of Neural Systems . MIT Press, August 2005. ISBN 978-0-262-54185-5. Google-Books-ID: fLT4DwAAQBAJ.

Xingsi Dong, Zilong Ji, Tianhao Chu, Tiejun Huang, Wenhao Zhang, and Si Wu. Adaptation Accelerating Sampling-based Bayesian Inference in Attractor Neural Networks. October 2022. URL https://openreview.net/forum?id=Y0Bm5tL92lg .

Kenji Doya, Shin Ishii, Alexandre Pouget, and Rajesh Rao. Bayesian brain. Probabilistic approaches to neural coding. January 2007.

Rodrigo Echeveste, Laurence Aitchison, Guillaume Hennequin, and M´ at´ e Lengyel. Corticallike dynamics in recurrent circuits optimized for sampling-based probabilistic inference | Nature Neuroscience. Nature Neuroscience , 23(9):1138-1149, September 2020. ISSN 1546-1726. doi: 10.1038/s41593-020-0671-1. URL https://www.nature.com/articles/ s41593-020-0671-1 .

Dylan Festa, Amir Aschner, Aida Davila, Adam Kohn, and Ruben Coen-Cagli. Neuronal variability reflects probabilistic inference tuned to natural image statistics. Nature Communications , 12(1):3635, June 2021. ISSN 2041-1723. doi: 10.1038/s41467-021-23838-x. URL https://www.nature.com/articles/s41467-021-23838-x . Number: 1 Publisher: Nature Publishing Group.

Wulfram Gerstner, Werner M. Kistler, Richard Naud, and Liam Paninski. Neuronal dynamics: From single neurons to networks and models of cognition . Cambridge University Press, 2014.

Thomas L. Griffiths and Joshua B. Tenenbaum. Optimal predictions in everyday cognition. Psychological Science , 17(9):767-773, September 2006. ISSN 0956-7976. doi: 10.1111/j. 1467-9280.2006.01780.x.

Thomas L. Griffiths, Nick Chater, Charles Kemp, Amy Perfors, and Joshua B. Tenenbaum. Probabilistic models of cognition: exploring representations and inductive biases. Trends in Cognitive Sciences , 14(8):357-364, August 2010. ISSN 1364-6613. doi: 10.1016/j.tics.2010.05.004. URL https://www.sciencedirect.com/science/article/pii/S1364661310001129 .

Ralf M. Haefner, Pietro Berkes, and J´ ozsef Fiser. Perceptual Decision-Making as Probabilistic Inference by Neural Sampling. Neuron , 90(3):649-660, May 2016. ISSN 0896-6273. doi: 10. 1016/j.neuron.2016.03.020. URL https://www.sciencedirect.com/science/article/ pii/S0896627316300113 .

Guillaume Hennequin, Laurence Aitchison, and Mate Lengyel. Fast Sampling-Based Inference in Balanced Neuronal Networks. In Advances in Neural Information Processing Systems , volume 27. Curran Associates, Inc., 2014. URL https://proceedings.neurips.cc/paper/ 2014/hash/a7d8ae4569120b5bec12e7b6e9648b86-Abstract.html .

Jonathan Ho, Ajay Jain, and Pieter Abbeel. Denoising Diffusion Probabilistic Models. In Advances in Neural Information Processing Systems , volume 33, pages 6840-6851. Curran Associates, Inc., 2020. URL https://proceedings.neurips.cc/paper/2020/hash/ 4c5bcfec8584af0d967f1ab10179ca4b-Abstract.html .

Neil M.T. Houlsby, Ferenc Husz´ ar, Mohammad M. Ghassemi, Gergo Orb´ an, Daniel M. Wolpert, and M´ at´ e Lengyel. Cognitive Tomography Reveals Complex, Task-Independent Mental Representations. Current Biology , 23(21):2169-2175, November 2013. ISSN 0960-9822. doi: 10.1016/j.cub.2013.09.012. URL https://www.ncbi.nlm.nih.gov/pmc/articles/ PMC3898796/ .

Patrik Hoyer and Aapo Hyv¨ arinen. Interpreting Neural Response Variability as Monte Carlo Sampling of the Posterior. In Advances in Neural Information Processing Systems , volume 15. MIT Press, 2002. URL https://proceedings.neurips.cc/paper/2002/hash/ a486cd07e4ac3d270571622f4f316ec5-Abstract.html .

Yanping Huang and Rajesh PN Rao. Neurons as Monte Carlo Samplers: Bayesian Inference and Learning in Spiking Networks. In Advances in Neural Information Processing Systems , volume 27. Curran Associates, Inc., 2014. URL https://proceedings.neurips.cc/paper/ 2014/hash/dc58e3a306451c9d670adcd37004f48f-Abstract.html .

David C. Knill and Alexandre Pouget. The Bayesian brain: the role of uncertainty in neural coding and computation. Trends in Neurosciences , 27(12):712-719, December 2004. ISSN 0166-2236. doi: 10.1016/j.tins.2004.10.007. URL https://www.sciencedirect.com/ science/article/pii/S0166223604003352 .

Chulan Kwon, Ping Ao, and David J. Thouless. Structure of stochastic dynamics near fixed points. Proceedings of the National Academy of Sciences , 102(37):13029-13033, September 2005. doi: 10.1073/pnas.0506347102. URL https://www.pnas.org/doi/10.1073/pnas. 0506347102 . Publisher: Proceedings of the National Academy of Sciences.

Y. Lecun, L. Bottou, Y. Bengio, and P. Haffner. Gradient-based learning applied to document recognition. Proceedings of the IEEE , 86(11):2278-2324, November 1998. ISSN 1558-2256. doi: 10.1109/5.726791. Conference Name: Proceedings of the IEEE.

Moshe Leshno, Vladimir Ya. Lin, Allan Pinkus, and Shimon Schocken. Multilayer feedforward networks with a nonpolynomial activation function can approximate any function. Neural Networks , 6(6):861-867, January 1993. ISSN 0893-6080. doi: 10.1016/S0893-6080(05)80131-5. URL https://www.sciencedirect.com/science/article/pii/S0893608005801315 .

Wei Ji Ma and Mehrdad Jazayeri. Neural Coding of Uncertainty and Probability. Annual Review of Neuroscience , 37(1):205-220, 2014. doi: 10.1146/annurev-neuro-071013-014017. URL https://doi.org/10.1146/annurev-neuro-071013-014017 . eprint: https://doi.org/10.1146/annurev-neuro-071013-014017.

Wei Ji Ma, Jeffrey M. Beck, Peter E. Latham, and Alexandre Pouget. Bayesian inference with probabilistic population codes. Nature Neuroscience , 9(11):1432-1438, November 2006. ISSN 1546-1726. doi: 10.1038/nn1790. URL https://www.nature.com/articles/nn1790 . Number: 11 Publisher: Nature Publishing Group.

Yi-An Ma, Tianqi Chen, and Emily Fox. A complete recipe for stochastic gradient mcmc. Advances in neural information processing systems , 28, 2015.

Andrew J. Majda and Andrea L. Bertozzi. Vorticity and incompressible flow . Camb. Texts Appl. Math. Cambridge University Press, Cambridge, 2002. ISBN 978-0-521-63057-3 978-0-52163948-4. doi: 10.1017/CBO9780511613203.

Paul Masset, Jacob A. Zavatone-Veth, J. Patrick Connor, Venkatesh N. Murthy, and Cengiz Pehlevan. Natural gradient enables fast sampling in spiking neural networks. October 2022. URL https://openreview.net/forum?id=Yopob26XjmL .

Bruno A. Olshausen and David J. Field. Emergence of simple-cell receptive field properties by learning a sparse code for natural images. Nature , 381(6583):607-609, June 1996. ISSN 1476-4687. doi: 10.1038/381607a0. URL https://www.nature.com/articles/381607a0 . Number: 6583 Publisher: Nature Publishing Group.

Gergo Orban, Pietro Berkes, J´ ozsef Fiser, and M´ at´ e Lengyel. Neural Variability and SamplingBased Probabilistic Representations in the Visual Cortex. Neuron , 92(2):530-543, October 2016. ISSN 0896-6273. doi: 10.1016/j.neuron.2016.09.038. URL https://www.cell.com/ neuron/abstract/S0896-6273(16)30639-0 . Publisher: Elsevier.

Hong Qian. The zeroth law of thermodynamics and volume-preserving conservative system in equilibrium with stochastic damping. Physics Letters A , 378(7):609-616, January 2014. ISSN 0375-9601. doi: 10.1016/j.physleta.2013.12.028. URL https://www.sciencedirect.com/ science/article/pii/S0375960113011766 .

Rajesh P. N. Rao, Bruno A. Olshausen, and Michael S. Lewicki, editors. Probabilistic models of the brain: Perception and neural function . Probabilistic models of the brain: Perception and neural function. The MIT Press, Cambridge, MA, US, 2002. ISBN 978-0-262-18224-9. doi: 10.7551/mitpress/5583.001.0001. Pages: x, 324.

Olaf Ronneberger, Philipp Fischer, and Thomas Brox. U-Net: Convolutional Networks for Biomedical Image Segmentation, May 2015. URL http://arxiv.org/abs/1505.04597 . arXiv:1505.04597 [cs].

W. Rudin. Functional Analysis . International series in pure and applied mathematics. McGrawHill, 1991. ISBN 978-0-07-054236-5. URL https://www.google.com/books/edition/ Functional_Analysis/Sh_vAAAAMAAJ?hl=en .

Camille Rull´ an Bux´ o and Cristina Savin. A sampling-based circuit for optimal decision making. In Advances in Neural Information Processing Systems , volume 34, pages 1416314175. Curran Associates, Inc., 2021. URL https://proceedings.neurips.cc/paper/ 2021/hash/76444b3132fda0e2aca778051d776f1c-Abstract.html .

Cristina Savin and Sophie Den` eve. Spatio-temporal Representations of Uncertainty in Spiking Neural Networks. In Advances in Neural Information Processing Systems , volume 27. Curran Associates, Inc., 2014. URL https://proceedings.neurips.cc/paper/2014/hash/ 4e2545f819e67f0615003dd7e04a6087-Abstract.html .

Eero P Simoncelli and Bruno A Olshausen. Natural Image Statistics and Neural Representation. Annual Review of Neuroscience , 24(1):1193-1216, 2001. doi: 10.1146/annurev. neuro.24.1.1193. URL https://doi.org/10.1146/annurev.neuro.24.1.1193 . eprint: https://doi.org/10.1146/annurev.neuro.24.1.1193.

Yang Song and Stefano Ermon. Generative Modeling by Estimating Gradients of the Data Distribution. In Advances in Neural Information Processing Systems , volume 32. Curran Associates, Inc., 2019. URL https://proceedings.neurips.cc/paper/2019/hash/ 3001ef257407d5a371a96dcd947c7d93-Abstract.html .

Yang Song, Jascha Sohl-Dickstein, Diederik P. Kingma, Abhishek Kumar, Stefano Ermon, and Ben Poole. Score-Based Generative Modeling through Stochastic Differential Equations, February 2021. URL http://arxiv.org/abs/2011.13456 . arXiv:2011.13456 [cs, stat].

David Sussillo and L. F. Abbott. Generating Coherent Patterns of Activity from Chaotic Neural Networks. Neuron , 63(4):544-557, August 2009. ISSN 0896-6273. doi: 10.1016/ j.neuron.2009.07.018. URL https://www.sciencedirect.com/science/article/pii/ S0896627309005479 .

Pascal Vincent. A Connection Between Score Matching and Denoising Autoencoders. Neural Computation , 23(7):1661-1674, July 2011. ISSN 0899-7667. doi: 10.1162/NECO a 00142. Conference Name: Neural Computation.

Eszter V´ ertes and Maneesh Sahani. Flexible and accurate inference and learning for deep generative models. In Advances in Neural Information Processing Systems , volume 31. Curran Associates, Inc., 2018. URL https://proceedings.neurips.cc/paper/2018/hash/ 955cb567b6e38f4c6b3f28cc857fc38c-Abstract.html .

Eviatar Yemini, Albert Lin, Amin Nejatbakhsh, Erdem Varol, Ruoxi Sun, Gonzalo E Mena, Aravinthan DT Samuel, Liam Paninski, Vivek Venkatachalam, and Oliver Hobert. Neuropal: a multicolor atlas for whole-brain neuronal identification in c. elegans. Cell , 184(1):272-288, 2021.

A Helmholtz-Hodge decomposition and proof of Proposition 1

First we give a proof for Proposition 1:

Proposition. Let p be the stationary distribution of the neural dynamics, and the diffusion matrix be the identity matrix. If the DF field G is strictly orthogonal to the gradient field ∇ p , meaning that G ( v ) · ∇ p ( v ) = 0 for all v , then the drift term F θ ( v ) can be written as the sum of a divergence-free field p -1 G and a gradient field ∇ log p .

Proof. Since p is the stationary distribution of the neural dynamics, from the Fokker-Planck equation we have

where G is divergence free. Now

Therefore, p -1 G is also divergence free.

Now we give a statement of the Helmholtz-Hodge decomposition, which is an application of the Hodge decomposition theorem to vector calculus on R n [8, 37].

Theorem 4 ( Helmoholtz-Hodge Decomposition ) . A smooth vector field V on a bounded domain of R n can be uniquely decomposed into the sum of a gradient field ∇ u that is normal to the boundary, a divergence-free field v that is parallel to the boundary and a harmonic field h , i.e. V = ∇ u + v + h . Moreover, the three components are orthogonal to each other in the L 2 sense.

We note that the form of the decomposition in Proposition 1 coincides with the Helmoholtz-Hodge decomposition with a zero harmonic field. Therefore, we can define the orthogonal projection operator P that projects F θ onto its gradient component ∇ log p . Under the strict orthogonality constraint that requires G to be orthogonal to ∇ p pointwise , to be able to sample from a broad range of distributions with ∇ log p orthogonal to the boundary, we need that for all p , there exists G p and θ such that F θ ( v ) = p -1 G p + ∇ log p . Applying the projection operator on both sides, we have

Moreover, if the function space { F θ } θ admits a set of basis functions { e i } i , i.e. F θ = ∑ i c i e i , then

This means that the space of ∇ log p needs to be spanned by { P e i } i , so { F θ } θ should also be spanned by an infinite number of basis functions { e i } i if we want to sample from a complex class of ∇ log p .

B Neural dynamics not following gradient fields

For the meaning of notations, see Section 3.2.

Proposition 5. When m ≥ 2 , F SC θ ( v ) := D ( -v + Wϕ ( v ) + I ) is a gradient field if and only if W is a zero matrix.

Proof. ( = ⇒ ) If F SC ( v ) = ∇ G ( v ) is a gradient field, then

̸

because F SC θ ( v ) is smooth, and we can switch the order of partial differentiation. Written in the form of (7), we have for all v i and v j (where i = j ),

since v i and v j are arbitrary and ϕ is nonlinear (so the derivative ϕ v is not the same for all v ), this implies d i W ij = d j W ji = 0 . But the decay constants cannot be 0. Therefore, W ij = W ji = 0

B.1 Hilbert projection theorem and proof of Proposition 2

Here we directly state the Hilbert Projection Theorem. For detailed proof, we refer readers to standard functional analysis textbooks [44].

Theorem 6. (Hilbert Projection Theorem) Given a Hilbert space H , and a nonempty closed convex set E ⊂ H , for any x ∈ H , there exists a unique Π x ∈ E , such that ∥ Π x -x ∥ = inf c ∈ E ∥ x -c ∥ .

Here Π is called the orthogonal projection operator. Next, we give the proof of Proposition 2.

Proof. Here we consider a special case of a Hilbert space L 2 ( R m , R m ; p ) ,where the inner product is defined by ⟨ f, g ⟩ = ∫ R m | f · g | p ( x ) d x and we let E = { A v + Bϕ ( v ) + I | A,B ∈ R m × m ; I ∈ R n × 1 } . The set of functions E is a closed convex vector subspace of L 2 ( R m , R m ; p ) because E is closed under addition and finite-dimensional. Hence by Hilbert projection theorem, there exists a unique Π H ∈ E such that ∥ (1 -Π) H ∥ = inf F ∈ E ∥ H -F ∥ > 0 . Because { F SC θ } θ ⊂ E if the decay matrix D is diagonal, we have

C Proof of Theorem 3

First, we give a statement of the universal approximation theorem as in [33].

Theorem C.1. (Universal Approximation Theorem) The continuous transfer function ϕ is not polynomial if and only if for every k ∈ N , m ∈ N , compact set U ⊂ R k , f ∈ C ( U, R m ) , and ε > 0 , there exists n ∈ N , W 2 ∈ R n × k , b ∈ R n , W 1 ∈ R m × n such that

where g ( x ) = W 1 ϕ ( W 2 x + b ) . Or equivalently, Σ n = span { ϕ ( w · x + b ) : w ∈ R k , b ∈ R } is dense in C ( R k ) if and only if ϕ is not polynomial.

The theorem says that for any transfer function that is not polynomial ( tanh for example), there is a multi-layer neural network with the transfer function that is able to approximate any continuous function to arbitrary precision on a closed and bounded subset of R m . The proof of Theorem 3 proceeds in three steps:

Choose a large enough compact support U for s θ ( x ) such that

Choose a large enough n and appropriate θ such that the universal approximation theorem can be applied to show that

3. Combine equation (22) and (23) so that we have

We begin with two lemmas that will be helpful in the proof of the theorem. Both of them are standard results 3 , but we include here for completeness. Let the upper incomplete Gamma function be defined by Γ( s, C ) = ∫ ∞ C r s -1 e -r dr .

Lemma C.2. If s is a positive integer, then Γ( s, C ) = ( s -1)! e -C ∑ s -1 i =0 C i i !

Proof. This can be proved by induction. For s = 1 ,

Therefore the conclusion holds. For s > 1 , we assume that for s = k , the conclusion holds. Then for s = k +1 , Through integration by parts, we have

Therefore the conclusion holds for s = k +1 as well. By induction, it holds for all positive integer s .

Lemma C.3. Γ( s, C ) → 0 as C →∞ .

Proof. When C →∞ , Γ( s, C ) < ∫ ∞ C r ⌈ s -1 ⌉ e -r dr . Therefore W.L.O.G., we can assume that s -1 is a positive integer. By lemma C.2,

since the exponential term e -C is beyond all orders.

Now we give a formal proof of Theorem 3.

Theorem. Suppose that we are given a probability distribution with continuously differentiable density function p ( x ) : R m → R + and score function ∇ log p ( x ) for which there exist constants M 1 , M 2 , a, k > 0 such that

when ∥ x ∥ > L for large enough L . Then for any ε > 0 , there exists a recurrent neural network whose firing-rate dynamics are given by (11) , whose recurrent weights, output weights and the diffusion coefficient are given by W rec ∈ R n × n of rank m , W out ∈ R m × n , and σ ∈ R n × m respectively, such that, for a large enough n , the score of the stationary distribution of the output units s θ ( x ) satisfies E x ∼ p ( x ) [ ∥∇ log p ( x ) -s θ ( x ) ∥ 2 ] < ε .

Therefore

Proof.

Step 1 First of all, we would like to find a compact set U C = { x | ∥ x ∥ 2 ≤ C } such that ∫ R m \ U C ∥∇ log p ( x ) -s θ ( x ) ∥ 2 p ( x ) d x < ε 2 . We can upper bound the integral by the following calculation using spherical coordinates when C > L .

Note that we assume s θ ( x ) = 0 outside of U C 4 . By lemma C.3, there exists a large enough constant ˜ C such that Γ( m + k, a ˜ C ) < a m + k Γ( m 2 ) ε 4 M 1 M 2 π m/ 2 . Therefore

Step 2 Next we write down the specific form of s θ ( x ) , the score of the stationary distribution of x for the reservoir-sampler dynamics (11)

Since σ is learnable, we can define σ = W T out ( W out W T out ) -1 such that W out σσ T W T out is an identity matrix 5 :

As p is continuously differentiable, by Theorem C.1, there exists W out , ˜ W rec such that

Therefore with those choices of W , W and σ , we have

(40)

Step 3

D Pseudocode for training the reservoir-sampler network

E Accelerated sampling with reservoir-sampler network

To construct an irreversible dynamics that accelerates sampling, we let the divergence-free (DF) field G be of the form J ∇ p , where J = -J T can be any skew-symmetric matrix that is either learned through training or prescribed. Then from equation (6) we see that the drift term F θ satisfies

Therefore the corresponding score matching problem is α (Σ + J ) -1 ( W out ϕ ( ˜ W rec x + I ) -x ) ≈ ∇ log p ( x ) . With a slight modification, the pseudo code for an accelerated RSN training algorithm is given in algorithm 2. We repeat the experiment in Section 4.1 with the accelerated RSN. The results are shown in Figure 5. We see that the accelerated RSN is able to sample from the distribution faster than the RSN.

F Additional experiments

F.1 Failure cases for sampler-only networks with hyperbolic tangent nonlinearity

Figure 6 shows that with tanh nonlinearity, sampler-only network is able to sample from the distribution we consider in Section 4.1. However, this is because the score function of the distribution considered can be spanned by just two basis functions equipped by the drift term of the sampler-only network. Therefore, our theory predicts that the sampler-only network will not be able to approximate score functions that are not exactly spanned by these two basis functions. Indeed, if we consider a slightly different Gaussian mixture distribution, p data ( x ) = 1 2 ( N ( -1 , 0 . 0625) + N (1 , 0 . 25)) , then the sampler-only network will not be able to recover the score function as shown in Figure 7, while RSN still succeeds in recovering the score function.

Algorithm 2: Training accelerated RSN Input: Training samples { x i } , pseudo recurrent weights ˜ W rec , output weights W out , pseudo diffusion coefficient ˜ σ , skew-symmetric matrix J , start noise level σ 1 , noise decay factor C , number of noise level N Output: trained recurrent weights W rec , trained output weights W out , trained diffussion coefficient σ for i = 1 , . . . , N do while not done do Sample x from the training set Perturb the samples with Gaussian noise ˜ x = x j + ε , ε ∼ N (0 , σ 2 i I ) Compute the gradient of the score-matching loss 1 2 ∇ ˜ W rec ,W out , ˜ σ,J ∥ ∥ ∥ α ( 1 2 ˜ σ ˜ σ T + J ) - 1 ( W out ϕ ( ˜ W rec x + I ) - x ) - x - ˜ x σ 2 i ∥ ∥ ∥ 2 Update ˜ W rec , W out , ˜ σ with gradient descent Update J with gradient descent (Optional) σ i +1 = Cσ i W rec ← ˜ W rec W out σ ← W T out ( W out W T out ) - 1 ˜ σ return ˜ W rec , W out

x1

x2

1.8

1.75

Accelerated

Accelerated

distance

1.6

distance

1.50

1.4

1.25

1.2

1.00

1.0

0.75

W

0.8

0.6

0.50

0

50

100

150

200

0

50

100

150

200

time (ms)

time (ms)

SO-SC

SO-FR

RS-FR

a)

b)

c)

100

truescore

5.0

true score

5.0

truescore

5

Noise

2.5

2.5

score

0

0.0

0.0

10-1

-2.5

-2.5

-5

-5.0

-5.0

(p

2

0

2

e)

-2

0

2

f)

-2

0

2

Sampled points

Ipoints

200

200

Scaled density

200

150

150

150

sampled

100

100

100

50

50

50

#

0

-2

0

2

0

0

2

0

-2

0

2

V

r

x

Noise

SO-SC

SO-FR

RS-FR

a)

b)

c)

100

20

truescore

20

true score

20

truescore

score

10

10

10

0

10-1

0

0

-10

-10E

-2

0

2

-2

0

2

-2

0

2

d)

e)

f)

400

400

400

Scaled density

Sampled points

# sampled points

300

300

300

200

200

200

100

100

100

#

0

-2

0

2

D

-2

0

2

0

-2

0

2

r

x

F.2 Sampling using autoencoder

We show that we can replace the fixed linear PCA projection used in Section 4.2 with pretrained nonlinear autoencoder. We test the algorithm on both the MNIST dataset (Figure 8) and the CIFAR-10 dataset (Figure 9).

66868

８９５９６

５０６０６５

８３６８６９０

８Ｇ６８６３３０３５

667６

8

S

θ897

８９８

3

6

8

9

G Related works

In this section, we examine the neural dynamics considered in [17, 1, 38, 19] and discuss how our work is related.

Dong et al. [17] uses Hamiltonian Langevin dynamics to accelerate sampling in continuous attractor networks. The Hamiltonian dynamics below are considered in the paper (cf. eq (19) and (20)):

The overdamped Langevin dynamics that samples from the same marginal stationary distribution over s as (42):

where s o is an observation generated by a latent feature s according to a Gaussian distribution, and the linear term Λ( s o -s ) comes from the external input. So the network dynamics in Dong et al. [17] themselves do not generate samples without the external input, and the study does not clarify how to supply the network with nonlinear score functions.

Samples

CIFAR 10 Images

Reconstructed Images

Aitchison and Lengyel [1] have shown that Hamiltonian Monte Carlo (HMC) naturally maps onto the dynamics of excitatory-inhibitory neural networks. However, the neural dynamics considered are entirely linear in terms of the network variables (cf. eq (23) and (24)). Therefore, the dynamics are again equivalent to the synaptic current dynamics with an identity transfer function in Section 3.2. The same applies to the analysis in Masset et al. [38], which also only considers linear neural dynamics. By Proposition 2 and the decomposition discussed in Kwon et al. [31], these dynamics can only sample from probability distributions whose score functions are linear, i.e. Gaussians.

The work by Echeveste et al. [19] provides a unifying model for several dynamical phenomena in sensory cortices by training a nonlinear recurrent excitatory-inhibitory neural circuit model to perform sampling-based probabilistic inference. The synaptic neural dynamics below (cf. equation (8)) is used, where the nonlinear transfer function is supralinear, i.e. ϕ ( u ) = k ⌈ u ⌉ n :

As discussed in Section 3.2, while they are richer than linear dynamics, dynamics of this form still have limited ability to sample from complex probability distributions. Moreover, we note that the training criterion considered in Echeveste et al. [19] only matches the mean and the variance of the stationary distribution. These points are in contrast to our work here, where we show that the reservoir-sampler network, which extends the dynamics (44), can be trained via alternate methods to sample from complex probability distributions by matching their score functions.

H Details of numerical experiments

All experiments were run on one NVIDIA Quadro RTX 6000 GPU. We always use the model saved at the last training iteration.

H.1 Training details for Section 4.1

For the 1-D bimodal Gaussian distribution experiment (Figure 2), we used 1000 reservoir neurons (only in the reservoir sampler network) and 1 sampler neuron. We trained all 3 networks (SO-FR, SO-SC, RS-FR) for 79000 iterations with the Adam optimizer. The learning rate was 0.0001, and the batch size was 128. We started by adding Gaussian noise with standard deviation (std) σ 1 = 1 to the training samples. We decreased the std every 7900 iterations by a constant factor, i.e. σ i +1 /σ i = C , such that σ 10 = . 01 . When simulating the stochastic neural dynamics, we used a step size of 10 -4 , and ran 10000 steps.

For the mixture of 2-D Laplace distributions experiment (Figure 3), we used 1000 reservoir neurons (only in the reservoir sampler network) and 2 sampler neurons. We trained the RS-FR network for 62,500 iterations with the Adam optimizer. The learning rate was 0.0001, and the batch size was 128. We started by adding Gaussian noise with std σ 1 = 1 to the training samples. We decreased the std every 6250 iterations by a constant factor, i.e. σ i +1 /σ i = C , such that σ 10 = . 01 . When simulating the stochastic neural dynamics, we used a step size of 10 -4 , and ran 20000 steps.

H.2 Training details for Section 4.2

For the MNIST experiment (Figure 2), we used 20000 reservoir neurons (only in the reservoir sampler network) and 300 sampler neurons. We trained all 3 networks (SO-FR, SO-SC, RS-FR) for 1000 epochs with the Adam optimizer. The learning rate was 0.001, and the batch size was 64. We started by adding Gaussian noise with std σ 1 = 1 to the training samples. We decreased the std every 100 epochs by a constant factor, i.e. σ i +1 /σ i = C , such that σ 10 = . 01 . When simulating the stochastic neural dynamics, we used a step size of 10 -6 , and ran 30000 steps.

I Statement of code availability

All code is available on Github

Peer reviews:
{"IS_META_REVIEW": false, "comments": "SUMMARY:\nThis paper studies circuit algorithms for sampling-based Bayesian inference in continuous-time rate-based recurrent neural networks. Specifically, it argues that using a linear readout from a noisy reservoir provides a substantial expressivity benefit relative to representing the sampled distribution directly in the recurrent population.\n\nSTRENGTHS:\n1. The question of the minimal recurrent circuit architectures that allow sampling from complex distributions is clearly relevant to the neuroscience community at NeurIPS, and I think the main result is interesting (albeit unsurprising).\n\n2. The experiments show to a reasonable degree that the proposed method can sample from non-trivial non-Gaussian distributions (MNIST). This is an improvement on most comp neuro papers on sampling, which largely focus on Gaussian distributions. My enthusiasm for this point is, however, dampened a bit by the fact that the networks here are rate-based and the authors aren't trying to optimize functionals of the dynamics (e.g. as in work from the Lengyel group), so it's not very surprising that this can be made to work.\n\nWEAKNESSES:\n1. How does Proposition 1 differ from the results of Ma, Chen, and Fox, \"A Complete Recipe for Stochastic Gradient MCMC\" (NeurIPS 2015)? Perhaps I've missed something, but I do not see a novel contribution in Section 3.1. \n\n2. The present manuscript does not address the speed of relaxation to the stationary distribution. The ability to obtain accurate samples quickly is a necessary feature of any model of sampling-based inference in the brain, and indeed the question of how to achieve fast sampling in biologically-plausible implementations has been a major focus of past work (e.g., Hennequin et al. 2014, Aitchison and Lengyel 2016, Echeveste et al. 2020, Masset et al. 2022). In my view, this is a key shortcoming of the learning algorithm proposed in Section 3.4: no attention is paid to whether the resulting network enjoys favorable convergence properties. Of course, one could modify the resulting drift and diffusion terms (as in Hennequin et al. 2014 or Masset et al. 2022), but this would require an additional optimization step. The authors should at least discuss this point; adding more experiments to probe this issue would make for a stronger paper. \n\n3. In Lines 293-295 of the Discussion, the authors state that \"Our preliminary experiments show that one-hidden-layer RSNs cannot readily approximate high-dimensional heavy-tailed distributions (e.g., those of overcomplete sparse coding representations [36]).\" If the authors have such results, they should show them. In particular, related to point (2) above, they should show how the convergence speed and number of reservoir neurons required to obtain accurate samples scales with the dimension of the target distribution. As the authors themselves discuss, their approach is currently limited to approximating the score with a single-hidden-layer MLP, and such Cybenko-Hornik-type approximation results may require immensely wide networks. This is also a limitation of the MNIST experiment: MNIST is intrinsically not that high-dimensional, and already here the authors used a network with 20000 reservoir neurons (Line 638)! \n\n4. I think it's important to mention that the striking result of Figure 2 depends critically on the choice of ReLU activation function, particularly as much of the paper is concerned with existence results. If instead one used $\\tanh$, then the performance gap between the trained sampler-only firing rate and reservoir firing rate models should be small. In particular, a sampler-only firing rate network can implement exact Langevin sampling in this case. The score of $p(x) = \\frac{1}{2} \\mathcal{N}(\\mu , \\sigma^{2}) + \\frac{1}{2} \\mathcal{N}(-\\mu,\\sigma^2)$ is $\\frac{d}{dx} \\log p(x) = \\frac{1}{\\sigma^{2}} \\left[ - x + \\mu \\tanh\\left(\\frac{\\mu}{\\sigma^{2}} x\\right) \\right]$. This gives the Langevin dynamics $dx(t) = \\frac{d \\log p}{dx} dt + \\sqrt{2} dB(t) = \\frac{1}{\\sigma^{2}} \\left[ - x + \\mu \\tanh\\left(\\frac{\\mu}{\\sigma^{2}} x\\right) \\right] dt + \\sqrt{2} dB(t)$. With $\\mu = 1$ as is used in Figure 2, this is exactly of the form of a single-neuron sampler-only firing rate network in eq (8) of the submitted manuscript, with $D = 1/\\sigma^{2}$, $W_{rec} = 1/\\sigma^{2}$, $I=0$, and $\\phi(x) = \\tanh(x)$. One can easily verify numerically that this network produces accurate samples from the desired bimodal distribution.\n\nQUESTIONS:\n- The figure axis labels are too small, making them hard to read. Figure 4b is also too small. Please increase the font and panel sizes to improve legibility. \n\n- Lines 32-33: Along with the other references on Gaussian sampling, Hennequin, Aitchison, and Lengyel, \"Fast Sampling-Based Inference in Balanced Neuronal Networks\" (NeurIPS 2014), should be cited. \n\n- Line 225: I do not see how the proof of Theorem 3 is \"constructive,\" since it is based on an existence-type universal approximation theorem. \n\n- Lines 303-304: \"This procedure is more aligned with the developmental processes involved in forming visual representations in the infant brain, where visual representations are thought to be noisier (less linearly separable) initially [3]\" Please elaborate; I don't quite follow. \n\n- Line 317-318: This is quite vague. Having a clearer proposal for what this model might help explain in neuroscience would make for a much stronger paper. \n\n- It would be helpful to repeat the theorem statements in the Supplement. \n\n- Lemmas C.2 and C.3 can be replaced by using standard results on the asymptotic expansion of the upper incomplete Gamma function for large argument, see https://dlmf.nist.gov/8.11. \n\n- In Line 562, in the proof of Theorem 3, should $m$ be replaced by $n$?\n\nLIMITATIONS:\nThe authors provide a generally adequate discussion of the limitations of their work (modulo the weaknesses discussed above), but fail to show the data for some points (see point 3 under Weaknesses).", "TITLE": "Official Review", "RECOMMENDATION": 5, "REVIEWER_CONFIDENCE": 5, "SOUNDNESS_CORRECTNESS": 2, "DATE": "2023-06-16"}

{"IS_META_REVIEW": false, "comments": "SUMMARY:\nIn this paper, the authors address the question of how the dynamics of recurrent neural networks (RNNs) can generate samples from probability distributions of interest. This is of interest to the neuroscience community, since it has been proposed that biological networks can use such sampling-based inference to represent and compute with probability distributions in order to account for their noisy surroundings. The authors prove that standard RNNs have limited expressivity when used directly for sampling-based inference.\nThey proceed to show that RNNs with separate (linear) readouts in contrast have the necessary expressivity to approximate any probability distribution through Langevin sampling. Finally, it is demonstrated empirically that such a 'reservoir' formulation allows RNNs to generate samples from a variety of complex distributions in practice, including multimodal, heavy-tailed, and high-dimensional distributions.\n\nSTRENGTHS:\nThe paper contains several interesting theoretical results related to the topic of sampling-based inference using recurrent neural networks. This is an important open problem in computational neuroscience, where it remains unknown how the brain performs (approximate) probabilistic computations and represents the necessary probability distributions for such computations. By providing a firmer theoretical grounding for our understanding of sampling-based inference, this work has the potential to inspire both new computational and experiment studies of probabilistic computations in neural circuits. The paper is also generally well written and demonstrates impressive empirical results, although only on relatively 'toy' problems.\n\nWEAKNESSES:\nMuch of the motivation and discussion of the paper is written with reference to the neuroscience literature on sampling-based inference, especially in sensory cortices. However, the empirical results all use artificial toy examples with no obvious relation to questions of interest to the neuroscience community. It would have been interesting to e.g. look at natural images or similar and delve a bit deeper into the dynamics learned by the network to make it more interesting to a neuroscience audience.\n\nMany of the figure axis labels and legends are too small to be easily readable, and they would benefit from an increased font size.\n\nQUESTIONS:\nL60: The authors state that they derive a 'biologically plausible' learning rule, but the training procedure described in Eq 14 does not seem particularly biologically plausible, requiring both backprop and matrix inverses (as the authors also highlight themselves in L288-291). Perhaps the introduction could be reworded to make this initial statement more in tune with the subsequent methods/results?\n\nL73: it would be useful to briefly state what these regularity conditions entail.\n\nL114: Helmholtz typo\n\nFigure 2 legend: \"SO-SC and SO-FR is (_sic_) only able to fit the score function with piecewise linear function (_sic_) when using ReLU transfer function (_sic_)\". Why the contrast between 'piecewise linear' in the legend and what looks like globally linear approximations to the score function in the figure?\n\nRef 5 & 37: formatting errors in author name (\"GergHo Orban\").\n\nI am slightly confused by the authors' network dynamic equations (Eq 7 & Eq 8). When modeling neural firing rates, a positive (e.g. ReLU) nonlinearity is commonly used since firing rates are strictly positive. However, would the Brownian noise term added to the rates in Eq 8 not allow for negative neural firing rates?\n\nI was also surprised by the synaptic current equations, since RNN dynamics are usually formulated in terms of either firing rates or membrane potentials. Potentials and currents are of course equivalent for ohmic units, but I was wondering if there was a reason that the authors decided to describe Eq 7 in terms of currents rather than membrane potentials?\n\nThe authors have discussed the case of a non-linear RNN with a linear readout and shown that it can approximate arbitrary probability distributions. Is the same true for non-linear RNNs with non-linear readouts? and if so, could the reservoir sampler network be considered a special case of a non-linear RNN where only a subset of units are used to represent samples from the target distribution, and the remainder are used for additional computational power/expressivity?\n\nLIMITATIONS:\nThe authors have adequately addressed the limitations of their study.", "TITLE": "Official Review", "RECOMMENDATION": 7, "REVIEWER_CONFIDENCE": 2, "SOUNDNESS_CORRECTNESS": 3, "DATE": "2023-06-21"}

{"IS_META_REVIEW": false, "comments": "SUMMARY:\n- This study solves an outstanding problem involving arbitrary density sampling using stochastic neural networks.\n- The authors propose a a Reservoir Sampling architecture, whereby an auxiliary recurrently-connected population facilitates the sampling from a non-trivial distribution.\n- The work seems solid and elegant (although SDEs are not my domain of expertise), and the numerical experiments are convincing.\n\nUPDATE: Sep 1, 2023. I have read the rebuttal, it addressed my Qs and I maintain my score.\n\nSTRENGTHS:\n- The math looks solid, although I did not have time to go through the supplement.\n- There are numerical experiments on complex distributions (MNIST PCs), demonstrating that their procedure can operate on non-trivial densities.\n\nWEAKNESSES:\n- This work seems to address an _existence_ problem with arbitrary density sampling with RNNs, but how would one validate this kind of model in physiological experiments?\n- In fact, I would appreciate more discussion on the state of affairs in the neurophysiology of density representation.\n\nQUESTIONS:\n- This auxiliary RNN population approach reminds me of a recent poster/paper at cosyne by Duong et al. (\"Adaptive whitening in neural populations with gain-modulating interneurons\"; ICML 2023 https://openreview.net/forum?id=cEWB5hABV5), where they show that if the auxiliary population is greater than a specific size, it can represent and whiten a multivariate gaussian densities exactly. In your framework, is there a relationship between the dimensionality of reservoir and the expressivity of the network in terms of what kinds of densities it can represent? Could this provide testable predictions for an experimentalist to search for? \n- Suggestion: I did enjoy reading this manuscript, but there was more emphasis on technical parts than necessary to get your point across. If the text were reframed with less emphasis on the math, I think it would flow much nicer and would be much more approachable.\n\nLIMITATIONS:\nThere was adequate discussion of limitations.", "TITLE": "Official Review", "RECOMMENDATION": 6, "REVIEWER_CONFIDENCE": 3, "SOUNDNESS_CORRECTNESS": 3, "DATE": "2023-07-03"}

comments: SUMMARY:
The authors proposed a revervoir-sampler network whose firing rate dynamics can sample from an arbitrary probability distribution. They first established the relationship between the sampling power of the neural dynamics and the ability of the dynamics to approximate the score function. Then they showed that the synaptic current dynamics of the traditional sampler-only networks is only able to approximate score functions that are in a finite-dimensional function space. Importantly they proved that the  revervoir-sampler network can sample from an arbitrary probability distribution to arbitrary precision. Finally, they developped a biologically-plausible learning rule for the proposed model.

STRENGTHS:
This paper is very clearly presented and the scientific question is quite interesting.

WEAKNESSES:
Comparison with previous models should be addressed in the experiment part.

QUESTIONS:
Q1: Why did the authors choose to use the reservoir network as the building block? 

Q2: Following the first question, does the RSN model work because of the linear readout layer, which rescales the distributions? Can the authors explaine more about this？

Q3: Can the current model be extended to the multiplicative noise scenario which could be the feature of the poisson spike neurons, or (at the network level) be the feature of the E-I balanced spiking net.

Q4: How does the RSN model compare to the coupled attractor model which also implement Langevin sampling [1]?

[1]: Zhang, W. H., Lee, T. S., Doiron, B., & Wu, S. (2020). Distributed sampling-based Bayesian inference in coupled neural circuits. bioRxiv, 2020-07.

LIMITATIONS:
The authors addressed some limitations.
TITLE: Official Review
SOUNDNESS_CORRECTNESS: 4
DATE: 2023-07-06

{"IS_META_REVIEW": false, "comments": "SUMMARY:\nThe paper investigates architectural requirements for recurrent neural circuits to sample from complex distributions using diffusion models. It presents a model where traditional sampler-only networks are enhanced with additional firing-rate dynamics and a set of separate output units, called reservoir-sampler networks (RSNs). An efficient training procedure based on denoising score matching is proposed. Empirical experiments are presented to demonstrate the model's ability to sample from complex data distributions.\n\nSTRENGTHS:\n- The research addresses a significant issue in computational neuroscience and Bayesian learning – how neural dynamics can sample a complex distribution. \n- Biological plausibility and mathematical computation efficiency are particularly commendable aspects of this work.\n- The theoretical analysis is well constructed, providing strong support for the model design, including the choice of firing-rate dynamics and the reservoir-sampler network.\n- The empirical experiments presented provide evidence of the effectiveness of the proposed method.\n\nWEAKNESSES:\n- The experiments conducted need improvements. Despite using score matching for model training, the quality of the generated images leaves room for improvement. The incorporation of Unet-like or transformer backbones might have enhanced the results.\n- The paper lacks a clear, diagrammatic representation to explain the utilization of diffusion models in the design of recurrent neural circuits architecture.\n- The results and conclusions seems to have limited impact to the general AI/ML areas, giving limited experimental results and comparison (e.g. precision and efficiency ) with existing diffusion probabilistic models is somewhat lacking.\n\nQUESTIONS:\nSee weaknesses.\n\nLIMITATIONS:\nI am satisfied with the discussion of limitations.", "TITLE": "Official Review", "RECOMMENDATION": 6, "REVIEWER_CONFIDENCE": 4, "SOUNDNESS_CORRECTNESS": 2, "DATE": "2023-07-07"}