Manuscript Offprint
arXiv:2611.05436Constraint-Preserving Flow Matching for Spectral Graph Generation
Abstract
Spectral graph generation models graphs through the eigenvalues and eigenvectors of their Laplacians, providing a compact and continuous alternative to direct graph construction. However, these eigensystems must retain the structural properties of graph Laplacians. Existing approaches preserve eigenvector orthonormality but do not enforce the Laplacian nullspace constraint, potentially producing eigensystems inconsistent with Laplacian structure. To address this, we introduce Laplacian-Constrained Stiefel Flow Matching (LaSFM), which preserves the nullspace condition alongside eigenvector orthonormality and positive eigenvalues during generation. We characterize the underlying constrained Stiefel manifold and formulate flow matching on it. We further extend LaSFM to property-guided generation, steering samples toward desired graph properties while maintaining these constraints. Experiments demonstrate improved performance on both spectral and graph-level metrics, along with better alignment with target properties.
1 INTRODUCTION
Graph generation is central to molecular design, drug discovery, and modeling complex networks (Jin et al., 2018; Lee et al., 2023; You et al., 2018). However, directly generating graph is challenging because of its discrete and combinatorial nature (Vignac et al., 2023). Spectral graph generation addresses this difficulty by representing a graph through the eigenvector matrix and eigenvalue matrix of its Laplacian , rather than generating edges directly (Martinkus et al., 2022; Minello et al., 2025). This provides a compact, continuous representation of global graph

Figure 1: Spectral generation can produce distorted structure when eigenvector orthonormality, the Laplacian nullspace constraint, and positive nonzero eigenvalues are not preserved. LaSFM enforces these constraints throughout generation.
structure and enables smooth generative dynamics in spectral space.
This continuous representation, however, introduces an important challenge: the generated eigensystem must remain consistent with the structure of a graph Laplacian. Existing approaches preserve eigenvector orthonormality, (Martinkus et al., 2022; Huang et al., 2025), but do not explicitly enforce two additional Laplacian properties: the constant-vector nullspace condition, , and positivity of the nonzero eigenvalues, conditions. Without preserving these, the Laplacian reconstructed from the generated eigensystem can have nonzero row sums or lose positive semidefiniteness, resulting in a matrix that may no longer correspond to a graph Laplacian.
The Laplacian nullspace and eigenvalue positivity constraints directly affect graph generation. If the reconstructed Laplacian does not satisfy these constraints, the subsequent conversion to a discrete graph can alter the generated spectral structure. As a result, structural characteristics encoded in the eigensystem may be lost or distorted in the final graph, undermining the benefits of spectral generation, as illustrated in Fig. 1. To avoid this mismatch, we seek to preserve eigenvector orthonormality, the Laplacian nullspace, and positive nonzero eigenvalues throughout generation, improving consistency between the generated eigensystem and the resulting graph.
In this work, we introduce Laplacian-Constrained Stiefel Flow Matching (LaSFM), a flow-matching framework that generates eigensystems while preserving the required spectral constraints. We further extend LaSFM to property-guided generation, allowing samples to be steered toward desired properties without violating these constraints. Empirically, LaSFM improves spectral matching, reconstructed graph quality, and alignment with target properties, while ablations demonstrate the importance of each constraint.
Our contributions are summarized as follows:
-
We characterize the nullspace-constrained Stiefel manifold and derive constraint-preserving geodesics and vector fields.
-
We develop LaSFM, which combines flow matching on this constrained manifold with a positive eigenvalue parameterization, preserving orthonormality, the Laplacian nullspace, and positive nonzero eigenvalues throughout generation.
-
We extend LaSFM to gradient-based property guidance and establish that the spectral constraints remain preserved under guidance.
Spectral graph generation typically retains only eigenpairs to obtain a compact approximation of the graph spectrum:
where contains the retained eigenvectors and is the corresponding diagonal eigenvalue matrix. Hereafter, we omit the subscript for brevity and consider only the nonzero eigenvalues and their corresponding eigenvectors.
Structural constraints of Laplacian eigensystems. A combinatorial graph Laplacian is known to satisfy four properties (Chung, 1997):
(i) Symmetry:
(ii) Positive semidefiniteness:
(iii) Constant-vector nullspace condition:
(iv) Nonpositive off-diagonal entries: for
For the truncated eigensystem , the first three properties correspond to spectral constraints on the retained eigenpairs. Symmetry gives an orthonormal eigenbasis, requiring in the spectral decomposition; positive semidefiniteness requires the retained nonzero eigenvalues to be positive, equivalently ; and the constant-vector nullspace requires the retained eigenvectors to be orthogonal to . We therefore impose the following spectral constraints:
We do not directly enforce the nonpositive off-diagonal condition in (iv), as it is generally not preserved under low-rank spectral truncation.
Spectral graph generation via flow matching. Flow matching (Lipman et al., 2022; Albergo and Vanden-Eijnden, 2022; Liu et al., 2023) learns a time-dependent vector field that transports samples from a base distribution to the data distribution. In spectral graph generation, flow matching can be used to generate the eigenvectors and eigenvalues of graph Laplacians (Huang et al., 2025). Specifically, separate vector fields and are learned for the eigenvectors and eigenvalues, and the eigensystem is generated by integrating these fields from the base distribution (see Appendix A.1 for details).
Stiefel flow matching. The orthonormality constraint on the eigenvector matrix naturally motivates modeling its dynamics on the Stiefel manifold, where orthonormality is preserved. Flow matching can also be formulated on this manifold through Stiefel flow matching (Cheng et al., 2025), which builds on the broader Riemannian framework (Chen and Lipman, 2024).
For time index , let denote the eigenvector matrix at time , where is sampled from a base distribution on the Stiefel manifold and is the eigenvector matrix of a graph Laplacian from the data distribution. To preserve eigenvector orthonormality throughout the flow, must remain on the Stiefel manifold
Consequently, its velocity must lie in the corresponding tangent space
(4) obtained by differentiating the orthonormality condition , which gives .
To generate eigenvectors on this manifold, Stiefel flow matching learns a tangent vector field that approximates the geodesic velocity by minimizing
where denotes the norm induced by the Stiefel metric. Here, the geodesic velocity is given by
This is obtained by differentiating the geodesic between the source and data :
Here, and denote the Riemannian exponential and a logarithm map chosen consistently along the geodesic, respectively (Cheng et al., 2025). Further details are provided in Appendix A.2.
3 NULLSPACE-CONSTRAINTED STIEFEL GEOMETRY
Stiefel flow matching preserves eigenvector orthonormality in spectral graph generation (Huang et al., 2025), but does not enforce the constant-vector nullspace condition of graph Laplacians. We therefore extend the Stiefel dynamics to enforce this additional constraint. We first construct a geodesic that satisfies the nullspace condition (Sec. 3.1) and derive its velocity as the flow-matching target (Sec. 3.2). We then establish a sufficient condition on the learned vector field to maintain it throughout generation (Sec. 3.3).
3.1 Nullspace-Constrained Eigenvector Manifold
We first establish the relationship between the nullspace condition of the reconstructed Laplacian and the corresponding eigenvector matrix .
Proposition 1. For a Laplacian matrix , let and let be a diagonal matrix with positive eigenvalues such that . Then,
Proof. See Appendix B.2.
Proposition 1 allows us to enforce the nullspace condition directly on the retained eigenvector matrix. We
therefore define the nullspace-constrained Stiefel manifold
Since , the columns of lie in the -dimensional subspace . Let be an orthonormal basis for this subspace. By Lemma 1 in Appendix B.2, every can be written as
This provides an alternative approach: perform flow matching on the lower-dimensional Stiefel manifold and map the resulting eigenvectors back through . However, this requires choosing an explicit basis and transforming states, velocities, and guidance gradients between the two coordinate systems. We instead formulate the dynamics directly on in the original node coordinates, avoiding these additional transformations.
3.2 Nullspace-Preserving Geodesic Interpolation
Stiefel flow matching uses a geodesic path and its velocity as the flow-matching target. We now establish conditions under which remains on (Eq. 7), ensuring that the interpolation preserves the constant-vector nullspace constraint.
Proposition 2. Let satisfy
so that . If and are joined by a unique minimizing Stiefel geodesic , then
Proof. See Appendix B.2.
Intuitively, Proposition 2 shows that if both endpoint eigenvector matrices satisfy the nullspace constraint, then the minimizing Stiefel geodesic between them preserves throughout the training trajectory. Together with Proposition 1, this ensures that the reconstructed Laplacian satisfies throughout the generation. Additionally, since is randomly sampled from a continuous distribution on the manifold, the minimizing geodesic to is unique almost surely, as cases with multiple shortest paths occur with probability zero (Lee, 2018).
Notably, Proposition 2 requires and to satisfy the nullspace condition. Since the data eigenvectors already satisfy the endpoint conditions, we only need to construct on the Stiefel manifold with
- We obtain by first sampling a Gaussian noise matrix and projecting it onto using
We then orthonormalize the columns of PZ to obtain (see Appendix C.2).
3.3 Nullspace-Preserving Vector Fields
Next, we derive a sufficient condition on the vector field that ensures the generated eigenvector matrix remains on throughout the flow.
Proposition 3. Let be a continuously differentiable trajectory with initial condition . If its velocity satisfies
then
Proof. See Appendix B.2.
Proposition 3 shows that a Stiefel trajectory preserves the nullspace condition if and for all . Since already satisfies the initial condition by construction (Sec. 3.2), we only need to enforce the velocity condition on the learned vector field , which approximates .
We implement this through two successive projections of the learned vector field . First, we use (Eq. 8) to project the field onto , satisfying the nullspace velocity condition. We then apply the Stiefel tangent-space projection (Edelman et al., 1998) to preserve eigenvector orthonormality, yielding
where and .
We now show that the two-step projection enforces both the Stiefel tangent-space and nullspace velocity conditions required to remain on .
Proposition 4. For and any model output , the projected velocity in Eq. 9 satisfies
Proof. See Appendix B.2.
Proposition 4 establishes that the projected vector field lies in the tangent space , meaning that its velocity is constrained to directions along the manifold. Therefore, starting from , the trajectory generated by remains on , preserving both eigenvector orthonormality and the nullspace condition throughout generation.

Figure 2: Overview of LaSFM. Beyond eigenvector orthogonality, LaSFM preserves the Laplacian nullspace constraint and eigenvalue positivity throughout generation.
4 LAPLACIAN-CONSTRAINTED STIEFEL FLOW MATCHING
Building on the theoretical results developed in the previous section, we introduce Laplacian-Constrained Stiefel Flow Matching (LaSFM), a joint flow-matching framework for generating Laplacian eigenvectors and eigenvalues while preserving their spectral constraints. We first introduce the positive eigenvalue parameterization in LaSFM. We then describe the joint learning of eigenvalues and eigenvectors, where the eigenvectors follow nullspace-constrained Stiefel dynamics. An overview is illustrated in Fig. 2.
Positive Eigenvalue Parameterization. To ensure positive generated eigenvalues, we perform flow matching over unconstrained diagonal matrices . Then, the constrained eigenvalue matrix is obtained through a cumulative softplus transformation of its diagonal entries:
where denotes the -th entry of , and for . This ensures with strictly increasing diagonal entries, without constraining the eigenvalue vector field directly.
Joint Flow Matching. We now combine the constrained eigenvector dynamics and positive eigenvalue parameterization into a joint flow-matching formulation. Both vector fields are conditioned on the evolving spectral state , allowing the eigenvectors and eigenvalues to be jointly modeled.
For the eigenvector component, we sample an initial by drawing a Gaussian matrix, projecting
Algorithm 1 LaSFM Training
Require: Data distribution , LaSFM model
1: Sample and construct Laplacian
2: Compute
3: Sample diagonal with
4: Sample
5: Sample
Flow construction (paths and targets)
6: Map to using Eq. 10
7: Project onto by Eq. 8 and orthonormalize
8: Construct paths using Eq. 11
9: Construct targets using Eq. 12
Velocity prediction (model outputs)
10: Predict the transformed-eigenvalue and eigenvector velocities
11: Apply constrained projection from Eq. 9
Flow-matching loss (training objective)
12: Compute
Parameter update
13: Update to minimize
it onto using Eq. 8, and orthonormalizing the result, as described in Sec. 3.2. For the eigenvalues, we sample an initial diagonal matrix with
and zero off-diagonal entries. The target is obtained by inverting Eq. 10, with eigenvalue gaps lower bounded by before applying the inverse softplus.
Then, we construct the eigenvalue path by linear interpolation and the eigenvector path along the nullspace-preserving minimizing Stiefel geodesic:
where is the geodesic defined in Eq. 6. The corresponding target velocities are
where is the geodesic velocity defined in Eq. 5.
Using the target velocities in Eq. 12, we jointly train the eigenvalue vector field and eigenvector vector fields by minimizing
where and denote the transformed-eigenvalue and constrained-eigenvector per-sample flow-matching losses, respectively. Both vector fields are conditioned on , is diagonal, and denotes the constrained tangent-space projection defined in Eq. 9.
Architecture and Generation. Following Minello et al. (2025), we employ bidirectional cross-attention to jointly model the two spectral components. Architectural details are provided in Appendix C.1.
During generation, we jointly integrate the learned eigenvector and eigenvalue velocity fields:
The eigenvalues are then recovered from using Eq. 10, ensuring positivity, while the projected eigenvector velocity preserves orthonormality and the nullspace condition. Consequently, the reconstructed matrix remains symmetric, positive semidefinite, and has zero row sums throughout the continuous generation process.
5 CONSTRAINT-PRESERVING PROPERTY GUIDANCE
In many applications, we want generated graphs to satisfy certain desired properties. For example, molecular graph generation may target specific electronic properties. Property guidance can steer generation toward these targets. However, directly adding guidance gradients to the spectral dynamics may violate the spectral constraints, causing the trajectory to leave the constrained space. To address this, we extend LaSFM to property-guided generation while preserving the spectral constraints throughout the guided trajectory.
Following gradient-based guidance (Dhariwal and Nichol, 2021), we steer generated graphs toward desired properties using a differentiable objective
We modify the eigenvalue and eigenvector vector fields using its gradients:
where controls the guidance strength.
The guided dynamics preserve all spectral constraints enforced by LaSFM: eigenvector orthonormality, the Laplacian nullspace condition, and eigenvalue positivity hold throughout the trajectory for any guidance strength . We formalize it in the following corollary.
Table 1: MMD² ratios for eigenvalue and wavelet statistics, measuring agreement between generated and test spectral distributions (lower is better). LaSFM achieves the most consistent performance across datasets.
| Method | Planar | SBM | Community-Small | QM9 | ||||
|---|---|---|---|---|---|---|---|---|
| Eigenvalue ↓ | Wavelet ↓ | Eigenvalue ↓ | Wavelet ↓ | Eigenvalue ↓ | Wavelet ↓ | Eigenvalue ↓ | Wavelet ↓ | |
| SPECTRE | 3.092 | 26.87 | 14.21 | 1.612 | 1.051 | 2.378 | 2.974 | 15.39 |
| GGSD | 25.21 | 397.1 | 3.405 | 82.64 | 2.106 | 30.66 | 19.35 | 45.31 |
| SFMG | 21.35 | 14.95 | 1.811 | 11.83 | 2.101 | 5.695 | 25.92 | 23.16 |
| LaSFM (ours) | 3.839 | 4.562 | 1.814 | 2.333 | 1.000 | 1.023 | 1.827 | 1.561 |
Corollary 1. Suppose the guided dynamics are initialized with , , and . Then, throughout the guided trajectory,
Thus, the guided dynamics preserve all imposed spectral constraints.
Proof. See Appendix B.2.
Corollary 1 shows that the generated eigensystem can be steered toward target properties without sacrificing the spectral constraints enforced by LaSFM.
6 RELATED WORK
Spectral graph generation models graphs through the eigensystem of their Laplacian, providing a continuous alternative to directly generating discrete graph structure. GSDM (Luo et al., 2023) uses score-based diffusion to generate eigenvalues while sampling eigenvectors from the training data, limiting the diversity of the generated eigensystems. GGSD (Minello et al., 2025) instead generates both eigenvalues and eigenvectors using a DDPM (Ho et al., 2020) in Euclidean space, but does not explicitly preserve the structural constraints of the Laplacian.
Subsequent methods incorporate eigenvector orthonormality. SPECTRE (Martinkus et al., 2022) generates both spectral components using a GAN (Goodfellow et al., 2014) and preserves orthonormality through Stiefel rotation layers, while SFMG (Huang et al., 2025) enforces it through flow matching on the Stiefel manifold. However, neither explicitly preserves two graph-Laplacian properties: the constant-vector nullspace condition and positivity of the nonzero eigenvalues. Our work addresses these remaining constraints while retaining eigenvector orthonormality.
7 EXPERIMENTS
We evaluate LaSFM across the spectral generation pipeline. First, we assess whether constraint-preserving generation better matches the data distribution in spectral space (Sec. 7.1) and after graph reconstruction (Sec. 7.2). We then evaluate property-guided generation, testing whether the spectral constraints remain preserved while steering samples toward target properties (Sec. 7.3). Finally, we ablate each constraint to assess its contribution to spectral consistency and reconstruction (Sec. 7.4).
Experimental setup. We evaluate on the standard graph-generation datasets Planar, SBM, Community-small (Martinkus et al., 2022), and QM9 (Ramakrishnan et al., 2014; Wu et al., 2018). Following Martinkus et al. (2022), we use 80%/20% training-test splits and compare against SPECTRE (Martinkus et al., 2022), GGSD (Minello et al., 2025), and SFMG (Huang et al., 2025). We use a common across methods for spectral evaluation and the recommended method-specific for graph generation. SFMG is a best-effort reproduction because its code is not publicly available. Further experimental details are provided in Appendix D, with additional results in Appendix E.
7.1 Spectral Generation
We first evaluate how well LaSFM captures the spectral data distribution relative to existing methods. For all methods, we evaluate eigensystems generated directly in spectral space, before graph reconstruction.
Metrics. We report the ratio of generated-test to train-test MMD² for eigenvalue and graph-wavelet statistics (Gretton et al., 2012; Martinkus et al., 2022; Hammond et al., 2011). A lower ratio indicates better agreement with the test distribution, while 1 represents the empirical train-test discrepancy. We use the same number of retained eigenpairs across methods.
Results. LaSFM achieves consistently low eigenvalue and graph-wavelet MMD² ratios across datasets (Table 1), indicating that it captures both the Laplacian eigenvalue distribution and the spectral structure determined jointly by eigenvalues and eigenvectors. These results suggest that enforcing the Laplacian constraints provides a useful inductive bias for matching the spectral data distribution.
Table 2: MMD² ratios for graph statistics (lower is better) and the joint validity–uniqueness–novelty (VUN) score (higher is better). LaSFM achieves the most consistent performance across datasets.
| Method | Planar | SBM | Community-Small | |||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Deg. ↓ | Clust. ↓ | Orbit ↓ | V.U.N ↑ | Deg. ↓ | Clust. ↓ | Orbit ↓ | V.U.N ↑ | Deg. ↓ | Clust. ↓ | Orbit ↓ | V.U.N ↑ | |
| SPECTRE | 2.500 | 2.850 | 2.400 | 0.1400 | 3.000 | 1.670 | 1.680 | 0.1000 | 5.910 | 10.87 | 18.97 | 0.9900 |
| GGSD | 8.500 | 2.800 | 2.800 | 0.1500 | 2.630 | 1.660 | 2.650 | 0.1000 | 1.040 | 2.190 | 10.98 | 0.9500 |
| SFMG | 127.0 | 26.30 | 33.60 | 0.1800 | 32.75 | 2.080 | 3.440 | 0.2400 | 1.790 | 4.860 | 2.910 | 0.9000 |
| LaSFM | 2.500 | 2.730 | 1.400 | 0.1800 | 1.250 | 1.780 | 1.880 | 0.2000 | 1.037 | 1.952 | 9.720 | 0.9700 |
7.2 Graph Generation
We next test whether preserving the Laplacian spectral constraints translates into higher-quality discrete graphs after reconstruction.
Graph reconstruction. Spectral flow matching generates the eigensystem and thus a low-rank approximation of Laplacian, . However, it does not directly represent a discrete graph. Thus, following Huang et al. (2025), we train a Euclidean flow-matching postprocessor that maps to a continuous adjacency matrix. We then symmetrize and discretize the output to obtain the graph adjacency matrix . Reconstruction details are provided in Appendix D.
Metrics. We report MMD² ratios for degree, clustering, and orbit statistics (Minello et al., 2025), capturing local connectivity, neighborhood transitivity, and small-subgraph structure, respectively. We also report the joint validity–uniqueness–novelty (VUN) score, with validity defined as follows: for Planar, it requires connectedness and planarity; for SBM, we use the SPECTRE criterion (Martinkus et al., 2022) to assess consistency with the ground-truth SBM; for Community-small, which lacks a validity criterion, we set validity to 1. Uniqueness measures the fraction of non-isomorphic generated graphs, while novelty measures the fraction not found in the training set.
Results. LaSFM achieves the strongest overall graph-level performance, with consistently low MMD ratios across degree, clustering, and orbit statistics while maintaining competitive VUN (Table 2). Together with its stronger spectral distribution matching (Sec. 7.1), these results show that LaSFM's improvements in spectral generation also translate to improved graph-level distribution matching after reconstruction.
7.3 Constraint-Preserving Property Guidance
We next investigate whether spectral generation can be steered toward desired molecular properties while preserving the spectral constraints and maintaining molecular validity after reconstruction.
Setup. We evaluate property-guided QM9 generation for three targets: HOMO ( eV), LUMO ( eV), and the HOMO–LUMO gap ( eV). For each property, we train a spectral Transformer to predict the property from the eigensystem and atom types, and guide generation using as in Eq. 14. We apply the same guidance procedure to LaSFM, GGSD, and SFMG.
For a controlled comparison, all methods generate 9-node molecules using all nontrivial Laplacian eigenpairs. Unlike in Sec.7.2, we reconstruct graphs by thresholding the generated Laplacian rather than using a learned graph predictor. The threshold is selected separately for each method to maximize molecular validity. This isolates the effect of spectral guidance and avoids a learned reconstruction model correcting differences between the generated eigensystems. We then use RDKit (Landrum et al., 2024) to construct molecular structures from the reconstructed graphs. Guidance strengths ( in Eq. 14) are selected to balance target-property accuracy and molecular validity. Further details are provided in Appendix D.
Metrics. We report the mean absolute error (MAE) between the predicted and target property values (HOMO, LUMO, and HOMO–LUMO gap), along with its standard error. Property values are predicted on valid reconstructed molecules using independently trained directed message-passing neural networks (D-MPNNs) (Yang et al., 2019). We also report the frac-

Figure 3: Property-guided QM9 generation evaluated on reconstructed molecules. LaSFM achieves the lowest target MAE across all properties while maintaining competitive molecular validity.

Figure 4: Ablation of the Laplacian constraints on QM9 generation. LaSFM achieves the lowest reconstruction error and highest validity, showing the importance of all three constraints.
tion of valid molecules. A molecule is considered valid if its heavy-atom graph is connected and RDKit successfully performs bond-order assignment and sanitization. Finally, we measure spectral constraint violations through orthonormality error , nullspace error , and eigenvalue positivity error . All metrics are evaluated over 1,000 generated samples, with further definitions in Appendix D.
Results. As shown in Fig. 3, LaSFM achieves the lowest target MAE on reconstructed molecules with highest validity. Consistent with Corollary 1, it also has zero , , and for LUMO (Table 3), while the baselines violate these constraints. This suggests that constraint-preserving guidance improves target alignment without degrading the generated eigensystem. Results for other properties are in Appendix E.
7.4 Ablation
Finally, we ablate each Laplacian constraint and evaluate reconstruction consistency and molecular validity.
Setup. We use the same QM9 setting as Sec. 7.3. We ablate i) the nullspace constraint by removing the projection onto the orthogonal complement of 1, ii) orthonormality by replacing Stiefel flow matching with Euclidean flow matching, and iii) eigenvalue positivity by removing the positive-eigenvalue mapping in Eq. 10. All other settings are kept fixed.
Metrics. We measure reconstruction consistency using the Laplacian reconstruction error , defined as the discrepancy between the generated spectral Laplacian and the Laplacian of the thresholded reconstructed graph. We also report molecular validity, requiring a connected heavy-atom graph and successful RDKit bond-order assignment and sanitization. Results are reported over 1,000 samples. Lower indicates better agreement between the generated eigensystem and reconstructed graph, while higher validity indicates better molecular reconstruction. Exact defi-

Figure 5: Compared with variant without nullspace constraint, LaSFM generates Laplacians that require smaller corrections, thereby producing graphs that are more consistent with the generated Laplacians.
nitions are provided in Appendix D.
Table 3: Spectral constraint errors under LUMO guidance. LaSFM preserves all three constraints.
| Method | |||
|---|---|---|---|
| GGSD | 0.1062 | 0.0124 | 0.0003 |
| SFMG | 0.0000 | 0.2493 | 0.0146 |
| LaSFM | 0.0000 | 0.0000 | 0.0000 |
Results. The full LaSFM model outperforms every ablated variant, achieving the lowest reconstruction error and highest molecular validity, as shown in Fig. 4. Removing any Laplacian constraint increases the correction required during reconstruction, reducing consistency between the generated spectral representation and the reconstructed graph.
Figure 5 illustrates the effect of the nullspace constraint. Compared with LaSFM, the variant without this constraint produces a larger discrepancy between the generated spectral Laplacian and the Laplacian of the reconstructed graph, as captured by . This helps explain why preserving the constraints improves LaSFM's reconstruction performance.
8 CONCLUSION
Our work focuses on two graph-Laplacian properties not addressed by existing spectral generative methods: the constant-vector nullspace condition and positivity of the nonzero eigenvalues. We characterize the corresponding constrained Stiefel geometry and propose LaSFM, which preserves these properties together with eigenvector orthonormality during generation and property guidance. We empirically demonstrate improved spectral matching, graph reconstruction, and target alignment, while ablations show that removing any constraint degrades reconstruction.
There are, however, two remaining limitations. First, the enforced spectral constraints do not fully characterize a combinatorial Laplacian. In particular, truncated eigensystems do not guarantee the required non-positive off-diagonal entries, which LaSFM does not enforce. Second, converting the generated eigensystem into a discrete graph still requires a reconstruction procedure, which is beyond the scope of our work.
Acknowledgements
KK was supported by the Alexander von Humboldt Foundation (Humboldt Research Award), JSPS KAKENHI (JP26K21777 and JP25K24465), and JST ASPIRE (JPMJAP2302). YJ was supported by the National IT Industry Promotion Agency (NIPA) grant funded by the Korean government (MSIT) (Physical AI SDF-Specialized Foundation Model for Autonomous Factory Operations, RS-2026-25621588) and the National Research Foundation of Korea (NRF) grant funded by the Korean government (MSIT) (RS-2026-25588527).
References
Absil, P.-A., Mahony, R., and Sepulchre, R. (2008). Optimization Algorithms on Matrix Manifolds. Princeton University Press.
Albergo, M. S. and Vanden-Eijnden, E. (2022). Building normalizing flows with stochastic interpolants. arXiv preprint arXiv:2209.15571.
Chen, R. T. and Lipman, Y. (2024). Flow matching on general geometries. In International Conference on Learning Representations, volume 2024, pages 47922–47945.
Cheng, A. H., Lo, A., Lee, K. L. K., Miret, S., and Aspuru-Guzik, A. (2025). Stiefel flow matching for moment-constrained structure elucidation. In International Conference on Learning Representations, volume 2025, pages 21025–21055.
Chung, F. R. K. (1997). Spectral Graph Theory, volume 92 of CBMS Regional Conference Series in Mathematics. American Mathematical Society.
Dhariwal, P. and Nichol, A. (2021). Diffusion models beat GANs on image synthesis. Advances in neural information processing systems, 34:8780–8794.
Edelman, A., Arias, T. A., and Smith, S. T. (1998). The geometry of algorithms with orthogonality constraints. SIAM Journal on Matrix Analysis and Applications, 20(2):303–353.
Goodfellow, I. J., Pouget-Abadie, J., Mirza, M., Xu, B., Warde-Farley, D., Ozair, S., Courville, A., and Bengio, Y. (2014). Generative adversarial nets. Ad-
vances in Neural Information Processing Systems, 27.
Gretton, A., Borgwardt, K. M., Rasch, M. J., Schölkopf, B., and Smola, A. (2012). A kernel two-sample test. Journal of Machine Learning Research, 13(1):723–773.
Hammond, D. K., Vandergheynst, P., and Gribonval, R. (2011). Wavelets on graphs via spectral graph theory. Applied and Computational Harmonic Analysis, 30(2):129–150.
Ho, J., Jain, A., and Abbeel, P. (2020). Denoising diffusion probabilistic models. Advances in Neural Information Processing Systems, 33:6840–6851.
Holderrieth, P. and Erives, E. (2025). An introduction to flow matching and diffusion models. arXiv preprint arXiv:2506.02070.
Huang, R., Xu, J., Jiang, X., An, R., and Yang, Y. (2024). Can modifying data address graph domain adaptation? In Proceedings of the 30th ACM SIGKDD Conference on Knowledge Discovery and Data Mining, pages 1131–1142.
Huang, X., Ruan, T., Zhang, C., and Zhang, S. (2025). Graph generation with spectral geodesic flow matching. arXiv preprint arXiv:2510.02520.
Jin, W., Barzilay, R., and Jaakkola, T. (2018). Junction tree variational autoencoder for molecular graph generation. In International Conference on Machine Learning, pages 2323–2332. PMLR.
Landrum, G. et al. (2024). RDKit: Open-source cheminformatics. https://www.rdkit.org.
Lee, J. M. (2018). Introduction to Riemannian Manifolds, volume 176 of Graduate Texts in Mathematics. Springer, 2nd edition.
Lee, S., Jo, J., and Hwang, S. J. (2023). Exploring chemical space with score-based out-of-distribution generation. In International Conference on Machine Learning, pages 18872–18892.
Lipman, Y., Chen, R. T., Ben-Hamu, H., Nickel, M., and Le, M. (2022). Flow matching for generative modeling. In International Conference on Learning Representations.
Liu, X., Gong, C., and Liu, Q. (2023). Flow straight and fast: Learning to generate and transfer data with rectified flow. In International Conference on Learning Representations.
Luo, T., Mo, Z., and Pan, S. J. (2023). Fast graph generation via spectral diffusion. IEEE Transactions on Pattern Analysis and Machine Intelligence, 46(5):3496–3508.
Martinkus, K., Loukas, A., Perraudin, N., and Wattenhofer, R. (2022). SPECTRE: Spectral condition-ing helps to overcome the expressivity limits of one-shot graph generators. In International Conference on Machine Learning, pages 15159–15179. PMLR.
Minello, G., Bicciato, A., Rossi, L., Torsello, A., and Cosmo, L. (2025). Generating graphs via spectral diffusion. In International Conference on Learning Representations, volume 2025, pages 72574–72593.
Ramakrishnan, R., Dral, P. O., Rupp, M., and Von Lilienfeld, O. A. (2014). Quantum chemistry structures and properties of 134 kilo molecules. Scientific Data, 1(1):1–7.
Tropp, J. A. (2012). A comparison principle for functions of a uniformly random subspace. Probability Theory and Related Fields, 153(3):759–769.
Vaswani, A., Shazeer, N., Parmar, N., Uszkoreit, J., Jones, L., Gomez, A. N., Kaiser, L., and Polosukhin, I. (2017). Attention is all you need. Advances in Neural Information Processing Systems, 30.
Vignac, C., Krawczuk, I., Siraudin, A., Wang, B., Cevher, V., and Frossard, P. (2023). DiGress: Discrete denoising diffusion for graph generation. In International Conference on Learning Representations.
Wu, Z., Ramsundar, B., Feinberg, E. N., Gomes, J., Geniesse, C., Pappu, A. S., Leswing, K., and Pande, V. (2018). MoleculeNet: A benchmark for molecular machine learning. Chemical Science, 9(2):513–530.
Yang, K., Swanson, K., Jin, W., Coley, C., Eiden, P., Gao, H., Guzman-Perez, A., Hopper, T., Kelley, B., Mathea, M., et al. (2019). Analyzing learned molecular representations for property prediction. Journal of Chemical Information and Modeling, 59(8):3370.
You, J., Ying, R., Ren, X., Hamilton, W., and Leskovec, J. (2018). GraphRNN: Generating realistic graphs with deep auto-regressive models. In International Conference on Machine Learning, pages 5708–5717. PMLR.
Zimmermann, R. and Huper, K. (2022). Computing the Riemannian Logarithm on the Stiefel Manifold: Metrics, Methods, and Performance. SIAM Journal on Matrix Analysis and Applications, 43(2):953–980.
Supplements
A BACKGROUND
A.1 Flow Matching in Spectral Space
Spectral graph generation via flow matching. Flow matching(Lipman et al., 2022; Albergo and Vanden-Eijnden, 2022; Liu et al., 2023) is a generative modeling method that learns a time-dependent vector field that transports samples from a simple base distribution at to the data distribution at . Spectral graph generation can leverage flow matching to generate the eigenvectors and eigenvalues , respectively (Huang et al., 2025).
For the time index , let and denote the eigenvector and eigenvalue matrices at time , respectively. Then, their evolutions are characterized by the following vector fields
and and are specified as follows:
where and are sampled from the base distributions. The and follow the corresponding data distributions.
Since the true vector fields and are unknown, Flow Matching approximates them using neural networks.
Given the current time and state, and predict the corresponding velocities, thereby approximating and , respectively.
A.2 Stiefel Manifold Geometry
Here, we provide background on the Stiefel manifold and its exponential and logarithmic maps necessary to understand our method. Our description follows Cheng et al. (2025); further details are provided in Edelman et al. (1998); Zimmermann and Huper (2022).
Stiefel manifold The Stiefel manifold denotes set of orthonormal matrices defined as
It is a smooth manifold of dimension . Intuitively, each element of represents an ordered collection of orthonormal vectors in .
Tangent space The tangent space of at a point is defined as
This set is obtained by differentiating the orthonormality constraint defining .

Figure 6: Illustration of exponential and logarithmic maps.
Exponential map Given an initial point and a tangent vector , we can define geodesic for with the following condition
The exponential map sends the point to the point
We denote the geodesic point by .
Logarithmic map The logarithmic map identifies the tangent vector of a geodesic connecting two points on the Stiefel manifold. Given and initial point and an endpoint , let be a geodesic satisfying
Its initial velocity can be obtained from the logarithmic map:
Thus, for a fixed base point , maps the endpoint to the tangent vector in . We denote the tangent vector as .
Geodesic representation Therefore, the geodesic can be expressed using the exponential and logarithmic maps as
where and .
Computing Exponential and Logarithmic Maps Although the exponential and logarithmic maps are mathematically well defined, their computation is nontrivial. Fortunately, (Edelman et al., 1998; Zimmermann and Huper, 2022) provide practical algorithms for computing the exponential and logarithmic maps, respectively.
Algorithm 2 describes the computation of the exponential map, which takes an initial point and a tangent vector and returns the corresponding geodesic point on the Stiefel manifold.
Algorithm 3 computes the logarithmic map, which takes an initial point and an endpoint on the Stiefel manifold and returns the corresponding tangent vector . We adopt the implementation of Cheng et al. (2025), which modifies the Stiefel logarithm algorithm of Zimmermann and Huper (2022) for computational efficiency. Its dominant cost is , arising from the QR decomposition and initial matrix multiplications.
Algorithm 2: Exponential Map
Require: Base , time , and initial direction
1: Compute the QR decomposition
where and
2: Construct the block matrix
3: Compute the matrix exponential
4: Compute the geodesic point
5: return
Algorithm 3: Logarithm Map
Require: Base and target
1:
2:
3: Choose such that
4: for do
5:
6:
7: Solve
8:
9:
10: end for
11: return
B THEORETICAL DETAILS
B.1 Nullspace-Constrained Stiefel Geometry
Recall the nullspace-constrained Stiefel manifold
Its tangent space is
Thus, tangent velocities preserve both eigenvector orthonormality and orthogonality to the constant vector.
The manifold is isometric to and is a totally geodesic submanifold of . Consequently, geodesics initialized in with tangent velocity in remain in .
We prove these properties below.
B.2 Proof of Propositions
We first present Lemmas 1–3, which describe a reduced-dimensional representation of the Stiefel geodesic path induced from the nullspace constraint. We then use this representation to prove Propositions 1–4.
Lemma 1. If and satisfy the nullspace constraints
then there exists a basis matrix whose columns form an orthonormal basis for , and reduced representations,
where and
Proof. Since the dimension of is , the orthonormal basis matrix for exists and satisfies
We will now show that there exists . Let us consider any
meaning that all columns of belong to . Then, there exists a corresponding
because is an orthonormal basis matrix for .
Using the , the following holds
which implies that .
Next, we will show there exists . Similarly, let us consider any
Then, there exists a corresponding
because is an orthonormal basis matrix for .
Moreover, as
holds due to , substituting and into the equation gives
which implies
□
Lemma 2 (Corollary 2.2 in Edelman et al. (1998)). For and , the geodesic update on the Stiefel manifold from in the direction , with step size , is expressed by exponential map
where . The and are given by the QR decomposition
Proof. See Corollary 2.2 in Edelman et al. (1998).
□
Lemma 3. If and satisfy the nullspace constraints
then the Stiefel exponential map can also be expressed as
where denotes the matrix whose columns form an orthonormal basis for . The and denote the orthonormal matrix satisfying and .
Proof. Consider that for and satisfying the condition and , there exist and satisfying
due to Lemma 1. Also, due to Lemma 2, the exponential map is given as
where and is given from QR decomposition of .
Then, substituting and into A in the exponential map gives
Also, when and are given from the QR decomposition , the following holds
Thus, for the QR decomposition of , we can set
such that . This is because is orthonormal matrix, as
and is an upper triangular matrix.
Therefore, the following holds
Proposition 1. For a Laplacian matrix , let and let be a diagonal matrix with positive eigenvalues such that . Then,
Proof. The implication ( ) is trivial. Thus, we only need to prove that
Suppose that due to . Using the eigendecomposition , and right-multiplying both sides by gives
where we use . Since has strictly positive diagonal entries, it is invertible. Therefore,
□
Proposition 2. Let denote Laplacian eigenvector matrices sampled from the base distribution and the data distribution, respectively. Suppose
belong to the same connected component and that the minimizing Stiefel geodesic connecting and is unique. Then, for , the geodesic path satisfies
Proof. By Lemma 1, write
where .
Define
Then and .
By Lemma 3,
defines a minimizing Stiefel geodesic connecting and . By uniqueness, this is the geodesic in the proposition. Therefore,
Since ,
□
Uniqueness assumption. Proposition 2 assumes that the minimizing Stiefel geodesic between and is unique. Under the continuous sampling of , endpoint pairs admitting multiple minimizing geodesics form a measure-zero set. We therefore assume uniqueness throughout and exclude these degenerate cases.
Connected components. The nullspace-preserving geodesic construction requires and to lie in the same connected component of . For , is connected, so this condition is automatic. When , however, has two connected components, corresponding to the two possible orientations of an orthonormal basis of .
Since and are both orthonormal bases of in this case, the sign of determines whether they have the same orientation. If
we flip the sign of one column of by setting
This moves to the same connected component as without changing the represented Laplacian. Indeed, since is diagonal with entries ,
and hence
Proposition 3. Suppose and , then there exists a geodesic path for . Moreover, if and the velocity satisfies
then satisfies
Proof. For any point and tangent vector
there exists a unique geodesic satisfying
By the definition of the Riemannian exponential map, this geodesic is expressed as
Further details can be found in Section 5.4 of Absil et al. (2008). Here, we denote .
Then, by the fundamental theorem of calculus,
is given and multiplying both sides by gives
due to and for .
Proposition 4. For satisfying , the projected velocity defined in Eq. (9) satisfies
Therefore, preserves both the nullspace constraint and the Stiefel tangent-space condition.
Proof. The projection onto is given in Eq. 8 as,
and define
Then the projected velocity in Eq. (9) is
Since projects onto the orthogonal complement of ,
Together with the assumption , this gives
Moreover, since , . Therefore,
Hence, satisfies both the Stiefel tangent-space condition and .

Figure 7: Overview of LaSFM architecture.
Corollary 1. Suppose the guided dynamics are initialized with , , and . Then, throughout the guided trajectory,
so the guided dynamics preserve all imposed spectral constraints.
Proof. By Proposition 4, the guided eigenvector velocity satisfies both the Stiefel tangent-space and nullspace velocity conditions. Therefore, is preserved along the guided trajectory, while Proposition 3 implies preservation of .
For the eigenvalues, the mapping in Eq. (10) yields strictly positive, ordered eigenvalues for every finite . Therefore, all three constraints are satisfied throughout the guided trajectory, proving the result.
C LAPLACIAN-CONSTRAINTED STIEFEL FLOW MATCHING
We now describe the implementation of our proposed Laplacian-Constrained Stiefel Flow Matching (LaSFM) model, including the architecture, hyperparameters and training procedure.
C.1 Model
Architecture. Following the coupled spectral architecture of GGSD (Minello et al., 2025), LaSFM jointly processes the eigenvector matrix and the transformed eigenvalues . Each row of is represented as an eigenvector token, while each entry of is represented as an eigenvalue token. Both token streams are conditioned on a sinusoidal embedding of the flow time (Vaswani et al., 2017; Ho et al., 2020). The eigenvalue tokens also receive learned spectral-index embeddings, while graph size is encoded using the fraction of valid nodes.
The two token streams interact through stacked bidirectional cross-attention blocks. In each block, the eigenvalue tokens are first updated using the eigenvector tokens, after which the eigenvector tokens are updated using the resulting eigenvalue tokens. This allows information to be exchanged between the eigenvalue and eigenvector representations throughout the network.
The resulting eigenvalue tokens at time predict the transformed-eigenvalue velocity . We use this velocity to estimate the terminal transformed eigenvalues:
An embedding of then provides an additional update to the eigenvector tokens, allowing the eigenvector velocity to depend on the predicted terminal spectrum. A linear head predicts an ambient eigenvector velocity, which is projected onto the constrained Stiefel tangent space.
This design allows the eigenvalues and eigenvectors to evolve jointly and enables guidance to act on both components throughout generation. In contrast, SFMG first completes eigenvalue generation and then conditions eigenvector generation on the resulting spectrum (Huang et al., 2025).
Table 4: Hyperparameters used to train LaSFM on each dataset.
| Hyperparameter | Planar | SBM | Community-small | QM9 |
|---|---|---|---|---|
| Spectral representation | ||||
| Retained eigenpairs | 16 | 4 | 8 | 8 |
| Spectral Transformer | ||||
| Hidden dimension | 128 | 128 | 96 | 128 |
| Number of layers | 4 | 8 | 3 | 4 |
| Attention heads | 4 | 4 | 4 | 4 |
| Time embedding dimension | 16 | 16 | 8 | 8 |
| Dropout | 0.05 | 0.005 | 0.0 | 0.0 |
| Training | ||||
| Batch size | 128 | 128 | 128 | 128 |
| Training epochs | 20,000 | 10,000 | 10,000 | 6,000 |
| Eigenvalue pretraining epochs | 1,000 | 800 | 1,000 | 500 |
| Learning rate | ||||
| Learning-rate scheduler | ||||
| Reduction factor | 0.5 | 0.5 | 0.5 | 0.5 |
| Patience | 250 | 250 | 400 | 250 |
| Improvement threshold | 0.001 | 0.005 | 0.005 | 0.005 |
| Minimum learning rate | ||||
Dataset standardization. For each dataset, we standardize the transformed eigenvalues using the training-set mean and standard deviation. After generation, we undo this standardization before applying the cumulative-softplus mapping to obtain the Laplacian eigenvalues.
Hyperparameters. The dataset-specific hyperparameters used to train LaSFM are reported in Table 4.
C.2 Training
Sampling and . For each data graph, we discard the constant eigenvector associated with the zero eigenvalue and retain the nonzero-frequency eigenvectors as . Since is obtained from the eigendecomposition of a valid graph Laplacian, it already satisfies
To construct a base sample satisfying the same constraints, we draw a Gaussian matrix . Then, we project it onto the subspace orthogonal to the constant vector using Eq. (8), as follows:
where . We then compute the QR decomposition of , i.e.,
where the factor is on the Stiefel manifold (Tropp, 2012)
Then we set . Since has orthonormal columns that span a subspace of , satisfies both
D EXPERIMENTAL DETAILS
D.1 Datasets
We evaluate on three synthetic graph datasets and one real-world molecular dataset commonly used for graph generative models. We use the same preprocessed datasets and 80%/20% training-test splits following SPEC-TRE (Martinkus et al., 2022).
Planar: A synthetic dataset introduced in Martinkus et al. (2022), containing 200 planar graphs with 64 nodes each. Each graph is constructed by uniformly sampling points in the plane and computing their Delaunay triangulation.
Stochastic Block Model (SBM): A synthetic dataset from Martinkus et al. (2022), containing 200 stochastic block-model graphs. Each graph has between two and five communities, with each community containing between 20 and 40 nodes. Edges are sampled with probability 0.3 within communities and 0.05 between communities, producing graphs with clear modular structure.
Community-small: A synthetic dataset containing 100 graphs with 12–20 nodes. Each graph consists of two approximately equal-sized and densely connected communities, with sparse edges connecting nodes from different communities.
QM9: A real-world molecular dataset containing approximately 134,000 small organic molecules (Ramakrishnan et al., 2014; Wu et al., 2018). Each molecule contains at most nine heavy atoms drawn from carbon, nitrogen, oxygen, and fluorine. Molecules are represented as attributed graphs, where nodes denote atoms and edges denote chemical bonds.
D.2 Evaluation Metrics
Maximum Mean Discrepancy (MMD). We use the squared maximum mean discrepancy, MMD² (Gretton et al., 2012), to assess the similarity between the generated and reference graph distributions. For two distributions and ,
where is a positive-definite kernel. In practice, the expectations are estimated by averaging the kernel values over all pairs of empirical samples.
We use a Gaussian kernel over the total-variation distance,
with .
To account for the intrinsic train–test discrepancy caused by the finite dataset split, as well as differences arising from Laplacian normalization, we report the normalized MMD ratio
Lower values indicate that the generated distribution more closely matches the test distribution relative to the train–test baseline. We compute this ratio for the eigenvalue and wavelet statistics described below.
Eigenvalue MMD. For each graph, we sort the retained Laplacian eigenvalues in ascending order. In Eq. 26, and are the empirical distributions of these eigenvalue vectors for the generated and test graph sets (or train and test sets, respectively). This corresponds to the spectral MMD of Martinkus et al. (2022), except that we use the generated eigenvalues directly rather than reconstructing each graph and recomputing its eigendecomposition.
Wavelet MMD. Following Martinkus et al. (2022), we construct a multiscale descriptor using 12 spectral wavelet filters (Hammond et al., 2011). Each filter is a smooth band-pass function that emphasizes a different range of Laplacian eigenvalues, allowing the descriptor to capture graph structure at multiple frequency scales. For each filter and node , we compute
The node responses for each filter are summarized by a 100-bin histogram, and the 12 histograms are concatenated into one wavelet descriptor. In Eq. 26, and denote the empirical distributions of these descriptors for the two graph sets being compared. Unlike Martinkus et al. (2022), we compute the descriptors directly from the generated eigenvalues and eigenvectors rather than from reconstructed graphs.
D.3 Training Details
LaSFM training. We first pretrain the eigenvalue flow-matching model for the number of epochs specified in Table 4, and then jointly train the eigenvalue and eigenvector models. During pretraining, the eigenvalue model remains conditioned on the intermediate eigenvector state , obtained from the prescribed Stiefel geodesic in Eq. 6. We select the checkpoint with the lowest training loss, smoothed using a moving-average window of 100 epochs.
Baselines. We use the recommended hyperparameters and available implementations for each baseline, while using the same data split as LaSFM. For spectral evaluation, we use the same number of retained eigenpairs across methods, since directly affects the resulting MMD values. We follow the GGSD choice of for each dataset, except for SBM: using was computationally prohibitive, so we use for all methods, consistent with the settings used by SPECTRE and SFMG. As the SFMG implementation was not publicly available, we reproduce it following Huang et al. (2025).
Computation. All experiments were conducted on a single NVIDIA GeForce RTX 3090 GPU with 24GB of memory.
D.4 Graph Generation
Graph predictor. For the graph-generation experiment (Sec. 7.2), we use a learned graph predictor to map a generated spectral representation to a discrete graph. Following Huang et al. (2025), the predictor takes
as input and uses Euclidean flow matching to generate the corresponding adjacency matrix.
The predictor is trained on Laplacian-adjacency pairs from the training set. At generation time, we sample , construct , and apply the predictor to obtain an adjacency matrix, which is then symmetrized and discretized. Training hyperparameters are reported in Table 5. We select checkpoints from the Pareto frontier of generated-to-training MMD and VUN, balancing distributional matching and graph quality without using the test set.
We use this learned reconstruction model only for the graph-generation evaluation. For the property-guidance and ablation experiments, we instead reconstruct graphs directly from the generated Laplacian by thresholding, so that the evaluation more directly reflects the quality of the generated eigensystem.
Graph evaluation. Following GGSD, degree, clustering, and orbit statistics are represented as normalized histograms before computing MMD with a Gaussian total-variation kernel. We use bandwidths for degree, for clustering, and for node-normalized 4-node orbit counts. For Planar, a graph is valid if it is planar and connected. For SBM, validity follows the standard benchmark criterion based on recovered community structure, within- and between-community connection probabilities, and community-size constraints. Uniqueness is the fraction of valid generated graphs that are pairwise non-isomorphic, novelty is the fraction not isomorphic to any training graph, and VUN is the fraction satisfying validity, uniqueness, and novelty simultaneously.
Table 5: Hyperparameters used to train the flow-matching graph predictor for each dataset.
| Hyperparameter | Planar | Community-small | SBM |
|---|---|---|---|
| Batch size | 8 | 16 | 16 |
| Learning rate | |||
| Hidden dimension | 256 | 512 | 256 |
| Weight decay | |||
| Number of blocks | 8 | 4 | 4 |
Baselines. For spectral evaluation, we fix across methods because the eigenvalue and wavelet descriptors are computed directly from the retained eigensystem and therefore depend directly on . For graph-generation evaluation, the dependence on is indirect, through the reconstructed graph. We therefore evaluate each method using its recommended value of , following the corresponding paper.
D.5 Property Guidance
Background. Gradient-based guidance steers a generative process toward a desired target by modifying its vector field using the gradient of a target-dependent objective (Dhariwal and Nichol, 2021; Holderrieth and Erives, 2025). For generation conditioned on a target property , Bayes' rule gives
which motivates augmenting the generative dynamics with a gradient that increases compatibility with the target.
For continuous properties, we use a pretrained spectral predictor and define
We therefore modify the generative vector field using the negative gradient of , with a guidance strength controlling the magnitude of the update. For LaSFM, this update is applied separately to the eigenvalue and eigenvector components as described below.
Guidance predictor. For each target property, we train a separate spectral Transformer that predicts the molecular property from the Laplacian eigensystem and atom types . The model constructs node-level spectral features from , and , concatenates them with atom features, and processes them with a Transformer encoder. During training, we randomly flip eigenvector signs to account for sign ambiguity and optimize mean squared error on standardized property targets. We select the checkpoint with the lowest validation MAE.
LaSFM guidance. We apply the guidance update separately to the transformed-eigenvalue and eigenvector vector fields:
where controls the guidance strength. The eigenvalue gradient is backpropagated through the mapping in Eq. 10, while the eigenvector gradient is projected using Eqs. 8 and 9. This preserves both eigenvector orthonormality and orthogonality to the constant vector during guidance. We tune the guidance strength separately for each method and target property over , selecting the value that best balances target MAE and molecular validity.
Baseline guidance. We use the same property objective for all methods, adapting the gradient update to their respective sampling procedures. For GGSD (Minello et al., 2025), guidance is applied at each reverse diffusion step. Since the DDPM noise predictor determines the score of the noisy marginal up to a known scale, the property-likelihood gradient can be incorporated as an additional score term in the reverse denoising update (Ho et al., 2020; Dhariwal and Nichol, 2021).
For SFMG (Huang et al., 2024), guidance follows its two-stage generation procedure. The eigenvalue flow is first guided toward the target property, after which the eigenvector flow is guided conditional on the generated
Table 6: Property-guided QM9 generation in spectral space. LaSFM achieves lower MAE with greater reduction compared to unguided generation.
| Method | ||||||
|---|---|---|---|---|---|---|
| MAE | Gain | MAE | Gain | MAE | Gain | |
| GGSD | 1.3720 | 12% | 0.9835 | 6.2% | 1.9680 | 2.6% |
| SFMG | 0.1532 | 85% | 0.4065 | 81% | 0.3267 | 84% |
| LaSFM | 0.0277 | 97% | 0.0885 | 96% | 0.1046 | 95% |
Table 7: Spectral constraint errors before and after gradient-based guidance on QM9 across molecular property targets (lower is better). LaSFM consistently ensures no error with and without guidance.
| Method | |||||||||
|---|---|---|---|---|---|---|---|---|---|
| GGSDguided | 0.1080 | 0.0137 | 0.00030.0003 | 0.10800.1062 | 0.01370.0124 | 0.00030.0003 | 0.1080 | 0.0137 | 0.00030.0003 |
| SFMGguided | 0.0000.000 | 0.2114 | 0.000 | 0.0000.000 | 0.2114 | 0.000 | 0.0000.000 | 0.2114 | 0.0000.000 |
| LaSFMguided | 0.0000.000 | 0.0000.000 | 0.000 | 0.0000.000 | 0.0000.000 | 0.000 | 0.0000.000 | 0.0000.000 | 0.000 |
eigenvalues. This preserves the sampling structure of the original method while introducing the same property objective used for LaSFM.
D.5.1 Molecular Reconstruction and Evaluation
We evaluate whether guidance in spectral space translates to the desired properties after reconstructing the corresponding molecules.
Molecular reconstruction. Since we use full-rank generation ( for nine-heavy-atom QM9 molecules), we directly reconstruct the Laplacian and obtain binary molecular connectivity by thresholding . The threshold is selected on unguided samples to maximize molecular validity and is then fixed for guided generation. Atom types are inherited from sampled QM9 molecules (Ramakrishnan et al., 2014). Since the Laplacian specifies connectivity but not bond order, we use RDKit (Landrum et al., 2024) to assign single, double, or triple bonds from the generated connectivity and atom types, followed by molecular sanitization.
Independent property evaluator. For each target property, we train a separate directed message-passing neural network (D-MPNN) (Yang et al., 2019) to predict HOMO, LUMO, or the HOMO–LUMO gap from the reconstructed molecular graph. Each evaluator takes the atom types and RDKit-assigned bond types as input and is trained on the corresponding QM9 target. These evaluators are trained independently from the spectral predictors used for guidance and are used only for evaluation.
D.6 Ablation
Metrics. We evaluate the ablations using reconstruction error and molecular validity. Given a generated eigensystem , we reconstruct the spectral Laplacian as and threshold to obtain a discrete graph. The reconstruction error is defined as
where is the Laplacian of the reconstructed graph. Lower values indicate greater consistency between the generated spectral representation and the reconstructed graph.
We additionally report molecular validity. A molecule is considered valid if its heavy-atom graph is connected and RDKit successfully assigns bond orders and sanitizes the molecule.
E ADDITIONAL EXPERIMENTAL RESULTS
E.1 Additional Guidance Results
Spectral guidance and constraint preservation. We first evaluate guidance directly in spectral space. We report the mean absolute error (MAE) between the target property and the value predicted from the generated eigensystem, together with the relative MAE reduction,
To quantify whether guidance disrupts the spectral constraints, we additionally measure
where . These measure violations of eigenvector orthonormality, the Laplacian nullspace constraint, and eigenvalue nonnegativity, respectively.
As shown in Table 6, LaSFM achieves the lowest MAE across all three molecular property targets and the largest improvement over its unguided counterpart, indicating more effective steering in spectral space. Table 7 further shows that LaSFM maintains negligible constraint violations both before and after guidance. In contrast, GGSD and SFMG exhibit larger constraint violations in their unguided samples, which are further amplified by guidance. These results show that LaSFM enables effective property steering while preserving the spectral constraints.
Guided molecule visualization. Figure 8 shows representative QM9 molecules reconstructed from unguided and guided LaSFM samples. The guided samples qualitatively illustrate how spectral guidance shifts the generated molecules toward the target HOMO, LUMO, and HOMO–LUMO gap values while retaining chemically valid examples.

Figure 8: Reconstructed QM9 molecules from unguided and property-guided LaSFM. Guidance steers the generated molecules toward the target HOMO, LUMO, and HOMO–LUMO gap values.
E.2 Additional Ablation Results
Spectral guidance and constraint-preservation ablation. We again report the target MAE, relative improvement over unguided generation, and spectral constraint errors from Eq. 28. Table 8 compares guidance performance across the ablation settings. The full LaSFM model achieves the lowest MAE and largest improvement for every target, indicating that preserving all three constraints contributes to effective property guidance.
Figure 9 shows that removing any constraint increases the corresponding spectral violations, which are further amplified during guidance. These deviations are consistent with the higher MAE and smaller guidance gains observed for the ablated models.
Table 8: Guidance ablation on QM9. Removing any Laplacian constraint degrades performance (higher MAE and lower gain over unguided), especially orthonormality and the null-space constraint.
| Method | ||||||
|---|---|---|---|---|---|---|
| MAE | Gain | MAE | Gain | MAE | Gain | |
| LaSFM | 0.0277 | 97% | 0.0885 | 96% | 0.1046 | 95% |
| w/o orth. | 0.0849 | 91% | 0.2654 | 87% | 0.2486 | 87% |
| w/o null. | 0.0872 | 91% | 0.2270 | 89% | 0.2675 | 86% |
| w/o pos. | 0.0294 | 97% | 0.1041 | 95% | 0.1511 | 92% |

Figure 9: Ablation errors over generation process for . Guidance increases constraint violations, although the eigenvalue-positivity error vanishes by t = 0.15.