Extrapolating the emergence of Hamiltonian chaos with random-feature Hamiltonian neural networks
Abstract
Machine learning of Hamiltonian dynamics has driven growing interest in Hamiltonian neural networks (HNNs), which encode Hamilton’s equations of motion into the learning architecture. Despite this progress, it remains unknown whether such networks can predict dynamical regimes absent from their training data, in particular the broad chaotic sea that emerges beyond the observed parameter interval. We address this question using a parameter-aware random-feature Hamiltonian neural network (RF-HNN). Trained using data from only a small number of control-parameter values at which invariant tori dominate, the RF-HNN predicts autonomous long-time dynamics at unseen parameter values where mixed phase space develops and chaotic regions expand, with no data from that regime used in training or model selection. The method is demonstrated across four two-degree-of-freedom Hamiltonian families, including the Hénon–Heiles system. Using Poincaré-section geometry and finite-time Lyapunov exponents, we show that the RF-HNN reproduces the breakup of regular structures and the emergence and growth of chaotic regions, whereas conventionally trained HNNs with the same Hamiltonian structure remain too regular. These results show that what decides parameter extrapolation is not Hamiltonian structure alone but how the fitted Hamiltonian continues in the control parameter. To our knowledge, this is the first demonstration that a learned Hamiltonian can qualitatively extrapolate from predominantly regular dynamics into a broad chaotic sea absent from training.
I Introduction
Near-integrable Hamiltonian systems exhibit one of the most thoroughly studied routes to chaos in nonlinear dynamics. As a perturbation or control parameter grows, Kolmogorov–Arnold–Moser (KAM) tori are progressively destroyed, resonance layers widen and overlap, and an initially thin chaotic layer grows into a sea that dominates the energy shell [7, 22]. The resulting mixed phase space, in which islands of regular motion coexist with chaotic regions, is generic for conservative systems ranging from galactic potentials to molecular vibrations [14, 2, 21]. On a Poincaré section, the progression appears as the gradual breakup of invariant curves and the spread of scattered points over the accessible area, as exemplified by the Hénon–Heiles system [14]. A one-parameter family of Hamiltonians therefore spans the full range of behavior from predominantly regular to strongly chaotic motion.
Reconstructing such dynamics from data becomes necessary when the governing Hamiltonian is not known in explicit form. Conventional neural networks handle this task poorly, as a model trained directly on trajectory data does not inherit the conservation laws of the underlying flow, and its long-time predictions acquire spurious dissipation or energy drift even when training data are abundant [12]. Hamiltonian neural networks (HNNs) address this failure by representing a scalar function and obtaining the vector field from Hamilton’s equations, so that the learned flow conserves the learned energy and phase-space volume by construction [12]. Symplectic architectures take a complementary route and learn the discrete-time flow map itself, either by composing elementary symplectic modules or through parameterizations that are symplectic by construction [17, 6]. Structure-preserving models of this kind have delivered stable long-time predictions for systems ranging from simple oscillators to many-body problems and have conserved energy over horizons where conventional networks drift [12, 17, 6]. Trained across the order-to-chaos transition of the Hénon–Heiles system, HNNs also reproduce both regular and chaotic behavior, at conditions covered by the training data [10]. The generalization has been pushed even further by adaptable HNNs, which take the control parameter as an additional input and have reconstructed the Hamiltonian dynamics of a family at control values absent from the training set [13]. In these demonstrations, however, the training data already contained chaotic orbits, so predictions at new control values, including values outside the training set, reproduced dynamical regimes that were represented in training rather than a qualitatively new one.
Extrapolation beyond the training range is a far more demanding task [11], but a series of recent results in reservoir computing has shown that learned models can cross dynamical regimes [18, 20, 8]. In this approach, a fixed, randomly generated recurrent network is driven by the observed time series, and its internal states serve as random features on which only a linear readout is trained [15, 9]. Parameter-aware reservoir computers that receive the control as an additional input have reconstructed attractors at controls not sampled in training [18], predicted critical transitions and system collapse from pre-transition data [20, 24], and extrapolated tipping points of non-stationary systems when internal hyperparameters such as the spectral radius are optimized [19]. Regime-crossing results continue to accumulate in other settings: parameter-dependent neural ordinary differential equations extrapolate across bifurcations of dissipative systems [28], and an evolution-operator emulator trained only on chaotic dynamics predicts an unseen laminar regime [27]. Extrapolation of Hamiltonian dynamics, however, remains largely unexplored. Reservoir computing has been applied to Hamiltonian systems, reconstructing KAM diagrams from trajectories recorded at a few parameter labels [29]. In the mixed-regime demonstrations, however, chaotic motions were part of the training data, and the authors note that quasi-periodic training motions alone do not suffice to replicate the chaotic dynamics. The framework also offers no mechanism that enforces Hamiltonian structure by construction. Yet the random-feature strategy underlying reservoir computing is not tied to recurrent networks. Random-feature Hamiltonian models replace the reservoir with a static set of nonlinear features, drawn at random or sampled from data, and use the readout to represent the Hamiltonian itself, so that the fit reduces to a ridge regression solved in closed form [16, 5, 26, 25]. Models of this type retain the conservation structure of an HNN while avoiding back-propagation entirely, and for a single training system, data-driven sampling schemes such as SWIM have reached accuracies comparable to those of back-propagated networks at a fraction of the training cost [5, 26, 25].
| Family | Training controls | Interpolation controls | Extrapolation controls | ||
|---|---|---|---|---|---|
| Linear- Hénon–Heiles | 0.13 | — | 0.05 | ||
| Bounded Hénon–Heiles | 0.16 | 0.05 | |||
| Confined Barbanis-type | 0.18 | — | 0.04 | ||
| Bilinear Morse pair | 0.18 | — | 0.05 |
In this study, we apply this random-feature construction to the extrapolation of a Hamiltonian transition. Instead of drawing the features once and using them as given, we optimize internal hyperparameters such as the feature scales, as in reservoir computing, and the fast training provided by the single closed-form ridge fit is what makes this optimization affordable. We show that the resulting parameter-aware random-feature HNN (RF-HNN; Fig. 1), trained only at control values where regular motion dominates, extrapolates the emergence of widespread chaos beyond the training range. The extrapolation regime contributes nothing to training or model selection, and the test is carried out on four two-degree-of-freedom families, namely two Hénon–Heiles families, a confined Barbanis-type model, and a bilinearly coupled Morse pair [14, 2, 23], against conventionally trained parameter-aware HNNs [12, 13], both as a single network and as a 20-network ensemble. Because every model in the comparison is Hamiltonian by construction, differences in the extrapolated dynamics can be attributed to the fitted continuation in the control rather than to the presence of conservation structure. In all four families, the RF-HNN tracks the growth of the chaotic sea quantitatively, whereas the conventionally trained models, including the ensemble, fail to track that growth and remain too regular at the largest extrapolation controls. To our knowledge, no learned Hamiltonian has previously crossed this transition from a regular-dominated training regime, and the comparison identifies parameter continuation, rather than conservation structure alone, as the decisive factor.
II The regular-to-chaotic extrapolation task
We consider one-parameter families of two-degree-of-freedom Hamiltonians with , in which increasing the control drives the standard near-integrable route to chaos. We write when the control appears as an explicit argument. Along this route, invariant tori break up, resonance layers overlap, and a chaotic sea spreads over the energy shell. Figure 1(a) illustrates the extrapolation problem posed in this work for the canonical Hénon–Heiles family of Sec. II.1. At the observed control, the Poincaré section is organized by invariant curves and the orbit-wise finite-time Lyapunov exponents remain uniformly small. At the unseen target control, the same sampling yields a section dominated by a chaotic sea. The parameter axis beneath the sections summarizes the data constraints of the task. The learner receives vector-field samples , where is the canonical symplectic matrix, on a fixed energy shell , drawn only at the filled training controls, at which the section dynamics is dominated by invariant tori. Model selection, including all hyperparameter tuning, is likewise restricted to controls at or inside the training interval. The trained model is then integrated autonomously at the open test control, which lies strictly above the training interval and at which the true family develops a broad mixed phase space. Success is judged not by short-time trajectory error but by the long-time dynamical content of the learned flow, namely the occupied area and geometry of its Poincaré sections and its orbit-wise finite-time Lyapunov exponents, compared with truth by identical procedures (Secs. III.1 and III.2). No data from the extrapolation regime are used for training or model selection at any stage.
The two panels of Fig. 1(a) make clear that this task differs from interpolation in kind rather than in degree. Within the training interval, a faithful model needs only to connect regular behavior of the kind it has already observed. Beyond this interval, it must produce a qualitatively new form of long-time behavior from a fitted Hamiltonian whose continuation in was never supervised. This is the transition from the left panel of Fig. 1(a) to the right. Every model considered below is Hamiltonian by construction, but nothing in that constraint determines how the fitted Hamiltonian behaves at controls beyond the training interval. A model can conserve its learned energy exactly and still predict regular motion where the true family has become chaotic.
We instantiate the task on four families, summarized in Table 1. Two Hénon–Heiles families carry the principal claims, and two auxiliary families test whether the results generalize. We report a dedicated interpolation test for the bounded family. Every control designated for extrapolation lies strictly above its family’s training interval.
II.1 Canonical Hénon–Heiles family
The canonical family is
| (1) | ||||
where recovers the standard Hénon–Heiles Hamiltonian [14]. We fix and vary . Rescaling maps the family at energy onto the standard system at energy , so raising is equivalent to raising the energy of the standard system. Training uses , for which the Poincaré section is still dominated by invariant curves, and extrapolation extends to , at which the true section develops a broad chaotic component. The escape channels of the potential open at . At the shell energy still lies below this threshold, but the margin is small and closes near , so the canonical potential does not admit a substantially deeper bounded extrapolation. Going beyond this limit requires modifying the potential itself, which is the step taken in Sec. II.2.
II.2 Bounded nonlinear-control family
The more demanding test is
| (2) | ||||
with and . Training controls are and extrapolation reaches . The two modifications play distinct roles. The square on tests nonlinear parameter continuation. For any fixed control it only reparameterizes the cubic coefficient, but the network receives rather than and must continue this dependence from data. The quartic term genuinely changes the Hamiltonian and confines the motion, converting escape into bounded chaotic transport and thereby permitting an extrapolation deeper into the chaotic regime than Eq. (1) allows. We accordingly use Eq. (2) as a controlled, more demanding Hénon–Heiles-type test rather than as a claim about the standard system.
The two auxiliary families, a quartically confined Barbanis-type model and a bilinearly coupled Morse pair, are defined in Appendix A and are used only in Sec. IV.4, which tests whether the extrapolation generalizes across Hamiltonians. Across all four families we describe the training regimes as predominantly regular rather than strictly regular. None of the training sections contains a broad chaotic sea, although at the upper training controls of the two Hénon–Heiles families a minority of sampled orbits shows mildly elevated finite-time instability.
III Models and numerical protocol
Let denote the control parameter of a given family. Our model, the parameter-aware RF-HNN shown in Fig. 1(b), represents the Hamiltonian of the family as
| (3) | ||||
where is an elementwise activation function and the state weights , the control weights , the second-layer matrix , and the biases and are sampled once and kept fixed. Only the readout is trained. For a training state with target field ,
| (4) |
with the feature Jacobian evaluated in closed form through the fixed layers, and stacking the and reduces the fit to a ridge regression,
| (5) |
with regularization parameter . For fixed features and hyperparameters, the readout fit is a convex least-squares problem, and Eq. (5) is its unique solution, with no iterative optimization involved. Hamiltonian values are not required for training, and the additive constant of left undetermined by field matching does not affect the vector field. Hamilton’s equations applied to then define the autonomous flow used for all rollouts and diagnostics.
The scales of the random features act as internal hyperparameters and, as in reservoir computing, are optimized rather than fixed in advance. The state weights and control weights are independent standard normal draws multiplied by and , respectively. The second-layer matrix is a standard normal draw multiplied by , where is the common width of the two feature layers. The factor offsets the -term sums in , so that sets the second-layer scale independently of the width. Every bias component is drawn independently and uniformly from . For each of the three candidate activations (, , and ), 100 Bayesian-optimization trials independently optimize , , , , and the regularization parameter [1]. Each trial fits the readout at a designated subset of the training controls and is scored by the root-mean-square error (RMSE) of the predicted vector field on an independently sampled shell at one validation control inside the training interval. The activation and all remaining hyperparameters are then selected by that validation RMSE. No extrapolation control is used in model selection. Because each trial costs only one closed-form ridge fit, the 300 trials per family remain affordable. After selection, the readout is refitted at all training controls using 8000 independently sampled shell states per control, and reported results average three random-feature seeds. Full details of the search and the selected configurations are given in Appendix B.
Training states are sampled independently rather than extracted from trajectories. We draw uniformly from a family-specific rectangular proposal box and reject any point with potential energy , for which the shell leaves no kinetic energy. At each accepted point, the remaining energy fixes the momentum magnitude and leaves only its direction free: an angle drawn uniformly on gives , which places the state on the designated energy shell. Appendix A gives the proposal boxes.
For comparison, we train a conventional HNN in which every weight is trained end to end by back-propagation on all training controls, hereafter the MLP-HNN: two hidden layers of width 200 map to a scalar , following the standard parameter-aware design [12, 13]. The baseline receives the same field-matching objective and states from the same designated energy shell as the RF-HNN, and its architecture and training budget are fixed without consulting any extrapolation control. We evaluate both single networks and a 20-network ensemble, whose prediction is the gradient of the mean of the learned Hamiltonians. This is a controlled comparison of fitting methods on data drawn from the same shells and controls. The training details are given in Appendix A.
III.1 Poincaré diagnostics
At every control, 28 initial conditions are sampled from the section , on the true energy shell and then shared by truth and all learned models. Section crossings are linearly interpolated to . We retain exactly 50 crossings per orbit. The one exception is the confined Barbanis-type potential, where the broken symmetry makes some orbits cross the section several times more often than others. There we retain 20 crossings, which keeps the sample balanced across orbits. Every trajectory evaluated in the main comparison reaches its target count and none escapes.
The Poincaré sections displayed in the figures use a denser, visualization-only cloud: the first 12 of the same 28 initial conditions, integrated to 200 crossings per orbit so that invariant curves appear continuous at print size. All reported statistics use the 28-orbit sample above.
We use two complementary section metrics. First, the occupancy, a coarse-grained measure of the occupied section area, is the mean number of cells visited by one orbit on a fixed family-specific grid, with the grid ranges given in Appendix A. Its absolute scale should not be compared between families, whereas model–truth errors within one family are meaningful. Second, we pool the section crossings of all 28 orbits into a model cloud and a truth cloud . The symmetric Chamfer distance [3], the sum of the two directed mean nearest-neighbor distances between the clouds, is
| (6) |
Occupancy measures the two-dimensional area covered on the section and is bounded above by the retained crossing count per orbit, while detects displacement or deformation of the section geometry.
III.2 Finite-time Lyapunov exponents
Orbit-wise finite-time largest Lyapunov exponents are computed with the standard two-trajectory Benettin procedure [4], in which a companion orbit, displaced from the reference orbit by , is advanced alongside it and the separation is renormalized to after every integration step of size (Table 1). The exponent is the time-averaged logarithmic growth rate of this separation,
| (7) |
with unless noted. Truth and every learned field use the same initial conditions and perturbation directions. We retain as a continuous finite-time diagnostic and do not turn it into a fixed-threshold chaos label. Chaotic motion is identified by elevated together with the section geometry.
IV Extrapolating the emergence of chaos
We first test the canonical family, whose potential is unmodified, and then follow the transition deeper in the bounded family, whose confining wall permits extrapolation beyond the escape limit of the canonical potential. Section IV.4 then extends the comparison to all four families. All reported occupancy, Chamfer, and Lyapunov statistics are computed from the 28-orbit sample of Sec. III.1. Truth and every model are advanced by the same classical fourth-order Runge–Kutta implementation with the family time steps of Table 1, so that model-specific time steppers cannot confound the comparison and the finite-step integration error is common to all flows.
IV.1 The canonical family
Figure 2 tracks a single section initial condition across the canonical potential of Eq. (1). At the training control and at , truth and the RF-HNN trace the same regular three-lobed geometry. At the same orbit turns chaotic, and the learned flow reproduces this qualitative change, wandering irregularly over the same three-lobed region as truth, even though neither extrapolation control was used for training or model selection. Already at the level of a single orbit, the learned Hamiltonian therefore continues the family in the control rather than reproducing a frozen copy of the training flows.
The section statistics support the visual agreement [Fig. 3(a); ensemble curves in Fig. 7]. At the RF-HNN matches the true occupancy to within about one cell (38.35 versus 37.64), while the single MLP-HNN and the 20-network ensemble underoccupy the section at 26.13 and 25.00 cells. The finite-time exponents show the same split: 0.100 for the RF-HNN against 0.095 for truth, but 0.025 and 0.024 for the baselines, values that barely exceed their training-interval level. The baselines, in other words, prolong the nearly regular dynamics of the training interval, while the RF-HNN predicts the new instability. The sections in Fig. 3(b) show the same picture. At , the true section and the RF-HNN fill a broad chaotic component, while the MLP-HNN leaves substantially more of the sampled phase space on coherent structures. A broad chaotic component of this kind appears in no training section, so reproducing it is precisely what the task of Sec. II demands. The canonical test, however, ends while the phase space is still mixed, with moderate finite-time instability, because the shell energy reaches the escape threshold near (Sec. II.1). The bounded family carries the transition through to a fully developed chaotic sea (Secs. IV.2 and IV.3).
IV.2 The bounded family within the training interval
We now turn to the bounded family of Eq. (2) and first verify that a single parameter-aware fit connects the sampled regular shells. Across the interpolation controls of the bounded family, the RF-HNN occupancy mean absolute error is 0.091 cells and the mean section Chamfer distance is , both at the same small scale as at the training controls (Fig. 4). This check is not itself evidence of chaos prediction. It establishes instead that the extrapolation examined next starts from a faithful fit of the regular family, not from a model that already fails inside the training interval. The corresponding sections at the interpolation controls are shown in Appendix D (Fig. 6).
IV.3 The bounded family beyond the training interval
Beyond the last training control , the occupied section area of the true family changes little through and then grows rapidly [Fig. 5(a)]. Neither the location of this onset nor the rate of the subsequent growth is supervised, so the flat-then-rising shape is itself a sharp prediction target. The RF-HNN tracks this transition quantitatively. At , truth and the RF-HNN occupy 34.96 and 36.29 cells and yield and 0.125. At , their occupancies are 43.86 and 44.06, and their exponents are 0.263 and 0.271. The mean RF-HNN occupancy error over all three extrapolation controls is 0.62 cells.
The sections in Fig. 5(b), where each orbit carries its own finite-time exponent, show that the agreement extends beyond the summary statistics in (a). At , the learned flow retains the same visible regular structures as truth. At , it reproduces the broadened mixed section, and at it fills the same bounded chaotic region as truth. The RF-HNN thus continues the family of invariant structures beyond the training interval and reproduces both the onset and the growth of the chaotic sea, without any data from this regime. The agreement also demonstrates the nonlinear parameter continuation that the family was designed to test (Sec. II.2), since the network receives while the underlying Hamiltonian depends on .
IV.4 Generalization across Hamiltonians
Table 2 extends the test to all four families. The RF-HNN has the smallest mean occupancy error in every family and the smallest mean extrapolation Chamfer distance (Appendix E), and at the largest extrapolation control its finite-time exponent is within about 8% of truth in all four systems. The full control-dependent curves and error bars are shown in Appendix E.
| (cells) | ||||||||
|---|---|---|---|---|---|---|---|---|
| Family | RF-HNN | Single | Ensemble | Truth | RF-HNN | Single | Ensemble | |
| Linear- Hénon–Heiles | 0.30 | 4.32 | 4.60 | 1.10 | 0.095 | 0.100 | 0.025 | 0.024 |
| Bounded Hénon–Heiles | 0.62 | 7.18 | 10.02 | 1.50 | 0.263 | 0.271 | 0.066 | 0.057 |
| Confined Barbanis-type | 0.20 | 1.79 | 2.16 | 1.60 | 0.063 | 0.067 | 0.032 | 0.031 |
| Bilinear Morse pair | 0.19 | 1.29 | 1.29 | 1.10 | 0.172 | 0.168 | 0.102 | 0.106 |
The same table shows that this extrapolation does not follow from Hamiltonian structure alone. The MLP-HNN, trained on the same shells with the same objective, remains a valid Hamiltonian model and stays regular on the training tori, yet its extrapolated flows remain too regular once the true chaotic component expands. At the largest extrapolation control of the bounded family, the single MLP-HNN and the 20-network ensemble occupy 32.55 and 26.86 cells against 43.86 for truth, with exponents 0.066 and 0.057 against 0.263. The failure is visible in Fig. 5(b). At the single network’s section (middle row) retains torus-like invariant curves with uniformly low exponents where the true section is already a broad mixed sea, and at it spreads over more of the section while its exponents remain far below truth. The ensemble does not repair this deficit. Its mean occupancy error matches or exceeds the single MLP-HNN’s in all four families. Averaging suppresses member-to-member variance, but the extrapolated Hamiltonians share a bias toward sections that are too regular.
V Discussion
The main result of this study is that a parameter-aware RF-HNN can extrapolate the emergence of a broad chaotic regime from data dominated by regular motion. No data from the extrapolation regime enter training or model selection, yet the learned Hamiltonian reproduces the breakup of invariant structures and the growth of chaotic components at unseen controls across four Hamiltonian families. Because the flow of the learned scalar Hamiltonian is integrated autonomously, the prediction is not a direct classification of chaos or a short-time extension of observed trajectories. The out-of-range continuation of the learned Hamiltonian generates the long-time phase-space organization and instability of the new regime.
Evaluating this prediction requires measures that survive the rapid decorrelation of chaotic trajectories. We therefore use Poincaré-section occupancy, section geometry, and finite-time Lyapunov exponents, rather than long-horizon pointwise error, to probe the extent, location, and instability of the learned flow. Their combined agreement is important because the transition appears differently across the systems, with some showing a strong change in occupied area and others a clearer increase in instability. The consistent RF-HNN behavior across different potentials, symmetries, and couplings indicates that the result is not tied to one Hénon–Heiles parameterization.
The contrast with the MLP-HNN baselines exposes an ambiguity specific to parameter extrapolation. Matching the field on energy shells at a finite set of controls constrains the vector field where data are available, but it does not uniquely determine its continuation in . Distinct Hamiltonian models can therefore reproduce the observed regular regime while generating different phase-space organizations outside it. This is what the comparison shows. The MLP-HNNs reproduce the regular in-band behavior (inside the training interval), while their continuations delay or suppress the breakup of invariant structures and the associated growth of instability. The ensemble does not repair this discrepancy because averaging reduces member-to-member variance, not a bias shared by the learned continuations. The relevant distinction is therefore not only between Hamiltonian and non-Hamiltonian learning, but among Hamiltonian continuations that are nearly indistinguishable on the observed interval.
The mechanism by which the RF-HNN selects the more faithful continuation is not yet isolated, but the results suggest a specific role for its learning procedure. Once the random features are fixed, fitting is a regularized linear inverse problem, and the feature scales set how rapidly the representation can vary in state and control. In-band validation over these scales may therefore favor a lower-complexity continuation in without any access to the target regime, and the convex readout makes this selection computationally practical. The exploratory tests in Appendix C disfavor the simplest alternatives: increasing the MLP-HNN width, changing its activation, or refitting its final layer by ridge regression does not systematically recover the transition. These tests do not identify a unique mechanism, however. Matched ablations that equalize in-band approximation error and effective capacity will be needed to separate the roles of the fixed representation, the control-channel scaling, the regularized readout, and the hyperparameter selection.
A second implication is that the predictability of a dynamical regime can survive the unpredictability of its individual trajectories. Beyond the transition, pointwise rollouts decorrelate rapidly, yet the RF-HNN reproduces the occupied region of the section, the surviving regular structures, and the finite-time instability of the extrapolated flow. Vector-field data from a regular-dominated regime can thus contain enough information to extrapolate the parameter dependence that governs later resonance overlap, provided that the learning procedure selects an appropriate continuation. The claim is consequently about long-time phase-space organization, not about pointwise forecasting or global recovery of the Hamiltonian.
The present study establishes these results in a controlled setting: synthetic two-degree-of-freedom families, one smoothly varying control, clean vector-field data on a single energy shell, and moderate extrapolation distances. Extending the analysis to noisy and sparsely sampled trajectories, multiple energies or controls, and higher-dimensional Hamiltonian systems will determine how broadly the result persists. A further challenge is to decide, from in-band information alone, when an extrapolated phase portrait should be trusted, because a small in-band field error does not by itself certify the extrapolated dynamics.
The central conclusion is that matching the Hamiltonian vector field at the observed controls and reproducing the phase-space transition of the underlying family beyond them are distinct requirements. The former can be optimized and validated inside the observed interval, whereas the latter depends on how the fitted Hamiltonian continues in the control beyond it. In the four families studied here, the RF-HNN meets both requirements, generating the breakup of invariant structures and the growth of a chaotic sea absent from training and model selection.
Acknowledgements.
J. Choi was supported by a KIAS Individual Grant (No. AP092902) via the Center for Artificial Intelligence and Natural Sciences at the Korea Institute for Advanced Study (KIAS). This work was supported by the Center for Advanced Computation at KIAS.Data availability
The code and data that support the findings of this study are available from the corresponding author upon reasonable request.
Appendix A Additional systems and implementation details
| Family | Activation | Val. control | |||||
|---|---|---|---|---|---|---|---|
| Linear HH | GELU | 2000 | 0.416 | 0.0266 | 2.415 | 0.6 | |
| Bounded HH | GELU | 1800 | 0.378 | 0.0421 | 1.043 | 1.1 | |
| Conf. Barbanis | softplus | 1800 | 0.373 | 0.0201 | 0.0340 | 1.0 | |
| Morse pair | softplus | 2000 | 0.865 | 0.0203 | 0.888 | 0.4 |
The original Barbanis resonance model combines harmonic terms with a cubic coupling and contains no quartic wall [2]. Our auxiliary family is instead the quartically confined Barbanis-type Hamiltonian
| (8) | ||||
with and . The added quartic term makes this a globally bounded variant rather than the standard Barbanis system. Relative to the Hénon–Heiles families, the coupling changes both the symmetry and the resonant structure, while the quartic confinement is retained.
The onsite Morse potential is canonical [23], but there is no unique standard coupling of two Morse oscillators. Molecular coupled-Morse models may use, for example, a momentum coupling [21]. Here we use the deliberately simple bilinearly coupled Morse pair
| (9) | ||||
also at . Each uncoupled Morse oscillator is integrable, so the mixed dynamics arises entirely from the bilinear coupling, which breaks separability. Because the coupling does not confine the potential globally, escape is possible in principle, and the family therefore serves only as a supplementary test at the fixed shell energy and finite integration times used here. In practice, every orbit evaluated in the main comparison remains in the potential well from which the data are sampled and completes its 50 section crossings without escaping.
The configuration-space proposal boxes used to sample training shells are for linear Hénon–Heiles, for bounded Hénon–Heiles, for the confined Barbanis-type model, and for the Morse pair. The affine control normalizations supplied to the MLP-HNN, which map each family’s control values to a common order-one range, are , , , and , respectively.
For occupancy, the fixed ranges are for linear Hénon–Heiles, for bounded Hénon–Heiles and the Morse pair, and for the confined Barbanis-type model. These ranges and the resolution are held fixed across truth and all models within a family.
The MLP-HNN is trained with Adam (initial learning rate , no weight decay, cosine schedule) on the same field-matching objective and control set as the RF-HNN, using 12000 shell states per control, minibatches of 2048, and 12000–14000 updates depending on the family. States are standardized by the training-set mean and standard deviation before entering the network. Twenty independent networks are trained per family. The single MLP-HNN statistics average the first three members (training seeds 100–102), fixed by the protocol before any evaluation, and the ensemble prediction is the gradient of the mean of all 20 learned Hamiltonians.
Halving the time step, varying the perturbation size over , and computing the exponents by direct integration of the tangent equation all lead to the same conclusions. Integrations of truth extended to confirm decaying finite-time instability at every training control.
Appendix B Hyperparameter optimization
The RF-HNN uses two hidden layers of common width . We run a separate 100-trial Bayesian-optimization study with Optuna [1] for each activation in and each Hamiltonian family. The width candidates are . The log-uniform ranges are , , and , while . Bias scales are fixed at one, with every component sampled independently from , and the frozen matrices are dense. GELU denotes the exact activation, where is the standard normal cumulative distribution function. Each trial fits 8000 shell states per fitted control and is validated on 3000 independently sampled states.
The trial fits use the training controls , , , and for linear HH, bounded HH, Barbanis, and Morse, with the remaining training control of each family (, , , and , respectively) used for validation. Thus every trial and the activation choice use only the designated training interval. All search trials share one fixed random-feature seed. The selected configuration is then refitted with three fresh feature seeds that were never used during the search, and reported results average these three models. Table 3 gives the selected configurations.
Appendix C Architecture sweep of the MLP-HNN baseline
Table 4 reports the exploratory architecture sweep referenced in Sec. V: widths 200, 1000, and 2000 combined with tanh, GELU, and softplus activations, trained with the otherwise unchanged MLP-HNN protocol. No configuration reaches the truth-level exponents at the largest extrapolation control, the width-2000 tanh and GELU variants destabilize the Morse family, and the width-1000 tanh and GELU variants show partial escape there. In an additional test not included in Table 4, we refitted the final layer of each trained network by the same ridge regression used for the RF-HNN readout. This refit recovered the transition only in a minority of configurations, and no in-band criterion identified those configurations in advance. These results indicate that the gap reflects the full learning procedure rather than the readout alone, though we do not claim that conventionally trained HNNs are intrinsically unable to extrapolate.
| Linear- HH | Bounded HH | Conf. Barbanis | Morse pair | ||||||
| Width | Act. | ||||||||
| 200 | tanh | 4.32 | 0.025 | 7.18 | 0.066 | 1.79 | 0.032 | 1.29 | 0.102 |
| 200 | GELU | 2.68 | 0.039 | 4.21 | 0.135 | 0.90 | 0.042 | 5.22 | 0.054 |
| 200 | softplus | 2.44 | 0.050 | 3.23 | 0.126 | 0.40 | 0.052 | 1.07 | 0.103 |
| 1000 | tanh | 3.90 | 0.027 | 5.72 | 0.063 | 1.18 | 0.031 | 6.11† | 0.047 |
| 1000 | GELU | 2.25 | 0.047 | 2.73 | 0.159 | 1.12 | 0.039 | 3.82† | 0.084 |
| 1000 | softplus | 2.32 | 0.053 | 2.18 | 0.101 | 0.86 | 0.030 | 4.70 | 0.049 |
| 2000 | tanh | 3.91 | 0.030 | 5.19 | 0.061 | 1.21 | 0.039 | esc. | |
| 2000 | GELU | 3.69 | 0.028 | 2.28 | 0.125 | 1.26 | 0.028 | esc. | |
| 2000 | softplus | 2.93 | 0.033 | 4.10 | 0.095 | 0.99 | 0.026 | 4.98 | 0.041 |
| RF-HNN | 0.30 | 0.100 | 0.62 | 0.271 | 0.20 | 0.067 | 0.19 | 0.168 | |
| Truth () | — | 0.095 | — | 0.263 | — | 0.063 | — | 0.172 | |
Appendix D Poincaré-section geometry at the interpolation controls
Figure 6 shows the sections behind the interpolation check of Sec. IV.2, at the interpolation controls and .
Inside the training interval both learned models stay close to truth. They match the true occupancy to within one cell, every section remains uniformly low- on the color scale shared with Fig. 5, and at the invariant curves of both models are nearly indistinguishable from the true ones. At the MLP-HNN curves show a slight displacement from the true curves. The Chamfer distance quantifies the residual difference. At the two displayed controls, the RF-HNN Chamfer distance is about seventeen times smaller (– against – for the MLP-HNN). The much larger separation in occupancy appears only beyond the last training control [Fig. 5].
Appendix E Full four-family comparison
Figure 7 gives the control-dependent occupancy, finite-time-exponent, and Chamfer curves behind Table 2. Inside the training interval the occupancy curves remain close to truth, while the Chamfer curves already separate the models, consistent with Fig. 6. The curves diverge beyond the last training control, and the manner of the divergence differs by family. In the canonical family the baselines stay close through but fall sharply behind by , the ensemble more strongly than the single MLP-HNN. In the bounded family the occupancy changes little through and then rises steeply. Both baselines follow the initial segment but not the rise, so their error appears exactly where the qualitatively new growth appears.
The two auxiliary families refine rather than change this picture. In the confined Barbanis-type model the quartic wall keeps the occupied area within a narrow range, so the transition expresses itself less in occupancy than in the exponents. Both baselines underoccupy the section at the largest extrapolation control, while their exponents fall to about half the true value. In the Morse pair the occupancy of both baselines lies close to truth at the largest extrapolation control, while their exponents remain well below truth, so occupancy alone would understate the remaining difference there. Across all four families the RF-HNN Chamfer distance stays at or below that of both baselines at every extrapolation control, and its occupancy tracks the true curves throughout, including the non-monotonic segment of the Barbanis-type family.
References
- [1] (2019) Optuna: a next-generation hyperparameter optimization framework. In Proceedings of the 25th ACM SIGKDD International Conference on Knowledge Discovery & Data Mining, pp. 2623–2631. Cited by: Appendix B, §III.
- [2] (1966) On the isolating character of the ‘third’ integral in a resonance case. The Astronomical Journal 71, pp. 415–424. Cited by: Appendix A, §I, §I.
- [3] (1977) Parametric correspondence and chamfer matching: two new techniques for image matching. In Proceedings of the 5th International Joint Conference on Artificial Intelligence, pp. 659–663. Cited by: §III.1.
- [4] (1980) Lyapunov characteristic exponents for smooth dynamical systems and for Hamiltonian systems; a method for computing all of them. Part 1: Theory. Meccanica 15, pp. 9–20. Cited by: §III.2.
- [5] (2023) Sampling weights of deep neural networks. In Advances in Neural Information Processing Systems, Vol. 36. Note: arXiv:2306.16830 Cited by: §I.
- [6] (2021) Data-driven prediction of general Hamiltonian dynamics via learning exactly-symplectic maps. In Proceedings of the 38th International Conference on Machine Learning, PMLR, Vol. 139, pp. 1717–1727. Cited by: §I.
- [7] (1979) A universal instability of many-dimensional oscillator systems. Physics Reports 52, pp. 263–379. Cited by: §I.
- [8] (2022) Early warning for critical transitions using machine-based predictability. AIMS Mathematics 7 (11), pp. 20313–20327. External Links: Document Cited by: §I.
- [9] (2025) Homotopy reservoir computing: harnessing chaos for computation. Chaos 35, pp. 093112. Cited by: §I.
- [10] (2020) Physics-enhanced neural networks learn order and chaos. Physical Review E 101, pp. 062207. External Links: Document Cited by: §I.
- [11] (2024) Out-of-domain generalization in dynamical systems reconstruction. In Proceedings of the 41st International Conference on Machine Learning (ICML), Note: arXiv:2402.18377 Cited by: §I.
- [12] (2019) Hamiltonian neural networks. In Advances in Neural Information Processing Systems, Vol. 32. Note: arXiv:1906.01563 Cited by: §I, §I, §III.
- [13] (2021) Adaptable Hamiltonian neural networks. Physical Review Research 3, pp. 023156. External Links: Document Cited by: §I, §I, §III.
- [14] (1964) The applicability of the third integral of motion: some numerical experiments. The Astronomical Journal 69, pp. 73–79. Cited by: §I, §I, §II.1.
- [15] (2004) Harnessing nonlinearity: predicting chaotic systems and saving energy in wireless communication. Science 304, pp. 78–80. Cited by: §I.
- [16] (2022) Reconstruction of observed mechanical motions with artificial intelligence tools. New Journal of Physics 24, pp. 073021. External Links: Document Cited by: §I.
- [17] (2020) SympNets: intrinsic structure-preserving symplectic networks for identifying Hamiltonian systems. Neural Networks 132, pp. 166–179. Cited by: §I.
- [18] (2021) Teaching recurrent neural networks to infer global temporal structure from local examples. Nature Machine Intelligence 3, pp. 316–323. External Links: Document Cited by: §I.
- [19] (2024) Extrapolating tipping points and simulating non-stationary dynamics of complex systems using efficient machine learning. Scientific Reports 14, pp. 507. Cited by: §I.
- [20] (2021) Machine learning prediction of critical transition and system collapse. Physical Review Research 3, pp. 013090. External Links: Document Cited by: §I.
- [21] (2010) Noise-induced dynamic symmetry breaking and stochastic transitions in ABA molecules: I. Classification of vibrational modes. The Journal of Physical Chemistry B 114 (19), pp. 6549–6560. External Links: Document Cited by: Appendix A, §I.
- [22] (1992) Regular and chaotic dynamics. 2nd edition, Springer. Cited by: §I.
- [23] (1929) Diatomic molecules according to the wave mechanics. II. Vibrational levels. Physical Review 34, pp. 57–64. External Links: Document Cited by: Appendix A, §I.
- [24] (2024) Adaptable reservoir computing: a paradigm for model-free data-driven prediction of critical transitions in nonlinear dynamical systems. Chaos 34, pp. 051501. External Links: Document Cited by: §I.
- [25] (2026) Rapid training of Hamiltonian graph networks using random features. In International Conference on Learning Representations (ICLR), Note: arXiv:2506.06558 Cited by: §I.
- [26] (2024) Training Hamiltonian neural networks without backpropagation. In NeurIPS 2024 Workshop on Machine Learning and the Physical Sciences, Note: arXiv:2411.17511 Cited by: §I.
- [27] (2025) Deep learning of the evolution operator enables forecasting of out-of-training dynamics in chaotic systems. Note: arXiv:2502.20603 Cited by: §I.
- [28] (2025) Neural ordinary differential equations for learning and extrapolating system dynamics across bifurcations. Chaos 35, pp. 101103. Cited by: §I.
- [29] (2021) Learning Hamiltonian dynamics with reservoir computing. Physical Review E 104, pp. 024205. External Links: Document Cited by: §I.