Lang2Str: Two-Stage Crystal Structure Generation with LLMs and Continuous Flow Models
Organizations: AMLab, AI4Science Lab University of Amsterdam
Abstract
Generative models hold great promise for accelerating material discovery but are often limited by their inflexible single-stage generative process in designing valid and diverse materials. To address this, we propose a two-stage generative framework, Lang2Str, that combines the strengths of large language models (LLMs) and flow-based models for flexible and precise material generation. Our method frames the generative process as a conditional generative task, where an LLM provides high-level conditions by generating descriptions of material unit cells' geometric layouts and properties. These descriptions, informed by the LLM's extensive background knowledge, ensure reasonable structure designs. A conditioned flow model then decodes these textual conditions into precise continuous coordinates and unit cell parameters. This staged approach combines the structured reasoning of LLMs and the distribution modeling capabilities of flow models. Experimental results show that our method achieves competitive performance on ab initio material generation and crystal structure prediction tasks, with generated structures exhibiting closer alignment to ground truth in both geometry and energy levels, surpassing state-of-the-art models. The flexibility and modularity of our framework further enable fine-grained control over the generation process, potentially leading to more efficient and customizable material design.
Figures & tables
| Prompt | Target |
| <s> Below is a description of a bulk material. [The pretty formula is GaTe. The space group number is 194. It has in total 8 atoms, with 4 Ga, 4 Te.] . Generate a description of the geometric layout of the material unit cell: </s> | </s> GaTe crystallizes in the hexagonal P6 3 /mmc space group. The structure is two-dimensional and consists of two GaTe sheets oriented in the direction. Ga(1) is bonded to one Ga(1) and three equivalent Te(1) atoms to form distorted corner-sharing GaGaTe3 tetrahedra. The Ga(1)-Ga(1) bond length is Å. All Ga(1)-Te(1) bond lengths are Å. Te(1) is bonded in a distorted trigonal non-coplanar geometry to three equivalent Ga(1) atoms. </s> |
| Validity (%) | Coverage (%) | Property | ||||
|---|---|---|---|---|---|---|
| Struct | Comp | Recall | Precision | |||
| CDVAE ( Xie et al., 2022 ) | 100 | 86.70 | 99.15 | 99.49 | 0.688 | 0.278 |
| DiffCSP ( Jiao et al., 2023a ) | 100 | 83.25 | 99.71 | 99.76 | 0.350 | 0.125 |
| FlowMM ( Miller et al., 2024 ) | 96.85 | 83.19 | 99.49 | 99.58 | 0.239 | 0.083 |
| FlowLLM ( Sriram et al., 2024 ) | 99.94 | 90.84 | 96.95 | 99.82 | 1.140 | 0.150 |
| CrystalFlow ( Luo et al., 2025 ) | 99.55 | 81.96 | 98.21 | 99.84 | 0.169 | 0.259 |
| Method | MR (%) | RMSD (Å) | E | Steps |
|---|---|---|---|---|
| FlowMM | 74.3 | 0.096 | 0.303 | 191.98 |
| CrystalFlow | 48.7 | 0.185 | 1.056 | 246.89 |
| DiffCSP | 88.0 | 0.055 | 0.087 | 98.57 |
| FlowLLM | 94.9 | 0.023 | 0.090 | 37.97 |
| Ours | 96.2 | 0.036 | 0.055 | 52.49 |
| MP-20 | MPTS-52 | |||
| MR (%) | RMSE | MR (%) | RMSE | |
| DiffCSP | 51.49 | 0.063 | 12.19 | 0.1786 |
| FlowMM | 61.39 | 0.057 | 17.54 | 0.1726 |
| CrystalFlow | 62.02 | 0.071 | 22.71 | 0.1548 |
| Lang2Str | 63.92 | 0.076 | 28.36 | 0.1424 |
| Lang2Str(Oracle) | 78.33 | 0.073 | 39.45 | 0.1480 |
| Method | MR (%) | RMSE | Method | MR (%) | RMSE |
|---|---|---|---|---|---|
| CrystalFlow + Retrieved SP | 62.05 | 0.086 | CrystalFlow + GT SP | 72.93 | 0.085 |
| Ours + Retrieved SP | 63.92 | 0.076 | Ours + GT SP | 76.03 | 0.074 |
| MP-20 | MR (%) | RMSE |
|---|---|---|
| Ours | 63.92 | 0.076 |
| Ours with ML-DFT relaxation | 63.49 | 0.055 |
| Dataset | Metric | Sampling Steps | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 50 | 100 | 200 | 300 | 400 | 500 | 600 | 700 | 800 | 900 | 1000 | ||
| MP-20 | Match Rate (%) | 63.93 | 63.92 | 63.84 | 63.46 | 63.81 | 63.66 | 63.71 | 63.81 | 63.65 | 63.87 | 63.59 |
| RMSD | 0.1146 | 0.0760 | 0.0584 | 0.0521 | 0.0522 | 0.0520 | 0.0514 | 0.0526 | 0.0534 | 0.0516 | 0.0495 | |
| MPTS-52 | Match Rate (%) | 28.81 | 28.36 | 27.24 | 27.34 | 27.36 | 27.27 | 27.78 | 27.22 | 27.07 | 27.35 | 27.38 |
| RMSD | 0.1665 | 0.1424 | 0.1286 | 0.1287 | 0.1259 | 0.1235 | 0.1284 | 0.1263 | 0.1210 | 0.1245 | 0.1243 | |
Crystal Structure Generation
Crystal structure generation uses computational models to create periodic atomic arrangements for predicting and designing materials.
See all 61 papers