FamilySpace: From Emergent Chemical Semantics to Controllable Crystal Generation
Authors: Haowei Hua, Irwin King, Wanyu Lin
Organizations: Department of Computing, The Hong Kong Polytechnic University · Department of Computer Science and Engineering, The Chinese University of Hong Kong
Latent crystal generative models typically combine a variational autoencoder (VAE) for learning atom-wise representations with a flow model that transports a simple source distribution to the learned latent distribution. However, previous studies have mainly focused on the quality of generated crystals, leaving the structure and generative utility of the atom-wise latent space largely unexplored. In this work, we show that even a vanilla crystal VAE implicitly organizes atom-wise latent representations according to elemental families, with different families occupying largely separated regions of the latent space. We term this phenomenon emergent chemical semantics. This structure suggests that sampling from a family-specific latent region can bias the decoder toward atoms from the corresponding elemental family. Building on this insight, we propose FamilySpace, a framework for controlling the elemental-family composition of generated crystals. FamilySpace assigns each elemental family a distinct source component, forming a family-indexed multi-source distribution, and trains a flow model using source-target pairs matched by family. In inference, a user-specified family template selects the source component for each atom-wise representation, enabling direct control over the family composition of generated crystals. Experiments on MP-20 and MPTS-52 show that FamilySpace achieves competitive crystal-generation performance while matching prescribed elemental-family compositions. Moreover, selected family templates increase the fraction of generated crystals predicted to be stable or metastable, demonstrating that latent-space composition control can support targeted exploration of promising chemical regions without additional optimization techniques such as reinforcement learning. Code is available at https://github.com/hhw11/FamilySpace
Figures & tables
Figure 1: Emergent chemical semantics in atom-wise latent representations. We visualize the posterior-mean atom-wise latent representations extracted from the complete test splits using t-SNE. Each point represents an atom and is colored by its periodic-table family only for visualization. (a) Transformer VAE on MP-20. (b) Equiformer VAE on MP-20. (c) Transformer VAE on MPTS-52.
Figure 2: Overview of FamilySpace. Vanilla atom-wise VAE: Reconstruction and KL regularization yield atom-wise representations with emergent family organization. Family-matched latent flow: After the VAE is trained, source components are paired with posterior targets from the same family to train a shared flow model. Controllable generation: a family template selects the source component for each atomic representation. The shared flow transports the latent representations, and the frozen VAE decoder generates atomic species and crystal geometry.
Method
Valid (%) ↑
Uniqueness / novelty (%) ↑
Stability (%) ↑
Metastability (%) ↑
U
N
UN
S
SUN
MS
MSUN
DiffCSP ( Jiao et al., 2023 )
82.49
96.54
71.10
70.79
5.76
1.55
43.56
18.66
FlowMM ( Miller et al., 2024 )
82.14
97.86
72.34
72.20
4.91
1.40
39.43
15.80
MatterGen ( Zeni et al., 2025 )
83.58
97.92
74.96
74.68
4.96
1.80
44.74
23.23
ADiT ( Joshi et al., 2025 )
90.24
83.90
31.72
30.81
11.03
1.68
77.91
13.39
SymmCD ( Levy et al., 2025 )
84.60
97.87
73.19
72.79
4.84
1.53
34.09
10.90
Table 1: Crystal generation results on MP-20. The best results are highlighted in bold, while the second-best results are underlined.
Method
Valid (%) ↑
Uniqueness / novelty (%) ↑
Stability (%) ↑
Metastability (%) ↑
U
N
UN
S
SUN
MS
MSUN
ADiT ( Joshi et al., 2025 )
83.82
93.42
55.64
55.15
9.77
2.32
59.21
18.33
SGEquiDiff ( Chang et al., 2025 )
80.59
97.69
89.07
88.18
4.31
2.39
26.13
16.05
FamilySpace (Training templates)
78.59
96.75
84.47
83.73
5.32
2.11
31.60
17.27
FamilySpace (Alkali–Halogen 1:1)
97.32
24.56
39.65
24.14
18.75
0.63
93.89
21.10
FamilySpace (RE–Halogen 1:3)
98.11
69.56
95.22
69.28
8.97
5.10
74.55
46.24
Table 2: Crystal generation results on MPTS-52. The best results are highlighted in bold, while the second-best results are underlined.
Target family
Target-family fraction (%)
Family-count accuracy (%)
Alkali
99.44
96.90
Alkaline earth
99.90
99.30
Boron group
99.97
99.80
Carbon group
99.93
99.70
Pnictogens
99.98
99.70
Chalcogens
99.92
99.50
Table 3: Single-family control on MP-20. Target-family fraction measures the fraction of decoded atoms belonging to the requested family. Family-count accuracy measures the percentage of samples whose decoded family-count vector exactly matches the requested one. Formal metric definitions are provided in Appendix C.4 .
Family combination
Tested ratios
Family-set accuracy (%)
Family-ratio accuracy (%)
TM–Ch
1:1 , 1:2 , 2:3 , 3:4
99.99
99.94
Alkali–TM–Ch
1:1:2 , 1:2:4 , 1:1:3 , 2:1:3
99.99
99.95
AE–TM–Ch
1:1:3 , 1:2:4 , 1:1:2
100.00
99.98
RE–TM–Ch
1:1:3 , 1:1:4 , 2:1:4
99.99
99.98
Alkali–TM–Pn–Ch
1:1:1:4 , 1:1:2:7 , 2:1:1:4
99.99
99.99
All 50,000 samples
99.992
99.968
Table 4: Multi-family ratio control on MP-20. Family-set accuracy measures whether the generated crystal contains exactly the requested families, while Family-ratio accuracy additionally requires the reduced family ratio to match the request. Formal metric definitions are provided in Appendix C.4 .
Method
Valid (%) ↑
Uniqueness / novelty (%) ↑
Stability (%) ↑
Metastability (%) ↑
U
N
UN
S
SUN
MS
MSUN
RE–Halogen ( 1:3 )
MatterGen ( Zeni et al., 2025 )
90.09
23.11
47.79
21.11
11.51
2.17
86.26
13.00
Chemeleon ( Park et al., 2025 )
84.77
29.52
67.02
27.94
13.26
3.77
71.44
15.16
OMatG (CSP) ( Höllmer et al., 2025 )
100
8.14
34.72
7.12
9.12
0.77
81.87
5.04
FamilySpace
91.22
64.53
92.58
63.00
7.87
4.97
70.36
41.50
Table 5: Comparison with other composition-conditioned generative models.
Method
Family-set accuracy (%) ↑
Family-ratio accuracy (%) ↑
RE–Halogen ( 1:3 )
MatterGen ( Zeni et al., 2025 )
77.02
66.91
Chemeleon ( Park et al., 2025 )
92.79
81.90
FamilySpace
99.66
99.66
Alkali–Halogen ( 1:1 )
MatterGen ( Zeni et al., 2025 )
97.89
68.88
Table 6: Comparison of composition control accuracy on MP-20.
Appendix figures & tables12 assets
Supplementary material from the paper’s appendix.
Appendix
ID
Family
Elements
0
Alkali
H, Li, Na, K, Rb, Cs, Fr
1
Alkaline earth (AE)
Be, Mg, Ca, Sr, Ba, Ra
2
Boron group
B, Al, Ga, In, Tl, Nh
3
Carbon group
C, Si, Ge, Sn, Pb, Fl
4
Pnictogens (Pn)
N, P, As, Sb, Bi, Mc
5
Chalcogens (Ch)
O, S, Se, Te, Po, Lv
Appendix
Table 7: The deterministic family lookup used by FamilySpace. The category names denote the implemented partition: hydrogen is assigned to Alkali, and Rare earth includes both lanthanides and actinides. These assignments are modeling conventions.
Setting
MP-20
MPTS-52
Encoder / decoder layers
8 / 8
8 / 8
Hidden / latent width
512 / 8
512 / 8
Attention heads / feed-forward width
8 / 2048
8 / 2048
Activation / normalization
GELU / pre-norm
GELU / pre-norm
Dropout
0
0
Optimizer / learning rate
AdamW / 10−4
AdamW / 10−4
Appendix
Table 8: VAE architecture and optimization settings.
Figure 3: Emergent chemical semantics in atom-wise latent representations on the training sets. We visualize the posterior-mean atom-wise latent representations extracted from the complete training splits using t-SNE. (a) Transformer VAE on MP-20. (b) Equiformer VAE on MP-20. (c) Transformer VAE on MPTS-52. All representations are colored by periodic-table family.
Figure 4: Emergent chemical semantics in atom-wise latent representations on QM9. We visualize the posterior-mean atom-wise latent representations extracted from the complete (a) training split and (b) test split, respectively.
Family
MP-20
MPTS-52
N
Family 1-NN (%)
Family 5-NN (%)
N
Family 1-NN (%)
Family 5-NN (%)
Alkali
6,647
99.8195
98.9619
20,206
98.0006
90.2108
Alkaline earth
4,322
99.6992
98.9125
8,382
97.3157
87.5447
Boron group
5,724
99.9651
99.8078
11,075
96.2799
87.0429
Carbon group
5,754
99.9305
99.5829
12,791
97.9595
90.8060
Pnictogens
4,848
99.9587
99.6700
15,444
98.9964
94.3603
Appendix
Table 9: Quantitative family-neighborhood analysis of Transformer VAE posterior means on the MP-20 and MPTS-52 test sets. N denotes the number of test atoms in each family.
Figure 5: Structural analysis in the VAE latent space. a,b , The same atom-level t-SNE embedding colored by elemental family and crystal system, respectively. c–e , The same crystal-level t-SNE embedding colored by crystal system, space group, and AFLOW prototype, respectively. f , Same-label 1-NN metric.
Setting
MP-20
MPTS-52
Source noise α / radius factor β
0.1 / 0.2
0.1 / 0.2
DiT layers / hidden width / attention heads
12 / 768 / 12
12 / 768 / 12
Training-time interval
[0.01,0.99]
[0.01,0.99]
Optimizer / learning rate
AdamW / 10−4
AdamW / 10−4
Weight decay / learning-rate scheduler
0 / none
0 / none
Batch size / epochs
128 / 2,000
128 / 2,000
Appendix
Table 10: Latent-flow settings for both datasets. The frozen VAE and the family sources are specific to each dataset.
Method
Valid (%) ↑
Uniqueness / novelty (%) ↑
Stability (%) ↑
Metastability (%) ↑
U
N
UN
S
SUN
MS
MSUN
FamilySpace (our medoid)
89.48
97.14
69.63
69.53
6.26
1.38
42.99
15.31
FamilySpace (random representative 1)
90.88
95.72
71.41
70.63
5.86
1.01
42.27
14.14
FamilySpace (random representative 2)
92.11
95.83
71.02
70.43
5.77
1.13
43.70
15.32
FamilySpace (random representative 3)
88.38
96.43
73.13
72.40
5.57
1.07
40.93
14.73
FamilySpace (evenly spaced centers on [−10,10] )
90.11
97.62
75.43
75.00
4.95
0.94
38.34
14.55
Appendix
Table 11: Effect of the source centers on MP-20 generation. The best results are bold and the second-best results are underlined.
Family combination
Reduced compositions
Element sets
TM–Ch
4,337
1,950
Alkali–TM–Ch
2,418
1,284
AE–TM–Ch
3,004
1,885
RE–TM–Ch
2,435
1,899
Alkali–TM–Pn–Ch
1,013
692
Appendix
Table 12: Within-family compositional diversity in the multi-family ratio control experiments in Table 4 , with 10,000 generated samples for each family combination. Reduced compositions column reports the number of distinct reduced elemental formulas, while Element sets column reports the number of distinct element combinations, irrespective of stoichiometric ratios.
Family template
N
UN (%)
S (%)
MS (%)
SUN (%)
MSUN (%)
Training templates (reference)
10,000
69.53
6.26
42.99
1.38
15.31
Six-template mixture
Alkali–Halogen 1:1
1,667
51.71
14.70
90.16
1.74
42.11
AE–Halogen 1:2
1,667
62.75
9.90
70.13
0.42
34.43
Alkali–Ch 2:1
1,667
46.37
21.96
86.62
2.10
34.43
AE–Ch 1:1
1,667
19.80
22.50
77.38
0.12
4.56
Appendix
Table 13: Stability-oriented exploration on MP-20. N denotes the number of generated samples.
Family template
U (%)
N (%)
UN (%)
S (%)
SUN (%)
MS (%)
MSUN (%)
TM–Ch
90.25
89.01
85.93
2.34
1.07
20.86
9.79
Alkali–TM–Ch
87.63
88.93
84.30
1.12
0.18
21.17
10.35
AE–TM–Ch
82.64
85.27
78.98
1.54
0.08
23.94
7.31
RE–TM–Ch
87.37
89.48
83.84
1.34
0.36
21.64
9.97
Alkali–TM–Pn–Ch
94.85
98.73
94.40
0.05
0.04
13.74
10.54
Appendix
Table 14: Application-oriented exploration on MP-20. We generate 10,000 structures for each family template. U, N, UN, S, SUN, MS, and MSUN are reported as percentages. TM denotes Transition metal, AE Alkaline earth, RE Rare earth, Ch Chalcogens, and Pn Pnictogens, following Appendix A.1 .
Figure 6: Representative generated MSUN candidates with application-relevant compositions. (a) NaCrO2 from the Alkali–TM–Ch template; (b) SrTiO3 and (c) BaZrO3 from the AE–TM–Ch template; (d) LaMnO3 from the RE–TM–Ch template; and (e) Li2MnFe(PO4)2 from the Alkali–TM–Pn–Ch template.
De novo crystal generation seeks to discover materials that are not merely realistic, but also stable and novel. However, most existing generative models are trained to maximize the likelihood of observed crystals, which encourages samples to stay close to known materials yet not necessarily align with the criteria that matter in discovery. Our empirical analysis shows that current crystal generative models exhibit a clear conflict between stability and novelty: samples near the observed distribution tend to retain stability but offer limited novelty, whereas samples farther from it often lose stability rapidly. This suggests that the useful region for discovering crystals that are both stable and novel is extremely narrow. To move beyond this limitation, we introduce Crys-JEPA, a joint embedding predictive architecture for crystals that learns an energy-aware latent space preserving formation-energy differences. In this space, stability assessment can be reformulated as an embedding-based comparison against accessible training crystals, reducing the reliance on expensive energy evaluation and task-specific external references. Building on Crys-JEPA, we further develop a screening-and-refinement pipeline that identifies promising generated crystals and reintroduces them to refine the generative model. On MP-20 and Alex-MP-20 datasets, we achieve improvements over baselines up to 53.8% and 72.7% on V.S.U.N. metric, respectively.
Nian Liu, Nikita Kazeev, Stephen Gregory Dale +8
1National University of Singapore · 2Loyola Marymount University · 3New York University +1
The search for new crystalline materials spans an enormous compositional and structural space. Generating candidates in this space requires modeling the relationships between elemental composition, crystallographic symmetry, and crystal geometry. The space group specifies the crystal's symmetry and determines the admissible Wyckoff positions and geometric degrees of freedom; fixing it in advance prevents this global symmetry choice from being revised using information from evolving Wyckoff occupations and elemental composition. We introduce DynaCrys, the first framework for complete crystal generation in which the space group co-evolves with Wyckoff occupations and elements. We develop physics-informed space-group diffusion that explicitly incorporates crystallographic group-subgroup relations, and a legality-constrained stochastic decoder that jointly samples compatible space groups, Wyckoff occupations, and elements, followed by symmetry-constrained geometry generation. In large-scale evaluations on standard benchmarks, DynaCrys achieves state-of-the-art performance in symmetry-aware crystal generation while supporting fast sampling.
Zhuotao Jin, Xiaoyun Wang, Nicholas Brawand +5
NVIDIA · Center for Computational Science and Engineering, Massachusetts Institute of Technology · Department of Materials Science and Engineering, Massachusetts Institute of Technology +4
De novo crystal generation, a central task in materials discovery, aims to generate crystals that are simultaneously valid, stable, unique, and novel. Existing methods mainly rely on black-box stochastic sampling, providing limited control over how generated structures move beyond the observed distribution. In this paper, we introduce a concept-based compositional framework for crystal generation. We train a vector-quantized variational autoencoder to automatically discover a shared set of reusable crystal concepts, which serve as building blocks for guided generation. These learned concepts naturally exhibit interpretability from both local atomic environments and global symmetry patterns, and generalize to crystals from different distributions. By recombining such concepts, our framework enables controllable exploration of novel crystals beyond the training distribution, rather than relying solely on unconstrained random sampling. To further improve composition efficiency, we introduce a composition generator and iteratively refine it using high-quality samples generated by the model itself. The resulting concept compositions are then used to condition downstream crystal generation. Numerical experiments on MP-20 and Alex-MP-20 show that compositing concepts separately increase base model up to 53.2% and 51.7% on V.S.U.N metric, with particular gains in novelty.
Nian Liu, Yuwei Zeng, Ryoji Kubo +7
National University of Singapore · Loyola Marymount University