EF-TALFM framework in PCQM4Mv2 study generates variable-size 3D molecules; 89.4% unique and valid molecules

Fixed-Dimensional Latent Flow for Generating Variable-Size 3D Molecules

Fixed-Dimensional Latent Flow for Generating Variable-Size 3D Molecules

In molecular discovery, molecule size is coupled to composition, structure, stability, binding affinity, and other target properties. Yet most 3D generators require molecule size to be specified before generation. Here, we introduce Equivariant-Free Transformer-Autoencoded Latent Flow Matching (EF-TALFM), a two-stage generative framework that relies entirely on a single fixed-dimensional molecule-level latent representation to generate variable-size molecules. The second-stage flow matching model samples this latent vector, and an autoregressive Transformer decoder then determines molecule size while generating atom types, coordinates, and chemically informative states. Canonical atom ordering and rigid-pose alignment enable standard Transformers without equivariant layers, while joint decoding of molecular geometry and an enriched chemical state enables reliable, deterministic, chemistry-guided graph recovery without requiring a learned dense pairwise bond decoder. The same fixed-dimensional latent supports unconditional and property-conditioned flow matching, while optional property supervision adds an internal ranking readout, with no separate predictor or reference calculations. On PCQM4Mv2, EF-TALFM achieves the highest fraction of molecules that are unique, absent from the training set, pass sanitization and PoseBusters sanity checks, 89.4%, compared with 75.6% for UAE-3D and 69.8% for FlowMol. Under the reported budgets on the same hardware, EF-TALFM also achieves higher measured computational throughput, with sampling-throughput speedups of 1.26 × \times and 3.62 × \times and approximate end-to-end training-throughput speedups of 3.20 × \times and 314 × \times over UAE-3D and FlowMol, respectively. Across ten target HOMO–LUMO gaps, internal ranking increases the density functional theory (DFT)-verified hit rate within 0.1 ​ eV 0.1,\mathrm{eV} from 25.0% to 52.4%, while preserving 97% novelty among unique verified hits relative to their property-matched training subsets. These results demonstrate that fixed-dimensional molecule-level generation followed by symmetry-resolved autoregressive realization provides a practical architecture for open-ended and property-directed 3D molecular design.

Molecular discovery requires generative models capable of proposing new molecules with three-dimensional structures and desired properties. This is inherently a variable-size design problem: molecular size, composition, and structure must be determined jointly, and the number of atoms needed to realize a desired property is generally not known in advance. A general molecular generator should therefore treat molecular size as an outcome of generation, supporting both open-ended generation of valid and novel molecules without a prescribed size and property-directed design that concentrates candidates near a target while preserving structural diversity.

For most 3D molecular generators, however, molecular size determines the shape of the state on which generation operates. Molecule-space diffusion and flow models instantiate N N atom states before beginning the generative process, and bond-explicit variants may additionally instantiate O ⁡ ( N 2 ) O(N^{2}) pairwise states ( Hoogeboom et al., 2022 ; Vignac et al., 2023 ; Hua et al., 2024 ; Le et al., 2024 ; Dunn and Koes, 2024 ; Irwin et al., 2025 ) . Most two-stage latent generators replace observable atom features with N N learned latent elements ( Xu et al., 2023 ; Joshi et al., 2025 ; Luo et al., 2025 ) , but their second-stage generative state remains an N × d N\times d array. In both cases, N N must be specified, sampled, or predicted before the atom-wise state can be instantiated. Nor does the presence of a single global embedding by itself resolve this dependence: when a 1 × d 1\times d code merely conditions diffusion over presized atom and pairwise-edge states ( Li et al., 2026 ) , the code is fixed-dimensional, but the state actually sampled by the molecular generator is still size-dependent. Fixed-size 3D representations have also been realized with continuous neural-field decoders or fixed sets of equivariant latent nodes ( Kirchmeyer et al., 2024 ; Chen et al., 2025 ) . These methods show that a molecular representation can remain fixed-dimensional across molecule sizes. Such a representation still requires a mechanism that converts it into a discrete molecule while determining molecular size, atom types, Cartesian coordinates, and other chemical attributes.

These considerations motivate our central architectural choice: the second-stage generative state is a single molecule-level latent vector 𝐳 ∈ ℝ d \mathbf{z}\in\mathbb{R}^{d} , independent of molecular size, and atom-wise structure is created only during decoding. The second-stage latent generator therefore operates entirely in ℝ d \mathbb{R}^{d} , without taking N N as input or instantiating a presized N × d N\times d atom-wise state. This separation places molecule-level variation in a common fixed-dimensional space while the decoder handles variable-size molecular construction; it also provides a direct locus for optional property conditioning. We instantiate this size-independent latent generator with flow matching ( Lipman et al., 2023 ) , which learns a vector field that transports a simple base distribution to the molecule-level latent distribution.

Turning a single fixed-dimensional latent into a molecule of unknown size requires a decoder that can determine when construction is complete. Direct autoregressive 3D generators address variable size by growing molecules atom by atom, but use the same autoregressive process to model both molecule-level variation and sequential construction ( Cheng et al., 2025 ; Li et al., 2025 ; Rose et al., 2025 ; Lu et al., 2025 ) . A latent alternative grows an atom-wise latent sequence, invoking conditional diffusion for each new latent and a separate classifier for termination ( Ottomano et al., 2026 ) . To keep the latent generator independent of molecular size, we instead use an autoregressive decoder that generates atoms sequentially and terminates with an explicit end-of-molecule (EOM) token. At each step, it conditions on 𝐳 \mathbf{z} and the previously generated prefix to predict either EOM or the next atom’s type, Cartesian coordinates, and chemical attributes. Molecular size is therefore determined by the decoder, without a separate diffusion or flow process at each atom.

Autoregressive decoding introduces two symmetry ambiguities: molecules have neither an intrinsic atom sequence nor a unique Cartesian pose, so equivalent structures can induce different causal and coordinate targets. Common models handle geometric symmetry through equivariant layers or SE ⁡ ( 3 ) \mathrm{SE}(3) augmentation ( Hoogeboom et al., 2022 ; Xu et al., 2023 ; Joshi et al., 2025 ; Cheng et al., 2025 ) . Canonical approaches instead select a consistent representation before learning, for example, through inertial-frame tokenization or geometric spectral canonicalization ( Li et al., 2025 ; Zhou et al., 2026 ) . We adopt the representation-level strategy in a lightweight form: canonical graph ordering provides a reproducible atom sequence, while coordinate alignment using translations and proper rotations provides a reproducible pose and keeps mirror images distinct. Applied once during preprocessing, these conventions enable standard Transformer and feed-forward backbones without rotational augmentation, learned frames, spectral canonicalization, or equivariant layers. This construction does not confer the formal transformation guarantees of an explicitly equivariant architecture; rather, it relocates permutation and rigid-motion handling from the network to deterministic preprocessing.

A second challenge is to turn the decoded atoms and coordinates into a chemically complete molecular graph. Explicitly predicting bond types produces a dense O ⁡ ( N 2 ) O(N^{2}) categorical output and requires the model to enforce globally consistent bond and valence assignments ( Luo et al., 2025 ; Li et al., 2026 ) . Coordinate-only generators avoid this pairwise output by generating atom types and coordinates and recovering connectivity in post-processing ( Hoogeboom et al., 2022 ; Xu et al., 2023 ; Joshi et al., 2025 ; Cheng et al., 2025 ) . Those outputs alone, however, may not uniquely determine bonding, charge assignment, or electronic structure through generic geometry-based perception, especially when only the heavy-atom scaffold is generated. We take an intermediate route: the decoder remains bond-free but augments atom types and coordinates with formal charge, attached-hydrogen count, hybridization, chirality, radical, aromaticity, conjugation, and ring membership, together with molecule-level descriptors including total charge, spin multiplicity, ring count, and fused-ring occurrence. These chemically informative states constrain a deterministic reconstruction pipeline, avoiding a learned dense bond-prediction head while supplying information that geometry alone leaves ambiguous.

Together, these design choices define Equivariant-Free Transformer-Autoencoded Latent Flow Matching (EF-TALFM), a two-stage framework that generates variable-size 3D molecules from a single fixed-dimensional molecule-level latent. In the first stage, an Equivariant-Free Transformer Autoencoder (EF-TAVAE) maps each canonically ordered and rigid-pose-aligned molecule to 𝐳 \mathbf{z} and reconstructs it with an EOM-terminated causal decoder. In the second stage, a flow-matching model learns the distribution of these latents and samples one 𝐳 \mathbf{z} per molecule for decoding.

The same factorization supports both unconditional and property-directed generation. For unconditional sampling, the flow learns p 𝜽 ​ ( 𝐳 ) p_{\bm{\theta}}(\mathbf{z}) ; for conditional sampling, an external target 𝐲 \mathbf{y} conditions the flow through p 𝜽 ​ ( 𝐳 ∣ 𝐲 ) p_{\bm{\theta}}(\mathbf{z}\mid\mathbf{y}) . The property is not included in 𝐳 \mathbf{z} and is not supplied as an input to the molecular encoder or autoregressive decoder. When optional property supervision is enabled during autoencoder training, complementary latent-only and molecule-conditioned readouts encourage property-relevant organization of the latent space and provide an internal score for decoded candidates. A generated molecule can then be re-encoded and ranked by its internal-readout error relative to the requested target, without training a separate property predictor or evaluating a reference property during selection.

We evaluate EF-TALFM in unconditional and property-directed regimes on PCQM4Mv2 ( Hu et al., 2021 ) . The unconditional study tests whether one fixed-dimensional latent retains sufficient information for faithful reconstruction and valid, variable-size generation. EF-TALFM generates the highest fraction of molecules that are unique, absent from the training set, pass sanitization and PoseBusters sanity checks, 89.4%, compared with 75.6% for UAE-3D and 69.8% for FlowMol, corresponding to relative improvements of 18.3% and 28.1%, respectively. Under the reported budgets on identical hardware, EF-TALFM achieves training-time speedups of 1.86 × 1.86\times and 2.72 × 2.72\times and end-to-end sampling-time speedups of 1.06 × 1.06\times and 2.83 × 2.83\times over UAE-3D and FlowMol, respectively. Its PoseBusters-verified novel sampling throughput is 1.26 × 1.26\times and 3.62 × 3.62\times that of the respective baselines, and it also achieves the highest approximate training-example throughput compared with the baselines. The property-directed study tests whether the same latent architecture can support targeted molecular discovery. Across ten target HOMO–LUMO gaps, retaining the top 30% of candidates ranke