betaFeedback

WorksComputer Science

Enhancing Spatial Reasoning in Large Language Models for Metal-Organic Frameworks Structure Prediction

Abstract

Metal-organic frameworks (MOFs) are porous crystalline materials with broad applications such as carbon capture and drug delivery, yet accurately predicting their 3D structures remains a significant challenge. While Large Language Models (LLMs) have shown promise in generating crystal structures, their application to MOFs is hindered by MOFs' high structural complexity arising from the large number of atoms in unit cell. Inspired by the success of block-wise paradigms in deep generative models for MOFs, we pioneer the application of LLMs in this domain by introducing MOF-LLM, the first LLM framework specifically adapted for block-level MOF structure prediction. To effectively harness LLMs for this 3D modular assembly task, our training paradigm integrates spatial-aware continual pre-training (CPT), structural supervised fine-tuning (SFT), and matching-driven reinforcement learning (RL). By incorporating explicit spatial priors and optimizing structural stability via Soft Adaptive Policy Optimization (SAPO), our approach substantially enhances the spatial reasoning in a Qwen-3 8B model for MOF structure prediction. Comprehensive experiments demonstrate that MOF-LLM achieves state-of-the-art performance with a match rate of 35.78% while exhibiting superior sampling efficiency of 0.04 seconds per structure.

This work is licensed under a Creative Commons Attribution 4.0 International License. KDD ’26, Jeju Island, Republic of Korea. © 2026 Copyright held by the owner/author(s). ACM ISBN 979-8-4007-2592-2/2026/08 https://doi.org/10.1145/3770855.3818846

CCS Concepts

• Applied computing → Chemistry.

Keywords

Metal-Organic Frameworks, Large Language Models

ACM Reference Format:

Mianzhi Pan, Jianfei Li, Peishuo Liu, Botian Wang, Yawen Ouyang, Yiming Rong, Wei-Ying Ma, Hao Zhou, and Jianbing Zhang. 2026. Enhancing Spatial Reasoning in Large Language Models for Metal-Organic Frameworks Structure Prediction. In Proceedings of the 32nd ACM SIGKDD Conference on Knowledge Discovery and Data Mining, KDD ’26, August 09–13, 2026, Jeju Island, Republic of Korea. ACM, New York, NY, USA, 12 pages. https://doi.org/10.1145/3770855.3818846

Introduction

Metal-organic frameworks (MOFs) are a revolutionary class of porous crystalline materials with extensive applications such as carbon capture [28], drug delivery [16], and water harvesting [23]. In light of their value, the development of MOFs was recently awarded the Nobel Prize in Chemistry [33]. The functional versatility of MOFs arises from their distinctive architecture, where inorganic metal nodes and organic linkers, i.e., building blocks, assemble into periodic reticular structures (Figure 1). Variations in these building blocks can lead to millions of possible structures with diverse properties [30]. Navigating this expansive space to identify optimal candidates poses a significant challenge, as traditional experimental trial-and-error is intractable [3]. Therefore, Crystal Structure Prediction (CSP) plays a pivotal role in accelerating MOF discovery. By computationally predicting thermodynamically stable 3D structures, CSP enables the rapid screening of materials prior to laboratory synthesis. Recently, Large Language Models (LLMs) have emerged as a promising paradigm for CSP. By leveraging extensive pre-trained knowledge, LLMs have demonstrated a strong ability to generate physically plausible crystal structures when fine-tuned on crystallographic text data [1, 13, 41, 42, 48]. Such crystal representations typically consist of atom-level information, including element types and atomic positions. However, extending these approaches to MOFs presents significant challenges. Unlike simple bulk materials, MOF unit cells often contain hundreds of atoms. Representing such massive systems as conventional atom-wise strings leads to excessively long contexts that current LLMs struggle to handle.

Figure 1. Illustration of MOF structures. An MOF structure and its unit cell are shown on top. The unit cell can be decomposed into building blocks, including metal nodes and organic linkers (bottom). Atom color: Zn (purple), O (red), C (gray), H (white).

Inspired by recent advances in deep generative models for CSP, we adopt a block-wise generation paradigm to address the scalability challenges in MOF structure prediction. While early CSP models operated at the atomistic level [19, 29, 46], recent MOF-specific approaches have achieved significant breakthroughs by exploiting the intrinsic modularity of MOFs [11, 21, 25]. These methods predict the positions and orientations of MOF building blocks rather than individual atomic coordinates. As a result, the block-level generation paradigm substantially reduces the dimensionality of the design space.

Despite their promise, LLMs face key challenges in block-wise MOF structure prediction. First, MOF building blocks possess complex 3D geometries that are difficult for LLMs to understand, frequently resulting in block collisions and physically implausible assemblies. Second, generating stable MOFs requires precise control over the orientations of individual blocks, necessitating the accurate generation of rotations in 3D space. However, existing LLMs exhibit limited spatial reasoning ability, particularly regarding rotations [27], thereby constraining their efficacy in this task.

To address these challenges, this paper proposes MOF-LLM, the first LLM training framework that integrates spatial-aware continue pre-training (CPT), structural supervised fine-tuning (SFT), and matching-driven reinforcement learning (RL) for autoregressive MOF structure prediction. Our pipeline is as follows: first, we perform CPT on our curated dataset that explicitly incorporates block connectivity and geometry. This process facilitates LLMs’ basic spatial understanding and reasoning for MOF structures. Subsequently, we conduct SFT to generate lattice parameters and block-wise roto-translations, thereby enabling LLMs to assemble building blocks. Finally, we adapt RL with reward signals from the matching degree between the generated structures and stable MOF references, which further improves the stability of the predicted structures.

To validate the effectiveness of MOF-LLM, we conducted comprehensive experiments on the MOF dataset introduced by Boyd et al. [3]. MOF-LLM demonstrates superior predictive performance, achieving a match rate of 35.78% on unseen MOFs and outperforming both existing LLM-based approaches and state-of-the-art denoising-based models. Beyond strong accuracy, MOF-LLM also exhibits exceptional computational efficiency: with an inference time of 0.04 seconds per structure, it exceeds the fastest denoising-based methods currently available.

Our main contributions are as follows:

  • We propose MOF-LLM, a progressive framework integrating spatial-aware CPT, structural SFT, and matching-driven RL. To our knowledge, this is the first work to adopt LLMs for MOF structure prediction.

  • We enhance the spatial reasoning ability of LLMs, allowing accurate assembly of 3D building blocks into stable MOF structures.

  • We demonstrate the superior performance of MOF-LLM over all baselines in MOF structure prediction while achieving exceptional computational efficiency. Our analysis reveals the effectiveness of each training stage.

Related Work

Generative Models for Crystal Structure Prediction (CSP). Deep generative models are promising solutions for CSP. Jiao et al. [19, 20] propose joint generation of lattice parameters and fractional atomic coordinates using a periodic E(3)E(3)-equivariant denoising diffusion model. Miller et al. [29] and Wu et al. [46] introduce Riemannian flow matching (RFM) and periodic Bayesian flow networks (BFNs), respectively, enabling efficient sampling of crystals. For MOFs, Kim et al. [25] treat the metal nodes and organic linkers as rigid building blocks and introduce an RFM model to predict the position and orientations of these components. Jiao et al. [21] extend the periodic BFNs to the hypersphere for better orientation modeling by introducing Bingham BFNs. Unlike these denoising-based paradigms, we pioneer the application of LLMs for autoregressive MOF structure prediction.

LLM-based Crystal Generation. Although denoising-based models currently dominate 3D structure generation, recent advances have adapted LLMs for crystal generation by treating structures as text sequences. Gruver et al. [13] and Antunes et al. [1] pioneer fine-tuning LLMs to produce text-encoded atomic data for crystals. Furthermore, CrystalIC [42] extends LLM-based crystal generation with hybrid instruction tuning to enable few-shot in-context learning. Xu et al. [48] fine-tunes a Qwen-2.5-babckbone [36] with reinforcement learning to bias generation towards stable and novel structures with desired properties. MatExpert [8] mimics the workflow of human material scientists to generate crystals within a retrieval–transition–generation framework. To improve structural precision, FlowLLM [41] proposes a hybrid framework that couples LLMs with an RFM model [29], combining the ability of LLMs to provide informative structural priors with the continuous optimization strength of denoising-based models. Despite these advances, existing atom-level text representations fail to capture the intrinsic topology and modularity of MOFs, and also lead to extremely long contexts that LLMs struggle with.

Specifically for MOFs, recent systems like MOFGPT [2] and MOF-Gen [18] leverage LLMs for generative design. However, existing approaches circumvent direct 3D structural generation. They either rely on external diffusion solvers [18] or simplify topologies into 1D string identifiers [2]. Consequently, the potential of LLMs to explicitly perceive 3D spatial relationships and directly assemble precise atomic structures remains largely untapped.

LLM for 3D Object Generation. Emerging research has begun to explore the application of LLMs in generating physically plausible and realizable 3D objects. LLaMA-Mesh [43] fine-tunes the LLaMA model [9] to directly output 3D meshes, enabling unified language-mesh generation and spatial understanding within a single model. Similarly, BrickGPT [35] fine-tunes an LLM on a carefully-curated brick assembly dataset to generate physically stable and constructible brick structures from textual descriptions. These methods focus on positioning geometric primitives. In contrast, we focus on assembling intricate MOF blocks with full 3D roto-translational freedom.

Preliminaries

MOF Representation

Atom-level Representation of MOFs. Generally, MOFs are crystalline materials composed of atoms arranged periodically in 3D space. Such periodicity is described by a unit cell, the smallest repeating structural unit whose translations generate the infinite crystal. A unit cell containing NN atoms can be represented by the triplet S=(A,X,L)\mathcal{S} = (\mathcal{A}, \mathcal{X}, \mathcal{L}). Here, A=[an]n=1N∈AN\mathcal{A} = [a_n]_{n=1}^{N} \in\mathbb{A}^{N} with A\mathcal{A} specifies the atomic species, X=[xn]n=1N∈RN×3\mathcal{X} = [x_n]_{n=1}^{N} \in\mathbb{R}^{N \times3} gives the corresponding Cartesian coordinates of the atoms, and L=[l1,l2,l3]∈R3×3\mathcal{L} = [l_1, l_2, l_3] \in\mathbb{R}^{3 \times3} is the lattice matrix that encodes the periodicity of the crystal, which is uniquely determined by six lattice parameters: the edge lengths (a,b,c)∈R+3(a,b,c) \in\mathbb{R}_{+}^{3} and the interaxial angles (α,β,γ)∈[0,180]3(\alpha,\beta,\gamma) \in[0,180]^3. The infinite structure is obtained by

{(an′,xn′)∣an′=an, xn′=xn+kL, k∈Z1×3},(1)\left\{(a_n',x_n') \mid a_n'=a_n,\ x_n'=x_n+\mathbf{k}\mathcal{L},\ \mathbf{k}\in\mathbb{Z}^{1\times3}\right\}, \tag*{(1)}

where k\mathbf{k} is an integral vector that translates the unit cell to tile the entire space.

In crystallography, the fractional coordinates are usually used to reflect the periodicity of the crystal structure, utilizing the lattice vectors [l1,l2,l3][l_1,l_2,l_3] as the basis vectors instead of the standard Cartesian basis. Accordingly, the Cartesian coordinates X\mathcal{X} can be replaced by fractional coordinates F=XL−1∈[0,1)N×3\mathcal{F}=\mathcal{X}\mathcal{L}^{-1}\in[0,1)^{N\times3}. This representation is widely adopted by contemporary methods for crystal generation [13, 19, 46, 48].

Block-level Representation of MOFs. Inherently, MOFs are modular assemblies of building blocks (metal nodes and organic linkers). This modularity has motivated several studies to adopt block-level representations of MOFs [21, 24, 25]. Formally, a unit cell decomposed into MM blocks can be represented as the tuple S=(B,T,R,L)\mathcal{S}=(\mathcal{B},\mathbf{T},\mathbf{R},\mathcal{L}). Here, B=[Bm]m=1M\mathcal{B}=[\mathcal{B}_m]_{m=1}^{M} denotes the set of building blocks, and each building block Bm=(Am,Xm)\mathcal{B}_m=(\mathcal{A}_m,\mathcal{X}_m) is a group of NmN_m atoms with Am∈ANm\mathcal{A}_m\in\mathbb{A}^{N_m} specifies the atomic species and Xm∈RNm×3\mathcal{X}_m\in\mathbb{R}^{N_m\times3} denotes the local atomic coordinates. The local coordinate system is defined using principal component analysis (PCA)-based equivariant axes. T∈RM×3\mathbf{T}\in\mathbb{R}^{M\times3} and R∈SO(3)M\mathbf{R}\in SO(3)^M are translation vectors and rotation matrices, which specify the center position and orientation of each building block, respectively. See Appendix A.4 for construction details of the local coordinate system and associated roto-translations.

MOF Structure Prediction

Following established task settings [21, 25], we employ the block-level representation and formulate MOF structure prediction as a generative assembly problem. Specifically, the objective is to predict the lattice matrix along with the roto-translations for a given set of MOF building blocks. Formally, given a dataset D\mathcal{D} of stable MOFs, the training objective is to maximize the following likelihood:

max⁡θE(B,T,R,L)∼D[log⁡pθ(T,R,L∣B)].(2)\max_{\theta}\mathbb{E}_{(\mathcal{B},\mathbf{T},\mathbf{R},\mathcal{L})\sim\mathcal{D}}\left[\log p_{\theta}(\mathbf{T},\mathbf{R},\mathcal{L}\mid\mathcal{B})\right]. \tag*{(2)}

During inference, T\mathbf{T}, R\mathbf{R}, and L\mathcal{L} are sampled from pθ(T,R,L∣B)p_{\theta}(\mathbf{T},\mathbf{R},\mathcal{L}\mid\mathcal{B}) to assemble the building blocks, thereby reconstructing atom-level MOF structures for final evaluation.

Method

We now introduce MOF-LLM. First, in Section 4.1, we explain how we convert the 3D MOF structures to plain text for easy processing by LLMs. Section 4.2 and Section 4.3 then detail the spatial-aware continual pre-training (CPT) and the block-assembly supervised fine-tuning (SFT) process, respectively, which together enable a pre-trained LLM (Qwen-3 8B) [49] to accurately predict MOF structures. Finally, Section 4.4 presents the Soft Adaptive Policy Optimization (SAPO) [12] with a matching-based reward that biases LLMs toward generating more stable structures. The overall framework is shown in Figure 2.

Text Formatting of MOF Structure

Lattice and Translations. Enabling LLMs to directly generate 3D MOF structures requires an effective textual representation of the structures S=(B,T,R,L)\mathcal{S}=(\mathcal{B},\mathbf{T},\mathbf{R},\mathcal{L}). Recent studies [1, 13] have demonstrated that fine-tuned LLMs can generate crystal structures encoded via lattice parameters (a,b,c,α,β,γ)(a,b,c,\alpha,\beta,\gamma) and fractional atomic coordinates. Aligning with this approach, we convert the lattice matrix L\mathcal{L} to scalar lattice parameters (each rounded to two decimal places) and transform the translation vectors to fractional coordinates defined as F=TL−1\mathbf{F}=\mathbf{T}\mathcal{L}^{-1} (rounded to three decimal places).

Rotations. Directly utilizing rotation matrices is challenging for LLMs to generate, as these representations are redundant, conceptually abstract, and strictly constrained by the orthogonality conditions of the Special Orthogonal group SO(3)SO(3). To obtain a compact, unconstrained, and more intuitive representation, we adopt Euler angles (ϕ,ω,ψ)(\phi,\omega,\psi), where ϕ∈[−π,π]\phi\in[-\pi,\pi] (roll), ω∈[−π/2,π/2]\omega\in[-\pi/2,\pi/2] (pitch), and ψ∈[−π,π]\psi\in[-\pi,\pi] (yaw) are rotation angles that parameterize a 3D rotation R\mathbf{R} as three successive elemental rotations around the

Figure 2. Overview of our MOF-LLM framework. It enhances the spatial reasoning ability of LLMs for MOF structure prediction via a three-stage training: spatial-aware CPT to inject spatial and geometric priors, structural SFT enables block assembly, and matching-driven RL refines structure stability using Soft Adaptive Policy Optimization (SAPO).

xx-yy-zz coordinate axes by

R=Rz(ψ)Ry(ω)Rx(ϕ)=[cψcωcψsωsϕ−sψcϕcψsωcϕ+sψsϕsψcωsψsωsϕ+cψcϕsψsωcϕ−cψsϕ−sωcωsϕcωcϕ](3)\mathbf{R} = \mathbf{R}_{z}(\psi)\mathbf{R}_{y}(\omega)\mathbf{R}_{x}(\phi) = \begin{bmatrix} c_{\psi}c_{\omega} & c_{\psi}s_{\omega}s_{\phi} - s_{\psi}c_{\phi} & c_{\psi}s_{\omega}c_{\phi} + s_{\psi}s_{\phi} \\ s_{\psi}c_{\omega} & s_{\psi}s_{\omega}s_{\phi} + c_{\psi}c_{\phi} & s_{\psi}s_{\omega}c_{\phi} - c_{\psi}s_{\phi} \\ -s_{\omega} & c_{\omega}s_{\phi} & c_{\omega}c_{\phi} \end{bmatrix} \tag*{(3)}

with c(⋅)=cos⁡(⋅)c(\cdot) = \cos(\cdot) and s(⋅)=sin⁡(⋅)s(\cdot) = \sin(\cdot). Appendix A.5 provides the derivation of Euler angles from the rotation matrix R\mathbf{R}. The Euler angles are rounded to three decimal places in our experiment.

Building Blocks. The building blocks B\mathcal{B} are complex 3D geometries that present a significant semantic gap for LLMs. However, since these blocks correspond to chemically meaningful entities, i.e., metal ion clusters and organic molecules, we adopt canonical SMILES [34, 44] as a solution. In contrast to basic SMILES algorithms, canonical SMILES ensures that it produces a unique string for any given molecule. For an extracted molecular graph from 3D structures, the canonicalization algorithm systematically selects a specific initial atom and traverses the molecule using a predefined set of rules. This representation naturally aligns with LLMs and enables exploitation of the chemistry understanding and semantic priors of SMILES, which are implicitly acquired during large-scale pre-training [5, 15, 47]. To compensate for the loss of explicit 3D geometric information resulting from converting structures to 1D strings, we introduce a spatially aware CPT process in the subsequent section.

Spatial-aware Continual Pre-training

The assembly of building blocks into stable MOF structures can be regarded as ‘LEGO building’ at the microscale. A critical factor for success is the model’s ability to perceive the intrinsic geometry of individual blocks and to reason about their roto-translations. To this end, we augment the description of each building block Bm\mathcal{B}_m with its molecular weight and spatial spans [sm1,sm2,sm3][s_m^1, s_m^2, s_m^3] along three PCA axes. Specifically, the spans are defined as

smi=max⁡(Xmpmi)−min⁡(Xmpmi),i=1,2,3(4)s_m^i = \max\left(X_m p_m^i\right) - \min\left(X_m p_m^i\right), \qquad i = 1, 2, 3 \tag*{(4)}

where XmX_m is the local coordinates and pmi∈R3p_m^i \in\mathbb{R}^3 is the ii-th PCA axis of block Bm\mathcal{B}_m. Together with the molecular weight, the PCA spans form a mass-weighted minimal bounding box that encloses the building block and provides a compact geometric descriptor.

To further elucidate the impact of rotation on block orientation, we explicitly provide the block’s principal axis before and after the applied rotation. In addition, we incorporate the topology code extracted by MOFid [4], which describes the underlying connectivity of the building blocks and promotes a holistic understanding of the global MOF structure. A simplified prompt template is presented below for illustration:

The MOF structure has the [Topo Code] topology, defined as the standard symbol in the Reticular Chemistry Structure Resource (RCSR) database. [Topo Description]. The periodic lattice of this MOF is [Lattice Parameters].

Local properties of each block, whose principal axis is aligned with [1,0,0][1,0,0] in the local frame, are listed below.

[0] SMILES=[SMILES], molecular weight=[Molecular Weight], PCA span=[PCA Span] [1] ...

Global placement of each building block is described as below.

[0] Translation=[Translation], rotation=[Rotation], rotated main axis=[Rotated Principal Axis] [1] ... The complete prompt templates and a detailed description of the dataset construction process are provided in the Appendix § 9.§ 6. Based on this constructed dataset, we train a pre-trained LLM with the standard next-token prediction objective.

Structural Supervised Fine-tuning

We perform structural SFT to equip the LLM with the ability to autoregressively assemble MOF structures. In this stage, the LLM takes as input an instruction II which includes the task description, the output format, and a set of building blocks, and is fine-tuned to generate a response RR consisting of lattice parameters and block-wise roto-translations:

Instruction: [Task Description]. Given the
SMILES of all MOF building blocks, predict the
complete 3D structure configuration including
the lattice parameters in the format ’a b c α
β γ’, and for each building block (maintaining
the exact same order as provided in the input):
- Translation vector ([tx ty tz]): The
position of the building block’s center
within the unit cell, expressed in fractional
coordinates.
- Rotation angles ([roll pitch yaw]): The
orientation of the building block, represented
in radians using Euler angles.
Output format: [Output Format]
[SMILES] [SMILES] ...
Response: [Lattice Parameters]
[0] [Translation] [Rotation]
[1] [Translation] [Rotation]
[2] ...

The model is fine-tuned by minimizing the following generation loss:

L(θ)=−∑t=1∣R∣log⁡πθ(Rt∣I,R<t),(5)\mathcal{L}(\theta) = -\sum_{t=1}^{|R|} \log\pi_\theta(R_t \mid I, R_{<t}), \tag*{(5)}

where πθ\pi_\theta denotes the LLM parameterized by θ\theta, initialized from the spatial-aware CPT model.

Matching-driven Reinforcement Learning

While SFT enables effective block-wise placement by token-level cross-entropy loss, it inherently fails to enforce global structural plausibility. Consequently, the generated MOFs may exhibit structural instabilities. To address this, we employ reinforcement learning (RL) with global structural reward to further refine the SFT model. Specifically, we adopt the Soft Adaptive Policy Optimization (SAPO) framework, a soft and adaptive generalization of Group Relative Policy Optimization (GRPO) [14, 39]. This group-based RL paradigm derives informative learning signals from relative comparisons among multiple outputs, even when most are suboptimal.

For each instruction II, the model first samples a group of GG candidate responses {R(1),…,R(G)}\{R^{(1)}, \ldots, R^{(G)}\}, which are subsequently parsed into the corresponding MOF structures {S(1),…,S(G)}\{S^{(1)}, \ldots, S^{(G)}\}. We then evaluate the quality of each structure S(i)S^{(i)} by comparing it with the ground-truth stable reference SgtS_{gt}. To quantify this alignment, we compute a reward based on structural matching fidelity. Let τ\tau denote the minimum site tolerance at which the two structures are considered matched, as determined using the StructureMatcher class in pymatgen [32]. The reward r(i)r^{(i)} function is defined as:

r(i)={−1,if S(i) parsing failed,1+0.5e−4RMSE⁡(S(i),Sgt),if τ≤0.5,0.6,if 0.5<τ≤0.75,0.3,if 0.75<τ≤1.0,0,otherwise.(6)r^{(i)} = \begin{cases} -1, & \text{if } S^{(i)} \text{ parsing failed},\\ 1 + 0.5e^{-4\operatorname{RMSE}(S^{(i)},S_{gt})}, & \text{if } \tau\le0.5,\\ 0.6, & \text{if } 0.5 < \tau\le0.75,\\ 0.3, & \text{if } 0.75 < \tau\le1.0,\\ 0, & \text{otherwise.} \end{cases} \tag*{(6)}

where RMSE⁡(⋅,⋅)\operatorname{RMSE}(\cdot,\cdot) represents the root mean square distance between matched sites of the two structures. We provide more details about the reward calculation in the Appendix § 9.1.3. This reward function encourages high-precision generation (τ≤0.5\tau\le0.5) by providing an additional bonus for low geometric error, while assigning no bonus to suboptimal structures (0.5<τ≤1.00.5 < \tau\le1.0) to promote training stability.

The model is then updated by maximizing the SAPO objective:

JSAPO(θ)=1G∑i=1G1∣R(i)∣∑t=1∣R(i)∣fi,t(rˉi,t(θ))A(i).(7)\mathcal{J}_{\mathrm{SAPO}}(\theta) = \frac{1}{G}\sum_{i=1}^{G}\frac{1}{|R^{(i)}|}\sum_{t=1}^{|R^{(i)}|} f_{i,t}\left(\bar{r}_{i,t}(\theta)\right)A^{(i)}. \tag*{(7)}

Here, rˉi,t(θ)\bar{r}_{i,t}(\theta) is the importance ratio between the current policy πθ\pi_\theta and a reference policy πθref\pi_{\theta_{\mathrm{ref}}}, from which the responses are sampled, at time step tt:

rˉi,t(θ)=πθ(Rt(i)∣I,R<t(i))πθref(Rt(i)∣I,R<t(i)),(8)\bar{r}_{i,t}(\theta) = \frac{\pi_\theta\left(R_t^{(i)} \mid I,R_{<t}^{(i)}\right)}{\pi_{\theta_{\mathrm{ref}}}\left(R_t^{(i)} \mid I,R_{<t}^{(i)}\right)}, \tag*{(8)}

and A(i)A^{(i)} is a group-normalized advantage:

A(i)=r(i)−mean⁡([r(i)]i=1G)std⁡([r(i)]i=1G).(9)A^{(i)} = \frac{r^{(i)}-\operatorname{mean}\left([r^{(i)}]_{i=1}^{G}\right)}{\operatorname{std}\left([r^{(i)}]_{i=1}^{G}\right)}. \tag*{(9)}

The function fi,t(⋅)f_{i,t}(\cdot) is a smooth, temperature-controlled gating function that replaces the hard clipping used in GRPO, enabling stable and informative policy updates by preserving useful learning signals from moderately off-policy tokens:

fi,t(x)=σ(τi,t(x−1))⋅4τi,t,τi,t={τpos,if A(i)>0,τneg,otherwise.(10)f_{i,t}(x) = \sigma\left(\tau_{i,t}(x-1)\right)\cdot\frac{4}{\tau_{i,t}}, \qquad\tau_{i,t} = \begin{cases} \tau_{\mathrm{pos}}, & \text{if } A^{(i)} > 0,\\ \tau_{\mathrm{neg}}, & \text{otherwise.} \end{cases} \tag*{(10)}

where τpos\tau_{\mathrm{pos}} and τneg\tau_{\mathrm{neg}} are temperature parameters for positive and negative tokens, and σ(x)=1/(1+e−x)\sigma(x)=1/(1+e^{-x}) is the sigmoid function.

Experiments

In this section, we evaluate MOF-LLM from multiple perspectives. First, we report structure prediction accuracy in § 5.1, demonstrating the superior performance of MOF-LLM compared with both existing denoising-based and LLM-based methods. Next, in § 5.2, we assess the structural properties of the predicted outputs, showing that MOF-LLM successfully captures key characteristics of MOF structures. Finally, we analyze the contribution and effectiveness of each stage within MOF-LLM.

Structure Prediction

Dataset. We use the dataset introduced by Boyd et al. [3], which contains 324,426 computationally generated hypothetical MOF structures constructed through a topology-based assembly of building blocks. The dataset was originally developed for large-scale screening of MOFs for CO2\mathrm{CO}_{2} capture under realistic flue gas conditions. In practice, we adopt the preprocessed version of this dataset4 provided by Kim et al. [25], where all MOF structures are converted to block-level representation detailed in § 3.1 using the metal–oxo algorithm [4]. Structures containing more than 200 blocks are discarded, and the remaining data are split into training, validation, and test sets with an 8:1:1 ratio.

# of samplesstol = 0.5stol = 1.0Avg. time (s)↓
MR (%)↑RMSE↓MR (%)↑RMSE↓
Denoising-based
DiffCSP [19]10.090.396123.120.82945.37
50.340.384838.940.793726.85
MOFFlow [25]131.690.282087.460.51830.21
544.750.2694100.00.46451.07
MOF-BFN [21]135.270.273592.990.50000.04
553.510.249898.370.41170.21
LLM-based
PLaID++ [48]10.090.39436.220.77940.41
50.160.406719.940.79812.07
MOF-LLM (Ours)135.780.261293.250.49840.04
553.640.238398.480.40800.18

Table 1. Structure prediction accuracy. stol represents the site tolerance for matching criteria. MR is the match rate and RMSE is the root mean square error between generated structures and the ground-truths. The reported time is the average per structure.

Baselines. We compare MOF-LLM against two types of baselines: denoising-based methods and LLM-based methods. For the former, we include DiffCSP [19], a full-atom diffusion model, as well as MOFFLOW [25] and MOF-BFN [21], both of which are block-level generative models specifically designed for MOFs. For LLM-based methods, we benchmark against PLaID++ [48], a full-atom crystal generation model based on Wyckoff text presentation. Since PLaID++ is trained on bulk materials and based on Qwen-2.5, we reimplement it with Qwen-3 on our dataset for a fair comparison. Details are provided in Appendix § 9.§ 3.

Metrics. We use the match rate (MR) and root mean square error (RMSE) for evaluation. A predicted structure matches the ground truth if its deviations in site positions, lattice lengths and angles all lie within predefined tolerance thresholds. We use the StructureMatcher class in pymatgen and employ two sets of tolerances parameters (stol, ltol, atol): (0.5, 0.3, 10.0) and (1.0, 0.3, 10.0), following Jiao et al. [21], Kim et al. [25]. For each test case, we generate 1 and 5 structures, and the MR is defined as the proportion that at least one candidate matches the ground truth, while RMSE is computed as the per-atom root mean squared displacement between the ground truth and the best-matching prediction.

Results. Table 1 presents the main results. As expected, all-atom generation methods (DiffCSP and PLaID++) yield poor performance, achieving near-zero MR under the strict criterion (stol = 0.5) and remaining suboptimal even with a more lenient condition of stol = 1.0. This highlights the inherent limitations of all-atom approaches for predicting complex MOF structures. Notably, PLaID++ underperforms DiffCSP, likely due to the deficiency of LLMs to process extensive floating-point numerical data in atom-level representations, further motivating block-level modeling. In contrast, MOF-LLM outperforms current block-level baselines (MOFFlow and MOF-BFN), consistently achieving higher MR and lower RMSE across all settings, demonstrating superior structural accuracy. Figure 3 visualizes some predicted MOF structures of MOF-LLM.

Figure 3. Visualization of five selected samples where MOF-LLM’s predictions match the ground truth. The unit cells are rescaled for visual clarity. MOF-LLM accurately captures the atomic positions and lattice parameters.

We further evaluate sampling efficiency. Unlike denoising-based methods that require iterative sampling, MOF-LLM generates samples autoregressively in a single pass, reducing inference time to 0.04 seconds per structure. Notably, MOF-LLM maintains a lower total runtime in the five-sample evaluation compared to MOF-BFN (0.18 s vs. 0.21 s), indicating superior efficiency as sampling demand increases. Coupled with ongoing advances in LLM acceleration [26, 51], this efficiency underscores the strong potential of our approach for practical high-throughput MOF discovery.

Geometric Property Evaluation

In this section, we evaluate the geometric properties of the predicted MOF structures, which are key determinants of practical performance. For example, the pore limiting diameter (PLD), which characterizes the narrowest constriction along a pore channel, governs molecular adsorption selectivity and directly affects performance in applications such as carbon capture. We utilized the Zeo++ [45] to compute common geometric descriptors, including volumetric surface area (VSA), gravimetric surface area (GSA), accessible volume (AV), unit cell volume (UCV), void fraction (VF), PLD, largest cavity diameter (LCD), and density (DST).

Table 2 presents the RMSE between the geometric properties of the predicted structures and the ground-truth references on the test set. Notably, MOF-LLM performs competitively with MOF-BFN, the state-of-the-art denoising-based generative models, while significantly outperforming MOFFlow. Overall, these results indicate that our framework effectively captures essential spatial characteristics and preserves structural integrity, highlighting its promise for practical functional MOF discovery.

RMSE↓
MOF-LLMMOF-BFNMOFFlow
VSA (m²/cm³)251.3232.8264.5
GSA (m²/g)266.2247.5331.6
AV (ų)198.8315.4530.5
UCV (ų)168.8312.0569.5
VF0.02120.01870.0285
PLD (Å)0.93030.90721.0616
LCD (Å)0.95090.92571.1083
DST (g/cm³)0.01370.01850.0442

Table 2. Geometric property evaluation. RMSE computed between the predicted and ground-truth structures, with baseline results from Jiao et al. [21] and Kim et al. [25].

Scalability Evaluation

Traditional CSP methods typically scale poorly to realistically sized systems [19, 31, 38]. In this section, we evaluate the scalability of MOF-LLM as the MOF system size grows. Specifically, we assess the MR with an increasing number of atoms and building blocks in the unit cell. MOF-LLM is compared with MOF-BFN, the best performing baseline, under tolerance parameters (0.5, 0.3, 10.0).

Figure 4 shows the scalability of both models. For the atom-based analysis, samples are partitioned into bins with intervals of (t,t+200](t, t + 200]. MOF-LLM consistently achieves higher MR than MOF-BFN across all bins. Notably, the performance gap widens for larger systems, particularly those containing more than 800 atoms. A similar trend is observed when binned by the number of building blocks, with MOF-LLM showing a clear advantage for structures comprising more than seven blocks. These results demonstrate that MOF-LLM scales favorably with system size, highlighting its potential for predicting complex MOF structures.

Figure 4. Scalability evaluation. MOF structures are binned according to the number of atoms (left) and building blocks (right). For each bin, the match rate is computed for both MOF-LLM and MOF-BFN. Samples exceeding 1400 atoms or 20 building blocks are excluded, where both methods yielded a zero MR.

Ablation Study

Euler angles provide an LLM-friendly rotation representation. Beyond Euler angles, rotations can be encoded using other compact representations such as unit quaternions and axis–angle vectors. We specifically compared Euler angles with the axis–angle vector, which is defined as the product of a rotation angle and a unit axis (see Appendix § 9.§ 5) and has been successfully employed in autoregressive molecular structure generation [10]. As shown in Table 3, the Euler angle-based representation yields a substantial structure prediction accuracy over the axis-angle representation. We speculate that Euler angles provide a more intuitive format for LLMs, whereas axis-angle representations demand stronger spatial priors, which may hinder the LLM’s precise prediction of block orientations.

stol = 0.5stol = 1.0
MR (%)↑RMSE↓MR (%)↑RMSE↓
Euler angle34.600.264492.330.5058
Axis-angle vector31.820.272791.110.5190

Table 3. Ablation study on rotation representations. The axis–angle rotation vector is from Fu et al. [10]. Both models are fine-tuned via SFT from a Qwen-3 8B base model.

Spatial-aware CPT greatly enhances LLMs’ spatial reasoning capabilities. As shown in Figure 5, incorporating our proposed CPT stage yields a significant MR improvement over the pure SFT model. To isolate the contribution of explicit spatial knowledge, we conducted an ablation study in which all spatial and geometric descriptors, including the topology code, molecular weight, PCA spans, and rotated axis, were removed from the CPT prompts (‘w/o spatial info’). This results in a clear decline in MR and a notable increase in RMSE. To better characterize the spatial failure modes, we further evaluate the generated structures using two MOFChecker [22] validity metrics in Figure 6: has_atomic_overlaps and has_lone_molecules, which indicate steric clashes and topological errors, respectively. Spatial-aware CPT substantially reduces both types of structural invalidity compared with SFT and CPT without spatial priors. These findings demonstrate the effectiveness of the spatial-aware strategy in enabling LLMs to interpret complex 3D geometries.

Figure 5. Ablation study of key design components. CPT (w/o spatial info) denotes CPT using prompts without topology codes, molecular weight, PCA spans, and rotated axes. We report the standard deviation across a total of 9 runs (3 random seeds, each sampled 3 times).

Structural validity evaluation

Figure 6. Structural validity evaluation. The number of generated structures flagged with has_atomic_overlaps and has_lone_molecules is reported, corresponding to block collisions and disconnections, respectively.

Matching-driven RL constitutes a critical component. As shown in Figure 5, incorporating the RL stage achieves the best overall performance, yielding a pronounced improvement in predictive accuracy. Notably, the RL stage significantly reduces the number of structurally implausible structures, effectively mitigating errors such as block collisions and disconnections (Figure 6). A subsequent qualitative analysis in Figure 7 further corroborates that this RL refinement aligns the generated structures more closely with the ground truth. Overall, these results demonstrate that SAPO effectively steers the generation policy toward high-reward distribution, thereby substantially improving the accuracy of the predicted structures.

Conclusion and Discussion

In this work, we introduce MOF-LLM, the first framework that successfully adapts LLMs for predicting the structure of MOFs. By employing a three-stage training pipeline integrating spatial-aware CPT, structural SFT, and matching-driven RL, our approach substantially enhances the spatial reasoning capabilities of LLMs for complex building-block assembly. Comprehensive evaluations demonstrate the effectiveness and efficiency of our framework, while ablation studies confirm the critical roles of each component in enabling robust geometric understanding and structural stability.

From a broader perspective, this work contributes to reticular chemistry and materials science by introducing an efficient paradigm for accelerated MOF discovery, effectively overcoming the scalability bottlenecks of traditional workflows. Specifically,

Figure 7. Visualization of the generated structures of Cr6H32C51O28\mathrm{Cr}_{6}\mathrm{H}_{32}\mathrm{C}_{51}\mathrm{O}_{28}. The RL stage substantially improves the prediction accuracy. The dashed boxes highlight regions with the greatest prediction improvements.

MOF-LLM tackles the challenge of structural complexity of MOFs that renders conventional first-principles methods computationally prohibitive, offering an accurate and highly efficient alternative through LLM-based modeling. Applying LLMs to MOF structure prediction is inherently challenging due to their limited spatial reasoning at microscopic scales. Our meticulously designed post-training framework overcomes this and establishes a principled pathway for adapting generic LLMs to intricate scientific systems. We anticipate that MOF-LLM can serve as a foundational stepping stone toward next-generation MOF discovery, where natural language prompting directly enables versatile MOF design.

Limitations and Ethical Considerations

Limitations. While MOF-LLM enables accurate and rapid prediction of MOF structures, it still has several limitations. First, following established protocols [21, 25], we treat building blocks as rigid bodies and assume the availability of ground-truth block structures. Extending the framework to model conformational flexibility could further enhance practicality. Second, as discussed in § 4.1, flattening 3D blocks into 1D SMILES strings inherently simplifies geometric details. Future research could delve deeper into advanced tokenization methods that natively preserve 3D geometries. Finally, while our model directly generates solutions, integrating explicit Chain-of-Thought reasoning offers a promising direction for improving interpretability and complex spatial planning.

Ethical considerations. MOF-LLM is designed to support beneficial applications like carbon capture. However, its ability to rapidly predict complex MOF structures could be misused for the design of materials intended to store or transport hazardous substances. Addressing these risks requires responsible governance, careful oversight, and strict adherence to established ethical guidelines by the research community to ensure safe use of the technology. In addition, ongoing advances in LLMs’ safety alignment [40] techniques may offer a complementary avenue to help mitigate potential misuse and encourage responsible deployment.

GenAI Disclosure

We used generative AI tools (ChatGPT and Gemini; accessed in 2026) for language polishing and rephrasing throughout the manuscript. These tools were not used to generate new technical content, experimental results, figures, data, code, or references. All content was reviewed, verified, and finalized by the authors, who take full responsibility for the paper.

Acknowledgments

This work was supported by the Natural Science Foundation of China (Grant No. 62406170). We also acknowledge the support from Chemistry and Biomedicine Innovation Center (ChemBIC) and the AI & AI for Science Project of Nanjing University.

References

Appendix

Training Details

A.1.1 Spatial-aware Continual Pre-training. We utilize Qwen-3 8B [49] as our backbone model. To adapt the general-purpose model to the target domain, we perform full-parameter continual pre-training (CPT) using the LLaMA-FACTORY framework [52]. The experiment is conducted on 4 × NVIDIA H800-80GB GPUs.

Data Processing and Efficiency. To maximize computational efficiency and training throughput, we employ the sequence packing strategy. Instead of padding individual samples to the maximum length, multiple text segments from the dataset are concatenated to fill the context window of 3,072 tokens.

Optimization Setup. To accelerate training and reduce memory footprint, we employ DeepSpeed ZeRO Stage 3 [37] alongside Flash Attention 2 [6]. The training is conducted using bfloat16 (BF16) precision to ensure numerical stability and efficiency. We optimize the model using the AdamW optimizer with a standard auto-regressive language modeling objective.

Hyperparameters. The learning rate is configured with a peak value of 5e-5, following a cosine decay schedule with a 5% warmup period. The model is trained for 3 epochs with a global batch size of 128.

Structural Supervised Fine-tuning

Initialized with the last checkpoint from the CPT stage, we perform full-parameter Supervised Fine-Tuning (SFT) using the LLAMA-Factory framework. The training is conducted on 5 ×\times NVIDIA H800-80GB GPUs.

Optimization Setup. We maintain the same optimization configuration as in A.1.1.

Hyperparameters. We set the maximum input length to 2048 tokens, which covers 99% of the data. The learning rate is configured with a peak value of 2e-5, following a cosine decay schedule with a 3% warmup period. The model was trained for 12,000 steps with a global batch size of 100.

Matching-driven Reinforcement Learning

We utilize the SFT checkpoint as the initialization for the policy model to conduct the matching-driven RL using the ms-swift framework [50]. The training is performed on 8 ×\times NVIDIA H800-80GB GPUs.

Reward Calculation. Instead of explicitly calculating the minimum site tolerance τ\tau, we hierarchically verify whether the condition in Equation (6) is met. The core Python implementation for the reward calculation is as follows:

from pymatgen.core import Structure
from pymatgen.analysis.structure_matcher
    import StructureMatcher

def reward(S_i: Structure, S_gt: Structure):
    # Assume S_i has been successfully parsed

    # Initialize matchers with increasing site
    # tolerances (stol)
    matcher_1 = StructureMatcher(stol=0.5,
    ltol=0.3, angle_tol=10)
    matcher_2 = StructureMatcher(stol=0.75,
    ltol=0.3, angle_tol=10)
    matcher_3 = StructureMatcher(stol=1.0,
    ltol=0.3, angle_tol=10)

    # Hierarchical check
    rmsd = matcher_1.get_rms_dist(S_i, S_gt)
    if rmsd is not None: # Case: \tau <= 0.5
        return 1.0 + 0.5 * math.exp(-4 * rmsd
        [0])
    elif matcher_2.get_rms_dist(S_i, S_gt) is
    not None: # Case: 0.5 < \tau <= 0.75
        return 0.6
    elif matcher_3.get_rms_dist(S_i, S_gt) is
    not None: # Case: 0.75 < \tau <= 1.0
        return 0.3
    else:
        return 0.0

Generation and Rollout. To ensure efficient exploration, we utilize the vLLM engine [26] for high-throughput sequence generation. For each prompt, the model samples a group of 8 outputs. The sampling is performed with a temperature of 0.9, top-pp of 0.99, and top-kk of 50. We enable dynamic sampling with a maximum of 2 resample attempts to handle generation failures. The maximum completion length is restricted to 1,600 tokens.

Sampling Details

We sample MOF structures by vLLM on a single NVIDIA A100-80 GB GPU to ensure a fair comparison of sampling efficiency with the baselines (see the following section). For the one-sample evaluation setting, the sampling temperature, top-pp, and top-kk are set to 0.1, 0.6, and 10, respectively, encouraging low-variance and deterministic generation. For the five-sample evaluation, these parameters are adjusted to a temperature of 0.9, top-pp of 0.99, and top-kk of 50 to promote greater output diversity.

Implementation Details of Baselines

The match rate and RMSE values for the denoising-based baselines are taken directly from Kim et al. [25] and Jiao et al. [21]. To enable a fair comparison of sampling efficiency, we run MOFFlow [25] and MOF-BFN [21] on a single NVIDIA A100-80 GB GPU to sample MOF structures. Specifically, we adopt the Batch version of MOF-Flow, which offers an accelerated implementation. The runtime of DiffCSP [19] is directly taken from Kim et al. [25].

For PLaid++ [48], we reimplement it by fine-tuning a Qwen-3 8B model using Wyckoff-based textual encodings of MOFs. The prompt template is as follows.

Instruction: Below is a description of a crystal. The chemical formula is [Chemical Formula]. The spacegroup number is [Spacegroup]. Generate a description of the lengths and angles of the lattice vectors and then the element type and coordinates for each atom within the lattice.

Response: [Wyckoff-based String]

We exclude the preference alignment stage in PLaid++ because it relies on external evaluation tools, which would result in an unfair comparison. During training, the maximum input length is set to 8192 tokens, corresponding to approximately the 90th percentile of the sequence length distribution, to balance coverage and computational efficiency. As the long prompts make full-parameter fine-tuning prohibitively expensive, we adopt LoRA [17] with default settings (rank=8, α\alpha=32) used by Xu et al. [48]. The learning rate follows a cosine decay schedule with a peak value of 1e-5 and a 3% warmup period. The model is trained for 5,000 steps with a global batch size of 160.

During evaluation, we observe that almost all generated Wyckoff strings cannot be parsed into valid structures, likely because the model struggles to produce legal Wyckoff positions for a large number of atoms. Accordingly, we adopt a lenient evaluation setting that ignores Wyckoff positions and matches structures solely based on the generated atomic species and coordinates.

Construction of Local Coordinates for Building Blocks

To ensure that local coordinates remain consistent regardless of the building block’s initial global pose (SE(3)SE(3)-invariance), we adopt the global-to-local transformation scheme introduced by Kim et al. [25]. This process first enforces translational invariance by subtracting the block geometric centroid to center the atomic coordinates. Rotational invariance is then achieved by aligning the building block with a deterministic local frame derived from Principal Component Analysis (PCA) axes, with sign ambiguity resolved using a mass-weighted reference vector. In addition, unit cell canonicalization via Niggli reduction is applied prior to this transformation to ensure consistency across periodic representations. Details of this procedure can be found in Kim et al. [25].

Rotation Representation

Euler Angle Conversion

Given the rotation matrix

R=[r11r12r13r21r22r23r31r32r33],(11)\mathbf{R} = \begin{bmatrix} r_{11} & r_{12} & r_{13} \\ r_{21} & r_{22} & r_{23} \\ r_{31} & r_{32} & r_{33} \end{bmatrix}, \tag*{(11)}

the Euler angles are calculated as:

ω=arcsin⁡(−r31),ω∈[−π/2,π/2]ϕ=arctan⁡2(r32,r33),ϕ∈[−π,π]ψ=arctan⁡2(r21,r11),ψ∈[−π,π](12)\begin{aligned} \omega&= \arcsin(-r_{31}), && \omega\in[-\pi/2,\pi/2] \\ \phi&= \arctan2(r_{32},r_{33}), && \phi\in[-\pi,\pi] \\ \psi&= \arctan2(r_{21},r_{11}), && \psi\in[-\pi,\pi] \tag*{(12)} \end{aligned}

where arctan⁡2(y,x)\arctan2(y,x) is the two-argument arctangent function which handles the quadrant of the angle.

Axis-angle Rotation Representation

In the axis–angle formulation, a 3D rotation is represented by a rotation vector obtained by multiplying a unit rotation axis a=(ax,ay,az)\mathbf{a}=(a_x,a_y,a_z) with a rotation angle ψ\psi. Specifically, the rotation vector m∈R3\mathbf{m}\in\mathbb{R}^3 is defined as

m=(mx,my,mz)=ψa=(ψax,ψay,ψaz).(13)\mathbf{m}=(m_x,m_y,m_z)=\psi\mathbf{a}=(\psi a_x,\psi a_y,\psi a_z). \tag*{(13)}

Specifically, the rotation angle is obtained by

ψ=cos⁡−1(tr⁡(R)−12),(14)\psi=\cos^{-1}\left(\frac{\operatorname{tr}(\mathbf{R})-1}{2}\right), \tag*{(14)}

and the rotation axis is calculated by

ax=(r32−r23)/2sin⁡ψ,ay=(r13−r31)/2sin⁡ψ,az=(r21−r12)/2sin⁡ψ.(15)\begin{aligned} a_x &= (r_{32}-r_{23})/2\sin\psi, \\ a_y &= (r_{13}-r_{31})/2\sin\psi, \\ a_z &= (r_{21}-r_{12})/2\sin\psi. \tag*{(15)} \end{aligned}

Prompt Details

The detailed prompt template for spatial-aware CPT is provided as follows:

The 3D crystal structure of a metal-organic framework
(MOF) is described. MOFs represent a class of highly
ordered porous materials that assemble modular
architectures through metal node and organic linker
connections. This metal-organic framework adopts the
[Topo Code] topology, with the topology code defined
as the standard symbol in the Reticular Chemistry
Structure Resource (RCSR) database. [Topo Description].
The periodic lattice is specified by parameters: [a] Å, b = [b] Å, c = [c] Å, and angles α = [α]°, β = [β]°, γ = [γ]°.
Each building block is treated as a rigid entity with
a standardized local coordinate system.
In the local frame, the main structural PCA axis is
aligned with [1, 0, 0]. The local geometry of a block
is encapsulated by the spatial extent of atoms along
the primary axes in Å. Local properties of building
blocks are provided:
[0] SMILES=[SMILES], molecular weight=[Molecular
Weight], PCA span=[PCA Span]
[1] ...
Global placement for each building block is defined
in the lattice coordinate system, covering translation
vectors, rotation angles, and the rotated main axis.
The translation vector ([tx, ty, tz]) denotes the
block’s center position in the unit cell as fractional
coordinates. Rotation angles ([roll pitch yaw]),
expressed in radians via Euler angles, describe the
block’s orientation and the local main axis after
rotation. Additionally, per block, the rotated
main axis indicates the local main axis orientation
following rotation. Specifics for each building block
follow:
[0] Translation=[Translation], rotation=[Rotation],
rotated main axis=[Rotated Principal Axis]
[1] ...

To enhance prompt diversity, we rewrite the base template to generate 15 distinct variants using DeepSeek [7].

The detailed SFT prompt template is provided as follows:

Instruction: You are tasked with predicting the 3D
crystal structure of a Metal-Organic Framework (MOF).
MOFs are highly ordered porous materials formed by
connecting metal-containing nodes with organic linkers,
creating modular structures.
Given the SMILES of all MOF building blocks, predict
the complete 3D crystal structure configuration
including:
Lattice parameters in the format ’a b c α β γ’ (where
a, b, c are unit cell lengths, and α, β, γ are unit
cell angles).
For each building block (maintaining the exact same
order as provided in the input):
Translation vector [tx ty tz]: The position of
the building block’s center within the unit cell,
expressed in fractional coordinates.
Rotation angles ([roll pitch yaw]): The orientation of
the building block, represented in radians using Euler
angles.
Output Format:
First line: Lattice parameters, i.e.: a b c α β γ.
Subsequent lines (one per building block): [k] tx ty
tz roll pitch yaw
k: The 0-based index of the building block.
tx ty tz: Fractional coordinates within the unit cell.
roll pitch yaw: Euler angles in radians.
[SMILES] [SMILES] ...
Response: a b c α β γ
[0] tx ty tz roll pitch yaw
[1] tx ty tz roll pitch yaw
...

References

  1. [1]Luis M Antunes, Keith T Butler, and Ricardo Grau-Crespo. 2024. Crystal structure generation with autoregressive large language modeling. Nature Communications 15, 1 (2024), 10570.arxiv.org/abs/2307.04340
  2. [2]Srivathsan Badrinarayanan, Rishikesh Rishikesh, Akshay Antony Radheesh Sharma Meda, and Amir Barati Farimani. 2025. MOFGPT: Generative design of metal–organic frameworks using language models. Journal of Chemical Information and Modeling 65, 17 (2025), 9049–9060.arxiv.org/abs/2506.00198
  3. [3]Peter G Boyd, Aurunraj Chidambaram, Enrique García-Díez, Christopher P Ireland, Thomas D Daff, Richard Bounds, Andrzej Gładysiak, Pascal Schouwink, Seyed Mohamad Moosavi, M Mercedes Maroto-Valer, et al. 2019. Data-driven design of metal–organic frameworks for wet flue gas CO2 capture. Nature 576, 7786 (2019), 253–256.DOI
  4. [4]Benjamin J Bucior, Andrew S Rosen, Maciej Haranczyk, Zhenpeng Yao, Michael E Ziebel, Omar K Farha, Joseph T Hupp, J Ilja Siepmann, Alán Aspuru-Guzik, and Randall Q Snurr. 2019. Identification schemes for metal–organic frameworks to enable rapid search and cheminformatics analysis. Crystal Growth & Design 19, 11 (2019), 6682–6697.DOI
  5. [5]Cayque Monteiro Castro Nascimento and André Silva Pimentel. 2023. Do large language models understand chemistry? a conversation with chatgpt. Journal of Chemical Information and Modeling 63, 6 (2023), 1649–1655.DOI
  6. [6]Tri Dao. 2023. FlashAttention-2: Faster attention with better parallelism and work partitioning. arXiv preprint arXiv:2307.08691 (2023).arxiv.org/abs/2307.08691
  7. [7]DeepSeek-AI. 2024. DeepSeek-V3 Technical Report. arXiv:2412.19437 [cs.CL]. https://arxiv.org/abs/2412.19437
  8. [8]Qianggang Ding, Santiago Miret, and Bang Liu. 2025. MatExpert: Decomposing Material Discovery By Mimicking Human Experts. In The Thirteenth International Conference on Learning Representations.arxiv.org/abs/2410.21317
  9. [9]Abhimanyu Dubey, Abhinav Jauhri, Abhishek Pandey, Abhishek Kadian, Ahmad Al-Dahle, Aiesha Letman, Akhil Mathur, Alan Schelten, Amy Yang, Angela Fan, et al. 2024. The llama 3 herd of models. arXiv e-prints (2024), arXiv–2407.arxiv.org/abs/2407.21783
  10. [10]Cong Fu, Xiner Li, Blake Olson, Heng Ji, and Shiwang Ji. 2024. Fragment and Geometry Aware Tokenization of Molecules for Structure-Based Drug Design Using Language Models. In The Thirteenth International Conference on Learning Representations.arxiv.org/abs/2408.09730
  11. [11]Xiang Fu, Tian Xie, Andrew Scott Rosen, Tommi Jaakkola, and Jake Allen Smith. 2023. MODiff: Coarse-grained Diffusion for Metal-Organic Framework Design. In The Twelfth International Conference on Learning Representations.arxiv.org/abs/2310.10732
  12. [12]Chang Gao, Chujie Zheng, Xiong-Hui Chen, Kai Dang, Shixuan Liu, Bowen Yu, An Yang, Shuai Bai, Jingren Zhou, and Junyang Lin. 2025. Soft Adaptive Policy Optimization. arXiv preprint arXiv:2511.20347 (2025).arxiv.org/abs/2511.20347
  13. [13]Nate Gruver, Anuroop Sriram, Andrea Madotto, Andrew Gordon Wilson, C Lawrence Zitnick, and Zachary Ward Ulissi. 2024. Fine-Tuned Language Models Generate Stable Inorganic Materials as Text. In The Twelfth International Conference on Learning Representations.arxiv.org/abs/2402.04379
  14. [14]Daya Guo, Dejian Yang, Haowei Zhang, Junxiao Song, Ruoyu Zhang, Runxin Xu, Qihao Zhu, Shirong Ma, Peiyi Wang, Xiao Bi, et al. 2025. Deepseek-r1: Incentivizing reasoning capability in llms via reinforcement learning. arXiv preprint arXiv:2501.12948 (2025).DOI
  15. [15]Taicheng Guo, Bozhao Nan, Zhenwen Liang, Zhichun Guo, Nitesh Chawla, Olaf Wiest, Xiangliang Zhang, et al. 2023. What can large language models do in chemistry? a comprehensive benchmark on eight tasks. Advances in Neural Information Processing Systems 36 (2023), 59662–59688.
  16. [16]Patricia Horaczekda, Tamim Chali, Christian Serre, Brigitte Gillet, Catherine Sebrie, Tarek Baati, Jarrod Fubank, Daniela Heurtaux, Pascal Clayette, Christine Kreuz, et al. 2010. Porous metal–organic-framework nanoscale carriers as a potential platform for drug delivery and imaging. Nature materials 9, 2 (2010), 172–178.DOI
  17. [17]Edward J Hu, Yelong Shen, Phillip Wallis, Zeyuan Allen-Zhu, Yuanzhi Li, Shean Wang, Lu Wang, Weizhu Chen, et al. 2022. Lora: Low-rank adaptation of large language models. ICLR 1, 2 (2022), 3.arxiv.org/abs/2106.09685
  18. [18]Theo Jaffrelot Inizan, Sherry Yang, Aaron Kaplan, Yen-hsu Lin, Jian Yin, Saber Mirzaei, Mona Abdelgaid, Ali H Alawadhi, KwangHwan Cho, Zhiling Zheng, et al. 2025. System of agentic AI for the discovery of metal-organic frameworks. arXiv preprint arXiv:2504.14110 (2025).
  19. [19]Rui Jiao, Wenbing Huang, Peijia Lin, Jiaqı Han, Pin Chen, Yutong Lu, and Yang Liu. 2023. Crystal structure prediction by joint equivariant diffusion. Advances in Neural Information Processing Systems 36 (2023), 17464–17479.arxiv.org/abs/2309.04475
  20. [20]Rui Jiao, Wenbing Huang, Yu Liu, Deli Zhao, and Yang Liu. 2024. Space Group Constrained Crystal Generation. In The Twelfth International Conference on Learning Representations.arxiv.org/abs/2402.03992
  21. [21]Rui Jiao, Hanlin Wu, Wenbing Huang, Yuxuan Song, Yawen Ouyang, Yu Rong, Tingyang Xu, Pengju Wang, Hao Zhou, Wei-Ying Ma, et al. 2025. Mof-bench: Metal-organic frameworks structure prediction via bayesian flow networks. In The Thirty-ninth Annual Conference on Neural Information Processing Systems.
  22. [22]Xin Jin, Kevin Maik Jablonka, Elias Moubarak, Yuato Li, and Berend Smit. 2025. MOFCheck: a package for validating and correcting metal–organic framework (MOF) structures. Digital Discovery 4, 6 (2025), 1560–1569.
  23. [23]Hyunho Kim, Sungwoo Yang, Sameer R Rao, Shankar Narayanan, Eugene A Kapustin, Hiroyasu Furukawa, Ari S Umans, Omar M Yaghi, and Evelyn N Wang. 2017. Water harvesting from air with metal-organic frameworks powered by natural sunlight. Science 356, 6336 (2017), 430–434.
  24. [24]Nayoong Kim, Seongsu Kim, and Sungsoo Ahn. 2025. Flexible MOF Generation with Torsion-Aware Flow Matching. arXiv preprint arXiv:2505.17914 (2025).
  25. [25]Nayoong Kim, Seongsu Kim, Minsu Kim, Jinkyo Park, and Sungsoo Ahn. 2024. MOFFlow: Flow Matching for Structure Prediction of Metal-Organic Frameworks. In The Thirteenth International Conference on Learning Representations.
  26. [26]Woosuk Kwon, Zhuohan Li, Siyuan Zhuang, Ying Sheng, Lianmin Zheng, Cody Hao Yu, Joseph E. Gonzalez, Hao Zhang, and Ion Stoica. 2023. Efficient Memory Management for Large Language Model Serving with PagedAttention. In Proceedings of the ACM SIGOPS 29th Symposium on Operating Systems Principles.
  27. [27]Taoyuze Lv, Alexander Chen, Fengyu Xie, Chu Wu, Jeffrey Meng, Dongzhan Zhou, Bram Hoex, Zhicheng Zhong, and Tong Xie. 2025. AtomWorld: A Benchmark for Evaluating Spatial Reasoning in Large Language Models on Crystalline Materials. arXiv preprint arXiv:2510.04704 (2025).
  28. [28]Thomas M McDonald, Jarad A Mason, Xueqian Kong, Eric D Bloch, David Gygi, Alessandro Dani, Valentina Crocella, Filippo Giordano, Samuel O Odoh, Walter S Drisdell, et al. 2015. Cooperative insertion of CO2 in diamine-appended metal-organic frameworks. Nature 519, 7543 (2015), 303–308.
  29. [29]Benjamin Kurt Miller, Ricky TQ Chen, Anouor Sriram, and Brandon M Wood. 2024. FlowMM: Generating Materials with Riemannian Flow Matching. In International Conference on Machine Learning. PMLR, 35664–35686.
  30. [30]Seyed Mohammad Moosavi, Aditya Nandy, Kevin Maik Jablonka, Daniele Ongari, Jon Paul Janet, Peter G Boyd, Yongjin Lee, Berend Smit, and Heather J Kulik. 2020. Understanding the diversity of the metal-organic framework ecosystem. Nature communications 11, 1 (2020), 4068.
  31. [31]Mark Neumann, James Gin, Benjamin Rhodes, Steven Bennett, Zhiyi Li, Hitarth Choubisa, Arthur Hussey, and Jonathan Godwin. 2024. Orb: A Fast, Scalable Neural Network Potential. arXiv:2410.22570 [cond-mat.mtrl-sci] https://arxiv.org/abs/2410.22570
  32. [32]Shuye Ping Ong, William Davidson Richards, Anubhav Jain, Geoffrey Hautier, Michael Kocher, Shreyas Cholia, Dan Gunter, Vincent L Chevrier, Kristin A Persson, and Gerbrand Ceder. 2013. Python Materials Genomics (pymatgen): A robust, open-source python library for materials analysis. Computational Materials Science 68 (2013), 314–319.DOI
  33. [33]Nobel Prize Outreach. 2025. Nobel Prize in Chemistry 2025. https://www.nobelprize.org/prizes/chemistry/2025/summary/
  34. [34]Noel M O’Boyle. 2012. Towards a Universal SMILES representation-A standard method to generate canonical SMILES based on the InChI. Journal of cheminformatics 4, 1 (2012), 22.
  35. [35]Yawen Pang, Kangle Deng, Ruixuan Liu, Deva Ramanan, Changliu Liu, and Jun-Yan Zhu. 2025. Generating physically stable and buildable brick structures from text. In Proceedings of the IEEE/CVF International Conference on Computer Vision. 14798–14809.
  36. [36]Qi Yang, An Yang, Baosong Yang, Beichen Zhang, Binyuan Hui, Bo Zheng, Bowen Yu, Chengyuan Li, Daiheng Liu, Fei Huang, Haoran Wei, Huan Lin, Jian Yang, Jianhong Tu, Jianwei Zhang, Jianxin Yang, Jiaxi Yang, Jingren Zhou, Junyang Li, Kai Dang, Keming Lu, Keqin Bao, Kexin Yang, Le Yu, Mei Li, Mingfeng Xue, Pei Zhang, Qin Zhu, Rui Men, Runji Li, Tianhao Li, Tianyi Tang, Tingyu Xia, Xingzhang Ren, Xuancheng Ren, Yang Fan, Yang Su, Yichang Zhang, Yu Wan, Yuqiong Liu, Zeyu Cui, Zhenru Zhang, and Zihan Qiu. 2025. Qwen2.5 Technical Report. arXiv:2412.15115 [cs.CL] https://arxiv.org/abs/2412.15115
  37. [37]Jeff Rasley, Samyam Rajbhandari, Olatunji Ruwase, and Yuxiong He. 2020. DeepSpeed: System optimizations enable training deep learning models with over 100 billion parameters. In Proceedings of the 26th ACM SIGKDD international conference on knowledge discovery & data mining. 3505–3506.
  38. [38]Benjamin Rhodes, Sander Vandewalute, Vaidotas Šimkus, James Gin, Jonathan Godwin, Tim Duignan, and Mark Neumann. 2025. Orb-v3: atomistic simulation at scale. arXiv:2504.06231 [cond-mat.mtrl-sci] https://arxiv.org/abs/2504.06231
  39. [39]Zheying Shao, Peiyi Wang, Qiniao Zhu, Runxin Xu, Junxiao Song, Xiang Gao, Haowei Zhang, Mingchuan Zhang, YK Li, et al. 2024. Deepseekmath: Pushing the limits of mathematical reasoning in open language models. arXiv preprint arXiv:2402.03300 (2024).
  40. [40]Tianhao Shen, Renren Jin, Yufei Huang, Chuang Liu, Weilong Dong, Zishan Guo, Xinwei Wu, Yan Liu, and Deyi Xiong. 2023. Large language model alignment: A survey. arXiv preprint arXiv:2309.15025 (2023).arxiv.org/abs/2309.15025
  41. [41]Anuroop Sriram, Benjamin K Miller, Ricky T Chen, and Brandon Wood. 2024. FlowMM: Flow matching for material generation with large language models as base distributions. Advances in Neural Information Processing Systems 37 (2024), 46025–46046.
  42. [42]Ruobing Wang, Qiaoyu Tan, Yili Wang, Ying Wang, and Xin Wang. 2025. Crystal: Enabling In-Context Learning for Crystal Generation. In Proceedings of the 2025 Conference on Empirical Methods in Natural Language Processing. 18440–18455.arxiv.org/abs/2508.20143
  43. [43]Zhengyi Wang, Jonathan Lorraine, Yikai Wang, Hang Su, Jun Zhu, Sanja Fidler, and Xiaohui Zeng. 2024. Llama-mesh: Unifying 3d mesh generation with language models. arXiv preprint arXiv:2411.09595 (2024).
  44. [44]David Weininger, Arthur Weininger, and Joseph L Weininger. 1989. SMILES 2. Algorithm for generation of unique SMILES notation. Journal of chemical information and computer sciences 29, 2 (1989), 97–101.DOI
  45. [45]Thomas F Willems, Chris H Rycroft, Michael Keahl Kazi, Juan C Meza, and Maciej Haranczyk. 2012. Algorithms and tools for high-throughput geometry-based analysis of crystalline porous materials. Microporous and Mesoporous Materials 149, 1 (2012), 134–141.
  46. [46]Hanlin Wu, Yuxuan Song, Jingjing Gong, Ziyao Cao, Yawen Ouyang, Jianbing Zhang, Hao Zhou, Wei-Ying Ma, and Jingjing Liu. 2025. A Periodic Bayesian Flow for Material Generation. In ICLR.
  47. [47]Zhenxing Wu, Odin Zhang, Xiaorui Wang, Li Fu, Huifeng Zhao, Jike Wang, Hongyan Du, Dejun Jiang, Yafeng Deng, Dongsheng Cao, et al. 2024. Leveraging language model for advanced multiproperty molecular optimization via prompt engineering. Nature Machine Intelligence 6, 11 (2024), 1359–1369.
  48. [48]Andy Xu, Rohan Desai, Larry Wang, Gabriel Hope, and Ethan Ritz. 2025. Plaid++: A preference aligned language model for targeted inorganic materials design. arXiv preprint arXiv:2509.07150 (2025).
  49. [49]An Yang, Anfeng Li, Baosong Yang, Beichen Zhang, Binyuan Hui, Bo Zheng, Bowen Yu, Chang Gao, Chenggen Huang, Chenxu Lv, et al. 2025. Qwen3 technical report. arXiv preprint arXiv:2505.09388 (2025).arxiv.org/abs/2505.09388
  50. [50]Yuze Zhao, Jintao Huang, Jinghan Hu, Xingjun Wang, Yunlin Mao, Daoze Zhang, Zeyin Jian, Zhiqi Wu, Baole Ai, Ang Wang, Wenmeng Zhou, and Yingda Chen. 2024. SWIFT: A Scalable LightWeight Infrastructure for Fine-Tuning. arXiv:2408.05517 [cs.CL] https://arxiv.org/abs/2408.05517
  51. [51]Lianmin Zheng, Liang Sheng, Xizhiang Xie, Chuoyue Livia Sun, Jeff Huang, Cody Hao Yu, Shiyi Cao, Christos Kozyrakis, Ion Stoica, Joseph E Gonzalez, et al. 2024. Skyline: Efficient execution of structured language model programs. Advances in neural information processing systems 37 (2024), 62557–62583.
  52. [52]Yaowen Zheng, Rıchong Zhang, Junhao Zhang, Yanhang Ye, Zheyan Luo, Zhangchi Feng, and Yongqiang Ma. 2024. Llamafactory: Unified efficient fine-tuning of 100+ language models. arXiv preprint arXiv:2403.13372 (2024).

Paper details

vlnc:W_p8dbtp4h
Version
v1 · latest
Published
Fresh — added to the Hub within the last 30 days
Added
License
CC BY 4.0
Usage

views · 0

downloads · 0

A view counts once per browser per day, a download each time the PDF is requested.

  • Computer Science

Not recorded for this paper

View statement
Looking for related papers…
Contents