FamilySpace: From Emergent Chemical Semantics to Controllable Crystal Generation

Crystal VAE latent spaces spontaneously cluster by elemental family; FamilySpace leverages this to enable composition-controllable generation.
This work reveals that the atom-level latent space of crystal VAEs spontaneously clusters by elemental family, termed "emergent chemical semantics." Based on this, FamilySpace splits the flow model's source distribution into family-indexed components, directly controlling elemental family composition via templates without reinforcement learning. On MP-20 and MPTS-52, it matches preset compositions while maintaining competitive quality, and some templates increase stable/metastable proportions. Code is open-sourced.
Crystal generation models typically combine a variational autoencoder (VAE) with a flow model: the VAE learns atom-level representations, and the flow model maps a simple source distribution to the learned latent distribution. Prior research has mostly focused on the quality of generated crystals, but has rarely examined the structure of the atom-level latent space and its utility for generation. A recent work reveals a hidden pattern: even the most vanilla crystal VAE spontaneously organizes atom-level latent representations by elemental family, with different elemental families occupying clearly separated regions in the latent space. The authors call this phenomenon "emergent chemical semantics" and, based on it, propose the FamilySpace framework to achieve direct control over the elemental family composition of generated crystals.

The latent space is not disordered: emergent chemical semantics
This work starts from an easily overlooked question: what does the latent space of a crystal VAE actually look like? The authors find that, even without any additional constraints, after training the VAE causes atom-level latent representations to cluster by elemental family—alkali metals, halogens, transition metals, and so on each occupy distinct regions of the latent space. This structure is not artificially designed; it emerges naturally as the model fits crystal data.
The significance of this finding is that it turns "latent space structure" from a black box into a usable prior. Since different elemental families are already separated in the latent space, sampling from specific regions may guide the decoder to generate atoms of the corresponding elemental family. This provides a new entry point for controllable generation: rather than doing post-processing or reinforcement-learning optimization at the output end, it is better to impose control directly at the latent space level.
Variational Autoencoder (VAE) is a generative model consisting of an encoder and a decoder. The encoder maps input data (such as atoms and their environments in a crystal structure) to a probability distribution in a low-dimensional latent space, and the decoder samples from that distribution and reconstructs the original data. The training objective includes a reconstruction loss and a KL divergence regularization term, the latter encouraging the latent distribution to approach the prior (usually a standard normal distribution). In crystal generation, the atom-level latent representation of a VAE refers to the vector obtained after encoding each atom, which implicitly contains information about the atom's local chemical environment. It is precisely these vectors that spontaneously cluster by elemental family after training, forming the basis of "emergent chemical semantics."
FamilySpace: controlling generation with elemental family templates
Based on the above insight, the authors propose the FamilySpace framework. Its core design is to split the source distribution into multiple components, with each elemental family corresponding to an independent source component, forming a "multi-source distribution indexed by family." During training, the flow model learns using source-target pairs matched by elemental family, aligning each source component with the latent representation of the corresponding elemental family.
At inference time, the user only needs to provide an elemental family template specifying which elemental family each atom-level representation should belong to, and the model selects the corresponding source component for each atom. In this way, the elemental family composition of generated crystals can be directly controlled without relying on additional optimization techniques.
The ingenuity of this design lies in the fact that it does not change the basic architecture of the VAE and flow model, but instead exploits the structure already present in the latent space, turning "control" into a "source component selection" problem. Compared with posterior optimization methods such as reinforcement learning, this approach has lower computational overhead and a more direct control signal.
Flow model is a class of generative models that maps a simple source distribution (such as a Gaussian distribution) to a complex target distribution through invertible transformations. Unlike VAEs, flow models directly learn invertible mappings and can exactly compute the log-likelihood of data. In crystal generation, flow models are often used to model the distribution of VAE latent variables: first obtain atom-level latent representations through the VAE, then use the flow model to learn the transformation from the source distribution to the latent distribution, thereby supporting sampling from the source distribution and decoding to generate new crystals. The key modification in FamilySpace is to split the source distribution into multiple components, each corresponding to an elemental family; the flow model learns the mapping from each source component to the latent representation of the corresponding elemental family, and at inference time selecting source components according to the template controls the elemental family composition of generated crystals.
Experimental performance: both generation quality and composition control
The authors conducted experiments on two crystal generation benchmarks, MP-20 and MPTS-52. The results show that FamilySpace, while maintaining competitive crystal generation performance, can match a preset elemental family composition. In other words, controlling elemental family composition does not come at the expense of generation quality.
More interestingly, some elemental family templates can also increase the proportion of generated crystals predicted to be stable or metastable. This means that composition control at the latent space level is not only a constraint mechanism, but can also help the model explore more promising chemical regions without introducing additional optimization techniques such as reinforcement learning. For materials discovery, this property may be more practically valuable than generation quality alone.
MP-20 and MPTS-52 are two benchmark datasets commonly used in the crystal generation field, both derived from the Materials Project database. MP-20 contains about 20,000 crystal structures, each with at most 20 atoms, covering a broad chemical space; MPTS-52 contains about 40,000 structures with an upper limit of 52 atoms, being larger in scale and more complex. These two datasets are often used to evaluate the performance of generative models on crystal structure generation tasks, with evaluation metrics including the validity of generated structures, stability (such as predicted formation energy), and the diversity of composition and structure. Experiments on these two benchmarks show that FamilySpace's elemental family composition control capability generalizes across datasets.
Implications for crystal generation research
The value of FamilySpace lies not only in a controllable generation framework, but also in the research paradigm it reveals: structural regularities in the latent space can be discovered, understood, and transformed into generation control mechanisms. The authors point out that prior research has mainly focused on the quality of generated crystals, while the structure and generative utility of the atom-level latent space have been "largely unexplored." This work fills that gap.
From an application perspective, elemental family composition control has direct significance for materials design. The performance of many functional materials is closely related to elemental family combinations, and being able to specify elemental family templates on demand means researchers can explore specific chemical spaces in a more targeted manner. The code is open-sourced on GitHub (hhw11/FamilySpace), providing a reproducible foundation for subsequent research.
Of course, this method currently controls composition at the elemental family level, rather than exact element types or stoichiometric ratios. How to further refine the control granularity and how to combine it with more complex generation tasks remain directions worth exploring. But the discovery of "emergent chemical semantics" itself has already opened a new window for the interpretability and controllability of crystal generation models.
One-line Summary
Crystal VAE latent spaces spontaneously cluster by elemental family, and FamilySpace leverages this regularity to achieve composition-controllable generation by elemental family.
Paragraph Summary
This article reveals that the atom-level latent space of a crystal variational autoencoder (VAE) spontaneously clusters by elemental family, a phenomenon the authors call "emergent chemical semantics." Based on this finding, they propose the FamilySpace framework, which splits the flow model's source distribution into multiple components indexed by elemental family, directly controlling the elemental family composition of generated crystals through elemental family templates without posterior optimization such as reinforcement learning. On the MP-20 and MPTS-52 benchmarks, the method matches preset compositions while maintaining competitive generation quality, and some templates can even increase the proportion of stable/metastable generated crystals. The work shows that structural regularities in the latent space can be transformed into generation control mechanisms, offering new ideas for the interpretability and controllability of crystal generation; the code is open-sourced.
Related articles

Anthropic's IPO: Is a $1.4 Trillion Valuation AI's Future or the Peak of a Bubble?
Anthropic is about to list on Nasdaq with a valuation of up to $1.4 trillion, potentially raising over $60 billion to become the second-largest IPO in history. This article breaks down its revenue, the truth behind its hundred-billion-dollar book loss, compute costs, control design, and lock-up pressure, and analyzes the IPO's chain effects on the AI sector.

Anthropic Races Toward Nasdaq: Ticker ANT, Can a Trillion-Dollar Valuation Hold?
Anthropic files its S1 for a Nasdaq IPO under ticker ANT, led by Goldman Sachs and Morgan Stanley. We break down revenue, massive compute lease commitments, founder voting control, and the valuation debate.

How Anthropic Uses a Four-Layer Narrative to Prop Up a $2 Trillion Valuation
Anthropic's estimated $2 trillion valuation: a breakdown of its positioning theory and four-layer narrative — civilization-level fear, identity, product, and business — and how founder essays, technical docs, and opinion leaders support the AI safety guardian valuation story.