Tests: Multiferroic BiFeO3. BiFeO3 (BFO) is a room-temperature multiferroic materials. Traditionally, a classic explicit spin-lattice model potential is built to describe the spin-lattice coupling in multiferroic materials such as BFO based on the symmetry of the system . Unfortunately, the choices of the spin-lattice term and related coefficients are not easy to determine. Here, Spin-Allegro is used to build a timereversal and parity invariant magnetic potential for BFO. To build a spin-lattice dataset, 6834 configurations within a 4×4×4 supercell BFO are calculated. Each structure contains 64 Fe atoms and structures are randomly sampled from several molecular dynamics, and their energies are computed with density functional theory with different initial magnetization configurations (see Methods in SM). 5000 data are used for training, the left is for validating. Both energies and forces are provided as the target and are used in the loss function. Spin-Allegro performs well on this dataset, achieving high accuracy with MAE as 0.402 meV/site on the energy and 32.6 meV/Å on the force.