Ketbook · Architectures wiki/restricted-boltzmann-machine.md Draft · not yet reviewed by a curator

Edit this page ↗History ↗

Restricted Boltzmann machine

In brief. The RBM is a two-layer network whose hidden layer can be summed analytically, giving the closed form log⁡Ψ=∑iaiσi+∑jlog⁡2cosh⁡(bj+∑iWijσi)\log\Psi=\sum_ia_i\sigma_i+\sum_j\log2\cosh(b_j+\sum_iW_{ij}\sigma_i). Its accuracy is controlled by one integer, the hidden-unit density α=M/N\alpha=M/N. Weight sharing over lattice translations makes it a one-layer convolutional network; complex parameters give it a phase. It is the ansatz of the founding paper and still the baseline against which new architectures are measured.

Notation follows the conventions page.

The restricted Boltzmann machine (RBM) is the ansatz with which Carleo and Troyer introduced neural quantum states (arXiv:1606.02318). Two layers, one analytic marginalization, a closed-form log-amplitude, and a parameter count that interpolates between a Jastrow factor and an arbitrarily expressive variational state through α\alpha.

Definition

For NN spins σi=±1\sigma_i=\pm1 in the SzS^z basis and MM hidden binary units hj=±1h_j=\pm1, the RBM wavefunction is the marginal of a Boltzmann weight with no intra-layer couplings:

Ψ(σ)=∑{hj}exp⁡ ⁣(∑iaiσi+∑jbjhj+∑ijWijσihj). \Psi(\boldsymbol{\sigma})=\sum_{\{h_j\}}\exp\!\Bigl(\sum_i a_i\sigma_i+\sum_j b_jh_j+\sum_{ij}W_{ij}\sigma_ih_j\Bigr).

Because the hidden units do not interact with one another, the sum over 2M2^M hidden configurations factorizes:

Ψ(σ)=e∑iaiσi∏j=1M2cosh⁡ ⁣(bj+∑iWijσi). \Psi(\boldsymbol{\sigma})=e^{\sum_i a_i\sigma_i}\prod_{j=1}^{M}2\cosh\!\Bigl(b_j+\sum_i W_{ij}\sigma_i\Bigr).

The parameters θ=(a,b,W)\theta=(a,b,W) are complex in general: the wavefunction is holomorphic in them, and the phase of Ψ\Psi is produced by the imaginary parts. With α=M/N\alpha=M/N the ansatz has N+M+NM=N(1+α+αN)N+M+NM=N(1+\alpha+\alpha N) parameters; for α\alpha of order one this is quadratic in system size, like a two-body Jastrow factor, but the functional form is far richer.

Log-amplitude form

With the hidden-layer pre-activations ϑj(σ)=bj+∑iWijσi\vartheta_j(\boldsymbol{\sigma})=b_j+\sum_iW_{ij}\sigma_i,

log⁡Ψ(σ)=∑iaiσi+∑j=1Mlog⁡[2cosh⁡ϑj(σ)], \log\Psi(\boldsymbol{\sigma})=\sum_i a_i\sigma_i+\sum_{j=1}^{M}\log\bigl[2\cosh\vartheta_j(\boldsymbol{\sigma})\bigr],

a single-hidden-layer network with input σ\boldsymbol{\sigma}, activation log⁡2cosh⁡\log2\cosh, and a sum (not a learned readout) over the hidden layer. Everything VMC needs follows from this expression.

  • Ratios for the local energy and Metropolis. For a configuration σ′\boldsymbol{\sigma}' differing from σ\boldsymbol{\sigma} on a set of flipped sites ff, ϑj(σ′)=ϑj(σ)−2∑i∈fWijσi\vartheta_j(\boldsymbol{\sigma}')=\vartheta_j(\boldsymbol{\sigma})-2\sum_{i\in f}W_{ij}\sigma_i. Caching the vector ϑ(σ)\vartheta(\boldsymbol{\sigma}) makes each ratio Ψ(σ′)/Ψ(σ)\Psi(\boldsymbol{\sigma}')/\Psi(\boldsymbol{\sigma}) cost O(M∣f∣)O(M|f|) instead of O(NM)O(NM), so the full Heisenberg local energy on a lattice with O(N)O(N) bonds costs O(NM)O(NM), the same as one forward pass.
  • Log-derivatives. The quantities entering the gradient and the SR matrix are elementary:
Oai=σi,Obj=tanh⁡ϑj,OWij=σitanh⁡ϑj. O_{a_i}=\sigma_i,\qquad O_{b_j}=\tanh\vartheta_j,\qquad O_{W_{ij}}=\sigma_i\tanh\vartheta_j .

tanh⁡ϑj\tanh\vartheta_j is the conditional expectation of the hidden unit hjh_j given the visible configuration, so the RBM log-derivatives are the connected correlators of the underlying Boltzmann model.

  • Expansion in visible correlations. Expanding log⁡2cosh⁡ϑj\log2\cosh\vartheta_j in powers of ϑj\vartheta_j shows that each hidden unit generates all even-order products of spins weighted by WijW_{ij} (and odd orders through bjb_j). A Jastrow factor exp⁡(∑i<kJikσiσk)\exp(\sum_{i<k}J_{ik}\sigma_i\sigma_k) is recovered exactly in the limit of small weights with α\alpha large; an RBM with α≥1\alpha\ge1 strictly contains it.

Symmetric RBM

For a translation-invariant Hamiltonian the weights can be tied so that the ansatz is manifestly invariant. The hidden units are grouped into α\alpha features f=1,…,αf=1,\dots,\alpha, each replicated over the NN lattice translations TtT_t:

Wi,(f,t)=WTt−1i(f),b(f,t)=b(f),ai=a, W_{i,(f,t)}=W^{(f)}_{T_t^{-1}i},\qquad b_{(f,t)}=b^{(f)},\qquad a_i=a ,

so that

log⁡Ψ(σ)=a∑iσi+∑f=1α∑t=1Nlog⁡[2cosh⁡(b(f)+∑iWTt−1i(f) σi)]. \log\Psi(\boldsymbol{\sigma})=a\sum_i\sigma_i+\sum_{f=1}^{\alpha}\sum_{t=1}^{N}\log\Bigl[2\cosh\Bigl(b^{(f)}+\sum_iW^{(f)}_{T_t^{-1}i}\,\sigma_i\Bigr)\Bigr].

Each feature is a convolution filter of the full lattice size, and the sum over translations is a global pooling, so the symmetric RBM is a one-layer convolutional network with log⁡2cosh⁡\log2\cosh nonlinearity and α\alpha channels. The number of parameters drops from O(αN2)O(\alpha N^2) to α(N+1)+1\alpha(N+1)+1, the state is exactly in the zero-momentum sector, and the variance of the energy estimator is reduced because every sample contributes NN symmetry-related terms. The same construction extends to point-group and spin-flip symmetries by enlarging the group, and to a projection onto a chosen nontrivial irreducible representation by weighting the sum over group elements with characters.

Complex parameters and sign structure

An RBM with real parameters is strictly positive, so it can only represent states that are positive in the chosen basis, i.e. stoquastic ground states after a suitable basis rotation. The Marshall sign rule makes the Heisenberg model on a bipartite lattice such a case: rotating the spins on one sublattice by π\pi about zz multiplies the ground-state amplitudes by (−1)N↑A(-1)^{N_\uparrow^A} and leaves a positive state, which a real RBM can learn. For the transverse-field Ising model no rotation is needed.

Everything else needs a phase, which is produced in one of these ways:

  1. Complex parameters (a,b,W)∈C(a,b,W)\in\mathbb C, the original choice. log⁡Ψ\log\Psi is holomorphic, the gradient is Fk=⟨Oˉk∗Eˉloc⟩F_k=\langle\bar O_k^*\bar E_{\mathrm{loc}}\rangle and Skk′=⟨Oˉk∗Oˉk′⟩S_{kk'}=\langle\bar O_k^*\bar O_{k'}\rangle without real parts (see optimization). Amplitude and phase share parameters, which couples their optimization.
  2. Two real networks, log⁡∣Ψ∣\log|\Psi| and arg⁡Ψ\arg\Psi, each an RBM or a different architecture. Decouples the two problems and allows a phase network that outputs a discrete sign; the price is that the phase network is trained through ElocE_{\mathrm{loc}} only, which is a weak signal when the sign structure is wrong almost everywhere.
  3. A fixed sign prior times a positive RBM, for example the Marshall sign for the J₁–J₂ model at small J2J_2, or a Gutzwiller-projected fermionic sign (Nomura et al., arXiv:1709.06475; Ferrari, Becca, Carrasquilla, arXiv:1906.00463). The network then only corrects the prior.

The sign structure, not the amplitudes, is what limits RBMs on frustrated magnets. Szabó and Castelnovo (arXiv:2002.04613) showed that an RBM supplied with the exact sign structure reaches high accuracy where the same RBM asked to learn the signs stalls; Westerhout et al. (arXiv:1907.08186) showed that the learned sign structure generalizes poorly to configurations not seen during training. The J₁–J₂ model near J2/J1=0.5J_2/J_1=0.5 is the standard stress test, see the benchmark page.

What an RBM can represent

  • Any state with a polynomial number of nonzero amplitudes, and many with exponentially many: cluster states, graph states, and the toric code ground state have exact RBM representations with α\alpha of order one (Deng, Li, Das Sarma, arXiv:1701.04844).
  • Volume-law entanglement with O(N)O(N) hidden units when the weights are long-ranged; short-range RBMs (each hidden unit connected to a local patch) are area-law and are exactly equivalent to a class of string-bond and entangled-plaquette states (Chen et al., arXiv:1701.04831; Glasser et al., arXiv:1710.04045).
  • Exact representations of a class of models obtained by a deterministic construction rather than optimization, including a deep-Boltzmann-machine form for imaginary-time evolution (Carleo, Nomura, Imada, arXiv:1802.09558).

Expressivity theorems say what is representable, not what is reachable by stochastic optimization from a random start. In practice the reachable accuracy on a given model is a function of α\alpha, the symmetry construction, the sign treatment, and the optimizer, in roughly that order of importance.

Original 2017 results

Carleo and Troyer optimized translation-symmetric complex RBMs with stochastic reconfiguration on three models with periodic boundaries: the transverse-field Ising chain of 80 spins at h=1/2h=1/2, 11 and 22, the antiferromagnetic Heisenberg chain of 80 spins, and the antiferromagnetic Heisenberg model on a 10×1010\times10 square lattice (arXiv:1606.02318, Fig. 3). The hidden-unit density ran from α=1\alpha=1 to 44 in one dimension and from 11 to 3232 in two. Accuracy was measured by the relative error ϵrel=∣ERBM−Eref∣/∣Eref∣\epsilon_{\mathrm{rel}}=|E_{\mathrm{RBM}}-E_{\mathrm{ref}}|/|E_{\mathrm{ref}}| against exact energies in one dimension and against the stochastic-series-expansion value E/N=−0.671549(4)E/N=-0.671549(4) for the 10×1010\times10 lattice (Sandvik, arXiv:cond-mat/9707123, Table II).

The result that defined the field is the systematic decrease of ϵrel\epsilon_{\mathrm{rel}} with α\alpha on all three models. In one dimension the RBM passes the Jastrow ansatz already at α=1\alpha=1 and reaches the accuracy of matrix-product states; on the 10×1010\times10 lattice it passes the entangled-plaquette and PEPS energies available for the same cluster and keeps improving up to α=32\alpha=32, with no sign of the structural ceiling that limits mean-field and low-order Jastrow states. The same paper used SS and FF in the time-dependent variational principle to follow the unitary dynamics after quenches of the transverse field and of the Heisenberg coupling. The error curves are Figure 3 of the paper; Ketboard does not list these energies because they predate its instance definitions.

What was absent is as telling as what was present: no frustrated model appears, and the limitation of the RBM on frustrated lattices was identified in the following years as a problem of sign structure rather than of amplitude expressivity.

Variants

  • RBM + pair product (RBM+pp): multiply the RBM by a Pfaffian or determinant of a pair-product state, giving a fermionic sign prior with a neural correlator (Nomura, Darmawan, Yamaji, Imada, arXiv:1709.06475). With quantum-number projection and a few Lanczos steps this remains among the most accurate ansätze for the square-lattice J₁–J₂ model (Nomura and Imada, arXiv:2005.14142).
  • Deep Boltzmann machines: a second hidden layer makes the marginalization intractable in general but exact for specific constructions (arXiv:1802.09558); sampling the hidden layer jointly with the visible one restores tractability at the price of a larger state space.
  • Convolutional generalizations: replacing the single log⁡2cosh⁡\log2\cosh layer by a stack of convolutional layers with a final pooling gives the convolutional and group-convolutional NQS (Choo, Neupert, Carleo, arXiv:1903.06713; Roth, Szabó, MacDonald, arXiv:2211.07749), with the hidden-unit density α\alpha reappearing as the channel count.

References

  • G. Carleo, M. Troyer, Solving the quantum many-body problem with artificial neural networks, arXiv:1606.02318 (2016). The complex symmetric RBM, its optimization, and the results discussed above.
  • R. G. Melko, G. Carleo, J. Carrasquilla, J. I. Cirac, Restricted Boltzmann machines in quantum physics, Nature Physics 15, 887 (2019). Review of RBMs as quantum states.
  • A. W. Sandvik, Finite-size scaling of the ground-state parameters of the two-dimensional Heisenberg model, arXiv:cond-mat/9707123 (1997). Reference energies for the square-lattice Heisenberg model.
  • D.-L. Deng, X. Li, S. Das Sarma, Quantum entanglement in neural network states, arXiv:1701.04844 (2017). Entanglement of RBM states; exact representations of topological states.
  • J. Chen, S. Cheng, H. Xie, L. Wang, T. Xiang, Equivalence of restricted Boltzmann machines and tensor network states, arXiv:1701.04831 (2017).
  • I. Glasser, N. Pancotti, M. August, I. D. Rodriguez, J. I. Cirac, Neural-network quantum states, string-bond states, and chiral topological states, arXiv:1710.04045 (2017).
  • G. Carleo, Y. Nomura, M. Imada, Constructing exact representations of quantum many-body systems with deep neural networks, arXiv:1802.09558 (2018).
  • Y. Nomura, A. S. Darmawan, Y. Yamaji, M. Imada, Restricted Boltzmann machine learning for solving strongly correlated quantum systems, arXiv:1709.06475 (2017). RBM times pair-product states.
  • Y. Nomura, M. Imada, Dirac-type nodal spin liquid revealed by refined quantum many-body solver using neural-network wave function, correlation ratio, and level spectroscopy, arXiv:2005.14142 (2020).
  • F. Ferrari, F. Becca, J. Carrasquilla, Neural Gutzwiller-projected variational wave functions, arXiv:1906.00463 (2019).
  • A. Szabó, C. Castelnovo, Neural network wave functions and the sign problem, arXiv:2002.04613 (2020).
  • T. Westerhout, N. Astrakhantsev, K. S. Tikhonov, M. I. Katsnelson, A. A. Bagrov, Neural quantum states of frustrated magnets: generalization and sign structure, arXiv:1907.08186 (2019).
  • K. Choo, T. Neupert, G. Carleo, Study of the two-dimensional frustrated J₁–J₂ model with neural network quantum states, arXiv:1903.06713 (2019).
  • C. Roth, A. Szabó, A. H. MacDonald, High-accuracy variational Monte Carlo for frustrated magnets with deep neural networks, arXiv:2211.07749 (2022).

Edit this page

Corrections, sharper derivations and missing references are welcome. Edit the Markdown on GitHub and open a pull request; LaTeX is rendered at build time.

Edit on GitHub ↗