Do Machine-Learned Force Fields Leak the Structures They Simulate?

Machine-learned interatomic potentials are neural networks trained to reproduce quantum-mechanical energies and forces at a small fraction of the cost of density functional theory. They are becoming hosted services that companies call with proprietary molecules, battery electrolytes, or candidate crystals. These models build a graph in which each atom connects to every neighbor within a fixed cutoff radius. As a result, the amount of computation per call depends on how densely the atoms are packed. A dense solid, a liquid, a vacancy, and a crack tip each produce a different number of graph edges, and therefore different runtimes and memory-access patterns. Cryptographers have long treated data-dependent runtime as a leak and removed it with constant-time programming, meaning code whose execution trace does not depend on secret inputs. No one has asked whether the same leak exists in atomistic simulation, how many bits it carries, or what it would cost to close.

This note proposes to answer those three questions for MACE, a widely used equivariant force field. The central claim is that, once atom count is hidden, the leak is dominated by a single public-checkable quantity: the per-call edge count. If so, fixing tensor shapes caps the leakage at a number of bits we can choose in advance, and the real price is set by how much density varies within a workload. We would measure that price on systems ranging from crystalline quartz to liquid water to a protein. A secondary strand applies the same lens to active-learning structure search, where the decision to call DFT reveals whether a candidate is novel.

Core Claim

The claim has three parts. First, an observer who sees only the latency of a force-field call can infer structural properties of the input beyond its size, including phase, coordination, and the presence of defects. This should hold even when the atom count is padded to a constant, because MACE's message passing scales with the number of edges within the cutoff (MACE). Second, suppose inference is run with fixed tensor shapes, padding both atoms and edges to one of $B$ preset sizes. If runtime then depends only on which size was used, the information leaked per call is bounded by

$$I(\text{structure};\ \text{runtime}) \le \log_2 B \text{ bits},$$

because runtime is then a deterministic function of a variable that takes $B$ values. Third, the throughput cost of this bound is predictable from the spread of edge counts in the workload. The cost should be modest for homogeneous solids and large for interfaces and mixed phases.

The bound is only as good as the "runtime depends only on shape" assumption. Testing that assumption empirically is half the project. Floating-point subnormals, nondeterministic scatter-add kernels, and fused equivariant CUDA kernels could all reintroduce data-dependent timing, just as compilers undo constant-time idioms in cryptographic code (Lou et al.).

Positioning

The file contains no work joining these areas, so the proposal borrows from each side in distinct roles.

On the security side, Drucker et al. supply the method template. They convert a variable-iteration QC-MDPC decoder into a fixed-iteration one with masked dummy iterations (Drucker et al.). Related work finds that this kind of hardening can nearly double cost (Drucker et al.). Wahby shows that unifying edge cases algebraically keeps overhead within 10% (Wahby). Together these bracket what "affordable" means. Chen et al. remove secret-indexed table lookups by working over whole tables in vector registers (Chen et al.). That is the analogue of replacing sparse neighbor gathers with dense padded blocks.

Zhao et al. motivate the threat model. They recover 81% of ECDSA nonce bits across tenants on Google Cloud Run despite noise 40x louder than the signal (Zhao et al.).

On the materials side, two papers define what is being hardened and what it must compete with. MACE pushes body order into each layer to need only two message-passing layers (MACE). DistMLIP removes all redundant communication through zero-redundancy graph partitioning (DistMLIP). Both optimize purely for throughput. Padding deliberately reintroduces redundancy, so DistMLIP's numbers are the cost we must justify.

Research Program

The work proceeds in three stages.

Stage 1: measure the leak. We serve MACE from the reference implementation (ACEsuit/mace) in two settings. The first is a CPU server, where a co-resident process can additionally probe the shared cache in the style of Zhao et al. The second is a GPU server, where the observer sees only request latency. Inputs are drawn at a fixed padded atom count, so size is not the signal. We record latency traces and train simple classifiers to predict structural labels from them. The labels are phase (solid, liquid, or interface), presence of a vacancy, chemical family, and coordination quantile. Leakage is reported as classifier accuracy above chance and as an estimated mutual information. We also run CtChecker (CtChecker) over the C++ neighbor-list code, with coordinates marked secret. The aim is to locate the secret-dependent branches. We expect its points-to imprecision on dense numerical code to produce many false alarms, and we will report them as such.

Stage 2: fixed-shape inference. We pad atoms and edges to one of $B$ bucket sizes and mask the padded entries out of every sum. We use fixed-trip neighbor construction over cell lists. Bucket boundaries are chosen from the workload's edge-count distribution. $B=1$ is full constant shape; larger $B$ trades bits for speed. We then re-run Stage 1's attack and check whether residual leakage falls below $\log_2 B$. If it does not, we locate the kernel responsible.

Stage 3: active-learning search. The pipeline of Hessmann et al. halts relaxation when ensemble uncertainty crosses a threshold and then calls DFT (Hessmann et al.). Whether DFT is called therefore exposes novelty. We compare it with a fixed-schedule variant that relaxes for a fixed number of steps and always sends exactly the top-$k$ uncertain candidates to DFT per round. We measure how many extra DFT calls this costs.

Baselines

The naive reference point is stock MACE inference with dynamic neighbor lists and no defense. It fixes the attacker's best-case accuracy and the fastest throughput. For throughput on large systems, the strongest existing method is DistMLIP running MACE. That paper reports 9.6 microseconds per atom-timestep on a 250,000-atom GaN supercell on 8 A100 GPUs (DistMLIP). For single-structure latency, MACE reports about 10.5 ms for its invariant $L=0$ model on 3BPA (MACE). We will rerun both on our hardware rather than compare against the published numbers.

We would claim success if fixed-shape inference on the homogeneous DistMLIP systems (quartz, GaN, water) stays within 1.5x of the rerun baseline per atom-timestep while residual leakage stays under the $\log_2 B$ budget. This does not need to "beat" the baseline in speed; the question is whether the security gain comes at a tolerable cost.

The defense baselines are random-jitter injection, tuned so that mean latency matches our padded variant, and pad-to-dataset-maximum ($B=1$). For the active-learning strand, the baseline is the original adaptive pipeline. Hessmann et al. report 400–700 single-point DFT evaluations to find the global minimum on Si16, Na8Cl8, Ga8As8, and Al4O6.

The key ablation separates padding atoms from padding edges. If padding atom count alone removes most of the leak, the edge-level claim is wrong and the proposal reduces to a triviality. All variants use the same trained weights, inputs, and hardware.

Why not just…?

Why not just run proprietary simulations on isolated clusters? For organizations that do, the threat is moot, and we will say so. But hosted foundation models such as MACE-MP and shared multi-GPU nodes are becoming common. Zhao et al. show that co-tenancy on commodity cloud is exploitable within seconds. The question this study answers is whether the leak is large enough to matter when isolation is absent.

Why not just add random delay? Zhao et al. extract periodic signals under 40x noise using spectral analysis. Averaging over many queries also defeats zero-mean jitter. Our jitter baseline, matched in cost to padding, tests this directly. If jitter achieves the same leakage reduction at equal cost on our attacks, that is a real threat to the proposal, and we would report it.

Why not just pad to fixed shapes, as JAX already requires? This is the most serious objection, because it is essentially our Stage 2 mechanism. The contribution is not the padding trick. It is three things: showing whether a leak exists beyond atom count, checking whether shape-determined runtime actually holds on GPU equivariant kernels, and pricing the budget across density-heterogeneous workloads. Static-shape frameworks bucket shapes for compilation speed, not under a stated leakage budget, and nobody has measured what leaks through them.

Why not use relaxed timing notions, or a fixed-token model? Ben Dov et al.'s query-obliviousness (Ben Dov et al.) is defined for keyed pseudorandom functions and itself relies on fixed-time components. It has no obvious meaning for continuous atomic coordinates. Transformer generators such as Crystalite (Crystalite) remain size-dependent and are generators, not force fields. Their pairwise-geometry module also involves periodic wrapping.

Proposed Experiments and Decisive Checks

The data come from three sources. PubChemQCR-S, with 40,979 trajectories (Fu et al.), provides chemically varied molecules and relaxation intermediates. The DistMLIP suite (quartz, electrolyte, water, GaN, MOF, protein) provides density heterogeneity. The AIRSS systems Si16, Na8Cl8, Ga8As8, and Al4O6 serve the search strand.

Four checks would decide the outcome. The first is whether, at fixed atom count, a latency-only classifier predicts phase or vacancy presence well above chance. If it does not, the paper becomes a negative result that reassures practitioners. The second is whether residual leakage after fixed-shape inference stays under $\log_2 B$ on GPU. If it does not, we report which kernels break shape-determinism. The third is the overhead curve as a function of $B$ for each system class. The fourth is whether the fixed-schedule active-learning variant stays within a small factor of the 400–700 DFT-call range on the AIRSS systems. A large multiple would show that novelty-hiding in search is expensive.