Towards Fast, Specialized Machine Learning Force Fields: Distilling Foundation Models via Energy Hessians

Ishan Amin, Sanjeev Raja, Aditi S. Krishnapriyan

Machine Learning Force Fields (MLFFs) have emerged as powerful, fast surrogates for computationally expensive quantum mechanical calculations, such as Density Functional Theory (DFT). Recently, the computational chemistry community has shifted toward Foundation Models (FMs)—massive neural networks trained on millions of diverse molecular structures.

While these FMs are highly accurate "jacks-of-all-trades," they face three major hurdles in practical applications:

  1. Inference Speed: Their sheer size makes them prohibitively slow for long-scale molecular dynamics (MD) simulations.
  2. Generality vs. Specialization: Researchers typically focus on specific chemical niches (e.g., just amino acids or specific catalysts). The broad, generalized knowledge of an FM is computationally inefficient for these targeted tasks.
  3. Physical Consistency: Large models often struggle to strictly conserve energy during simulations unless specifically constrained, which can further increase computational costs.

To address these challenges, researchers have introduced a novel method to "shrink" these giant models into tiny, specialized "engines." By distilling knowledge from massive FMs using Energy Hessians, they create specialized MLFFs that are faster, more accurate for specific tasks, and physically sound.

The Energy Hessian Distillation Framework

The core of this approach relies on Knowledge Distillation (KD), but with a critical twist. Instead of merely matching the teacher model's final outputs (energy and forces) or internal hidden layers, the student model is trained to match the Energy Hessian.

Overview of the Energy Hessian Distillation framework

The Hessian represents the second derivative of energy with respect to atomic positions, effectively describing the "curvature" of the energy landscape. By forcing the student model to match the teacher's Hessian, the student learns a much richer, more detailed representation of the local chemical environment.

Key advantages of this methodology include:

  • Architecture Agnosticism: The distillation process does not require the teacher and student to share the same architecture. A massive, complex FM can be distilled into a simple, lightweight Graph Neural Network (GNN).
  • Efficient Subsampling: Computing a full Hessian is mathematically expensive ($O(N^2)$). To overcome this, the authors utilize Vector-Jacobian Products (VJPs) to sample only a few rows of the Hessian per training step. Remarkably, sampling even a single row is often sufficient to reap the benefits of Hessian matching without a massive training overhead.
  • Conservative Force Training: The framework allows for distilling a teacher that predicts forces directly (non-conservative) into a student that derives forces strictly from an energy gradient (conservative). This ensures the student model strictly obeys the laws of thermodynamics during MD simulations.

Experimental Validation and Datasets

The researchers evaluated their Hessian distillation method across several large-scale benchmarks and specialized subsets:

  • SPICE: A dataset of drug-like molecules and peptides, focusing on subsets like Monomers, Solvated Amino Acids, and Iodine-containing systems.
  • Materials Project (MPtrj): Utilizing subsets from its 1.6 million structures, including Perovskites, Yttrium-containing materials, and insulators.
  • MD22: Used for large-molecule testing, specifically targeting the Buckyball Catcher and Double-Walled Nanotubes.

Key Insights and Results

The results demonstrate that Hessians provide incredibly "rich" supervision. While forces dictate the direction of movement, Hessians reveal how the energy landscape curves, allowing smaller models to learn complex representations with significantly fewer parameters.

  • Massive Speedups: The specialized student models achieved consistent inference speedups of 10x to 20x compared to their FM teachers, reaching up to 50x in certain high-throughput scenarios.
  • The "Specialization Bonus": Because the student model focuses on a narrow slice of chemical space, it frequently outperformed the giant Foundation Model on that specific subset, achieving lower Force Mean Absolute Error (MAE).
  • Enhanced Stability: In Molecular Dynamics simulations, the distilled models exhibited superior stability. For instance, on the Buckyball Catcher, the distilled student conserved energy better than the massive JMP-Large foundation model it learned from.
  • Outperforming Baselines: The Hessian-matching approach consistently surpassed other distillation baselines, such as standard node-to-node feature matching.

Limitations and Future Directions

While highly effective, the method does introduce a training overhead. Even with efficient subsampling, computing Hessians adds computational cost during the training phase compared to standard force-matching (typically ~2x the cost). Furthermore, the student model's performance is inherently bottlenecked by the quality of the teacher's Hessian; noisy second derivatives in the FM will be inherited by the student.

Ultimately, this work suggests a promising new paradigm for MLFF development: a future where massive, generalized Foundation Models are released alongside a library of small, lightning-fast, specialized "engines" tailored for common chemical tasks and downstream applications.

Summary updated

BibTeX
@inproceedings{amin2025towards,
  author = {Ishan Amin and Sanjeev Raja and Aditi S. Krishnapriyan},
  title = {{Towards Fast, Specialized Machine Learning Force Fields: Distilling Foundation Models via Energy Hessians}},
  booktitle = {International Conference on Learning Representations},
  year = {2025},
  url = {https://openreview.net/forum?id=1durmugh3I},
}
Figure