acceptodds
Under review as a conference paper at ICLR 2027

Grand Canonical Generators

Abstract

We introduce Grand Canonical Generators (GCG), a generative framework that extends Boltzmann generators to the grand canonical ensemble. We present two designs. The first conditions a variable-size generative model on the chemical potential, sampling particle number and configuration jointly. The second factorizes the grand canonical distribution into a particle-number distribution and the corresponding canonical Boltzmann density. This factorized formulation can use any existing Boltzmann generator for the canonical component, encodes the known linear chemical-potential dependence analytically, and yields a tractable likelihood that supports self-normalized importance sampling (SNIS). Empirically, GCG accurately reproduces grand canonical observables on a Lennard–Jones fluid and methane adsorption in a zeolite, demonstrating generalization across chemical potentials and correction via SNIS and grand canonical Monte Carlo.

Primary area:
applications to physical sciences (physics, chemistry, biology, etc.)
Keywords:
Boltzmann Generators, Sampling, Generative Modelling, Molecular Dynamics, GCMC, Grand Canonical

Reviews

Among:
Shape:
1234this paper, Top 15%
Figure 1. Mean review rating of the reviewed papers at ICLR 2027. This paper averages 3.00 over 3 reviews, above 85% of the others.
Reviewer_z4jtOpenReview ↗
Rating
2
Confidence
3
Informativeness
2
Presentation
3
Soundness
2
Read review
Paper summary

The paper extends Boltzmann generators (NVT ensembles) to Grand Canonical generators GCG (muVT ensembles) which allow for a varying number of particles. The authors propose two different ways for realizing GCGs. First, they adapt the jump processes with generator matching, and second, they factorize the density in to conditional NVT ensembles and a categorical distribution over particle numbers. Furthermore, the authors show that their model can be used to do self-normalized importance weighting, allowing for debiasing the estimation of observables. They test their method on LJ fluids and methane adsorption in a zeolite.

Critical strengths
  • The paper is well-written and tackles an interesting problem, i.e., learning GC ensembles with is a direct extension of Boltzmann generators. Moreover, the paper is honest in reporting negative results for GC-SNIS. The particle number density p(N) seems to be learned well across tasks.
  • The factorized is simple and principled and allows to use methods for learning standard BGs, which makes it easy to adapt existing methods to GC ensembles.
Critical weaknesses
  • As presented, the paper shows the joint likelihood exists but not that it is useful. Moreover, computing likelihoods is expensive (as already pointed out by the authors)
  • The cost comparison to GCMC does not seem fair to me. To my understanding, the evaluations for generating the training data are not counted. Moreover, I’m not an expert in GCMC but I would assume that there exist better baselines than Metropolis GCMC? Moreover, the comparison in Fig 4 at the bottom can be misleading as it is almost trivial that GCMC initialized from model samples converge faster than GCMC from starting from gas.
Questions for authors
  • It would be interesting to see if the model can accurately estimate the grand potential? On that note, can the authors also report the ESS of the learned model across different values for μ\mu?
  • If I understand it correctly then the full GC-SNIS weights are never used. Could the authors clarify this? Also, why was GC-SNIS not used for the zeolite system?
  • Does the cost comparison to GCMC also count the NFE to generate the training data?
  • In Fig. 4, how is an "energy evaluation" counted for GCMC (one trial move = one evaluation?), and how does the comparison look in wall-clock time including the CNF likelihood cost? Can you provide a wall clock comparison? I would suggest that it would highly favor GCMC over the learned model
  • Which mu values are used in Fig. 4? Are they coming from the training set or test set?
1 comment

We thank the reviewer for their careful reading and for highlighting the principled factorization and the importance of reporting the negative result for grand canonical reweighting.

Reweighting

We used the full grand canonical weights in Fig. 4. We drew 400 configurations at each particle number from N=10N=10 to 5050, divided the target density by the product of the allocation probability and the conditional model density, and normalized the weights across all 16,400 configurations. This changes the particle-number probabilities and increased their W1W_1 error from 0.08 to 0.20. Conditional SNIS preserves the learned particle-number probabilities and reduces the energy W1W_1 from 0.60 to 0.30 and the pair-distance W1W_1 from 1.6×10−31.6\times10^{-3} to 9×10−49\times10^{-4}. We did not run SNIS or measure ESS for zeolite adsorption because of the large cost of evaluating CNF likelihoods at the larger particle numbers. In canonical systems the cost of likelihoods is usually alleviated by using likelihood flow maps or autoregressive models, which we leave for future work.

Effective sample size and grand potential

The pooled normalized ESS in Fig. 4 was 0.13 for conditional SNIS and 0.12 for stratified GC-SNIS. In a proof of concept of 100 joint proposals per state, the normalized joint ESS was 0.171, 0.328, 0.185, 0.405, and 0.308 at βμ=−3.75,−3.50,−3.25,−3.00,\beta\mu=-3.75,-3.50,-3.25,-3.00, and −2.75-2.75, respectively. The mean of the unnormalized joint importance weights estimates the grand partition function, from which we can compute the grand potential. Our preliminary LJ estimates of changes in grand potential followed the broad trend from WHAM.

Cost and nearby-state GCMC initialization

Fig. 4 uses βμ=−2.75\beta\mu=-2.75. The separate interpolation experiment uses βμ=−3.50\beta\mu=-3.50. We calculate the speedup under the assumption that the generator is reused and target evaluations dominate inference time. The cost comparison excludes GCMC training-data generation, model training, sample generation, and CNF likelihood evaluation.

We count one trial move for GCMC and one full configuration energy for SNIS. The CNF took about 61 seconds to generate and score one N=20N=20 configuration on an A100. FEASST ran about 158,000 trials per second on one AMD EPYC 7532 core. These timings are specific to LJ, where GCMC moves can be computed using a cheap local energy difference. We view our experiment as a proof of concept of likelihood-based correction in grand canonical systems. In realistic systems, the cost of accurate energies can often dominate, especially when fast likelihoods via flow maps or autoregressive models are available.

We agree that a nearby equilibrium state is a strong baseline when configurations are available. We ran 16 chains per initialization at βμ=−2.75\beta\mu=-2.75 with the same GCMC kernel.

Trials per chainEmpty startNearby-state start (βμ=−3.00\beta\mu=-3.00)Model start
5,0001.8192.4101.616
100,0000.5350.3870.513
1,000,0000.1230.1580.109
10,000,0000.0680.0620.067

More advanced move sets remain to be tested, and could also be applied to configurations from the model.

Chemical potential in Fig. 4

Fig. 4 uses βμ=−2.75\beta\mu=-2.75. The separate interpolation experiment uses βμ=−3.50\beta\mu=-3.50. We will clarify this in the manuscript.

Reviewer_o53XOpenReview ↗
Rating
4(+1)
Confidence
4
Informativeness
2
Presentation
3
Soundness
2
Read review
Paper summary

This paper introduces Grand Canonical Generators (GCG), extending Boltzmann Generator-type approaches to the grand canonical ensemble, where both particle coordinates and particle numbers fluctuate. The paper develops two approaches, Joint GCG and Factorized GCG.

The main contribution is the Factorized GCG framework, which decomposes the joint distribution into a particle-number distribution and a conditional configurational distribution. The former is modeled using a categorical distribution with a physics-informed parameterization, while the latter is learned through a Transformer-based continuous normalizing flow, allowing the velocity field to share parameters across different particle numbers. This factorization also enables tractable likelihood evaluation and importance-sampling-based corrections.

The proposed methods are evaluated on ideal gas, Lennard-Jones fluids, and methane adsorption in zeolites, demonstrating their ability to reproduce grand canonical equilibrium statistics and generalize across chemical potentials.

Critical strengths
  1. Extending generative sampling methods from fixed-particle-number systems to grand canonical ensembles is an interesting and practically relevant problem. The proposed framework provides a natural way to handle fluctuations in both particle numbers and configurations.

  2. The Factorized GCG is particularly appealing. It combines a structured categorical model for particle numbers with a Transformer-based conditional flow for particle coordinates, enabling parameter sharing across different particle numbers. The incorporation of the known chemical-potential dependence into the particle-number model is also well motivated and facilitates generalization across thermodynamic conditions.

Critical weaknesses
  1. The experimental evaluation relies heavily on Morph as a baseline. However, Morph is not necessarily the most informative baseline for assessing the advantages of the proposed factorized architecture. Several recent generative approaches have also considered grand canonical or variable-particle-number systems, and a more comprehensive comparison with these methods would help establish the contribution of GCG.

  2. The particle-number distribution is determined by the canonical partition functions Z_N, while these partition functions can, in principle, also be estimated using the conditional generative models for each N, provided that their likelihoods are tractable. In the current Factorized GCG, these two components are primarily connected through shared training data rather than an explicit thermodynamic consistency condition. Exploring or at least discussing this connection would help clarify whether the proposed factorization can exploit additional physical information and improve statistical efficiency.

Questions for authors
  1. Could the authors clarify the main advantages of GCG over recent generative approaches for grand canonical or variable-particle-number systems? In particular, would it be possible to provide additional comparisons beyond Morph, or explain why the existing alternatives are not suitable baselines?

  2. In Factorized GCG, the particle-number model learns a residual term corresponding to \log Z_N, up to an additive constant. On the other hand, since the conditional CNFs provide tractable likelihoods, the corresponding partition functions or free-energy differences could also be estimated through importance sampling or variational free-energy methods. Have the authors considered exploiting this relationship to couple the training of the particle-number model and the conditional generators? Could such a consistency constraint improve accuracy or reduce dependence on GCMC training data?

  3. Given the connection between the structured particle-number model and WHAM/MBAR discussed in the paper, how does the learned r_\phi(N) compare with conventional histogram-based estimates of \log Z_N?

2 comments

We thank the reviewer for their careful reading and for highlighting the use of the known chemical-potential dependence and the sharing of parameters across particle numbers.

Comparison with prior generative approaches

We agree that Morph is most informative as a baseline for Joint GCG, which adapts its variable-size generation process to periodic equilibrium systems. In Factorized GCG, the conditional flow can be reused across chemical potentials at fixed temperature for the same system, since changing the chemical potential only tilts the particle-number distribution. The two factors also give a tractable joint likelihood for importance correction in continuous space. Prior lattice methods use a discrete spatial representation, and JANUS uses crystalline site occupations and displacements with a path-based correction. A comparison on our fluid or adsorption benchmarks would require adapting these methods to a common setting.

Thermodynamic consistency

Yes, the conditional flows can also inform the particle-number model. At fixed NN, we can estimate ZNZ_N by averaging e−βUN(X)/qθ(X∣N)e^{-\beta U_N(X)}/q_\theta(X\mid N) over samples from the conditional flow, using the same configurational measure as in the paper. We could use the estimated log partition-function ratios to regularize rϕ(N)−rϕ(N′)r_\phi(N)-r_\phi(N'). In the current model, both factors learn from GCMC data independently. Appendix C takes a related step after training by using Bennett acceptance ratio estimates of adjacent partition-function ratios to correct the particle-number distribution. Coupling the two factors during training could reduce the need for particle-number data from GCMC. Its usefulness would depend on how well the conditional flows cover the target and on the cost of scoring samples, since noisy importance estimates can give biased log ratios.

Comparison with WHAM

WHAM is a natural choice for estimating particle-number probabilities for a single system at fixed temperature when histograms at nearby chemical potentials overlap. With a free parameter for every NN, our particle-number likelihood gives the same multiple-histogram estimate up to an additive constant.

Following the reviewer’s suggestion, we fitted WHAM to the LJ validation histograms at four chemical potentials. We added log⁡(N!)\log(N!) to the WHAM log weights and aligned the estimates of log⁡ZN\log Z_N at N=10N=10. We compared the estimates over particle numbers 5 through 30 and evaluated the predicted particle-number distributions against the GCMC test histogram at the held-out chemical potential βμ=−3.5\beta\mu=-3.5.

MethodRMSE in log⁡ZN\log Z_N relative to WHAMTotal variation distance to the test histogram
WHAM—0.019
Factorized GCG (8×512)0.110.056
Factorized GCG (8×768)0.180.028

WHAM gave the closest particle-number distribution in this comparison, which used one retraining per architecture and one held-out GCMC chain. However, applying standard WHAM across systems would require fitting a separate curve for each system. The neural residual can share parameters across systems.

The authors have made good revisions based on my comments, so I have raised my score.

Reviewer_6NLWOpenReview ↗
Rating
3
Confidence
4
Informativeness
2
Presentation
3
Soundness
2
Read review
Paper summary

It introduces Grand Canonical Generators for grand canonical ensemble sampling with variable particle number. It proposes a joint method and a factorized method. The factorized model incorporates the known chemical-potential dependence and provides a tractable likelihood for importance correction. Experiments cover an ideal gas, a Lennard–Jones fluid, and methane adsorption in an MFI zeolite.

Critical strengths

The paper addresses a relevant sampling problem with clear practical applications. I like the proposed extension of Boltzmann generators to systems with variable particle numbers, and the adsorption example demonstrates its practical value. The paper is generally well written and easy to follow. The motivation and the differences between the two formulations are explained clearly. Overall, I like this work and consider it a useful contribution to neural equilibrium sampling.

Critical weaknesses
  1. The strongest improvements come from conditional SNIS, which leaves particle number probabilities unchanged. GC-SNIS increases the reported particle-number error from 0.08 to 0.2, and no correction or ESS results are shown for zeolite adsorption if I understand correctly. The practical benefit of correcting the joint distribution therefore remains only partially demonstrated.

  2. Comparisons count target energy evaluations without reporting the costs of generation and likelihood evaluation. Wall-clock comparisons, including a GCMC baseline initialized from existing nearby-state configurations, would better establish the computational advantage.

Questions for authors

Major:

  1. The paper reports that the error in the particle-number distribution increases from 0.08 before correction to 0.2 after GC-SNIS. Can you show another condition, or a larger sampling budget, where correcting the particle-number probabilities actually improves the result?

  2. Which standard BG capabilities carry over to each method? Please clarify the feasibility of energy-based training and AIS/SMC correction, including any additional requirements arising from variable particle number.

  3. What motivates local message passing over sparse local attention for the zeolite case, and what is the anticipated accuracy cost tradeoff?

Minor:

  1. “Grand Canonical Boltzmann Generators” as a title to me could make the connection to BGs clearer. For the implemented joint variant without tractable endpoint likelihoods, “Grand Canonical Boltzmann Emulator” could clarify its capabilities. Just my suggestion, no need to follow exactly.

  2. Include the existing Kish (1965) citation at the first main-text definition. Consider discussing Coarse-Grained Boltzmann Generators (Chen et al., 2026), which changes the number of particles via coarse-graining and use learned target potentials.

2 comments

We thank the reviewer for their careful reading and for highlighting the relevance of the problem, the clarity of the writing and motivation of the method.

Reweighting

We agree that the clearest improvements in Fig. 4 come from conditional SNIS. It reduces energy W1W_1 from 0.60 to 0.30 and pair-distance W1W_1 from 1.6×10−31.6\times10^{-3} to 9×10−49\times10^{-4} while preserving the learned count probabilities. With 16,400 configurations, stratified GC-SNIS increases particle-number W1W_1 from 0.08 to 0.20. Using the Bennett acceptance ratio (Appendix C) gives a count W1W_1 slightly below 0.08 at a substantially larger insertion/deletion budget. In this LJ toy benchmark, the particle number probabilities are already quite accurate. We expect the joint correction to be most relevant with a general generator that amortizes across systems.

Cost and nearby-state GCMC initialization

Following the reviewer’s suggestion, we ran 16 chains per initialization with the same GCMC kernel at βμ=−2.75\beta\mu=-2.75.

Trials per chainEmpty startNearby-state start βμ=−3.00\beta\mu=-3.00Model start
5,0001.8192.4101.616
100,0000.5350.3870.513
1,000,0000.1230.1580.109
10,000,0000.0680.0620.067

For this single system starting from a nearby state is indeed a strong baseline, if such samples are available.

The CNF took about 61 seconds to generate and score one N=20N=20 configuration on an A100. FEASST ran about 158,000 GCMC trials per second on one AMD EPYC 7532 core. We view the CNF experiment as a proof of concept for likelihood-based correction in the grand canonical ensemble. Few-step invertible flow maps and autoregressive density models could reduce likelihood-evaluation cost. Following previous work, we use cheap force fields (LJ-like). We expect that using more accurate potentials, energy evaluations instead of likelihood evaluations may dominate the runtime.

Energy-based training and AIS/SMC

Yes, and thank you for the question. The Factorized GCG can use the same energy-based training as a standard Boltzmann generator at each fixed particle number. For example, a conditional flow with an evaluable likelihood can be trained directly against a differentiable target energy using reverse KL.

AIS and SMC are also possible. At a fixed particle number, we can start with configurations drawn from the model and gradually shift from the model distribution to the physical target. At each step, we can propose moving a molecule and accept or reject the move using the current distribution. To correct the particle number probabilities as well, we can either estimate the total Boltzmann weight at each particle number and combine those estimates with the known grand canonical factors, or run a single sampler that can also insert and delete molecules.

Local message passing in zeolite

We chose local message passing for simplicity. It gave us a straightforward way to incorporate periodic geometry. Sparse attention is another plausible option but would require adapting the fast attention kernels to periodic neighbor lists. Sparse local attention could potentially improve accuracy, but remains to be tested.

Naming and references

We appreciate the title suggestion. We chose the name since Boltzmann generators target the (canonical) Boltzmann distribution, and Grand Canonical Generators extend the idea to the grand canonical distribution. We will add a comment clarifying the connection, and that the joint variant without tractable endpoint likelihoods acts as an emulator. We will cite Kish also in the main text where we introduce ESS and discuss Coarse-Grained Boltzmann Generators. Thank you for bringing them to our attention.

I thank the authors for their response and the additional experiments, which help clarify the scope and limitations of the work. Overall, I still consider this a useful contribution and will maintain my positive score.

From OpenReview, CC BY 4.0. Authors as signed there; shown unedited.

Related papers

Loading the map…

Discussion (0)

Sign in to comment.