TL;DR
tmol is a GPU-native, differentiable PyTorch library that reimplements the state-of-the-art RosettaGenFF forcefield for biomolecular modeling. By providing up to a 362-fold speedup over traditional CPU-based implementations, it allows researchers to seamlessly integrate physics-based priors into generative machine learning pipelines for protein and ligand design.
What Problem Does This Paper Address?
Generative machine learning (ML) models have revolutionized protein design and structure prediction. However, these models often "hallucinate" physically unrealistic structures—such as poor stereochemistry or impossible atom overlaps—because they lack a fundamental understanding of physics.
Traditional physics-inspired forcefields like Rosetta are excellent at identifying these implausible conformations, but they are notoriously difficult to use in modern ML workflows. They are typically written in legacy C++, are slow to evaluate, and lack the differentiability required for gradient-based optimization within frameworks like PyTorch. tmol bridges this gap by bringing the gold-standard Rosetta energy function directly into the GPU-accelerated, differentiable world of modern AI.
Methods
The authors built tmol from the ground up as a PyTorch library, focusing on three technical pillars:
- PoseStack Representation: To keep GPUs saturated,
tmolgroups multiple independent molecular systems into a single "PoseStack." This allows for highly efficient batched tensor operations across structures with different sequences and chemistries. - GPU-Native Kernels: The library uses a custom tiling scheme for atom-pair interactions. Each block of atoms is assigned to a GPU thread block (CTA), which stages data in fast shared memory to evaluate up to 1,024 interactions simultaneously. This architecture supports CUDA (NVIDIA) and MPS (Apple Silicon).
- Parallel Kinematics: A major challenge was handling "torsion-space" refinement, which is inherently recursive and thus difficult for GPUs. The authors implemented a "generational segmented scan" algorithm that converts recursive tree traversals into parallel prefix sums, enabling fast coordinate updates and derivative calculations.
Crucially, tmol is fully differentiable via PyTorch's autograd, meaning researchers can backpropagate through the energy function to guide ML model training or structure refinement.
Datasets
The authors validated tmol using several established benchmarks:
- Score Agreement: A set of 1,000 high-resolution protein structures was used to ensure
tmolreproduces PyRosetta energy terms accurately. - Decoy Discrimination: 61 protein monomers and 65 protein-protein complexes were used to test if the forcefield can distinguish native structures from "decoys."
- Stability ($\Delta\Delta G$): A dataset of ~1,200 point mutations to compare predicted vs. experimental changes in folding free energy.
- CASF-2016: A protein-ligand set (285 complexes) used to benchmark docking and scoring power.
- Generative Design: The library was integrated as a reward function for the RFD4-Proteina design model across 24 protein-protein targets.
Key Insights and Ideas
- Physics as a Prior: The authors demonstrate that physics-based rewards can significantly improve ML-generated designs. By using
tmolas a reward in a beam search, they increased the success rate of designs with strong hydrogen bonding from 16% to 66%. - Automatic Everything: One of the biggest hurdles in Rosetta is manually parameterizing new ligands or non-standard residues.
tmolincludes a fully automatic pipeline that generates parameters from SMILES strings or chemical files in seconds, making it much more accessible for drug discovery. - GPU Efficiency Over "Bump Checks": In traditional Rosetta, a "bump check" is used to quickly discard clashing rotamers to save CPU time. Because
tmolis so fast on GPUs, it can afford to skip this check and evaluate all rotamers, which actually improved rotamer recovery metrics by keeping near-native conformations that the old check might have discarded.
Key Results
- Massive Speedups:
tmolachieved a 362-fold increase in throughput for batched score-plus-gradient calculations and a 96-fold to 102-fold speedup for structure refinement (FastRelax) compared to single-threaded PyRosetta. - High Fidelity: The total energy calculated by
tmolshowed a Pearson correlation of 0.997 with PyRosetta, confirming that the reimplementation is faithful to the original physics. - Design Success: When used to guide protein-protein interface design,
tmolrewards led to a significant increase in complex interactions, such as water bridges (rising from 17% to 68% success).
Limitations and Future Work
While tmol is highly effective, the authors noted that designs guided by its rewards sometimes resulted in larger-than-average interfaces and a slight increase in atomic clashes. Additionally, while the library automates much of the chemical parameterization, it does not yet infer bond orders from geometry—they must be provided in the input.
Future work will likely focus on tighter integration into the training loops of generative models (rather than just inference-time guidance) and expanding the library's support for even more diverse chemical space.
Summary updated