Manuscript Offprint
arXiv:2610.17885Deep Mesoscopic Dynamics
Yue Zhao , Shiqi Wu , Yihang Ouyang , Sergey Grebenchuk , Magdalena Grzeszczyk , Xiaoxu Zhao , Kostya S. Novoselov , Maciej Koperski , and Qianxiao Li
Institute for Functional Intelligent Materials, National University of Singapore, Singapore 117544, Singapore
Department of Mathematics, National University of Singapore, Singapore 117543, Singapore
Department of Materials Science and Engineering, National University of Singapore, Singapore 117575, Singapore
Integrative Sciences and Engineering Programme, NUS Graduate School, National University of Singapore, 119077, Singapore
School of Materials Science and Engineering, Peking University, Beijing 100871, China
AI for Science Institute, Beijing 100871, China
October 14, 2026
Abstract. Microscopic simulations resolve spatial patterns but are feasible only over small domains and short timescales, whereas bulk descriptions erase those patterns through spatial averaging. Mesoscopic fields preserve this spatial organisation, but their effective equations are known only for selected microscopic systems and scaling limits. We introduce Deep Mesoscopic Dynamics (DeepMesoD), which uses neural networks to learn an effective mesoscopic field equation from microscopic trajectories at a prescribed coarse-graining scale. For the nonconserved dissipative dynamics studied here, DeepMesoD learns the free-energy functional with a spatial interaction kernel and a state-dependent dissipation operator constrained by the fluctuation–dissipation relation. We first validate the construction in the Ising–Kac model, where the learned mesoscopic equation recovers the known hydrodynamic limit and rollouts remain stable far beyond the training horizon. We then treat two systems without closed-form mesoscopic descriptions. For a two-dimensional Heisenberg ferromagnet governed by atomistic spin dynamics, DeepMesoD learns a mesoscopic model whose predictions match atomistic references up to 1 ns, and a rollout with an unseen initial condition remains bounded up to 25 ns. For layered CrBr₃, the learned kernel captures the suppression and sign reversal of interlayer coupling at a stacking fault whose location and strength are not supplied as inputs. Controlled changes to the learned interaction show how fault number and placement shape multistep magnetic responses, complementing our magneto-photoluminescence measurements. Across the two atomistic systems, DeepMesoD achieves a three-to-four-order-of-magnitude reduction in wall-clock time compared with atomistic spin dynamics.
Equal contribution.
Corresponding authors: kostya@nus.edu.sg; msemaci@nus.edu.sg; qianxiao@nus.edu.sg.
In magnets, alloys, and other many-body systems, microscopic interactions organise spins or atoms into spatial patterns whose evolution controls material behaviour. For example, magnetic domains can store information (1), with localised spin textures such as skyrmions explored for spintronic and probabilistic-computing applications (2, 3), while antiphase domains and phase boundaries shape the evolution of alloy microstructures (4, 5). Predicting how these structures form, move, and interact requires a dynamical description that resolves their spatial variation. Microscopic simulations such as atomistic spin dynamics and molecular dynamics evolve the coupled dynamics of individual spins or atoms, but their computational cost limits the spatial region over which complete patterns can be resolved (6–8). On the other hand, descriptions based only on bulk averages such as total magnetisation or mean composition cannot capture domains, textures, or interfaces.
A mesoscopic description lies between these two levels and provides an efficient means to simulate these spatial features at realistic timescales. This description is captured by a field defined on a spatial domain , and is the number of field components. The field value at each spatial location is obtained by a local coarse-graining map acting on the microscopic configurations near . For example, for magnetic systems may be the average magnetic moment near . The mesoscopic field describes the formation, motion, and interaction of spatial structures without the need to record microscopic arrangement below the prescribed scale (Figure 1, left). In particular, if an accurate evolution equation can be derived for , simulations can then be realised over spatial and temporal scales that are relevant to probe important phenomena, such as domain formation and phase transitions. However, even when the microscopic dynamics and coarse-graining map are known, determining an accurate evolution equation for is a central open problem in dynamics modelling.
Classically, such mesoscopic field dynamics are commonly constructed in two ways. The first prescribes phenomenological forms for the free energy and field dynamics using symmetry, conservation laws, and empirical knowledge. For example, Landau-Ginzburg theory (9, 10) posits that evolves according to a gradient flow with respect to a phenomenological free energy functional
where the local free energy density , , and , yielding the Allen-Cahn equation (4, 5) . The coefficients , , can be fitted, but the model remains restricted to the prescribed form of energy, and is not an accurate description of any particular dissipative dynamical process at the mesoscopic scale.
The second approach directly derives a mesoscopic field equation from a microscopic dynamical model. For selected microscopic systems, a controlled scaling limit yields an effective hydrodynamics equation for the coarse field (11, 12). The Ising–Kac model with Glauber dynamics is one example (13, 14). For more complex systems, eliminating microscopic variables that are not represented in the coarse field can produce conditional expectations, memory terms, or high-dimensional integrals that are not available in a computable form (15). In practice, dynamic mean-field models obtain a computable equation by prescribing a mean-field free energy and selected field dynamics (16). The resulting equation then depends on these modelling approximations, which can omit effects that remain relevant at the chosen coarse-graining scale.
To address these difficulties, we introduce DeepMesoD, which constructs accurate mesoscopic field dynamics without the need for phenomenological prescriptions or complex derivations. Instead, we consider a highly general class of dissipative dynamics with unknown dissipation operators and free energy functionals, where the thermal noise and the dissipation operator satisfy a fluctuation-dissipation relation. These operators are parametrised by structured neural networks and trained

Figure 1: Workflow of DeepMesoD. Microscopic trajectories are coarse-grained into observations of a mesoscopic field at a prescribed spatial scale. DeepMesoD uses these trajectories to estimate the physical structures in a mesoscopic field equation within a prescribed dynamical class.
directly on microscopic observations to obtain accurate mesoscopic descriptions that can then be used to simulate and analyse the system on large temporal and spatial scales.
We first validate DeepMesoD in the Ising–Kac model, whose hydrodynamic limit provides analytic references for the learned field equation (13, 14). We then apply the same construction to a -like two-dimensional ferromagnet (17, 18) and layered (19–24), two systems whose mesoscopic equations are not known in closed form. Atomistic-spin trajectories provide microscopic references in both systems. In , the modelled multistep response is consistent with our magneto-photoluminescence measurements. Controlled numerical experiments with the learned stacking-fault interaction show how fault number and placement affect the calculated field response.
DeepMesoD Methodology
From microscopic trajectories to field observations We first describe how microscopic trajectories provide coarse-grained field observations. While our framework is designed for general dissipative mesoscopic dynamics, for clarity we specialise our discussion to magnetic spin systems defined on a lattice. We denote the index set of microscopic spins by and the state space of each spin by . The microscopic configuration is assumed to evolve as a continuous-time Markov process. For example, in the Ising–Kac ferromagnet, and evolves as a Markov jump process under Glauber dynamics (13, 25, 26). Another example is classical Heisenberg magnets, where each atomic spin is represented by a three-dimensional unit vector. In this case, is the unit sphere, and specifies the orientation of atomic spin . The trajectories are recorded at discrete observation times. At each recorded time, we compute coarse observations at spatial locations . For each location, contains the microscopic spins in its averaging neighbourhood, with fixed within each system. The observation map gives the value at that position:
These averages give scalar magnetisation for Ising–Kac and three-component magnetisation for the atomistic spin systems , where each microscopic spin is a unit vector. We seek a mesoscopic field whose dynamics reproduce the observations,
Thus each training observation pairs a spatial position with a field value . We write for the space of these fields at any fixed time.
Field dynamics and fluctuation–dissipation structure We aim to learn an effective equation for the evolution of from the observations . We consider fields whose spatial integral is not conserved and whose coarse-grained observations exhibit thermal fluctuations, motivating a description that combines relaxation and noise. We model the relaxation as free-energy-driven dissipation, giving the stochastic field equation in Itô form
where is the inverse temperature in Boltzmann units. The noise is a zero-mean, p-component Gaussian field that is white in space and time, with
where is the identity matrix.
This hypothesis space is inspired by Landau’s model, but with important distinctions. First, the free-energy functional is not assumed to involve a polynomial energy density, nor gradient-based domain penalisation ( ). Instead, we minimally constrain this functional to satisfy locality and translational invariance on homogeneous domains (details below). Second, we explicitly model the rate of thermal dissipation via a general dissipation operator . We similarly constrain by symmetry principles, in the spirit of Onsager’s reciprocal relations (27). Third, we explicitly model state-dependent thermal noise ( ), which is assumed to satisfy a fluctuation–dissipation relation , where denotes the adjoint operator. The divergence term ( represents the thermal drift in the Itô form of the stochastic differential equation with state-dependent dissipation. As the fields and operators are defined on function spaces, rigorous definitions of this term and the stochastic-integral formulation are given in the SI Appendix, section 1. In summary, instead of guessing explicit function forms as in phenomenological modelling, here we constrain the physical quantities by broad symmetry and invariance principles, and leave exact functional and operator identification as a learning problem under these constraints. Below we present the precise constraints we apply to each quantity.
Free energy and spatial interaction We constrain the free-energy density at each position to depend on the local field and on a variation field that describes its spatial environment:
The energy density depends on the local value and the variation field . The bounded operator is defined by
where is a spatial interaction kernel learned from data. We use the normalisation convention
Notice that the variation field vanishes by construction on spatially uniform . The energy-density function and the interaction kernel are learned jointly from the coarse-field trajectories. This generalises the Landau form of the free energy functional, corresponding to the choice , where is a local energy density and is chosen so the last term is a non-local approximation of the gradient norm, which describes interfacial energy. Our parametrisation, however, allows for non-additive interactions between bulk and interfacial energies, and this turns out to be important for the van der Waals magnets we investigate later.
Factorised dissipation operator We now discuss the construction of the dissipation operator. Since we enforce the fluctuation–dissipation relation through the factorisation , it suffices to parametrise the factor . This factorisation makes self-adjoint and positive semidefinite, as expected for a dissipation operator. At a fixed field state, maps a p-component input noise field to a perturbation of the q-component magnetisation field. Its matrix-valued kernel has q rows indexing magnetisation components at and p columns indexing noise components at . For an input field , the factor acts as
In this work we study short-range interactions and assume a locality radius . The factor vanishes when the distance between and exceeds , and depends on only through field values within distance of . For example, single-spin flips in Ising–Kac Glauber dynamics produce local instantaneous fluctuations in nonoverlapping block averages, while their rates depend on surrounding spins, motivating these locality assumptions. On periodic homogeneous domains, sharing the same local coefficient rule across positions makes the factor translation equivariant and reusable on larger domains without retraining, at fixed coarse-graining scale and numerical resolution. Numerical details are given in Materials and Methods.
Learning from field observations We learn the energy density , the spatial interaction kernel , and factor kernel from the observations at positions . We use a multilayer perceptron (MLP) to represent , trainable interaction coefficients to represent (here assumed to be piecewise constant, thus uniquely defined by a square matrix of function values), and a convolutional neural network (CNN) to represent the dependence of on local field values. For training, we first learn the noise factor from fluctuations in the observed field increments after subtracting their fitted mean drift. The fluctuation–dissipation relation then gives . With the factor parameters fixed, we jointly fit and to the observed field increments using the complete deterministic drift in (1). After training, we numerically integrate the learned drift in (1) to simulate the mesoscopic field on a coarse grid. The learned equations enable simulations on much larger domains without retraining (SI Appendix, section 2G) and run thousands to tens of thousands of times faster than atomistic spin dynamics for the two magnetic materials (Materials and Methods). Details are given in Materials and Methods and the SI Appendix. For the magnetic systems below, we use the conventional notation for a scalar magnetisation field and for a vector magnetisation field, in place of .
We consider the two-dimensional periodic microscopic lattice of linear size , with spin configuration . A spin at site flips at the heat-bath Glauber rate
where is the local interaction field and is the applied field. We use a normalised periodic Gaussian Kac kernel of range in unit-domain coordinates on , the unit periodic domain. The kernel denotes its corresponding lattice weight. The flips satisfy detailed balance with respect to the Boltzmann distribution , with Ising–Kac Hamiltonian
Averaging spins at each coarse position gives the scalar observations . The simulation procedure is given in Materials and Methods and the SI Appendix, section 2A.
Under Kac scaling, each averaging cell contains increasingly many spins while its diameter becomes small relative to the interaction range. Microscopic fluctuations average out, and the hydrodynamic limit gives the deterministic magnetisation equation (13, 14)
where and . We rewrite (3) in the deterministic form of (1), with the reference dissipation operator defined accordingly. The reference free energy has the form (2), with energy density
where . The homogeneous equilibrium free-energy density is
Here C is an arbitrary additive constant. We consider two temperatures on either side of the critical temperature at zero field. At T = 0.75, spins collectively align to form magnetic domains, whereas at T = 1.5, thermal fluctuations prevent spontaneous magnetic order.
The hydrodynamic limit describes deterministic evolution, whereas finite averaging cells still exhibit fluctuations. Spin-flip activity determines the noise covariance and hence a dissipation reference through the fluctuation–dissipation relation. Let be the mean instantaneous flip activity in cell . Conditioning on the observation gives
We compare the learned dynamics with (3), the homogeneous energy density with , and the dissipation response with (Figure 2). The free-energy and finite-block covariance derivations are given in the SI Appendix, sections 2B–C.
Simulation and model setup The simulations use and . Each block contains spins, and the observations are stored on a array. The microscopic initial conditions are sampled from local Bernoulli probabilities whose mean magnetisation is specified by multiscale Gaussian random fields. At , the first 500 time steps from each of three independently generated trajectories are used for training. At , the first 100 time steps from each trajectory are used for training. A separate initial field is generated for evaluation, and three microscopic realisations initialised from this field are averaged to form the reference trajectory. The evaluation rollouts contain 5,000 steps at and 1,000 at . Each reported learned-model result at a given temperature is based on three independent training runs with different random seeds. The temporal sampling and training details are given in Materials and Methods and the SI Appendix, sections 2A and 2D.
For the Ising validation, we use and learn the homogeneous density and a symmetric interaction , with . The hat distinguishes the learned interaction from the reference . This choice allows a direct comparison of with while learning the spatial interaction from data.
We compare DeepMesoD with the hydrodynamic-limit equation (3), a local Allen–Cahn approximation, and a patch CNN fitted directly to . The Allen–Cahn approximation replaces the nonlocal Kac interaction by its local second-order expansion, while the CNN provides an unconstrained data-driven baseline. Their numerical definitions are given in the SI Appendix, section 2E. An FNO trained on the same short Ising trajectories produced unstable autoregressive rollouts, so we omit its results from Figure 2 and present an FNO comparison for the atomistic spin system below.
Validation of dynamics and physical structure Figure 2 evaluates the learned equation in the ordered regime at T = 0.75 and in the disordered regime at T = 1.5, both at . DeepMesoD maintains a low field mean absolute error over 5,000 evaluation steps at T = 0.75 and 1,000 at T = 1.5, while the CNN accumulates substantially larger error (panels A and B). The spatial mean magnetisation follows the microscopic and hydrodynamic-limit references throughout the same intervals (panels C and D). The Allen–Cahn approximation has its largest error early in the rollout and lower error later, consistent with its second-order expansion better approximating the nonlocal interaction as the field becomes smoother.
The same figure compares the learned constitutive functions with their references. The homogeneous density g reproduces the double-well structure at T = 0.75 and the single-well structure at T = 1.5 and tracks the reference profiles (panels E and F). The conditional response of the learned dissipation operator, defined in the caption, agrees with the reference defined in (4) and estimated from microscopic trajectories (panel G). For panel H, we average the learned off-centre interaction weights over offsets at the same distance from the centre. The resulting radial profile agrees with the Gaussian reference, although training does not constrain weights at equal distances to be equal. Rollouts on larger periodic domains retain comparable errors at the same coarse-graining scale and numerical resolution (SI Appendix, section 2G).
A Trajectory Error: T=0.75
Train Extrapolate

B Trajectory Error: T=1.5
Train Extrapolate
E Free-energy density: T=0.75
C Mean magnetization: T=0.75
Train Extrapolate
F Free-energy density: T=1.5
D Mean magnetization: T=1.5
Train Extrapolate
G Dissipation operator
H Interaction kernel
Figure 2: Validation of DeepMesoD in the Ising–Kac system with hydrodynamic limit. The DeepMesoD rollouts are noise-free with the Itô thermal drift retained. A,B. Field mean absolute error at each evaluation time for T = 0.75 and T = 1.5. Green shading marks the training interval, and yellow shading marks the subsequent rollout-only interval. C,D. Mean magnetisation during the same rollouts. E,F. Homogeneous free-energy density , compared with the hydrodynamic-limit reference. Each curve is shifted independently so that its minimum is zero. G. Conditional dissipation-operator response , compared with the reference in (4) computed from the corresponding microscopic trajectories. H. Off-centre interaction weights, averaged over offsets with the same radial distance and compared with the Gaussian Ising–Kac kernel. For DeepMesoD and the CNN baseline, lines show the mean across three training seeds, and shaded bands indicate one standard deviation.
Discovery of mesoscopic structure in atomistic systems
We next apply DeepMesoD to atomistic spin dynamics trajectories from two magnetic systems whose mesoscopic equations are not known in closed form (17, 18). In a -like two-dimensional ferromagnet, we examine whether the learned equation recovers the anisotropy, exchange, and state-dependent dissipation required for long rollouts (28). In , we use the learned stacking-fault interaction in controlled numerical experiments that vary the number and placement of fault interfaces. The resulting responses reveal how this interaction organises multistep magnetic switching. Once learned, these neural-network field equations permit stable simulations over larger spatial domains at substantially lower computational cost than atomistic spin dynamics.
Microscopic model and atomistic spin dynamics At the atomistic level, both systems are described by a classical Heisenberg spin Hamiltonian, with a unit spin carrying moment at each magnetic site. For these vector spins, we write in place of the microscopic variable used above. A general form of the Hamiltonian is
combining exchange with couplings , uniaxial anisotropy of strength about the easy axis , Zeeman coupling to an applied field , and the long-range dipolar interaction . The -like ferromagnet and the film differ in lattice geometry and material parameters , and the stacking fault in the latter enters as a local modification of the exchange couplings across the fault plane.
Given this Hamiltonian, each spin evolves under the stochastic Landau-Lifshitz-Gilbert (LLG) equation
which combines reversible precession about the effective field , Gilbert damping with strength , and thermal noise whose covariance is fixed by the fluctuation–dissipation relation at temperature . We integrate these equations with VAMPIRE v7.0.0 (17, 18), which supplies the microscopic trajectories that DeepMesoD coarse-grains.
In both systems, the coarse observations are obtained by the same block average as before, now applied to the three-component spins:
We learn a vector field with and . Unlike the Ising–Kac model, whose coarse-grained constitutive structure is analytically known, no general constitutive description is available for atomistic spin systems governed by the LLG equation.
-like two-dimensional van der Waals ferromagnet Two-dimensional van der Waals magnets such as and provide atomically thin platforms for exploring low-dimensional magnetism and developing spintronic devices (29). Simulating two-dimensional magnets at experimentally relevant spatial and temporal scales is essential because their collective behaviour may not be captured in small computational domains. Large-scale atomistic simulations, for example, have revealed finite-size magnetic order beyond the conventional Mermin–Wagner limit, but at substantial computational cost, involving millions of spins and days of simulation (28). By learning thermodynamically consistent mesoscopic dynamics from atomistic trajectories, DeepMesoD enables cheaper spatial scale-up and long-horizon prediction beyond the reach of direct microscopic simulation. It is also of scientific interest to evaluate if an Allen–Cahn-type phenomenological model can quantitatively capture the mesoscopic dynamics of these magnets.
For the two-dimensional van der Waals ferromagnet, we specialise the general Hamiltonian above by restricting to a uniform nearest-neighbour coupling J, setting the applied field to zero, and neglecting dipolar interactions. With the easy axis chosen along z, the resulting anisotropic Heisenberg Hamiltonian reads
where each site carries a classical unit spin , is the ferromagnetic exchange coupling, and is the uniaxial anisotropy strength. The uniaxial anisotropy stabilises finite-temperature magnetic order, and the exchange and anisotropy parameters are adopted from Ref. (28). Under this effective modelling hypothesis, DeepMesoD uses the same finite-scale, thermodynamically consistent dissipative construction introduced in (1) and applied to the Ising–Kac system. The learned interaction kernel obeys the unit-sum constraint, , and for the present vector-valued magnetisation field, the dissipation construction is extended from the scalar case by replacing each scalar coupling with a block. Specifically, acts on the three spin components of neighbouring coarse cells, while the factorisation and the finite-range construction remain unchanged. The factor uses the same neighbourhood of noise sources as in the Ising–Kac system.
DeepMesoD is trained on 10 independent atomistic spin dynamics trajectories generated from random spin initialisations. Each trajectory is simulated for 250 ps with a microscopic time step of 0.1 fs, and configurations are saved every 1 ps. Training data are drawn from the first 150 ps of each trajectory, with the remaining 100 ps reserved for later-time evaluation. We further assess out-of-distribution generalisation with a triangular-domain initial condition, in which a single triangular magnetic domain is embedded in an otherwise uniformly magnetised background. Additional evaluations on domain-wall configurations are reported in the SI, section 3D. Two unstructured baselines are compared: the patch-wise CNN used in the Ising–Kac experiments and a Fourier neural operator (FNO (30)) that learns the field evolution as a black-box operator. For the triangular-domain initial condition, atomistic reference data are available over 0–1 ns, where prediction errors can be evaluated (Figure 3A and SI Appendix, section 3D). The learned-model rollout extends to 25 ns, a timescale beyond the practical reach of ASD for the same system under a comparable computational budget. Over 1–25 ns, the predicted mean magnetisation remains bounded and approaches -1 as the minority domain shrinks and the system relaxes towards a uniformly magnetised state (Figure 3B). In contrast, the CNN and FNO baselines become unstable during long rollouts.
No violations of were detected for DeepMesoD in the reported tests. Table 1 shows 0.00% unphysical predictions across the three tested initial conditions, against and for CNN and FNO.
Table 1: Physical constraint violations in learned-model predictions. Percentage of grid points where the predicted spin magnitude exceeds the unit sphere () across three magnetic configurations, without any post-processing. The 0.00% entries for DeepMesoD indicate zero detected violations.
| Model | Random | Domain Wall | Triangular domain |
|---|---|---|---|
| DeepMesoD | 0.00% | 0.00% | 0.00% |
| CNN | 37.59% | 94.48% | 94.44% |
| FNO | 81.66% | 96.66% | 98.31% |
Beyond stable rollout, DeepMesoD reconstructs the free-energy functional, dissipation operator, and interaction kernel of the ASD system directly from data. The learned free-energy landscape exhibits a double-well profile with minima at , consistent with the underlying uniaxial anisotropy (Figure 3D, left). These minima provide energetically favoured magnetised states, supporting a physical interpretation of the stable relaxation observed in the rollouts. Compared with the additive dependence assumed in the hydrodynamic limit of the Ising–Kac model, the learned thermodynamic force exhibits a nonlinear dependence on both and . The resulting two-dimensional response surface contains clear non-separable structure (Figure 3D, middle and right), demonstrating that the general parametrisation of the free-energy density used in DeepMesoD can represent thermodynamic couplings beyond an additive form. The learned
A
Mean magnetisation

C K spatial correlation
Coupling constants: and
B
Learned kernel
D Free-energy landscape
Force along
Additive ansatz along
Figure 3: Long-term stability and thermodynamic-structure recovery in atomistic spin dynamics. A. Long-term rollout from a triangular-domain initial condition on the same lattice. The DeepMesoD prediction is noise-free with the Itô thermal drift retained. Training uses random-initial-state trajectories. The triangular-domain initial condition is used for geometric-initial-condition extrapolation, not for fitting these stages. The dashed boundary at 1 ns separates the interval with an atomistic reference (“Observed”) from the interval without a reference (“Extrapolation”), ending at 25 ns. Time labels are in ps. The atomistic reference permits accuracy comparisons over 0–1 ns, but extending it to 25 ns is computationally costly. The 1–25 ns learned-model rollout assesses numerical stability and qualitative relaxation. B. Predicted magnetisation fields at the indicated times in ps. The triangular minority domain contracts towards a uniform magnetised state. C. Recovered Kernel. Left: spatial decay of the learned dissipation operator, quantified by the Frobenius norm of the block with distance d relative to the on-site block. Middle: dissipation coupling constants and as functions of centre spin , exhibiting an even (symmetric) profile that peaks near the disordered state and reflecting the expected axial anisotropy between the two coupling modes. Right: learned interaction kernel, revealing a dominant nearest-neighbour structure consistent with short-range exchange coupling. D. Recovered free energy. Left: free-energy landscape exhibiting a double-well profile with minima at , consistent with the underlying uniaxial anisotropy. Middle: thermodynamic force recovered by DeepMesoD, which is a general nonlinear function of both and and exhibits non-trivial contour structure. Right: the hydrodynamic limit , which assumes an additive dependence on alone, yields a purely striped pattern independent of , demonstrating that the additive assumption fails to capture the full free-energy structure of this system.
dissipation is likewise strongly localised in space. The Frobenius norm of the coupling block is largest on the on-site block and drops sharply already at , so the operator is effectively on-site dissipation (Figure 3C, left). For the on-site block itself, although is parametrised as a full matrix, the learned operator is approximately diagonal in the spin components, with in-plane entries , out-of-plane entry , and negligible off-diagonal coupling. Both coupling constants depend approximately evenly on and peak near the disordered state ( ), reflecting the reduced phase space available for fluctuations in the ordered phases (Figure 3C, middle). Finally, the recovered spatial interaction kernel exhibits a dominant nearest-neighbour structure consistent with the lattice symmetry, recovering the short-range exchange coupling without prescribing this structure (Figure 3C, right). The recovered thermodynamic components provide an interpretable description of the observed relaxation.
Layered CrBr₃ from a learned fault interaction to multistep field response CrBr₃ is a van der Waals ferromagnet whose interlayer magnetic coupling depends on the stacking registry of adjacent layers. Different stacking configurations, including monoclinic M-stacking and rhombohedral AB-stacking, correspond to different relative translations between adjacent layers and can favour antiferromagnetic or ferromagnetic interlayer correlations (Figure 4A) (23, 24). Experimentally, such magnetic switching can be probed through magneto-photoluminescence (magneto-PL), where photoluminescence refers to light emitted following optical excitation and its response can depend on the magnetic state of the material (19). Our magneto-PL measurements on an approximately 50 nm CrBr₃ flake show abrupt changes in PL intensity associated with magnetic switching (Figure 4D). These measurements reveal the occurrence of magnetic switching, but do not directly resolve the spatial magnetisation dynamics that connect the local stacking fault to the observed macroscopic response. In particular, how the modified exchange interface reorganises magnetic domains and mediates switching across the film remains difficult to access experimentally. Atomistic spin dynamics simulations can in principle resolve these processes, but become prohibitively expensive over the spatial and temporal scales required to follow domain formation and collective switching. This motivates the use of DeepMesoD to learn an effective mesoscopic description that retains the influence of the microscopic stacking-dependent exchange while enabling direct study of the resulting domain evolution and macroscopic magnetisation dynamics.
Because the layered geometry provides prior information about the distinction between in-plane and interlayer interactions, we impose additional structure on the interaction kernel, separating these two contributions to reduce the parameter space and make their physical roles explicit. We generate atomistic spin dynamics trajectories for a 51.4 nm CrBr₃ film with a single antiferromagnetic stacking fault at its midplane. Averaging three atomic layers per slab gives 28 resolved slabs. From these trajectories, DeepMesoD learns the energy-density function, the spatial interaction, and the dissipation operator of the coarse-field equation. We represent the spatial interaction kernel as a separable product: its layer-dependent factor captures variations associated with surfaces and stacking faults, whereas its in-plane factor represents short-range exchange. At coarse indices (x, y, z), the interaction kernel is
Here is a global layer-to-layer matrix, whereas is a local finite-range in-plane kernel.
Applying DeepMesoD to these trajectories yields the interaction kernels and free-energy landscape shown in Figure 4B and C. The learned interlayer kernel has a predominantly tridiagonal structure, with the coupling across the stacking fault between coarse-grained layers 13 and 14 reversing sign relative to the bulk interlayer coupling (Figure 4B, left). The in-plane kernel is isotropic and approximately nearest-neighbour, consistent with the symmetry of the lattice (Figure 4B, right). Through the learned free energy, this fault-induced change in the interaction kernel alters the equilibrium structure of the system. Restricting the free energy to configurations with spatially uniform magnetisation within the blocks above and below the fault reveals four distinct minima in the mean-magnetisation and block-contrast coordinates (Figure 4C). Two correspond to parallel block magnetisations and two to antiparallel block magnetisations. This contrasts with a uniformly ferromagnetic system, which exhibits only two symmetry-related minima. The additional basins therefore reveal fault-induced equilibrium states and provide a mesoscopic free-energy picture for the multiple magnetic transitions associated with the stacking fault.
A

B
C
D
E
F
Magnetic field (mT)
Magnetic field (mT)
Figure 4. A learned stacking-fault interaction connects internal geometry to multistep magnetic response in CrBr₃. A. Structural and magnetic schematic of layered CrBr₃. Left: crystal structure of CrBr₃ (Cr atoms in purple, Br atoms in gold). Middle: top and side views of representative M-stacking and AB-stacking configurations, where M denotes monoclinic stacking and AB denotes rhombohedral stacking and the two adjacent layers are coloured purple and green. Right: schematic AFM (antiparallel) and FM (parallel) interlayer spin alignments across a stacking fault, shown alongside the simulated three-dimensional magnetisation field mₓ at the final time step. The light-blue plane marks the stacking-fault interface between coarse slabs 13 and 14 (zero-based indices), and the pink (AFM) and green (FM) dashed circles highlight representative anti-correlated and correlated magnetic subdomains on either side of the fault. B. Effective interaction kernels learned by DeepMesoD without supplying the fault location as a model input. Left: learned interlayer kernel Jₓ as a function of layer indices a and b, showing a predominantly tridiagonal structure. The coupling across the stacking-fault interface between coarse slabs 13 and 14 (zero-based indices) has the opposite sign to the bulk interlayer coupling. Right: learned in-plane kernel Jₓy as a function of in-plane displacement (Δx, Δy), showing an isotropic, short-range profile. C. Learned free-energy landscape for configurations with spatially uniform magnetisation within each of the two blocks. The coordinates are the mean magnetisation m = (m_top + m_bottom)/2 and block contrast Δm = (m_top - m_bottom)/2. The four minima represent correlated states at (m, Δm) = (±m₀, 0) and anti-correlated states at (m, Δm) = (0, ±m₀). The red curves indicate minimum-energy paths connecting these basins. D. Magneto-photoluminescence signature of magnetic transitions on a roughly 50 nm CrBr₃ flake. The normalised PL intensity is shown as a function of out-of-plane magnetic field for sweeps from −2T to 2T and from 2T to −2T, with a step-like PL response to the applied magnetic field. The purple and orange curves show smoothed traces, while the faint traces in the background show the corresponding unsmoothed experimental data. Arrows indicate the magnetic-field sweep directions. The inset shows a schematic of exciton–magnetisation coupling in CrBr₃. X denotes a CrBr₃ exciton, represented here by an electron–hole pair with both carrier spins oriented upward. The σ⁺ label denotes the circular polarisation associated with this representative optically active exciton configuration. The local magnetisation vector M is chosen to point downward. E. Calculated equilibrium mean interfacial sign correlation ξ_sim versus external field for the 51.4 nm film containing one, three, five, or seven approximately uniformly spaced stacking faults. This observable averages the product of longitudinal magnetisation signs across each fault.
over in-plane cells, fault planes, and equilibrium configurations [(6)]. The plateaus correspond to dominant block-alignment sectors. The small diagrams show the fault locations. F. Dependence of the first and final transition fields on fault positions for films containing three faults. Left: starting from alternating block magnetisations, the outer block opposing the field reverses first, followed by the remaining antiparallel internal block. Green and orange outlines identify these blocks, whose thicknesses are and , respectively, measured in resolved slabs. Right: inverse thicknesses and plotted against the first and final transition fields, respectively. Symbols denote the simulated geometries; dashed linear fits show the approximately linear relationships.
Having identified how a single stacking fault reshapes the free-energy landscape and introduces additional equilibrium basins, we next examine how this mechanism extends to films containing multiple faults. In particular, we ask how the number and spatial arrangement of stacking faults modify the field-dependent magnetic response. Addressing this question requires systematic variation of the fault configuration while resolving the resulting magnetisation dynamics. Atomistic spin dynamics simulations can represent individual faults explicitly, but systematic exploration over fault number, position, film geometry, and applied field becomes prohibitively expensive as the number of microscopic spins increases. Experiments can measure the resulting macroscopic switching response, but the number and positions of stacking faults are difficult to control independently, and the internal magnetisation dynamics associated with a particular fault configuration are not directly resolved. Once DeepMesoD has learned the mesoscopic free energy and interaction structure, however, different fault configurations can be introduced through the layer-dependent coupling and explored directly at the coarse-grained level.
We introduce an out-of-plane field through the Zeeman term
where is the dimensionless applied field, is the out-of-plane magnetisation component, and converts the field to the learned free-energy scale. We calibrate after training as described in Materials and Methods. To vary the fault geometry, we retain the 28 resolved slabs and insert translated copies of the learned fault neighbourhood at prescribed interfaces of , keeping the other learned quantities fixed. We quantify the response by the mean sign correlation across all fault planes, so that each internal interface contributes to the observable:
where is the number of stacking faults, is the number of in-plane coarse-grained cells, and and denote the out-of-plane magnetisation in cell of the slabs immediately above and below fault in a configuration at applied field . The expectation averages over equilibrium configurations within and across the retained block-alignment sectors at fixed . Thus, and indicate equal and opposite longitudinal magnetisation signs, respectively, at every interface cell throughout the equilibrium ensemble. Intermediate values can arise from mixed alignments within a fault plane, different alignments among fault planes, or averaging over configurations. Direct trajectories do not sample all relevant block-alignment sectors on the accessible time scale. We therefore use bidirectional annealed importance sampling, which connects ensembles through intermediate distributions and estimates their relative equilibrium weights from bidirectional switching.
work (31, 32), to evaluate (6). Computational details are given in Materials and Methods and the SI Appendix, section 4D.
We vary the interlayer interaction kernel to represent one, three, five, and seven approximately uniformly spaced faults while keeping the other learned quantities fixed (SI Appendix, section 4D). The resulting equilibrium field responses exhibit distinct plateaus that reflect successive changes in the dominant block-alignment sectors (Figure 4E). Increasing the fault number changes the plateau sequence and extends the response to higher fields in the tested geometries. The simulated plateaus reflect changes in interfacial block alignment, whereas the PL steps in Figure 4D are an optical signature of changes in magnetic state. These calculations provide a possible magnetic interpretation of our PL steps.
We next fix the number of stacking faults at three and examine how their positions affect the first and final equilibrium transition fields (Figure 4F). Each fault geometry divides the 28-slab film into four magnetic blocks with thicknesses , counted consecutively through the film in resolved slabs, with . The left schematic illustrates two successive transitions from alternating block magnetisations as the field increases. The outer block opposing the field reverses first; its thickness is , and it is outlined in green. The remaining antiparallel internal block, outlined in orange, then reverses to align all four blocks with the field. Its thickness is . The outer block that reverses first is separated by one block from the internal block that reverses last.
Across the tested fault geometries, the first and final transition fields vary approximately linearly with and , respectively, as shown in the right panel. The scaling can be understood from the competition between the Zeeman energy gained by aligning a block with the applied field and the interfacial free-energy cost of replacing antiparallel alignments with parallel ones. For a fixed lateral area and comparable magnetisation magnitude, the Zeeman energy gain scales with the applied field times the thickness of the reversing block. If the interfacial cost remains comparable across fault geometries, the critical field therefore scales approximately inversely with the block thickness, so that thicker blocks switch at lower applied fields.
Discussion
Physical interpretation and computational scale
The results demonstrate three uses of learned mesoscopic dynamics: extending simulations in time and space, analysing thermodynamic structure, and isolating how spatial interactions control collective magnetic response.
First, evolving the coarse field avoids resolving every atomistic spin and extends short microscopic observations to longer-time simulations. In the two-dimensional atomistic spin system, predictions agree with an atomistic reference up to 1 ns and remain bounded during relaxation to 25 ns. For the two-dimensional ferromagnet and CrBr₃, the wall-clock speedups over atomistic spin dynamics are approximately and , respectively, without operator-specific optimisation (Materials and Methods). The Ising calculations also demonstrate evaluation on larger spatial domains at fixed coarse-graining scale and resolution (SI Appendix, section 2G).
Second, the learned equations preserve thermodynamic structure while allowing the free energy, interaction kernel, and dissipation to be analysed separately. In Ising, the learned energy density reproduces the double-well and single-well profiles at the two temperatures, and the conditional dissipation response agrees with the finite-block fluctuation reference. In the atomistic systems, the energy density reveals uniaxial anisotropy, the dissipation varies with the magnetisation, and the interaction kernel identifies a reversal of interlayer coupling at the stacking fault.
Third, the learned interactions enable controlled calculations of mesoscopic magnetic properties. In , changing the number and placement of fault interfaces while holding the other learned quantities fixed isolates their effects on interfacial alignment and field-induced switching. The calculated plateaus track changes in magnetic alignment across fault interfaces, providing a magnetic perspective on the multistep optical response observed in magneto-photoluminescence. In the future, atomic-resolution scanning transmission electron microscopy (23) combined with magnetic measurements could help examine the predicted relation between stacking-fault geometry and magnetic response in real samples.
Relation to other data-driven methods
We then discuss related work on data-driven dynamics modelling. Neural operators such as DeepONet and Fourier neural operators learn black-box mappings between input and solution fields (30, 33). Equation-discovery methods including SINDy, AI-Feynman, and PDE-Net infer governing expressions using prescribed candidate libraries, symbolic search spaces, or structured differential representations (34–37). For coarse-grained particle trajectories, symmetry-informed candidate libraries and sparse regression have been used to infer deterministic hydrodynamic equations for active matter (38). Effective stochastic dynamics can also be learned from microscopic simulations by fitting drift and diffusion functions using objectives based on stochastic numerical integrators (39). OnsagerNet, generalised-Onsager learning, and GENERIC-informed models parametrise thermodynamically structured dynamics for finite-dimensional state vectors rather than directly parametrising mesoscopic field equations (40–44). Recent work extends Onsager-structured learning to mesoscopic field dynamics through deterministic trajectory fitting (45). A related approach learns conserved density dynamics from molecular dynamics trajectories (46). By contrast, DeepMesoD develops a more general mesoscopic modelling framework based on symmetry principles and the fluctuation–dissipation relation, with flexible free-energy functionals and dissipation operators for nonconserved fields.
Stat-PINNs and DeepMesoD both use fluctuation statistics to constrain dissipation and mean evolution to learn the free energy (47), but obtain these statistics differently. Stat-PINNs prepare and evolve microscopic replica ensembles around prescribed field profiles, whereas DeepMesoD uses increments along recorded mesoscopic field trajectories. The same trajectories supply both the mean evolution and fluctuation statistics, removing the need to prepare and evolve additional microscopic replicas for each prescribed field profile. The two methods also differ in how they represent operators. Stat-PINNs learn weak-form dissipation entries in a selected finite-element space. DeepMesoD defines a factor on the field space and constructs , then learns its numerical representation. This separates the definition of the operator structure from its numerical discretisation. Self-adjointness and positive semidefiniteness follow from the factorisation. DeepMesoD also learns the spatial interaction kernel , which reveals how different regions interact. In , modifying this kernel enables controlled numerical experiments that help reveal how spatial interactions shape collective magnetic behaviour (Figure 4E,F). DeepMesoD includes the thermal drift in the Itô equation (1), whereas Stat-PINNs derive this term but omit it under their asymptotic scaling. In the formal Fokker–Planck equation, this term ensures zero probability current at Gibbs equilibrium. At finite coarse-graining volume , omitting it while keeping the same free energy and noise covariance generally breaks detailed balance with respect to that equilibrium.
Dynamical assumptions and scope
Hohenberg and Halperin classify critical dynamics according to whether the order parameter is conserved and how it couples to other slow variables (48). Among these classes, Model A describes relaxation of a nonconserved order parameter, whereas Model B describes transport-driven evolution of a conserved order parameter. Couplings to additional slow fields and reversible dynamics give rise to further classes. Here, DeepMesoD describes the selected coarse field using Markovian Model-A-type dynamics at the prescribed scale.
Atomistic LLG dynamics includes reversible precession as well as dissipation. At the chosen coarse-graining scale, spatial averaging suppresses incoherent transverse precession, and the SI diagnostics (sections 3B and 4A) show no statistically resolved reversible coupling between the remaining transverse motion and the longitudinal magnetisation . These observations support the dissipative description of the longitudinal dynamics compared here. Conserved fields or systems with appreciable reversible couplings require a different field equation. Eliminating unresolved microscopic variables can produce memory and coloured noise, as described by Mori–Zwanzig theory (15, 49). The ab initio generalised Langevin equation provides a data-driven example in which a force field, memory kernel, and noise model are learned from atomistic trajectories while satisfying the fluctuation–dissipation relation (50). These are worthy avenues to explore in future work.
Beyond these dynamical assumptions, the accuracy of the learned mesoscopic equation also depends on the microscopic trajectories used as reference data. The trajectories studied here are generated from effective spin Hamiltonians rather than first-principles simulations. Machine-learned interatomic potentials could extend this framework to more materials by providing microscopic trajectories with first-principles-informed energies and forces (7, 8, 51). Spin-dependent potentials such as DeepSPIN also provide magnetic torques for spin-lattice dynamics (52). Learning mesoscopic equations from these trajectories could extend simulations of collective magnetic dynamics towards device-relevant spatial scales.
Materials and Methods
Microscopic data generation
Ising–Kac trajectories are generated by heat-bath Glauber dynamics on a periodic lattice with spacing 1/4,096. The Gaussian Kac interaction has range , corresponding to 64 lattice spacings. The reported datasets use zero external field at and , with multiscale Gaussian-random-field initial conditions.
We generate atomistic spin dynamics trajectories for the -like two-dimensional ferromagnet by integrating the stochastic LLG equation with VAMPIRE v7.0.0 (18). Ten independent trajectories of a monolayer are generated at for 250 ps, with configurations saved every 1 ps.
The same VAMPIRE package is used to generate atomistic spin dynamics trajectories for a 51.4 nm CrBr₃ film with one antiferromagnetic stacking fault at its midplane. The 200 × 200 nm² reference film contains approximately 2 × 10⁷ spins. Ten independent zero-field trajectories are generated at T = 50 K for 500 ps, with full spin configurations saved every 2 ps. The SI Appendix (sections 2A, 3A, and 4A) gives the microscopic parameters, integration settings, and initial conditions for all three systems.
Common coarse-graining and learning procedure
The observations at positions are block averages over neighbourhoods containing microscopic sites. For Ising–Kac, a block width of 32 gives and maps the lattice to a array of coarse magnetisations. For the two-dimensional ferromagnet, a block width of 16 gives and maps the lattice to a array. For , the atomistic spin configurations are averaged over nonoverlapping blocks of size , each containing three atomic layers. This procedure produces a array, with .
The reported calculations place the coarse observations on regular arrays and use a unit-spacing piecewise-constant numerical representation. These control regions define the spatial quadrature. They are distinct from the microscopic averaging neighbourhoods that determine .
The observations satisfy . In the training formulas below, denotes these observations arranged by position and field component. The subscript on numerical quantities denotes discretisation on the coarse cells. The energy-density function is represented by a multilayer perceptron, written as when its trainable parameters are explicit. The interaction kernel is represented by trainable coefficients , which act identically on each field component to form the interaction input. Applying the spatial quadrature to (2) gives the numerical free energy . A convolutional neural network with parameters represents the local dependence of the factor kernel : it takes the field values in a neighbourhood of each cell and returns a coefficient matrix for each allowed noise-source offset. Assembling these coefficients gives and the dissipation operator .
Training uses three stages. Stage 1 fits an auxiliary conditional drift by minimising the mean-squared error , where is a finite-difference drift label specified for each system in the SI Appendix, sections 2A and 2D, 3C.1, and 4B.2. At consecutive recorded times and , write and , . Stage 2 fits the factor parameters using the residual increments . Let index the magnetisation components in a group of neighbouring coarse cells. Stage 2 minimises the Gaussian quasi-likelihood
Here is the model covariance of the residual increments indexed by , is the residual restricted to , is the number of scalar field entries indexed by , is its identity matrix, is a numerical covariance floor, and the brackets average over sampled time-window pairs.
After Stage 2, the fitted factor parameters are held fixed. The resulting operator remains state dependent while Stage 3 jointly optimises the free energy and interaction against the observed field changes. Its direct drift loss is
Here i indexes coarse-cell magnetisation components, and denotes the empirical average over sampled entries and increments. The coordinate state divergence and the system-specific sampling and loss normalisations are given in the SI Appendix, sections 1C, 2D, 3C, and 4B.
Ising–Kac implementation
The Ising free energy uses a homogeneous density , the parameterised version of g in the Results, and a symmetric, unit-sum interaction with offsets in a neighbourhood. The scalar factor reads a field patch and acts on noise sources at the nine offsets in a neighbourhood. Its coefficients are even under global spin reversal.
Two-dimensional-ferromagnet implementation
The two-dimensional ferromagnet uses a component-shared unit-sum interaction, a three-component drift network, and a scalar energy-density network. The factor has and assigns a matrix to each offset in . Three circular convolutional layers give a state receptive field, while the noise sources lie in a neighbourhood.
CrBr implementation and equilibrium calculations
The CrBr₃ drift and free energy use independently fitted separable interactions: a unit-sum 7 × 7 in-plane kernel and a symmetric, unnormalised 28 × 28 layer matrix. The layer matrix carries the interlayer coupling strength. The factor acts within each slab and shares its coefficients across slabs; interlayer coupling enters through the free energy. Stage 3 uses the unnormalised direct drift loss. System-specific free-energy formulas, network architectures, sampling, and optimisation settings are given in the SI Appendix, section 4B. Because the training trajectories are generated at zero field, we calibrate the coupling to the applied field after training. We add the Zeeman density and fit from paired opposite-field increments at ±25 and ±50 mT. The fit gives for with T, where is the saturation magnetisation. The learned energy density, interaction kernels, and dissipation operator remain fixed during this calibration.
Multi-fault calculations retain the 28-slab film thickness. We decompose the learned single-fault matrix into a background and a local fault correction, then add translated copies of this correction at the prescribed interfaces. Overlapping contributions are summed, and entries outside the film are omitted. The construction and example matrices are given in the SI Appendix, section 4D. The energy-density network, in-plane kernel, dissipation factor, temperature, and field calibration remain fixed.
Long direct trajectories do not cross all block-alignment sectors on the available simulation time scale. Equilibrium sector weights are therefore computed by bidirectional annealed importance sampling. For each sampled configuration, we evaluate the sign statistic inside (6) and combine its sector averages using the restricted partition-function weights. A transition bracket is formed by two adjacent simulated field values for which the dominant block-alignment sector changes. The first and last brackets locate the two transitions plotted in Figure 4F. Further sampling details are given in the SI Appendix, section 4D.
Simulation timing
For the -like two-dimensional ferromagnet, advancing the system by 1 ps takes 16.2 s with VAMPIRE (17, 18) on 128 CPU cores, and 3.96 ms with DeepMesoD on one NVIDIA L40S GPU. For , advancing the system by 2 ps takes 190.05 s with VAMPIRE (17, 18) on 128 CPU cores, and 4.8 ms with DeepMesoD on the same GPU.
Magneto-photoluminescence (PL) measurements
Magneto-PL measurements were performed in a home-built backscattering microscope integrated with an attocube attoDRY 2100 closed-cycle cryostat operated at 1.7K and equipped with a superconducting magnet providing fields up to 9T. The sample was excited with a continuous-wave 730nm laser at a power of ≈ 50 μW and focused to a spot size of ≈ 1 μm, and the emitted light was collected through the same objective and detected using a spectrometer equipped with a 150 lines/mm grating and a CCD camera. An out-of-plane magnetic field was applied and swept in both directions. Circularly polarised excitation was generated using a quarter-wave plate placed in the excitation path.
Data and code availability
The code is available at https://github.com/MLDS-NUS/DeepMesoD.
Acknowledgments
This work was supported by the National University of Singapore and the AI for Science Institute, Beijing, through the AISI–NUS Joint Research Initiative Fund 2025 Award. This work was also supported by the Ministry of Education (Singapore) through the Research Centre of Excellence program (grant EDUN C-33-18-279-V12, I-FIM).
References
-
A Hubert, R Schäfer, Magnetic domains: the analysis of magnetic microstructures. (Springer Science & Business Media), (1998).
-
S Grebenchuk, et al., Topological spin textures in an insulating van der waals ferromagnet. Adv. Mater. 36, 2311949 (2024).
-
J Zázvorka, et al., Thermal skyrmion diffusion used in a reshuffler device. Nat. Nanotechnol. 14, 658–661 (2019).
-
SM Allen, JW Cahn, A microscopic theory for antiphase boundary motion and its application to antiphase domain coarsening. Acta Metall. 27, 1085–1095 (1979).
-
JW Cahn, JE Hilliard, Free energy of a nonuniform system. i. interfacial free energy. The J. Chem. Phys. 28, 258–267 (1958).
-
W E, Principles of multiscale modeling. (Cambridge University Press), (2011).
-
W Jia, et al., Pushing the limit of molecular dynamics with ab initio accuracy to 100 million atoms with machine learning in SC20: International Conference for High Performance Computing, Networking, Storage and Analysis. (IEEE Press), (2020).
-
Z Guo, et al., Extending the limit of molecular dynamics with ab initio accuracy to 10 billion atoms in Proceedings of the 27th ACM SIGPLAN Symposium on Principles and Practice of Parallel Programming. (ACM), (2022).
-
LD Landau, On the theory of phase transitions. Phys. Z. Sowjetunion 11, 26–35 (1937).
-
LD Landau, EM Lifshitz, Statistical Physics. (Butterworth-Heinemann, Oxford), 3rd edition, (1980).
-
C Kipnis, C Landim, Scaling Limits of Interacting Particle Systems. (Springer), (1999).
-
H Spohn, Large Scale Dynamics of Interacting Particles. (Springer), (1991).
-
E Presutti, Scaling limits in statistical mechanics and microstructures in continuum mechanics. (Springer), (2009).
-
A De Masi, E Orlandi, E Presutti, L Triolo, Glauber evolution with kac potentials. I. mesoscopic and macroscopic limits, interface dynamics. Nonlinearity 7, 633–696 (1994).
-
R Zwanzig, Nonequilibrium Statistical Mechanics. (Oxford University Press), (2001).
-
JGEM Fraaije, et al., The dynamic mean-field density functional method and its application to the mesoscopic dynamics of quenched block copolymer melts. The J. Chem. Phys. 106, 4260–4269 (1997).
-
B Skubic, J Hellsvik, L Nordström, O Eriksson, A method for atomistic spin dynamics simulations: Implementation and examples. J. Physics: Condens. Matter 20, 315203 (2008).
-
RF Evans, et al., Atomistic spin model simulations of magnetic nanomaterials. J. Physics: Condens. Matter 26, 103202 (2014).
-
M Grzeszczyk, et al., Strongly correlated exciton–magnetization system for optical spin pumping in CrBr₃ and CrI₃. Adv. Mater. 35, 2209513 (2023).
-
L Kipczak, et al., Resonant raman scattering of few layers CrBr3. Sci. Reports 14, 7484 (2024).
-
SY Grebenchuk, et al., Correlations in magnetic sub-domains as an unconventional phase diagram for van der waals ferromagnets. Adv. Sci. 12, 2500562 (2025).
-
J Fullerton, et al., Observation of topological chirality switching induced freezing of a skyrmion crystal. Adv. Mater. 38, e13067 (2026) Epub 2025 Oct 28.
-
S Yang, et al., Controlling the 2d magnetism of CrBr3 by van der waals stacking engineering. J. Am. Chem. Soc. 145, 28184–28190 (2023).
-
F Yao, et al., Multiple antiferromagnetic phases and magnetic anisotropy in exfoliated CrBr3 multilayers. Nat. Commun. 14, 4969 (2023).
-
E Ising, Beitrag zur theorie des ferromagnetismus. Zeitschrift für Physik 31, 253–258 (1925).
-
RJ Glauber, Time-dependent statistics of the ising model. J. mathematical physics 4, 294–307 (1963).
-
L Onsager, Reciprocal relations in irreversible processes. i. Phys. Rev. 37, 405 (1931).
-
S Jenkins, et al., Breaking through the mermin-wagner limit in 2d van der waals magnets. Nat. Commun. 13, 6917 (2022).
-
KS Burch, D Mandrus, JG Park, Magnetism in two-dimensional van der waals materials. Nature 563, 47–52 (2018).
-
Z Li, et al., Fourier neural operator for parametric partial differential equations (arXiv:2010.08895) (2020).
-
RM Neal, Annealed importance sampling. Stat. Comput. 11, 125–139 (2001).
-
MR Shirts, E Bair, G Hooker, VS Pande, Equilibrium free energies from nonequilibrium measurements using maximum-likelihood methods. Phys. Rev. Lett. 91, 140601 (2003).
-
L Lu, P Jin, G Pang, Z Zhang, GE Karniadakis, Learning nonlinear operators via DeepONet based on the universal approximation theorem of operators. Nat. Mach. Intell. 3, 218–229 (2021).
-
SL Brunton, JL Proctor, JN Kutz, Discovering governing equations from data by sparse identification of nonlinear dynamical systems. Proc. Natl. Acad. Sci. 113, 3932–3937 (2016).
-
SM Udrescu, M Tegmark, AI feynman: A physics-inspired method for symbolic regression. Sci. Adv. 6, eaay2631 (2020).
-
Z Long, Y Lu, X Ma, B Dong, PDE-net: Learning PDEs from data in International Conference on Machine Learning. (PMLR), pp. 3208–3216 (2018).
-
Z Long, Y Lu, B Dong, PDE-net 2.0: Learning PDEs from data with a numeric-symbolic hybrid deep network. J. Comput. Phys. 399, 108925 (2019).
-
R Supekar, et al., Learning hydrodynamic equations for active matter from particle simulations and experiments. Proc. Natl. Acad. Sci. 120, e2206994120 (2023).
-
F Dietrich, et al., Learning effective stochastic differential equations from microscopic simulations: Linking stochastic numerics to deep learning. Chaos: An Interdiscip. J. Nonlinear Sci. 33, 023121 (2023).
-
H Yu, X Tian, W E, Q Li, OnsagerNet: Learning stable and interpretable dynamics using a generalized Onsager principle. Phys. Rev. Fluids 6, 114402 (2021).
-
X Chen, et al., Constructing custom thermodynamics using deep learning. Nat. Comput. Sci. 4, 66–85 (2024).
-
A Zhu, BW Soh, GA Pavliotis, Q Li, Identifiable learning of dissipative dynamics (arXiv:2510.24160) (2025).
-
M Grmela, HC Öttinger, Dynamics and thermodynamics of complex fluids. i. development of a general formalism. Phys. Rev. E 56, 6620 (1997).
-
Z Zhang, Y Shin, GE Karniadakis, GFINNs: GENERIC formalism informed neural networks for deterministic and stochastic dynamical systems. Philos. Transactions Royal Soc. A: Math. Phys. Eng. Sci. 380, 20210207 (2022).
-
Z Li, A Zhu, Q Li, Hypothesis-driven construction of mesoscopic dynamics (arXiv:2605.16211) (2026).
-
M Chen, P Zhong, Z Zhang, Q Li, Learning ab initio phase-field models (arXiv preprint arXiv:2610.01432) (2026).
-
S Huang, Z He, N Dirr, J Zimmer, C Reina, Statistical-physics-informed neural networks (statpinns): A machine learning strategy for coarse-graining dissipative dynamics. J. Mech. Phys. Solids 194, 105908 (2025).
-
PC Hohenberg, BI Halperin, Theory of dynamic critical phenomena. Rev. Mod. Phys. 49, 435–479 (1977).
-
H Mori, Transport, collective motion, and Brownian motion. Prog. Theor. Phys. 33, 423–455 (1965).
-
P Xie, R Car, W E, Ab initio generalized langevin equation. Proc. Natl. Acad. Sci. 121, e2308668121 (2024).
-
P Friederich, F Häse, J Proppe, A Aspuru-Guzik, Machine-learned potentials for next-generation matter simulations. Nat. Mater. 20, 750–761 (2021).
-
T Yang, et al., Deep learning illuminates spin and lattice interaction in magnetic materials. Phys. Rev. B 110, 064427 (2024).
Supplementary Information
1 Theoretical and methodological details
A Function-space formulation
A.1 Free-energy derivative
We use the field space and the interaction operator defined in the main text. The inner product is . The dual of is identified with through the Riesz representation. The functional derivative therefore satisfies for every perturbation .
Let be the continuously differentiable energy-density function, with denoting its trainable parameters. For , write
We assume that this functional is Fréchet differentiable on the fields considered. With and , its derivative is
Here is the Hilbert-space adjoint. Under the unit-integral convention in the main text,
B Finite-scale stochastic equation
The white noise in the main text is the formal time derivative of a cylindrical Wiener process on . Its components satisfy . Thus the term is interpreted through the Itô integral . For each admissible field , the factor kernel satisfies , so its integral operator is Hilbert–Schmidt.
For the field equation in the main text, let be an orthonormal basis of . If is Fréchet differentiable and the following limit converges in independently of the chosen basis, we define
Here is the derivative in the direction . Along an adapted field trajectory, we assume that is predictable and that for every finite . These conditions make the stochastic integral well defined.
C Finite-coordinate stationary density
Here N is the number of coarse cells and q the number of field components per cell.
The piecewise-constant reconstruction assigns each cell its field value and defines the numerical field space . For the coordinate calculations below, collects the field values by position and component. When evaluating training losses, these coordinates are supplied by the observations z defined in Materials and Methods. Their piecewise-constant reconstruction is . The numerical free energy evaluates the free-energy functional defined in the main text with unit spatial integration weights. These weights give identity mass matrices, so the coordinate gradient represents the free-energy derivative. In another numerical basis, the mass matrices must be included when representing this derivative, the factor adjoint, and the noise covariance.
For numerical efficiency, we represent as piecewise constant on pairs of numerical cells and learn its matrix of coefficients . These coefficients can be shared across spatial offsets where translation symmetry applies. This is a numerical representation of the interaction kernel; a general function of can also be parameterised when needed.
The factor coefficients are numerical coefficients in the state and noise bases. Let be the allowed noise-source offsets, and let denote the field patch of radius centred at cell , where bounds both the state dependence and the noise-source range as in the main text. For a latent vector , the factor acts as
Here indexes field components and indexes noise channels. On a periodic homogeneous domain, the same coefficient network is applied at every position. With fitted parameters, write and . The operator acts on a vector as without forming a dense covariance matrix. Since two field entries can share a noise source, the support of lies in and is bounded by radius .
The corresponding finite-coordinate equation is
where is a standard Np-dimensional Wiener process and
Assume that the finite-coordinate equation is nonexplosive and admits a density satisfying the Fokker–Planck equation. For the complete drift, its probability current reduces to
For , the bracket vanishes. Under normalisability and zero probability flux, this density is stationary. Omitting the state-divergence term leaves an uncancelled derivative of when the dissipation depends on the field.
D Estimation from field increments
The observed increments are .
For a model increment , the orders in the short-time conditional moments follow from the diffusion generator. Write the coordinate equation as
, where is the conditional drift and . For a smooth scalar test function , its generator is
Here and are the coordinate gradient and Hessian, and denotes matrix contraction. For smooth coefficients, the Markov semigroup gives (1). Applying this expansion to gives the conditional mean below. Applying it to gives the raw second moment . Subtracting the outer product of the conditional mean changes only the term. Hence
At the finite sampling interval, these relations define the short-time Gaussian quasi-likelihood used for estimation. Stage 1 estimates the conditional drift from finite differences of the observations, as specified in the system-specific implementation sections below, and gives a residual increment . Stage 2 estimates the dissipation factor from the covariance of . Let index the magnetisation components in a group of neighbouring coarse cells, as does in Materials and Methods. Stage 2 minimises
Here is the principal covariance block of the complete coordinate matrix. The brackets denote an empirical average over the sampled increments and windows. The term , with , is a numerical covariance floor and is not part of the fluctuation–dissipation covariance. The vector is the residual restricted to these components, is the identity on its scalar field entries, and is their number. This covariance block includes all latent noise sources whose factor support reaches the observation window. After Stage 2, the fitted factor parameters are held fixed while Stage 3 jointly optimises the free energy and interaction against the observed field changes. The fitted operator still varies with the field state .
For , , and , Stage 3 uses the direct drift residual
Here i indexes coarse-cell magnetisation components, and averages over the sampled coordinates and increments. The free-energy gradient and the state derivatives in are evaluated by automatic differentiation.
2 Ising–Kac implementation and experiments
A Microscopic dynamics and coarse graining
The microscopic reference is a two-dimensional periodic Ising–Kac model with heat-bath Glauber spin flips. The microscopic index set is , as in the main text, and is the normalised microscopic position of site i. A spin at site i flips with rate
where is the attempt rate and is its interaction field. The local field is
where is the external field and is the normalised lattice weight associated with the displacement . This dynamics satisfies detailed balance with respect to the microscopic Gibbs measure. For a cell containing spins, the coarse observation at is . The main calculations use zero external field and temperatures and , with . They use , mapping a microscopic lattice to a mesoscopic field.
The lattice spacing is 1/4096 in normalised coordinates. The Kac interaction range is , and a block width of 32 gives . The simulator uses adaptive leaping.
At step , the simulator sets , where and is the largest spin-flip rate in the current microscopic configuration. One microscopic configuration is recorded after each -leap step and is subsequently block averaged. The stored times therefore define the nonuniform intervals used to form the forward increments.
Gaussian random field initialisation. We generate two independent mean-zero Gaussian random fields with Gaussian power spectra. Their correlation lengths are 1/16 and 3/512 in the unit-torus coordinates, and they are rescaled to standard deviations 1.5 and 2.0. The initial magnetisation-bias field is
At microscopic position , the initial spin is sampled independently with . The initial coarse field is then obtained by the prescribed block average.
B Independent theoretical references
The hydrodynamic reference is written on the unit torus. Let be the periodic Gaussian Kac kernel with range , normalised by . This continuous kernel is defined by the Fourier coefficients
The simulator evaluates this kernel at the microscopic lattice displacements by Fourier synthesis. The resulting lattice weights have unit sum before the self-interaction coefficient is omitted from the local field. For the heat-bath rate above, the conditional spin drift is
With the time unit chosen so that , this relation gives the reference mean evolution after coarse graining. Under Kac scaling, the interaction range in lattice spacings diverges and each averaging cell contains increasingly many spins ( ), while its diameter is small relative to that range. The lattice interaction converges to convolution with J, and fluctuations of the block averages vanish. The block magnetisation then converges to
The right-hand side is denoted by . The corresponding homogeneous free-energy density is
The entropy terms are continuously extended to using . The reference functional is
For fields uniformly bounded away from , its functional derivative is
The monotonicity of tanh makes the hydrodynamic drift oppose this free-energy derivative, so it can be expressed as with nonnegative reference dissipation. Here is an arbitrary additive constant. The drift and free-energy derivative are hydrodynamic-limit references. The covariance reference below describes fluctuations in finite averaging cells.
At zero field, normalisation of makes a spatially uniform field satisfy . The linear growth rate at is , which changes sign at , or . Equivalently, . This is the critical temperature of the hydrodynamic reference.
C Finite-block covariance reference
Let be the increment of the block average in cell over an infinitesimal interval . A flip of spin changes by . Conditional on the microscopic configuration , the jump-process quadratic variation is therefore
For the nonoverlapping Ising blocks used here, a single spin flip belongs to only one block. Hence for . The noise term in (S1) has coordinate covariance . Equating its diagonal entry with (S2), then conditioning on , gives
This is the finite-block instantaneous covariance reference used in the main-text Ising comparison. It is diagonal in coarse-cell coordinates only in the quadratic-variation limit. Covariances of sampled increments at a finite interval also include correlations induced by deterministic evolution.
At a spatially uniform Kac-limit equilibrium value , the heat-bath identity gives \mathbb{E}[c_i \mid m^*] = (1 - m^*^2)/2. (S3) then reduces to K_{\mathrm{cov}}^{(m)}(m^*) = \beta(1 - m^*^2).
D Ising implementation
Stage 1 conditional drift. For the Ising Stage 1 model, the drift at cell i is represented by a pointwise MLP evaluated on and . Here is an auxiliary learned unit-sum convolution used only in the drift regression. The MLP has three hidden layers of width 128 with Softplus activations. The MLP and are optimised jointly with a batch size of 256 for 2,000 epochs and 500 batches per epoch. Adam starts at for both parameter groups, and both learning rates are halved every 500 epochs. Training samples are balanced over the centre magnetisation and patch mean using 10 bins. The fitted drift is held fixed when forming the residual increments for Stage 2.
Stage 2 dissipation factor. For DeepMesoD in the Ising–Kac system, the factor network is evaluated on a field patch and uses . With periodic distance measured in coordinate spacings, the state patch extends seven cells from its centre and the noise sources extend one cell, so the common bound in the main text is . Its three convolutional layers use dilations 1, 2, and 4, so the centre readout has a effective state receptive field. The first two layers have 32 output channels and tanh activations. The last layer returns nine direction values and one amplitude value. The direction vector is normalised and multiplied by a positive Softplus-transformed amplitude. The resulting factor coefficients are constrained to be even under global spin reversal. One row of couples a neighbourhood. The factor has one latent noise channel, . The Stage 2 quasi-likelihood uses a local observation window.
The Ising finite-range runs use the selected initial portions of three independent trajectories and a patch batch size of 256. Stage 2 starts from a fresh random factor and uses 10 equal bins of the centre magnetisation for state-balanced sampling. The factor is trained for 2,000 epochs and 100 batches per epoch. Adam starts at , and the learning rate is halved every 200 epochs. The covariance floor in the Stage 2 likelihood is .
Stage 3 free energy and interaction. The fitted factor parameters are held fixed during Stage 3, while the operator remains state dependent. The free-energy density and interaction are initialised afresh and optimised jointly against the observed drift. For this reference calculation, , with . The homogeneous density is even under spin reversal. The interaction is represented by a symmetric, unit-sum periodic convolution kernel without an imposed radial form. Its coefficients are averaged between opposite offsets and projected to unit sum before use.
For the numerical magnetisation vector , the free energy and its coordinate derivative are
For a spatially uniform field, the interaction action vanishes. The plotted homogeneous density is up to an additive constant; each displayed curve is shifted by its own minimum.
Stage 3 uses batch size 256 for 400,000 Adam updates. The learning rate starts at and is halved every 40,000 updates. The final update supplies the evaluated model.
The selected initial intervals of three independently generated trajectories are all used for training. Each trajectory supplies 500 recorded time steps at T = 0.75 and 100 at T = 1.5. There is no validation split or validation-based checkpoint selection.
A separately generated initial field is used for evaluation, and three microscopic realisations from that field provide the reference rollout. Three training seeds are evaluated at each temperature.
E Baselines and displayed quantities
The hydrodynamic baseline integrates the nonlocal limiting equation given above. The Allen–Cahn baseline replaces the Kac convolution by its isotropic second-moment expansion. Its coefficients are fixed by and the Kac range. The patch CNN predicts the drift from a field patch without a free-energy or dissipation-operator parametrisation.
For the unit-normalised Kac kernel and , the Allen–Cahn approximation used in the comparison is
The baselines and DeepMesoD are evaluated at the microscopic recording times. The patch CNN is trained on the same trajectories and temperature-dependent intervals as DeepMesoD. It is trained independently for three random seeds, whose mean and population standard deviation are reported.
Let 1 be the coordinate vector whose entries are all one. The dissipation curve in the main figure is
The learned operator and the microscopic finite-block reference are evaluated on the same nonuniform fields and conditioned on the same magnetisation bins. For the instantaneous spin-flip process, distinct cells have zero cross quadratic variation. For the learned finite-range operator, this response contains the on-site entry and the signed sum of all represented off-site entries in the row.
For the interaction plot, the learned interaction coefficients and the continuous Gaussian reference are compared on the same set of offsets. The reference coefficients are obtained by evaluating at , where is the number of coarse coordinates along one side of the unit domain, and normalising the sampled coefficients to unit sum. The displayed curves average coefficients over offsets with the same radial distance. The centre coefficient is omitted without renormalising the remaining coefficients. This averaging is used only for visualisation and does not impose radial symmetry during training.
F Evaluation field rollouts
The rollouts use the models from the main Ising figure and begin from a separately generated coarse field. The microscopic reference is the mean of three independent realisations from this field. The displayed DeepMesoD evolution is deterministic. Its Wiener increment is set to zero, while the state-divergence term remains in the drift. No clipping or field postprocessing is applied.
G Training-horizon and larger-domain evaluations
Figure S3 compares rollout errors across training durations and domain sizes. The first two panels compare models trained with the initial 10% and 50% of the recorded fields in each trajectory. The last two panels evaluate models trained on fields without retraining on larger periodic domains. The mesoscopic cell scale, coarse-graining volume , microscopic lattice spacing, and physical parameters are unchanged. For each setting, the reported quantity is the mean over the full rollout of the spatial field MAE against the corresponding microscopic reference.

Figure S1: Ising field evolution at T = 0.75. The DeepMesoD rollouts are noise-free with the Itô thermal drift retained. Rows show the microscopic reference, the hydrodynamic-limit equation, the Allen–Cahn approximation, the patch CNN, and the final finite-range DeepMesoD model. All methods start from the same evaluation field, and the microscopic reference is the average of three independent realisations initialised from that field. Green column labels mark saved times inside the training duration. Ochre labels mark later rollout times. Every panel uses the display range . Values outside this range in the two late CNN panels appear saturated.
At the fixed coarse-graining scale, the learned model retains comparable rollout errors on the larger periodic domains without retraining. Increasing the training portion from 10% to 50% slightly reduces the DeepMesoD error at T = 0.75 and leaves it nearly unchanged at T = 1.5.
H Spatial structure of the dissipation operator
Spatial coefficient magnitudes. Let be the set of displacements induced by the finite-range factor. Let index the independently trained Stage 2 factors, and write for the coordinate dissipation matrix produced by factor . For each displacement , we calculate the root-mean-square coordinate coefficient
The expectation is the uniform empirical average over the three factor seeds, three independently generated evaluation trajectories, 24 sampled times from each trajectory, and every periodic cell index. At both temperatures, the RMS profile is dominated by the on-site coefficient, while all represented off-site offsets are small on the common colour scale.

Figure S2: Ising field evolution at T = 1.5. The DeepMesoD rollouts are noise-free with the Itô thermal drift retained. Rows show the microscopic reference, the hydrodynamic-limit equation, the Allen–Cahn approximation, the patch CNN, and the final finite-range DeepMesoD model. All methods start from the same evaluation field, and the microscopic reference is the average of three independent realisations initialised from that field. Green column labels mark saved times inside the training duration. Ochre labels mark later rollout times. Every panel uses the display range .
3 Two-dimensional ferromagnet
A Microscopic dynamics and coarse graining
The two-dimensional ferromagnet is simulated by atomistic spin dynamics. The same microscopic dynamical law is used for the layered CrBr₃ system described in the following section. At each magnetic site i, a classical unit spin carries magnetic moment . The general microscopic Hamiltonian is
where denotes the exchange coupling, is the uniaxial anisotropy about the easy axis e, B is the applied field, and is the dipolar interaction. The two systems differ in their lattice geometry and material parameters. In the system, the stacking fault additionally changes the exchange coupling across one interface.
A Training horizon, T = 0.75

B Training horizon, T = 1.5
C Larger domains, T = 0.75

D Larger domains, T = 1.5

Figure S3: Training-horizon and larger-domain diagnostics for the Stage 3 drift fit. The DeepMesoD rollouts are noise-free with the Itô thermal drift retained. The first two panels compare the hydrodynamic-limit equation, the Allen–Cahn approximation, the patch CNN, and DeepMesoD when the initial 10% or 50% of the recorded fields in each training trajectory is used. The last two panels compare the same methods on , , and periodic fields. The models are not retrained for the larger domains, and the mesoscopic cell scale and remain fixed. Bars report the trajectory-averaged spatial MAE. Error bars for the learned models show one population standard deviation across three random seeds.
A
B

Figure S4: Spatial structure of the learned Ising dissipation operator. The plots show , computed from the coordinate realisation on evaluation fields. The RMS statistic reports coefficient magnitude without sign cancellation. The displayed window is the complete coordinate support of . The coefficient network uses a field patch to determine these entries.
Each spin evolves according to the stochastic Landau–Lifshitz–Gilbert equation
Here is the gyromagnetic ratio, is the Gilbert damping, and is a zero-mean thermal field whose covariance is fixed by the microscopic fluctuation–dissipation relation at temperature T. The precessional and damping terms preserve . We integrate this dynamics with VAMPIRE v7.0.0 (2) using the Heun scheme. For either system, the mesoscopic field in a cell containing microscopic spins is the three-component block magnetisation
System and coarse-graining parameters. The two-dimensional reference system specialises the Hamiltonian above to nearest-neighbour ferromagnetic exchange and easy-axis anisotropy,
The parameters are J, J/atom, and , following Ref. (3). The Gilbert damping is , and the applied field is zero. The system is a monolayer at temperature K. The microscopic integration step is 0.1 fs, and the trajectory is sampled at 1 ps intervals. Ten independent trajectories are initialised from random spin configurations and evolved for integration steps (250 ps). Frames from 75 to 150 ps are used to estimate the drift and free energy, the first 150 ps are used to estimate the dissipation, and the 150–250 ps segments of these same trajectories are reserved for later-time evaluation. Nonoverlapping blocks give and map the microscopic lattice to a mesoscopic vector field. Consecutive saved fields provide the 1 ps forward increments used in estimation.
B Assessment of reversible dynamics under coarse graining
In the present work, we restrict attention to the easy-axis magnetisation and represent its coarse-grained evolution by Model-A dynamics. The microscopic stochastic LLG equation also contains reversible precession, so this representation requires that reversible motion make no appreciable contribution to the coarse-grained channel. Our claim is that block averaging suppresses spatially incoherent transverse precession, while any coherent precession that remains is a rotation about the easy axis and hence changes without changing .
To test this claim, we measure four complementary quantities: the transverse angular velocity, antisymmetric cross-correlations between magnetisation components, the dependence of high-frequency transverse spin-wave power on the coarse-graining volume , and the circular polarisation and frequency of the surviving transverse motion. Together, these quantities test both parts of the claim: whether incoherent precession is suppressed by coarse graining and whether the remaining reversible motion couples to .
Reversible rotation in the transverse plane is measured by the domain-sign-weighted angular velocity
Here indexes coarse cells and denotes a temporal average. The domain-sign factor aligns the opposite precessional handedness of up- and down-magnetised domains before averaging.
More generally, we compute the antisymmetric cross-correlations
where is the standard deviation of component a. The in-plane quantity probes transverse rotation, while and test whether reversible motion couples directly to the coarse-grained channel.
To determine how spatial averaging affects incoherent precession, we measure the transverse spin-wave power over a high-frequency band,
and compare across block sizes. This isolates the suppression of spatially incoherent transverse modes by coarse graining.
The handedness and frequency of the transverse motion that remains after coarse graining are characterised by the circularly polarised spectrum
and its power-weighted mean frequency
Together, these quantities distinguish incoherent spin-wave dephasing from coherent rotation and determine whether either contribution produces a reversible component in the coarse-grained dynamics.
Upon spatial coarse-graining, both the high-frequency and relaxational spectral powers decrease approximately inversely with the block volume, indicating that incoherent fluctuations are progressively averaged out. A coherent, single-handed precession about the z axis nevertheless remains identifiable, with a mean frequency of 5.42 GHz, corresponding to an effective field of mT. Importantly, the associated reversible coupling is confined to the transverse plane: is finite, whereas and are statistically consistent with zero. Thus, although transverse spins precess coherently, this motion does not generate a reversible contribution to the longitudinal dynamics, supporting an effective Model-A description of the channel.
C Implementation
C.1 Stage 1: conditional drift
Stage 1 estimates the conditional mean of the coarse-field increments. At cell i, the drift model is
where is a learned circular-convolution kernel. The same spatial kernel is applied componentwise to , , and . Thus, the pointwise input to the MLP is
The MLP has three hidden layers of width 64, with tanh activations, and a three-dimensional output.
For two consecutive saved fields and , let
Model-A validation of the channel — 2D ferromagnet, large damping (VAMPIRE, , ), 10 seeds
(a) incoherent component dephases

(b) coherent precession about z
(c) channel: no reversible motion
Figure S5: Validation of the effective Model-A description for the longitudinal magnetisation in a two-dimensional ferromagnet with large damping. (a) The spectral power in both the high-frequency (100–500 GHz) and relaxational (< 10 GHz) bands decreases with the coarse-graining volume , with fitted exponents -0.95 and -0.81, respectively, close to the scaling expected for incoherent fluctuations. (b) The circularly polarised spectrum reveals a coherent, single-handed precession about the axis, with mean frequency GHz, corresponding to mT. (c) The inferred reversible generator is dominated by , which describes rotation within the transverse plane, while and remain consistent with zero (inset, with error bars denoting SEM). The coherent transverse precession therefore produces no reversible motion in the channel. Results are obtained from VAMPIRE simulations with coarse-graining blocks, , and 10 independent seeds.
The convolution and MLP are trained jointly by the mean-squared error between and . No additional regularisation term is used. Stage 1 is used only to estimate the conditional mean that is subtracted from the increments in Stage 2. Neither its MLP nor its auxiliary kernel enters the final mesoscopic equation.
C.2 Stage 2: dissipation factor
Stage 2 freezes the Stage 1 model and learns a finite-range factor . The dissipation operator is defined by
which makes it symmetric and positive semidefinite by construction. The factor acts on a three-component latent field over the radius-one offset set
Its coordinate action is
A three-layer circular CNN reads the local magnetisation environment and returns one matrix for each of the nine offsets, or coefficients at every cell.
For a displacement d, the corresponding block of the dissipation operator is
where a factor coefficient is zero when its offset lies outside . Because has radius one, has maximum radius two.
The covariance observation window has radius one,
It therefore contains nine cells and scalar field entries. Let be the corresponding principal covariance block of the complete periodic operator. Conditional on , Stage 2 models the short-time increment as
With
the factor is fitted by the full-covariance Gaussian negative log-likelihood
The normalised quadratic residual of the fitted model is
close to the unit value expected when the learned covariance has the correct noise scale.
The learned operator is strongly localised. To quantify its spatial structure, define the distance-binned block magnitude relative to the on-site block by
The measured value is approximately , while the represented couplings at larger distances decrease rapidly to below 0.5%.
C.3 Stage 3: free energy and interaction
Stage 3 freezes the fitted factor , and hence , while jointly learning the free-energy density and the final interaction kernel. The free energy is
Here is a learned circular convolution applied componentwise to the three magnetisation components. It is initialised and trained independently of the auxiliary Stage 1 kernel . The local density , the system-specific energy density corresponding to in the general formulation, is an MLP with three hidden layers of width 64, tanh activations, and one scalar output.
Let , and let and denote derivatives with respect to the local magnetisation and interaction-field inputs, respectively. The thermodynamic force is obtained by differentiating the complete free energy:
Thus, differentiation includes both the direct dependence on and the dependence of neighbouring energy densities on through the convolution.
The conditional drift of the final finite- equation is
Noise-free prediction integrates , retaining the thermal drift while setting the Wiener increment to zero. Writing , its continuous-time energy balance is
Only the first term is necessarily nonpositive. Thus, these predictions are distinct from pure gradient flow, which omits both thermal drift and noise, and from the full stochastic model, which retains both. Neither the noise-free prediction nor the full stochastic model has a general pathwise free-energy descent guarantee.
For an observed rate , define
The quantity is a training residual, not a samplewise physical identity: the observed rate contains stochastic fluctuations and finite-lag error relative to the conditional drift. Stage 3 minimises its normalised mean-square loss
The action of the dissipation operator is evaluated matrix-free as
so the complete matrix is never explicitly assembled.
C.4 Optimisation schedule
The three stages are trained sequentially for 3000, 1000, and 3000 epochs, respectively. Every stage starts with learning rate . The learning rate is decayed by a factor of 0.5 every 300 epochs in Stage 1, every 100 epochs in Stage 2, and every 300 epochs in Stage 3. The Stage 1 checkpoint is frozen for Stage 2, and the fitted Stage 2 factor is frozen for Stage 3. The Stage 1 auxiliary kernel and Stage 3 interaction kernel are initialised and trained independently.
D Evaluation field rollouts
We evaluate the learned dynamics on three qualitatively different initial conditions. The first uses random initial spins and is therefore consistent with the distribution represented in the training trajectories. Following a rapid quench, the system evolves from a highly disordered state with many small domains towards a state dominated by larger domains. Figure S6 illustrates this evolution. The drift and free-energy components are trained using the interval from 75 to 150 ps, while DeepMesoD remains accurate when extrapolated to 250 ps. In contrast, both the FNO and the patch CNN develop substantial errors during the extrapolation interval, with the FNO becoming unstable most rapidly.
The domain-wall initial condition tests whether the learned dynamics preserve a coherent interface over long times. Figure S8 illustrates that DeepMesoD maintains the position and structure of the wall through 1000 ps, whereas the two unstructured baselines progressively diverge from the atomistic reference. The triangular-domain initial condition provides a complementary test of relaxation towards the negative, uniformly magnetised state. As shown in Figure S7, DeepMesoD reproduces the expected contraction of the minority domain and its eventual disappearance, while the FNO and CNN again accumulate large errors during the rollout. Reference-based errors for the triangular-domain initial condition are evaluated only over 0–1000 ps. The main text also shows a rollout to 25,000 ps. Beyond 1000 ps, only numerical stability, boundedness, and qualitative relaxation are assessed because no atomistic reference is available.
Together, these tests cover evolution from a disordered state, persistence of a sharp domain wall, and curvature-driven relaxation to equilibrium. Accuracy comparisons are restricted to intervals with atomistic references. The later segments of the random-initial-state trajectories assess temporal extrapolation, while triangular-domain and domain-wall initial conditions assess geometric-initial-condition extrapolation.
t = 0.075 ns
Data
t = 0.076 ns
DeepMesoD
t = 0.077 ns
FNO
t = 0.078 ns
CNN
t = 0.079 ns

Train Extrapolate
DeepMesoD
FNO
CNN
Time (ns)
MAE
0.1
0.2
0
2.00
1.75
1.50
1.25
1.00
0.75
0.50
0.25
0.00
Figure S6: Random-initial-condition rollout for the two-dimensional ferromagnet. The DeepMesoD rollout is noise-free with the Itô thermal drift retained. Each column shows a saved time, with green labels marking times within the training-data interval and ochre labels marking extrapolated times. Rows show the atomistic reference, the finite-range DeepMesoD model, the Fourier neural operator (FNO), and the patch CNN. The reference is the mean of independent atomistic realisations initialised from the same coarse field. The right-hand panels show the rollout MAE and the corresponding absolute-error fields. All magnetisation fields use the display range .

Figure S7: Triangular-domain rollout for the two-dimensional ferromagnet. The DeepMesoD rollout is noise-free with the Itô thermal drift retained. The triangular minority domain is evolved from the same initial condition by the atomistic reference, DeepMesoD, the FNO, and the patch CNN. Green and ochre labels distinguish times before and after the 150 ps training horizon of the random-initial-state data. Neither colour indicates that triangular-domain data entered training. Comparisons with the atomistic reference are restricted to 0–1000 ps. DeepMesoD reproduces the domain evolution over this reference interval, whereas the unconstrained baselines develop substantially larger errors. The right-hand panels show the rollout MAE and absolute-error fields only where atomistic reference data are available. All magnetisation fields use the display range .
4 CrBr film with a stacking fault
A Microscopic dynamics and coarse graining
The CrBr calculations use the same classical-spin Hamiltonian, stochastic LLG dynamics, VAM-PIRE v7.0.0 Heun integrator, and block-average definition introduced for the two-dimensional ferromagnet above.
CrBr₃ is represented by its magnetic Cr³⁺ sublattice only. Br-mediated superexchange is incorporated into effective exchange constants. The Cr sites form a honeycomb lattice with in-plane hexagonal lattice constant , nearest-neighbour Cr–Cr distance
and a rectangular four-atom unit cell of dimensions . These cells are stacked with an interlayer spacing . Each site has , carries , and has uniaxial anisotropy along the out-of-plane (001) easy axis. The Gilbert damping is .
The exchange parameters are the intralayer nearest-neighbour coupling J, the ferromagnetic bulk interlayer coupling J/atom, and the antiferromagnetic stacking-fault coupling J/atom. The film contains 84 atomic layers, corresponding to a thickness of 51.4 nm, with a single antiferromagnetic stacking fault at the midplane.

Figure S8: Domain-wall rollout for the two-dimensional ferromagnet. The DeepMesoD rollout is noise-free with the Itô thermal drift retained. Time-label colours refer to the random-initial-state training horizon and do not indicate training on domain-wall data. The initial configuration contains a nearly planar domain wall separating oppositely magnetised regions. Rows compare the atomistic reference, DeepMesoD, the FNO, and the patch CNN over the observed and extrapolated time intervals. DeepMesoD maintains the position and morphology of the wall, while the baseline models accumulate larger deviations during extrapolation. The right-hand panels show the rollout MAE and absolute-error fields only where atomistic reference data are available. All magnetisation fields use the display range .
separating two 42-layer blocks. The upper block is shifted in-plane by one nearest-neighbour vector, changing the interlayer bond topology relative to the bulk stacking, and the coupling across this interface is set to . Periodic boundary conditions are imposed in and , with lateral sizes from 200 to 800 nm, while the two surfaces in are open. The reference film contains approximately microscopic spins.
Each trajectory begins from an independently sampled random spin configuration. At , the system is instantaneously quenched to at zero applied field and then integrated for steps with a 2 fs time step, giving a total duration of 500 ps. Ten statistically independent trajectories are generated, using a distinct random seed for both the initial spin configuration and the thermal integrator noise in every trajectory. Full atomic spin configurations and cell-averaged magnetisation fields are saved every 2 ps.
For coarse graining, the Cr moments are averaged over nonoverlapping cells. Each slab spans three atomic layers, and the learning calculation uses . The in-plane cell spacings differ by 7.6%, a geometric anisotropy retained in the learned grid-index kernels. For the reference film, this gives a mesoscopic vector field with 251 saved frames per trajectory. Consecutive fields provide the 2 ps forward increments.
The quantities used to assess reversible motion in follow the definitions introduced in section B for the two-dimensional ferromagnet. The high-frequency transverse power decreases nearly inversely with the block volume, whereas the low-frequency relaxational power is much less sensitive to coarse graining. This contrast shows that block averaging selectively suppresses spatially incoherent precession while retaining the slow collective dynamics. The surviving transverse motion is single-handed and corresponds to coherent precession about the z axis at . The antisymmetric correlation rates and are statistically consistent with zero, while remains finite. These diagnostics support the dissipative description of the longitudinal magnetisation at the chosen coarse-graining scale.
Model-A validation of the channel — CrBr (VAMPIRE, 84 layers, lattice blocks ), 10 seeds
(a) incoherent component dephases

(b) coherent precession about z
(c) channel: no reversible motion
Figure S9: Validation of the effective Model-A description for the longitudinal magnetisation in the layered CrBr film. (a) The normalised high-frequency transverse spectral power (100–250 GHz) decreases with coarse-graining volume with a fitted exponent of -0.86, close to the scaling expected for spatially incoherent fluctuations. In contrast, the low-frequency relaxational power (< 10 GHz) decreases more slowly, with a fitted exponent of -0.26. (b) The circularly polarised spectrum identifies a coherent, single-handed precession about the axis, with mean frequency GHz, corresponding to an effective field mT. (c) The antisymmetric correlation rate is dominated by , which describes rotation in the transverse plane, whereas and are consistent with zero (inset, with error bars denoting SEM). The coherent transverse precession therefore generates no detectable reversible motion in the channel. Results are obtained from VAMPIRE simulations of the 84-layer film using lattice-commensurate blocks with the training coarse-graining volume and 10 independent seeds.
B Implementation
Here m collects the coarse-cell magnetisations, and and denote the corresponding numerical factor and dissipation matrices. The model follows the same three-stage construction as the two-dimensional ferromagnet: Stage 1 estimates the conditional drift, Stage 2 learns the factorised dissipation operator , and Stage 3 learns the free energy and interaction with the fitted factor parameters held fixed. The principal change is the treatment of the third spatial direction. The interaction kernel couples different slabs and can therefore represent surfaces and the stacking fault, whereas the finite-range dissipation factor acts independently within each slab. The working model uses , , and during training. The numerical time unit is ns.
B.1 Factorised three-dimensional interaction kernel
Let index an in-plane coarse cell and let , with , index the coarse slabs. Slab contains atomic layers , , and in one-based numbering. The midplane fault separates atomic layers 42 and 43, hence coarse slabs 14 and 15 in this notation, or slabs 13 and 14 in the zero-based numbering used in the main text. In Stages 1 and 3, the interaction is parametrised as
and is applied componentwise to the three magnetisation components:
The shared in-plane profile uses circular padding in and and is normalised to unit sum. Here is the spatial kernel of the main text, distinct from the antisymmetric correlation rates used above. The layer matrix is symmetric but is not normalised. The full layer matrix allows the learned interaction to vary at the two free surfaces and across the film midplane. Neither the location nor the coupling of the stacking fault is supplied during training. Because the coarse cells have unequal in-plane spacings, all kernels are learned in grid-index coordinates and the resulting geometric anisotropy is absorbed by .
B.2 Stage 1: conditional drift
Stage 1 uses an independently initialised factorised kernel and models the conditional drift as
Since and are fixed in this dataset, they are not included as network inputs. The six input coordinates are . The same MLP is shared over all slabs. It has three hidden layers of width 64, tanh activations, and a three-dimensional output. Thus all explicit layer dependence enters through the learned matrix .
The regression target is the one-frame drift estimate
The convolution and MLP are trained jointly by the mean-squared error between and . Stage 1 is trained on frames , corresponding to 100–500 ps, for 3000 epochs. Adam starts at , and the learning rate is multiplied by 0.8 every 300 epochs. Stage 1 is used only to define the conditional mean of the Stage 2 residual. It does not enter the final mesoscopic equation.
B.3 Stage 2: dissipation factor
Stage 2 freezes the three-dimensional Stage 1 drift and learns the same matrix-valued finite-range factor used for the two-dimensional ferromagnet, but applies it independently to every z slab. With ,
There is therefore no dissipative coupling between distinct slabs: the layer-to-layer dynamics is represented by the free-energy interaction , not by . Within a slab, each of the nine offsets carries a full matrix. A three-layer circular CNN with channels , tanh activations, and an effective state patch predicts the 81 coefficients at each cell. The diagonal entries of the central block are passed through a Softplus map to keep them positive. The complete factor is made even under global spin reversal,
but no fourfold or dihedral in-plane symmetry is imposed, because the lattice-commensurate coarse cells are not square. As in the two-dimensional model, has radius one and has maximum in-plane radius two.
For each sampled slab, the covariance likelihood is evaluated on a in-plane observation window , containing scalar magnetisation entries. The complete latent halo is retained, and
Here contains the rows of indexed by W and all latent columns contributing to those rows.
The factor is fitted with the Gaussian quasi-likelihood in section D, using the frozen Stage 1 drift to form the residual increments. Stage 2 uses all frames and is trained for 1000 epochs with Adam initialised at . The learning rate is halved every 200 epochs. Samples are balanced over . Ten magnitude bins supply 20 batches of 128 patches per epoch. We set the covariance floor in section D to .
B.4 Stage 3: free energy and interaction
Stage 3 holds the fitted factor parameters fixed and learns
The factorised -by- interaction is initialised and trained independently of . The local density network has six inputs , three hidden layers of width 64 with tanh activations, and one scalar output. No explicit layer embedding is used, so interpretable layer dependence is carried by . Here is the numerical free energy for this layered implementation. The second input to is , and the unnormalised layer matrix carries the interlayer coupling strength.
The vector represents the free-energy derivative in the numerical coordinates,
The thermodynamic force is . The derivative is evaluated by automatic differentiation on the complete field, which retains the adjoint contribution from every energy density coupled through .
For every training field, define
The state divergence is evaluated by local Jacobian contraction and is precomputed because the factor parameters are held fixed. Stage 3 minimises the direct residual
The operator action is computed independently in each slab as
without assembling the full dissipation matrix.
Stage 3 uses frames , with stride three for the precomputed state-divergence targets. It is trained for 2000 epochs with Adam initialised at . The learning rate is halved every 400 epochs. Each epoch contains 50 updates with four complete fields per update. The selected increments start every third frame from 100 to 496 ps, giving 67 increments per trajectory, each of duration 2 ps.
B.5 Zeeman calibration
The zero-field training data do not identify the scale of the Zeeman term. It is therefore calibrated after the three-stage fit using
Fitting paired +B and -B increments at 25 and 50 mT gives
for the dimensionless field h, or equivalently a coefficient of when the field is expressed directly in tesla. The fit uses inverse-variance weighting, with statistical uncertainty on .
C Prediction dynamics
The trajectory rollouts integrate the finite- conditional drift with the Itô thermal drift retained and the Wiener increment set to zero.
The equilibrium field responses are computed from sector weights using annealed importance sampling, as described below.
D Inference with multiple stacking faults
The factorised interaction representation also permits inference for films containing more stacking faults than the single fault present in the training trajectories. We retain the original coarse slabs. Let denote the fault interface in the training geometry and let be a prescribed set of interfaces in the same 28-slab film. We form a background matrix by replacing entries near the original fault with the median learned coupling at the same layer separation, estimated from interior entries away from the fault. Both the coupling range and the fault-neighbourhood radius are four resolved slabs. Within this coupling range, an entry is replaced if either layer index lies within four slabs of . All other entries remain unchanged. The fault correction is , and the multi-fault matrix is
Here is zero outside the film's index range. Translated corrections add where they overlap. Placing a single fault at recovers the original learned matrix.
Figure S10 shows matrices containing one, three, five, and seven approximately evenly spaced faults. They are controlled modifications of the geometry-dependent matrix . The local free-energy density , in-plane kernel , dissipation factor , and all network weights remain fixed. Copying the learned fault motif to prescribed interfaces therefore isolates how fault geometry changes the field response within the learned model, without additional microscopic training trajectories.

Figure S10: Construction of multi-fault interlayer kernels at fixed film thickness. From left to right, the learned single-fault structure is used to assemble layer matrices containing 1, 3, 5, and 7 stacking faults. Dashed horizontal and vertical lines mark the prescribed fault interfaces. At every added interface, the local fault correction extracted from the learned single-fault is added to the background matrix defined above. All matrices are displayed on the same normalised colour scale. Only is modified. The film thickness, local free energy, in-plane interaction, dissipation operator, and network weights remain unchanged, and no retraining is performed.
D.1 Equilibrium sector weights from annealed importance sampling
At a fixed dimensionless field , direct trajectories relax within a block-alignment sector but do not visit all sectors with their equilibrium probabilities on the simulated time scale. Each sector specifies the signs of the out-of-plane block magnetisations. Let denote the set of retained block-alignment sectors and let be the configurations in sector . For the field-dependent free energy , which abbreviates of the main text for the prescribed fault geometry, the restricted partition function is
The integrals here are over the numerical field coordinates used in the calculations. For a configuration , the fault-plane statistic is
Here is the number of faults, is the number of cells per plane, and and are the out-of-plane magnetisations immediately above and below fault . Its conditional equilibrium average within sector is
The equilibrium response reported in main-text Fig. 4E is therefore
Intermediate values of can arise from mixed alignments within a fault plane, different alignments among fault planes, or averaging over configurations.


Figure S11: Effect of fault placement at fixed fault number. A. Four interlayer matrices assembled from the learned fault motif, each containing three stacking faults at different prescribed interfaces. The labels give the corresponding block thicknesses in coarse-slab units. B. Equilibrium mean fault-plane correlation as a function of external field for the same four geometries. The field dependence is calculated from the equilibrium sector weights described below. Points below the running maximum of as the field increases are omitted from the displayed switching traces. The complete unfiltered values are retained in the source data. The local free energy, in-plane interaction, dissipation operator, field calibration, and network weights are unchanged.
The ratios of the restricted partition functions are evaluated by bidirectional annealed importance sampling (4). For a bridge with unnormalised densities , normalising constants , and samples propagated by Markov transitions that preserve the successive bridge distributions, the forward importance weight is
The reverse schedule estimates the reciprocal ratio and provides an overlap check between the endpoint work distributions. Forward and reverse work overlap, endpoint sampling diagnostics, and repeated paths are used to assess each field value. These partition-function ratios determine the probabilities in (S7). The annealing index labels the statistical bridge and is not physical time. The longest AIS runs used 736 annealing stages, with four Hamiltonian Monte Carlo updates of 16 leapfrog steps per stage. A transition bracket is formed by two adjacent simulated field values for which the dominant block-alignment sector changes. The midpoints of the first and last brackets give the field coordinates in main-text Fig. 4F, paired with and , respectively.
Supplementary References
-
GA Pavliotis, Stochastic Processes and Applications. (Springer), (2014).
-
RF Evans, et al., Atomistic spin model simulations of magnetic nanomaterials. J. Physics: Condens. Matter 26, 103202 (2014).
-
S Jenkins, et al., Breaking through the mermin-wagner limit in 2d van der waals magnets. Nat. Commun. 13, 6917 (2022).
-
RM Neal, Annealed importance sampling. Stat. Comput. 11, 125–139 (2001).