Colour me shocked: Exact Molecular Hessians from local MLIPs in O(N) time using sparse differentiation!
Listen
Radio episode about this paper
Transcript
Introduction to the show: ident: Computer Science. The day in computer science: software, systems and theory on arXiv.
Tom: We're looking at the paper: "Colour me shocked".
Jane: Here's the gist of the paper. The paper shows how to use techniques from sparse automatic differentiation to reduce the cost of local MLIPs' Hessians to a system-size-independent number of Hessian-vector products, yielding overall O(N) total cost without any approximations This opens up the possibility of scaling high-accuracy MLIP Hessians to very large systems, such as proteins that were previously inaccessible The Bottleneck in Current Atomistic Modeling The Hessian of the energy with respect to the nuclear positions is indispensable in atomistic modelling However, constructing this matrix requires O(N) Hessian vector products, traditionally limiting high-accuracy Hessians to small systems Machine learning interatomic potentials (MLIPs) have accelerated atomistic modelling by providing highly accurate energies and forces at O(N) cost, yet the resulting O(N2) cost of Hessians remains a practical bottleneck for large systems By contrast, constructing the full 3N × 3N Cartesian Hessian requires 3N second-derivative probes, and O(N2) storage, thereby introducing an additional factor in system size in time and memory and leading to a total time complexity of O(N2) Deriving the Exact Sparsity Pattern The authors show that they can derive the sparsity pattern for an MLIP’s Hessians in closed form This is achieved by exploiting how information propagates through a finite number of message-passing layers within a radius of neighbours The sparsity pattern Pij = 1 if Hij!= 0, 0 if Hij = 0, which indicates whether the Hessian entry coupling i and j can be nonzero This graph-based upper bound on the atomwise Hessian sparsity pattern is induced by the local decomposition of the energy Schütt et al.
2017: , Batatia et al.
2022: The full Cartesian Hessian sparsity pattern is inferred from the graph topology, avoiding the computation from the sparsity detection pass Gebremedhin et al.
2009: The Sparse Automatic Differentiation Pipeline The sparse Hessian procedure comprises four stages 1.
Title and authors: Tom: So we're looking at this paper, "Colour me shocked: Exact Molecular Hessians from local MLIPs in O(N) time using sparse differentiation!"
Jane: That title sounds pretty dramatic, Tom. What's the core idea here for a listener who doesn't do machine learning?
Tom: Well, it’s about how we get the Hessian matrix for molecular energy. The authors are showing you a way to compute it in O of N time instead of O of N squared time. That’s huge because normally building that full matrix takes way too long for big systems.
Jane: So, if I'm driving and I need to calculate something quickly, this is about making sure the calculation doesn't take forever just because the system is big? How does it do that without just using some sort of guess or approximation?
Tom: It uses a technique from sparse automatic differentiation. They derive the exact sparsity pattern for these molecular Hessians in closed form, which lets them use a compressed seed matrix instead of probing every single direction. This means they only need to do a system-size independent number of Hessian vector products to get the whole thing.
Jane: A system-size independent number of products sounds really efficient, but what does that actually mean for the computer running the model? Is it just faster, or does it change how much memory we need?
Tom: It’s about reducing the total cost to O of N overall time. That means if you double the size of your system, the time doesn't double quadratically; it stays linear. They achieve this by mapping that sparsity pattern onto a graph and using coloring algorithms to create that seed matrix.
Jane: So, they are using the structure of the molecule itself—its locality—to figure out which parts of the Hessian actually matter before they even start calculating anything? That sounds like a really smart shortcut.
Tom: Exactly, Jane. They derive the sparsity pattern by looking at how information propagates through message-passing layers within a certain radius around neighbors in their MLIP architecture. This gives them that structural map without having to do a separate, costly pass just to find where the non-zero entries are.
Jane: That avoids what they call a "sparsity detection pass," which sounds like another extra step that usually slows things down, right? So they skip that extra search step because they know the pattern beforehand?
Tom: Right. They use this graph-based upper bound on the atomwise Hessian sparsity pattern induced by the local decomposition of the energy, which essentially tells them what couplings can be non-zero based on how far apart atoms are. This avoids a lot of wasted computation when doing those vector products.
Title and authors: Jane: If we look at what they say about performance, they mention that using acyclic coloring leads to runtime savings up to fifteen times for alkanes and eight times for water clusters. What does that tell us about the practical speedup?
Tom: It shows the method is very effective in practice. Acyclic coloring gives consistent and large runtime savings, and the star algorithm still cuts down on those vector products but is generally slower than acyclic coloring, so you should probably focus on that one for good results.
Jane: So we're talking about a real practical speedup here, not just theoretical complexity improvements. What about the accuracy? Since they're using these approximations based on locality, how close are they to the actual high-level methods like DFT?
Tom: They’ve shown that with this method, you get accuracy comparable to high level density functional theory at a scaling of O of N time because of those cutoff radii they use. The maximum Hessian entry error in their DFT experiments is on the order of ten to the minus eight for float32 precision, which is what we expect.
Jane: That’s a solid number for accuracy when you’re dealing with floating point numbers. So, even though it's an approximation based on locality, it's still accurate enough for serious work on large systems. What is the actual tool they give us to use this?
Tom: They introduced ColPackPy, which is an easy to use Python interface for these sparse Hessian computations. It supports sparse return types for scalable Hessians of very large systems, which makes it much easier for engineers like Meng to integrate into production pipelines.
Jane: That’s good that it’s easy to use. I wonder about the limits, though. The paper mentions that the scaling regime where the number of Hessian vector products becomes independent of system size is precise only when the maximum degree of their induced Cartesian Hessian sparsity graph is bounded by a function dependent only on d and L.
Tom: That's a key point for scaling. They show that this specific condition, combined with sparse-Hessian coloring results, implies that admissible star or acyclic colorings require p equals O of d times log L colors. This means the number of necessary vector products is independent of the system size N.
Title and authors: Jane: So we are looking at a scaling where you can tackle things like proteins that were previously inaccessible because the cost doesn't explode as fast as you thought? That’s a big implication for biology and chemistry modeling.
Tom: It definitely opens up possibilities for scaling high accuracy MLIP Hessians to very large systems, like those proteins we used to only be able to model crudely. This whole approach is about making the O of N2 cost manageable by exploiting the inherent structure of the MLIP itself.
Lu: From a representation learning standpoint, what really excites me is that they derived this sparsity pattern in closed form based on message-passing layers. It’s not just a heuristic cutoff radius; it's tied directly to the architecture of how they learned the potential. That gives us a solid theoretical foundation for why this works.
Meng: I think from my side, the O of N scaling is what matters because it dictates deployment costs. If we can run these Hessian evaluations in linear time with respect to system size, then we can actually deploy models on larger molecular systems without needing massive supercomputing resources just for the second derivatives.
Lalam: I’m confident in this direction because the framework handles higher derivatives too, like anharmonicity corrections which Kaser et al. showed extends easily to this sparsity derivation. It means we can scale VPT2 corrections for large systems as well, which is a big win for predictive accuracy.
Tom: So we've seen how they use sparse automatic differentiation to turn a quadratic cost problem into a linear one in terms of system size for these local MLIPs. We’ve seen the speedups in practice and the theoretical basis for scaling them up.
Jane: So, if I were just listening, I'd say this paper shows that we can get exact molecular Hessians from local MLIPs in linear time with respect to system size by using sparse differentiation techniques. It means we can finally look at much bigger molecules without the computation becoming completely impossible.
Lu: Yeah, it’s about realizing that the structure of the model itself—how it’s built—provides a shortcut to finding the necessary information for second derivatives.
Meng: For production, this means we can start thinking about running larger systems with these potentials without worrying that the Hessian computation will blow up our runtime.
Lalam: The paper "Colour me shocked: Exact Molecular Hessians from local MLIPs in O(N) time using sparse differentiation!" gives us a concrete path to scaling these critical calculations for large molecular simulations.
Tom: That’s right, it’s about taking the bottleneck of the Hessian cost and solving it by leveraging structure we already know about.
The paper's summary: Tom: So we’re looking at how they took a problem that was supposed to take quadratic time, O of N squared, and they managed to get it down to linear time with respect to the system size, O of N total cost.
Jane: That means instead of the calculation exploding as you add more atoms or molecules into your simulation, it just grows steadily. Like if you double the number of atoms in a protein, the time it takes doesn't double; it just doubles again.
Lu: Exactly. They achieved this by using sparse automatic differentiation to get an exact sparsity pattern for these molecular Hessians in closed form based on how information moves through local layers in their machine learning potential architecture.
Meng: So they aren’t using some kind of generic approximation that works okay most of the time; they are deriving the exact structure first, which is a lot more work, but it unlocks linear scaling. What does that mean for me at the startup level?
Tom: It means we can finally look at systems that were previously completely out of reach for high-accuracy Hessian calculations, like big proteins or complex molecules. That’s the whole point here—scaling those high-accuracy potentials to things like proteins.
Jane: It sounds like they used a four-stage pipeline: first deriving that sparsity pattern from the molecule's graph, then mapping that to a graph and using coloring algorithms to get a seed matrix, then probing the Hessian with that seed matrix, and finally using a reconstruction algorithm to get the explicit Hessian.
Lu: That’s right. The crucial part is how they derive that initial sparsity pattern based on locality from their message-passing architecture or by using a simple heuristic cutoff radius, which avoids that expensive pass where you try to detect non-zero entries for every single entry.
Tom: And the results show that specific coloring algorithms, like acyclic coloring, lead to runtime savings of up to fifteen times for alkanes and eight times for water clusters. That’s a very tangible speedup on smaller systems right there in the experiments.
Jane: So even though they are using these locality-based patterns as an approximation, the accuracy holds up well enough for DFT experiments where errors are around ten to the minus eight when using standard floating point precision.
Meng: If I’m deploying this, it means I don't have to worry about the second derivative computation blowing up my runtime on larger molecules; that makes the whole deployment strategy much more feasible.
Tom: And they even extended this framework to higher derivatives like anharmonicity corrections, which is important because you need those for things like vibrational corrections, VPT two, and scaling them up requires that sparsity derivation extends easily.
Jane: So the main idea is taking a quadratic cost problem and turning it into a linear one by using the inherent structure of the MLIP itself to guide how we calculate those second derivatives.
Lu: It really shows how representation learning architecture can directly inform derivative calculations, giving us a solid theoretical foundation for why this works in principle.
Meng: The tool they built, ColPackPy, is an easy Python interface that supports these sparse return types for very large systems, which is what makes it practical to use instead of just being a theory.
Tom: So we've seen how they used sparse automatic differentiation to turn a quadratic cost problem into a linear one in terms of system size for these local MLIPs. Now we look at how that means we can finally look at much bigger molecules without the computation becoming completely impossible.
Jane: And that leads us to thinking about what comes next, because the paper also explains how you can batch parallel computations for different noninteracting systems efficiently by reducing the number of Hessian vector products to at most three N max, where n max is the biggest system size in your batch.
The paper's improvements: Tom: So, the authors aren't just happy with their initial result; they suggest a few ways to make this sparse Hessian procedure even better for future work.
Jane: What are these improvements? Are they just trying to squeeze out a tiny bit more speed or are they fixing some of the limitations we saw in practice?
Lu: They focus on making the sparsity pattern derivation even tighter by tying it directly into the exact message-passing layers of the MLIP architecture, instead of just using a general heuristic cutoff radius.
Meng: Tighter is good for me because if we can get a more precise structure, we can tune our probing vectors better and hopefully reduce those Hessian vector products even further than they already are.
Tom: They also mentioned that the method can be extended to higher derivatives, like anharmonicity corrections, which means you don't have to start over when you move from just the energy to things like vibrational frequencies.
Jane: That’s a big deal because those higher-order terms are essential for getting accurate predictions for things like molecular vibrations, and if they can scale linearly with system size, that opens up new avenues for those corrections.
Lu: And finally, they proposed batching parallel computations; this means you can run the Hessian calculations for several different noninteracting systems at once much more efficiently by limiting the number of vector products to at most three N max.
Meng: Batching sounds really useful from an engineering standpoint because it lets us utilize the hardware better when we have many smaller systems instead of having to wait for one giant system to finish its whole calculation.
Tom: So, if you can batch them, it means the overall runtime scales even more favorably when you are dealing with a lot of different molecular setups running in parallel.
Jane: It sounds like they’re really pushing this framework toward making it a robust tool for large-scale simulation, not just a neat trick for small test cases.
Lu: I think what's most interesting is that these suggestions build on the idea that the structure of the learned potential dictates the efficiency of all subsequent derivative calculations.
Tom: It’s about moving from "this works well" to "this is how we make it scale reliably for real-world, high-accuracy applications."
Conclusion: Jane: So, we’re wrapping up "Colour me shocked: Exact Molecular Hessians from local MLIPs in O of N time using sparse differentiation!" by summarizing how they solved the big problem of Hessian calculation cost for large systems.
Tom: It’s a heavy lift, but they showed that by exploiting the structure inherent in their machine learning potential, you can get an exact Hessian matrix with total cost O of N instead of O of N squared.
Lu: That really shows how the way you build your model—the message-passing layers—can directly inform how efficiently you can calculate its second derivatives.
Meng: From a deployment view, linear scaling means we can actually run these high-accuracy potentials on systems that were previously impossible because the runtime wouldn't just explode.
Jane: It’s about taking the quadratic cost problem and turning it into a linear one by using the inherent structure of the machine learning potential itself to guide how we calculate those second derivatives.
Tom: And they showed that with these new techniques, you can finally tackle things like proteins at high accuracy that were just out of reach before.
Lalam: I’m confident in this result because the derivation is tied directly to the architecture; it's not a lucky guess, it's mathematically grounded in how these potentials are built.
Lu: It really demonstrates that representation learning can be used not just for predicting energies, but for efficiently calculating all the necessary derivatives needed for those energy predictions.
Meng: For me, this means we can start thinking about running larger systems with these potentials without worrying that the Hessian computation will blow up our runtime on real traffic.
Jane: So, if you’re a scientist looking at complex molecules, this paper gives you a clear path to scaling those high-accuracy calculations up significantly.
Tom: Exactly. This whole approach is about taking the bottleneck of the Hessian cost and solving it by leveraging structure we already know about in the model design.
Lalam: It’s a solid piece of work because it provides a concrete mechanism—the sparsity pattern derivation—to achieve that linear scaling for these local MLIPs.
Lu: I think this opens up new ways to explore how potential energy surfaces behave across much larger chemical spaces without getting bogged down by the computational cost of derivatives.
Jane: We’ve covered how they get there, the speedups they found, and what it means for scaling up molecular modeling.
Tom: That’s right. It’s a major step forward in making high-accuracy atomistic simulations feasible for much larger biological systems.
Lalam: We're going to keep an eye on how these structural insights translate into even more efficient derivative calculations in other areas of AI and science.
University of Toronto · Vector Institute for Artificial Intelligence · Acceleration Consortium · Canadian Institute for Advanced Research
cs.CE
Submitted: 2026-09-21
Updated: 2026-11-04
Code: https://github.com/adrhill/asdex
License: http://creativecommons.org/licenses/by/4.0/
Importance score: 97/100
The gist: The paper shows how to use techniques from sparse automatic differentiation to reduce the cost of local MLIPs' Hessians to a system-size-independent number of Hessian-vector products…
Key concepts
- Hessian Vector Products (HVPs)
- These are the fundamental operations needed to compute the Hessian matrix of an energy function. Traditionally, computing them requires O(N) operations per product, leading to an overall O(N^2) cost for a full Hessian, which is too slow for large systems.
- Sparsity Pattern Derivation
- The authors derive the exact structure (sparsity pattern) of the Hessian matrix directly from how information propagates through local message-passing layers in the MLIP architecture. This structural knowledge allows them to skip costly general sparsity detection passes.
- Sparse Automatic Differentiation Pipeline
- This is a four-stage process: first, derive the sparsity pattern; second, map this pattern to a graph and use coloring algorithms to create probing vectors; third, probe the Hessian using these vectors; and finally, reconstruct the full Hessian. This pipeline ensures efficiency by leveraging prior knowledge of the system's structure.
- System-Size Independence
- The key finding is that by exploiting the locality of message-passing architectures to define a 'heuristic sparsity pattern,' the number of required Hessian-vector products becomes independent of system size, achieving an overall O(N) total cost for obtaining high-accuracy Hessians.
Terminology
Summary
The paper shows how to use techniques from sparse automatic differentiation to reduce the cost of local MLIPs' Hessians to a system-size-independent number of Hessian-vector products, yielding overall O(N) total cost without any approximations This opens up the possibility of scaling high-accuracy MLIP Hessians to very large systems, such as proteins that were previously inaccessible
The Bottleneck in Current Atomistic Modeling
The Hessian of the energy with respect to the nuclear positions is indispensable in atomistic modelling However, constructing this matrix requires O(N) Hessian vector products, traditionally limiting high-accuracy Hessians to small systems Machine learning interatomic potentials (MLIPs) have accelerated atomistic modelling by providing highly accurate energies and forces at O(N) cost, yet the resulting O(N2) cost of Hessians remains a practical bottleneck for large systems By contrast, constructing the full 3N × 3N Cartesian Hessian requires 3N second-derivative probes, and O(N2) storage, thereby introducing an additional factor in system size in time and memory and leading to a total time complexity of O(N2)
Deriving the Exact Sparsity Pattern
The authors show that they can derive the sparsity pattern for an MLIP’s Hessians in closed form This is achieved by exploiting how information propagates through a finite number of message-passing layers within a radius of neighbours The sparsity pattern Pij = 1 if Hij!= 0, 0 if Hij = 0, which indicates whether the Hessian entry coupling i and j can be nonzero This graph-based upper bound on the atomwise Hessian sparsity pattern is induced by the local decomposition of the energy Schütt et al. p. 3 Then a Hessian block
(i, j) can be nonzero only if there exists some atomic term Ea that depends on both Ri and Rj , i. P
atom
ij = 1[∃a such that MaiMaj = 1] = 1
(M⊤M)ij ̸= 0
(8)
This gives a graph-based upper bound on the atomwise Hessian sparsity pattern induced by the local
decomposition of the energy Schütt et al. [2025], now provide reliable surrogate potentials Schütt et al. [2017], Batatia et al. Extensions to sparsity patterns
of higher order derivatives are trivial by adding more Mak to the product. So far, we have only considered nodes, but each node is embedded in Cartesian space, and therefore,
the full Cartesian Hessian sparsity pattern is
P = P
atom ⊗ 13×3 (9)
Sparsity is therefore inferred from the graph topology, avoiding the computation from the sparsitydetection pass Gebremedhin et al.Where the paper says it
Where the paper says it
Where the paper says it
The Sparse Automatic Differentiation Pipeline
The sparse Hessian procedure comprises four stages 1. First we derive a sparsity pattern P from the atomistic graph 2. p. 2 The sparse Hessian procedure employed here comprises four stages, see figure 1:
1. First we derive a sparsity pattern P from the atomistic graph, section 3. First we derive a sparsity pattern P from the atomistic graph, section 3. We then map the sparsity pattern to a graph and use graph colouring algorithms to obtain a
seed matrix S ∈ {0, 1}
3N×p
, whose columns are our probing vectors. Our goal is to get a
seed matrix with p as small as possible, while still having enough information to recover the
Hessian exactly. We probe the Hessian using the seed matrix to obtain the response Y = HimplicitS
4. We probe the Hessian using the seed matrix to obtain the response Y = HimplicitS
4. We use a reconstruction algorithm to get the Hessian Hexplicit = frec.Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Performance and Practical Implementation
The results show that acyclic coloring leads to consistent and large runtime savings of up to 15× for alkanes and 8× for water cluster The star algorithm still reduces the HVP count but generally performs worse than the acyclic coloring and should therefore only be understood as a reference For DFT experiments, the maximum Hessian entry error is on the order of 10−8 for float32, which is within floating point precision as expected The authors introduce ColPackPy, an easy to use Python interface for sparse Hessian computations This library supports sparse return types for scalable Hessians of very large systems
Scaling and Future Extensions
The scaling regime in which the number of Hessian-vector products becomes independent of system size is precise when the induced Cartesian Hessian sparsity graph G(P) has maximum degree δ(G(P)) bounded by a function dependent only on d and L Standard sparse-Hessian colouring results then imply that admissible star or acyclic colourings require p = Od,L(1) colours, corresponding to a system-size-independent number of HVPs The framework can also be extended to higher derivatives like the anharmonicity Kaser et al.
Green — the paper says it, and the page is printed. Red — no passage carries it, so treat that sentence as unverified. The same check runs on your own text: check a summary against its source, $5.
Improvements for AI systems
-
Sparse Hessian computation for local MLIPs can be reduced to a system-size independent number of Hessian-vector products yielding overall O(N) total cost without any approximations. This allows scaling high-accuracy MLIP Hessians to very large systems, such as proteins that were previously inaccessible.
-
Implementation of ColPackPy provides an easy to use Python interface for sparse Hessian computations, including the graph-derived sparsity construction for MLIPs and differentiable recovery in PyTorch. This makes the exact sparse Hessian computation efficient even for single Hessian evaluations of relatively small systems.
-
The approach allows the derivation of a sparsity pattern from the locality of message-passing architecture or a heuristic cutoff radius, avoiding a costly sparsity detection pass. This makes exact sparse Hessians efficient by defining
heuristic sparsity patterns based on a cutoff radius
for any ab-initio method where the Hessian is well behaved and an approximation error is acceptable. -
The framework can be extended to higher derivatives like anharmonicity Kaser et al. 2021, as the sparsity pattern derivation extends trivially to higher orders. This enables scaling anharmonic vibrational corrections like VPT2 to large systems.
-
Batched parallel computation of Hessians of different noninteracting systems can be performed efficiently by reducing the number of HVPs to at most 3Nmax, where Nmax is the maximum number of atoms over the systems in a batch, even if each subsystem is dense.
Abstract
The Hessian of the energy with respect to the nuclear positions is indispensable in atomistic modelling. However, constructing this matrix requires O(N) Hessian vector products, traditionally limiting high-accuracy Hessians to small systems. Machine learning interatomic potentials (MLIPs) have accelerated atomistic modelling by providing highly accurate energies and forces at O(N) cost, yet the resulting O(N 2) cost of Hessians remains a practical bottleneck for large systems. Based on the insight that we can derive the sparsity pattern for an MLIP's Hessians in closed form, we show in this paper how to use techniques from sparse automatic differentiation to reduce the cost of a local MLIP's Hessians to a system-size-independent number of Hessian-vector products, yielding overall O(N) total cost without any approximations. We benchmark our approach on a variety of systems ranging from alkane chains to water clusters to A beta40 conformers. Depending on the MLIP configuration, we achieve the linear scaling regime already on relatively small systems, resulting in large runtime reductions between 2 times-15 times for these systems. This opens up the possibility of scaling high-accuracy MLIP Hessians to very large systems, such as proteins that were previously inaccessible.
Sources
- Shoot from the HIP: Hessian Interatomic Potentials without derivatives
- PFT: Phonon Fine-tuning for Machine Learned Interatomic Potentials
- MACE-OFF: Transferable Short Range Machine Learning Force Fields for Organic Molecules
- The Open Molecules 2025 (OMol25) Dataset, Evaluations, and Models
- SMC-AI: Scaling Monte Carlo Simulation to Four Trillion Atoms with AI Accelerators
- Revisiting Sparse Matrix Coloring and Bicoloring
- Projected Hessian Learning: Fast Curvature Supervision for Accurate Machine-Learning Interatomic Potentials
Related papers
- Constrained Sensing and Reliable State Estimation with Shallow Recurrent Decoders on a TRIGA Mark II Reactor
- DREChanNet: Patient-Relative iEEG Model for Channel-Wise Epileptogenic Zone Localization
- A matrix-free, differentiable PyTorch solver for phase-field fracture: Formulation, benchmarks, and inverse analysis
- BizAgentBench: Unveiling Hidden Challenges in Deploying Long-Horizon Agents for Real-World Business
- In-context learning as a retraining-free paradigm for constitutive modeling
- Topology-Preserving Mesh Adaptation for Sharp-Interface Multiphase PFEM