arXiv:2610.35617cs.LGOct 2026

Manuscript Offprint

arXiv:2610.35617

Distilling neural networks into equations to predict planetary instability

Simon Alford, Edward Gu, Omar Costilla-Reyes, Dan Tamayo, Miles Cranmer, Kevin Ellis

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Abstract

The problem of predicting when a multi-planet system will become dynamically unstable has defied analytical progress over the past three hundred years. Recent machine learning advances achieve high predictive performance of instability dynamics, but as black-box systems cannot be interpreted to connect to existing scientific understanding. Here we show analytic equations that predict when a multi-planet system will undergo instability. We discover these equations by first training a neural network on a dataset of N-body simulations, and then distilling its latent knowledge into closed-form algebraic expressions. Our two-stage pipeline first learns an interpretable variable basis, then searches for equations using symbolic regression. The resulting equations outperform existing analytic estimates of instability and apply across wide ranges of mass ratios, spacing, and orbital eccentricities. They capture structure in the prediction landscape with a small number of variables amenable to dynamical interpretation. These results demonstrate how symbolic learning can be combined with neural networks to extract scientific insight from complex dynamical systems.

For 300 years, mathematicians and physicists have studied the problem of predicting N-body dynamics for N≥3N \geq 3 (Musielak and Quarles, 2017), analytically solving special cases (Laplace, 1805) and using suites of numerical integrations to find predictors of instability time, the time until close encounters between planets which lead to collisions or ejections (Chambers et al., 1996; Marzari and Weidenschilling, 2002; Obertas et al., 2017; Smith and Lissauer, 2009). Understanding how instability times vary with planetary systems' masses and orbital parameters is important because it determines the subset of configurations that can survive to the present day and be observable. This helps rule out planetary arrangements that would rapidly become unstable, improving constraints on the more than 1,000 planetary systems known around other stars, and sheds light on how planetary systems evolve over billions of years (Tamayo et al., 2021).

The best predictor of N-body instability times uses black-box machine learning methods trained to predict from short ( ∼104\sim 10^{4} orbits) simulations (Cranmer et al., 2021; Tamayo et al., 2020; Thadhani et al., 2025)—surpassing human-derived analytic predictions (Petit et al., 2020; Quillen, 2011), but yielding little physical knowledge. We discover new analytic approximations to this long-standing problem by designing a method for distilling black-box neural network predictors into interpretable equations. Our method uncovers new physical knowledge and improves upon the best human-derived analytic approximations. Evaluating our equations is faster than both neural net inference and direct N-body simulation.

Discovering an equation involves two stages: identifying a basis of relevant variables, and synthesizing an equation that relates them. Past work, such as symbolic regression, discovers equations only after the relevant variables have been identified (Cranmer, 2023; La Cava et al., 2021; Schmidt and Lipson, 2009; Udrescu and Tegmark, 2020) (see also Appendix F). But identifying the basic inventory of variables—the equation’s vocabulary—is arguably more important, because it defines a frame that can cut across multiple equations. To jointly discover these two pieces—the basic variables and the equation relating them—we train a two-stage neural network which first constructs a basis set of variables, and then uses those variables to predict instability time. We then interpret both stages of the neural network to recover an equation and its basis variables.

Our findings embody two hallmarks of scientific discovery: the discovered equations generalize beyond the observations from which they were originally derived, and they implement new physical knowledge that can be understood by human scientists. Concretely, our equations extrapolate to planetary systems with more bodies and longer instability timescales than were seen during training, and in consultation with subject-matter experts in celestial mechanics (two of the authors), we derive new physical insight. Beyond astronomy, our techniques—breaking a neural net into pieces for divide-and-conquer interpretation, and joint discovery of equations and their constituent variables—can also apply more broadly, and we will conclude by discussing how these methods might hold value in other sciences.

A. Dataset of compact planetary system simulations

Figure

System goes unstable at distant time T

B. Two-stage neural network predicts instability

C. Sparse linear feature identification

(i) Train with L1L_{1} regularization

(ii) Prune weights

(iii) Freeze ϕ\phi, fine tune ψ\psi

Latent features

Figure

Figure

Figure

Latent features

f1=3.1x1+12.2x5f_{1}=3.1x_{1}+12.2x_{5}

fN=−30x2−5.5x5f_{N}=-30x_{2}-5.5x_{5}

D. Neural distillation via symbolic regression

Figure

Symbolic regression

via evolutionary search

Distilled equation

log⁡10Tinst=−μ2+3.6σ40.16\log_{10}T_{\text{inst}} = -\mu_2 + \frac{3.6}{\sigma_4^{0.16}}

Figure 1: Predicting planetary instability. (A) Planetary systems evolve chaotically and can eventually undergo instability, such as a collision or ejection. (B) We train a two-stage neural network, consisting of a feature extractor and prediction network, on a dataset of N-body integrations, and distill it into equations via two steps. (C) First, we distill a sparse linear feature space via regularization, pruning, and fine-tuning. (D) Second, we run symbolic regression to distill the predictor network into equations.

Method

We discover models that predict the time to instability TinstT_{inst} of a compact planetary system given an initial configuration x. We learn our models from 113,543 N-body integrations of compact 3-planet systems previously used to train machine learning models (Cranmer et al., 2021; Tamayo et al., 2020).

Instability times vary by orders of magnitude near integer ratios of planets’ orbital periods, known as mean-motion resonances (MMRs), so the dataset focuses on resonant systems, with each system initialized with two of the three planets in or near a strong MMR. We express instability time in dimensionless form, Tinst=tinst/P1T_{\text{inst}} = t_{\text{inst}} / P_1, where tinstt_{\text{inst}} is the original instability time and P1P_1 is the initial orbital period of the innermost planet. Each system was numerically integrated until an instability occurred (two planets coming within the sum of their Hill radii), up to Tinst=109T_{\text{inst}} = 10^9.

Our equations are distilled from a neural network trained to predict instability with a bottleneck layer that exposes an interpretable yet learned feature space (Fig. 1). Past interpretability work has employed sparse bottlenecks (Brunton et al., 2016; Huben et al., 2024) and distillation via symbolic regression (Cranmer et al., 2020; Udrescu and Tegmark, 2020), combined here as follows. Given an initial configuration x, both the neural network and our distilled equations calculate a new feature basis ϕ(x)\phi(x) from a short numerical integration over 10410^4 inner orbits, similar to Cranmer et al. (2021). Concretely, a human-designed encoding of the planetary system γ(x)\gamma(x) is taken, comprising orbital elements of each planet (see Appendix A.1). Next, a learned matrix W maps γ(x)\gamma(x) into an N-dimensional vector, Wγ(x)W\gamma(x). Following prior works, which predict instability using summary statistics of human-derived metrics (Tamayo et al., 2020), we take the mean and standard deviation of Wγ(x)W\gamma(x) over the numerical integration to form a feature basis ϕ(x)\phi(x) of size 2N. Last, these features are input to a model ψ\psi that outputs the mean and variance of a log-normal distribution:

ϕ(x)[0:N]=Ex′∼NumIntegrate(x)[Wγ(x′)],(1)\phi(x)_{[0:N]}=\mathbb{E}_{x^{\prime}\sim\mathrm{N u m I n t e g r a t e}(x)}\left[W\gamma(x^{\prime})\right], \tag{1} ϕ(x)[N:2N]=Stdx′∼NumIntegrate(x)[Wγ(x′)],(2)\phi(x)_{[N:2N]}=\mathbf{S t d}_{x^{\prime}\sim\mathrm{N u m I n t e g r a t e}(x)}\left[W\gamma(x^{\prime})\right], \tag{2} (μ,σ2)=ψ(ϕ(x)),(3)\left(\mu,\sigma^{2}\right)=\psi\left(\phi(x)\right), \tag{3} p(Tinst∣x)=LogNormal(Tinst;μ,σ2).(4)p(T_{inst}\mid x)=LogNormal\left(T_{inst};\mu,\sigma^{2}\right). \tag{4}

A sparse W and symbolic ψ\psi yield an interpretable model. We sparsify W with L1L_1 regularization and pruning (setting all but the top k=2k = 2 weights per feature to zero). To discover a symbolic ψ\psi, we use symbolic regression (La Cava et al., 2021; Schmidt and Lipson, 2009; Udrescu and Tegmark, 2020), specifically PySR (Cranmer, 2023), to find equations that predict the mean of the neural network's output. The predicted standard deviation, while useful for training, is not distilled.

References (75)