History-informed Lagrangian Neural Networks
Analyze & explore related research in Conceptio
Connect this record directly into your research workflow or AI agent. Explore citations across open repositories, query full text, and export structured proof bundles.
History-informed Lagrangian Neural Networks Tianshuo Zhang , Xianglei Xing
⋆
, Wenzhe Zhai , Jia Gao , and He Cao
arXiv:2608.13215v1 [cs.LG] 13 Aug 2026
College of Intelligent Systems Science and Engineering, Harbin Engineering University, Harbin 150001, China
Abstract. Forecasting the long-horizon evolution of mechanical systems from position-only observations is a pivotal yet difficult task, as hidden velocities and trajectory-specific physical properties must be inferred simultaneously. Although physics-guided neural networks like Lagrangian Neural Networks (LNNs) guarantee physical plausibility, they generally require complete state inputs and lack adaptability to changing system parameters. To break these limitations, we introduce Historyinformed Lagrangian Neural Networks (HiLNN). Grounded in the insight that temporal position sequences implicitly encode underlying dynamics, HiLNN employs a recurrent encoder to extract a latent context from history. This context not only reconstructs the unobserved initial velocity but also adaptively modulates the mass matrix, potential energy, and damping coefficients of a structured Lagrangian system. By leveraging a differentiable RK4 rollout scheme, the entire pipeline is optimized end-toend under multi-step trajectory supervision and energy-consistency regularization. Empirical evaluations across conservative, dissipative, and heterogeneous variable-parameter systems show that HiLNN delivers superior long-term prediction accuracy and maintains precise energy profiles compared to state-of-the-art baselines. The source code is publicly available at https://github.com/yingtian22/History-informed-LNN. Keywords: physical forecasting · Lagrangian neural networks · partial observations · system identification · structured dynamics
1
Introduction
Long-horizon forecasting of mechanical systems is fundamental to physical reasoning, robotics, control, and scientific modeling [1,15,17,9,12]. A reliable model should remain stable and physically plausible during extended open-loop rollouts, where small errors can recursively accumulate and produce unstable trajectories or inconsistent physical quantities such as velocity and energy. Recent neural dynamics models learn physical evolution from data through discrete-time transitions or continuous-time vector fields [15,3,16,13,10]. However, they often treat dynamics as black-box mappings without explicit mechanical structure, making long-term rollouts prone to error accumulation and physical inconsistency [17,7]. ⋆
Corresponding author: xingxl@hrbeu.edu.cn
2
T. Zhang et al.
Fig. 1. Overview of HiLNN.
Physics-guided neural dynamics address this limitation by incorporating mechanical priors. Hamiltonian and Lagrangian Neural Networks derive dynamics from learned energy functions or Lagrangians, improving interpretability and rollout stability [7,4,14,6,22]. Recent extensions further handle constrained, controlled, or dissipative systems through explicit structure and energy-dissipation mechanisms [14,22,18,5]. However, most Lagrangian models require full initial states, especially velocity, and learn a fixed global dynamics function, limiting their use under position-only observations and trajectory-varying dynamics. Our key observation is that position history contains cues about missing states and trajectory-specific properties, consistent with delay-coordinate reconstruction and recent studies on partial-observation dynamics learning [19,2]. Although velocity and physical parameters are unobserved, temporal position evolution reflects local motion trends and hidden dynamical variations. We therefore infer a compact latent context from history, enabling structured dynamics to adapt to each trajectory beyond current-position or finite-difference estimates. To this end, we propose HiLNN, a history-informed Lagrangian framework for position-only mechanical forecasting. Given a coordinate history, HiLNN uses a recurrent encoder to infer a latent dynamical context, which estimates the missing initial velocity and conditions context-dependent mass, potential, and optional damping terms. Starting from the inferred state, HiLNN performs differentiable RK4 rollout and jointly trains the encoder and structured dynamics module. We evaluate HiLNN on conservative, dissipative, and variable-parameter pendulum systems. Results show that HiLNN improves rollout accuracy and physical consistency over representative baselines, including LNN, HNN, Neural ODE, and MLP predictors. Our contributions are summarized as follows: – We study position-only long-horizon mechanical forecasting, where hidden velocity and trajectory-specific dynamics are inferred from history.
History-informed Lagrangian Neural Networks
3
– We propose HiLNN, a history-informed Lagrangian framework that conditions mass, potential, and optional damping on latent context. – We show that HiLNN produces more accurate and physically consistent rollouts on conservative, dissipative, and variable-parameter systems.
2
Related Work
2.1
Neural Dynamics Learning
Neural networks, such as recurrent models and Neural ODEs [3,16,11], are widely used to model continuous or discrete dynamical systems. Despite their flexibility in predicting future evolution via numerical integration, these black-box models lack explicit mechanical structure, energy consistency, or physical constraints. Consequently, they often suffer from accumulated rollout errors and physically implausible predictions over long horizons. To address this, our work builds on structured physical dynamics and introduces history-dependent context to improve long-horizon forecasting under incomplete observations. 2.2
Physics-Guided Neural Dynamics
Physics-guided neural dynamics embed mechanical structures to improve prediction accuracy. Representative examples include Hamiltonian Neural Networks for energy conservation [7] and Lagrangian Neural Networks using the Euler– Lagrange equation [4]. Further extensions introduce mass matrices, dissipation, or domain priors to enhance interpretability [14,21]. However, these methods typically learn a single global model and require complete state observations. In contrast, our work conditions structured Lagrangian dynamics on a historyinferred latent context, adapting to partially observed and trajectory-dependent systems. 2.3
Dynamics Learning from Partial Observations
Physical dynamics are frequently observed through incomplete measurements, omitting key variables like velocity or damping. Existing approaches employ recurrent encoders, latent state-space models, or neural ODE variants to infer hidden states from observation histories [8,16,20]. Although effective, their latent dynamics remain black-box and lack explicit mechanical structure. Conversely, our method infers a latent mechanical context from position-only history to condition a Lagrangian dynamics model, enabling structured, long-horizon prediction under partial observability and trajectory-dependent variations.
3
Method
3.1
Problem Formulation
We study long-horizon forecasting of mechanical systems from position-only observations. Let qt ∈ Rd be the generalized coordinate and q̇t ∈ Rd be the corresponding velocity, forming the physical state xt = (qt , q̇t ). Unlike standard
4
T. Zhang et al.
Lagrangian Neural Networks that usually assume access to the full initial state, we consider a partially observed setting where only a history of positions is available: Htq = {qt−L+1 , qt−L+2 , . . . , qt }. (1) Given Htq , the goal is to predict the future state trajectory X̂t+1:t+H = {(q̂t+1 , q̇ˆt+1 ), . . . , (q̂t+H , q̇ˆt+H )}
(2)
over an H-step open-loop rollout. This setting requires inferring both the missing initial velocity and trajectoryspecific dynamics from position history. HiLNN addresses this by using a historyinformed context to condition a structured Lagrangian dynamics model. 3.2
Overview of HiLNN
HiLNN combines history-based state inference and structured Lagrangian dynamics. As shown in Fig. 1, the position history Htq is encoded into a latent context (3) zt = Encθ (Htq ), which summarizes trajectory-specific dynamical information. The context is used by a velocity head to infer the missing initial velocity q̇ˆt , forming x̂t = (qt , q̇ˆt ).
(4)
It also conditions the Lagrangian module through context-dependent mass, potential, and optional damping terms. Starting from x̂t , HiLNN performs an openloop RK4 rollout for H steps, with zt kept fixed as the inferred context of the current trajectory. Unlike conventional LNNs that require known velocities and use a fixed global dynamics model, HiLNN infers both hidden velocity and trajectory-specific context from history. 3.3
History-Informed Context Encoder
The history encoder maps the position history to a compact latent context. Given Htq = {qt−L+1 , qt−L+2 , . . . , qt }, (5) we encode the sequence with a recurrent network: ht = GRUθ (Htq ),
(6)
where ht is the final hidden representation. It is projected to the latent context: zt = MLPz (ht ).
(7)
The context zt captures information unavailable from the current position alone, including motion trends, hidden velocity cues, and parameter variations. It is shared by the velocity head and the Lagrangian module, and remains fixed during rollout.
History-informed Lagrangian Neural Networks
3.4
5
Context-Conditioned Lagrangian Dynamics
To preserve mechanical structure, HiLNN models dynamics with a contextconditioned Lagrangian. Given x = (q, q̇) and context zt , we define Lθ (q, q̇, zt ) = Tθ (q, q̇, zt ) − Vϕ (q, zt ),
(8)
where Tθ and Vϕ denote the kinetic and potential energy terms, respectively. The kinetic energy is parameterized by a positive mass matrix: Tθ (q, q̇, zt ) =
1 ⊤ q̇ Mθ (q, zt )q̇, 2
(9)
and the potential energy is predicted by a neural network conditioned on both the coordinate and the inferred context: Vϕ (q, zt ) = MLPV ([q, zt ]).
(10)
The mass term is constrained positive. For one-dimensional systems, we use Mθ (q, zt ) = softplus MLPM ([q, zt ]) + ϵ,
(11)
where ϵ ensures numerical stability. For multi-dimensional systems, we use a positive diagonal mass matrix with element-wise softplus. The resulting acceleration is derived from the Euler–Lagrange equation: d ∂Lθ ∂Lθ − = Q, dt ∂ q̇ ∂q
(12)
where Q is the generalized non-conservative force. We set Q = 0 for conservative systems and optionally use context-conditioned damping for dissipative systems: Q = −Dψ (q, zt )q̇,
(13)
where Dψ (q, zt ) is constrained to be non-negative. In practice, the acceleration can be obtained by solving the Euler–Lagrange system: ∂Lθ q̈ = A−1 − B q̇ + Q , (14) ∂q where A=
∂ 2 Lθ , ∂ q̇ 2
B=
∂ 2 Lθ . ∂q∂ q̇
(15)
Thus, dynamics are computed from a structured energy-based formulation rather than direct acceleration regression. Conditioning mass, potential, and damping on zt allows HiLNN to adapt to trajectory-dependent dynamics while retaining mechanical structure.
6
3.5
T. Zhang et al.
Initial State Inference and Differentiable RK4 Rollout
Since the initial velocity is unobserved, HiLNN infers it from the last position and context: q̇ˆt = MLPv ([qt , zt ]), (16) where [qt , zt ] denotes concatenation. The initial state is then x̂t = (qt , q̇ˆt ).
(17)
Starting from x̂t , the model performs open-loop prediction using the contextconditioned dynamics. Let dx q̇ = fθ (x, zt ) = , (18) q̈θ (q, q̇, zt ) dt where q̈θ is derived from the context-conditioned Euler–Lagrange dynamics. We use a fourth-order Runge–Kutta integrator to advance the state: x̂t+k+1 = RK4 fθ , x̂t+k , zt , ∆t , k = 0, . . . , H − 1. (19) The rollout is fully differentiable, with zt fixed while the state is recursively updated by the learned dynamics. 3.6
Training Objective
HiLNN is trained end-to-end with multi-step rollout supervision. Given predicted trajectory X̂t+1:t+H and ground truth Xt+1:t+H , the rollout loss is H
Lroll =
1 X λq ∥q̂t+k − qt+k ∥22 + λq̇ ∥q̇ˆt+k − q̇t+k ∥22 , H
(20)
k=1
where λq and λq̇ balance position and velocity prediction errors. When ground-truth velocity at time t is available, we additionally supervise the velocity head: Lv0 = ∥q̇ˆt − q̇t ∥22 . (21) This encourages a physically meaningful rollout initialization. We further add energy regularization for physical consistency. Let E(q, q̇) denote mechanical energy: H
LE =
2 1 X E(q̂t+k , q̇ˆt+k ) − E(qt+k , q̇t+k ) . H 2
(22)
k=1
The final training objective is L = Lroll + λv0 Lv0 + λE LE ,
(23)
where λv0 and λE control initial velocity supervision and energy consistency. All losses are computed after differentiable RK4 rollout, enabling joint optimization of the encoder, velocity head, and Lagrangian dynamics.
History-informed Lagrangian Neural Networks
3.7
7
Implementation Details
Unless otherwise specified, we use history length L = 8, prediction horizon H = 32, and time interval ∆t = 0.05. The encoder is a one-layer GRU with hidden dimension 64, followed by an MLP that outputs a 32-dimensional context. The velocity head is a lightweight MLP taking [qt , zt ] as input. The context-conditioned mass and potential networks are MLPs with hidden dimension 128 and Tanh activations. Mass positivity is enforced by softplus with ϵ = 10−3 . Training and evaluation use RK4, and gradients are backpropagated through the full rollout without detaching intermediate states. We optimize the model using Adam with learning rate 10−3 , batch size 256, gradient clipping of 1.0, and early stopping with patience 15 over at most 50 epochs. The default loss weights are λq = 1.0,
λq̇ = 0.1,
λv0 = 0.1,
λE = 0.01.
(24)
All results are evaluated under open-loop rollout using only observed history.
4
Experiments
4.1
Experimental Setup
Datasets. We evaluate HiLNN on three pendulum-based systems: a fixed conservative pendulum, a fixed damped pendulum, and a variable-parameter pendulum with trajectory-dependent dynamics. For all datasets, the model observes only a position history of length L = 8 and predicts H = 32 future steps with ∆t = 0.05. Details are summarized in Table 1. Table 1. Dataset setup with L = 8, H = 32, and ∆t = 0.05. Dataset
Type
Pendulum Fixed conservative Damped Fixed dissipative Variable Variable params.
Train/Val/Test Test win. Params 1000/200/200 1000/200/200 3000/500/500
Property
32200 fixed l=1, m=1, c=0 Conservative 32200 fixed c=0.15 Decay 80500 sampled l, m, c Heterogeneous
Evaluation protocol. All methods follow the same position-only forecasting protocol. At test time, each model observes only the position history and performs open-loop rollout without future ground truth. We report MSE, MAE, Final MSE@32, and Energy MSE to measure trajectory accuracy, long-horizon error accumulation, and physical consistency. Baselines. We compare HiLNN with representative dynamics models, including LNN [4], HNN [7], Neural ODE [3], MLP-based predictors, and an LNNmultistep variant trained with rollout supervision. These baselines cover both black-box and physics-guided dynamics, enabling direct comparison with the proposed history-informed Lagrangian formulation.
T. Zhang et al.
Ground truth
8
Damped
Variable
LNN
LNN-multistep
HiLNN
(a)
(b)
(c)
(d)
(e)
(f)
Prediction
Pendulum
Fig. 2. Qualitative rollout comparison. Left: ground truth and HiLNN on three datasets (a–c). Right: ground truth and baseline predictions on the fixed pendulum (d–f).
Implementation details. HiLNN uses a one-layer GRU to encode position history into a latent context, which is shared by the initial velocity head and the context-conditioned Lagrangian module. The mass and potential terms are modeled by MLPs, with mass positivity enforced by softplus and a small constant. Unless otherwise specified, training and evaluation use RK4 with gradients propagated through the full rollout horizon. The training configuration is shown in Table 2. Table 2. Training configuration of HiLNN. Item
Value Item
Value
History length L Time step ∆t GRU hidden dim. GRU layers Mass positivity ε Detach between steps Learning rate Max epochs Gradient clip norm
8 0.05 64 1 10−3 False 10−3 50 1.0
32 GRU 32 128 RK4 Adam 256 15 λq /λq̇ /λv0 /λE = 1.0/0.1/0.1/0.01
4.2
Prediction horizon H Encoder Context dim. dz Lagrangian MLP hidden Integrator Optimizer Batch size Early-stop patience Loss weights
Main Quantitative Results
Fig. 2 qualitatively compares 32-step open-loop rollouts: panels (a–c) show groundtruth and HiLNN trajectories on the fixed, damped, and variable pendulum datasets, while panels (d–f) contrast LNN, LNN-multistep, and HiLNN on the fixed pendulum, with HiLNN tracking the ground truth most closely. Table 3 reports the overall comparison on the three pendulum systems. HiLNN achieves the best performance across conservative, dissipative, and variable-parameter settings. On the standard pendulum, it reduces the average MSE from 0.279 of
History-informed Lagrangian Neural Networks
9
LNN to 0.103, while also obtaining the lowest Final MSE@32 and Energy MSE, showing improved prediction accuracy and long-horizon physical consistency. The advantage is more pronounced on damped and variable-parameter systems. For the damped pendulum, HiLNN achieves an average MSE of 4.28×10−3 and reduces Energy MSE from 0.987 to 0.107 compared with LNN, indicating that the context-conditioned damping term captures dissipative dynamics. For the variable-parameter pendulum, HiLNN reduces MSE from 0.894 of LNNmultistep to 0.061 and Final MSE@32 from 2.295 to 0.193, suggesting that the latent context effectively adapts the structured dynamics to trajectory-dependent physical variations. Overall, these results show that a fixed global Lagrangian model is insufficient under position-only and heterogeneous dynamics. By inferring the missing initial velocity and conditioning Lagrangian components on history, HiLNN provides more accurate and physically coherent long-horizon forecasts. Table 3. Full quantitative results on the three pendulum systems. Method
MSE ↓
MAE ↓ Final MSE@32 ↓ Energy MSE ↓
LNN [4] LNN [4]-multistep HNN [7] Pendulum Neural ODE [3] MLP-one-step HiLNN
0.279 0.415 1.646 0.580 0.261 0.103
0.116 0.238 0.826 0.458 0.156 0.109
0.483 0.857 2.740 1.355 0.564 0.271
4.222 5.906 17.512 9.603 3.695 1.705
Damped
LNN [4] 0.037 0.104 LNN [4]-multistep 0.042 0.124 HiLNN 4.28 × 10−3 0.036
0.149 0.089 0.018
0.987 1.338 0.107
Variable
LNN [4] LNN-multistep [4] HiLNN
2.483 2.295 0.193
19.516 26.944 1.759
Dataset
4.3
0.960 0.894 0.061
0.536 0.522 0.113
Long-Horizon Rollout Analysis
To further analyze error accumulation, we report step-wise rollout errors over the 32-step open-loop horizon. As shown in Fig. 3, HiLNN consistently achieves lower errors on all three systems, especially at medium and long horizons. This shows that the history-informed context improves prediction accuracy and mitigates recursive error growth in open-loop forecasting. Table 4 reports detailed rollout errors on the conservative pendulum. Although LNN has the lowest one-step error, its error grows quickly over longer horizons. HiLNN achieves lower errors from Step 8 onward and reduces the final-step error from 0.483 to 0.271, showing that velocity inference and historyconditioned Lagrangian dynamics improve long-horizon stability.
10
T. Zhang et al. LNN
LNN-multistep
Pendulum
Variable-parameter pendulum
10
−1
10
−2
10
−3
5
10
15
20
25
30
State MSE
0
State MSE
State MSE
10
HiLNN
Damped pendulum
5
10
Forecast step
15
20
Forecast step
25
30
5
10
15
20
25
30
Forecast step
Fig. 3. Step-wise rollout error on the three pendulum systems. HiLNN achieves lower state MSE than LNN and LNN-multistep over the 32-step open-loop prediction horizon.
Fig. 4. Energy behavior on the damped, standard, and variable-parameter pendulum systems. Table 4. Rollout error summary on the pendulum system. Values report state MSE at selected forecast steps. Method
Step 1
Step 8 Step 16 Step 32 Avg. −3
LNN [4] 2.17 × 10 0.112 LNN [4]-multistep 3.55 × 10−3 0.162 HNN [7] 0.024 0.897 Neural ODE [3] 8.51 × 10−3 0.252 HiLNN 0.061 0.039
0.299 0.483 0.279 0.402 0.857 0.415 1.848 2.740 1.646 0.504 1.355 0.580 0.072 0.271 0.103
The damped pendulum results in Table 5 further show HiLNN’s advantage under dissipative dynamics. Although LNN has a very small Step-1 error, its error grows rapidly at later steps. HiLNN achieves the lowest errors at Steps 8, 16, and 32, reducing the final-step error from 0.149 to 0.018. This indicates that context-conditioned damping better captures long-term energy decay. The improvement is most evident in the variable-parameter setting, as shown in Table 6. Since trajectories follow different physical parameters, a single global Lagrangian model struggles with long-horizon prediction. HiLNN achieves the best performance at all selected steps and reduces the Step-32 error from 2.483/2.295 to 0.193 compared with LNN/LNN-multistep. This indicates that the latent context captures trajectory-dependent dynamics and enables adaptation across heterogeneous systems.
History-informed Lagrangian Neural Networks
11
Table 5. Rollout error summary on the damped pendulum system. Values report state MSE at selected forecast steps. Method
Step 1
Step 8 −4
Step 16
Step 32
Avg.
−3
LNN [4] 2.08 × 10 8.60 × 10 0.016 0.149 0.037 LNN [4]-multistep 6.62 × 10−3 0.027 0.039 0.089 0.042 HiLNN 2.68 × 10−3 1.36 × 10−3 2.21 × 10−3 0.018 4.28 × 10−3 Table 6. Rollout error summary on the variable-parameter pendulum system. Values report state MSE at selected forecast steps. Method
Step 1
Step 8 Step 16 Step 32 Avg. −3
LNN [4] 6.12 × 10 0.301 0.717 2.483 0.960 LNN [4]-multistep 7.56 × 10−3 0.350 0.685 2.295 0.894 HiLNN 5.92 × 10−3 0.016 0.042 0.193 0.061
Overall, these analyses show that baseline models may achieve competitive short-term prediction but suffer from rapid error accumulation in long open-loop rollouts. HiLNN stabilizes error growth by using history to infer both the missing initial state and trajectory-specific dynamical context. 4.4
Trajectory and Physical Consistency
Beyond aggregate metrics, we further examine trajectory and energy behavior. Fig. 5 shows that HiLNN closely tracks the ground-truth position q and velocity q̇ over 32 steps, whereas baselines show larger phase shifts or amplitude errors, consistent with Sec. 4.3. For physical consistency, Table 7 shows that HiLNN obtains the lowest energy errors at Steps 16 and 32 on the damped pendulum, reducing Test Energy MSE from 0.987 to 0.107 and mean absolute energy error from 0.686 to 0.167. These results suggest that history-informed context improves initialization and rollout dynamics, while context-conditioned damping better captures dissipative energy decay. These results indicate that history-informed context improves state initialization and dynamical evolution, while context-conditioned damping helps capture dissipative energy decay. The variable-parameter setting further evaluates physical consistency under trajectory-dependent parameters. As shown in Table 7, LNN and LNN-multistep accumulate large energy errors, with Test Energy MSE values of 19.516 and 26.944. In contrast, HiLNN reduces Test Energy MSE to 1.759 and Step-32 energy error from 26.111 to 3.646 compared with LNN. Although not best at Step 1, HiLNN achieves much lower later-step errors, showing that the learned context improves long-term physical consistency under heterogeneous dynamics. Overall, these results show that HiLNN improves both trajectory accuracy and physical consistency. By following dissipative energy decay and reducing long-horizon energy drift in parameter-varying systems, HiLNN validates the
12
T. Zhang et al.
Table 7. Energy behavior summary on damped and variable-parameter pendulum systems. For the damped system, the true energy drop is approximately 1.24 over 32 steps on average. Dataset
Method
E-MSE@1
LNN [4] 5.31 × 10 Damped LNN [4]-multistep 0.225 HiLNN 0.085 LNN [4] Variable LNN [4]-multistep HiLNN
E-MSE@16 E-MSE@32 Mean |err| Test E-MSE
−3
0.386 0.462 0.530
Pendulum
0.800 1.277 0.044
2.607 2.825 0.565
0.686 0.730 0.167
0.987 1.338 0.107
31.072 44.162 1.675
26.111 31.178 3.646
2.004 2.073 0.645
19.516 26.944 1.759
Damped pendulum Ground truth HiLNN
1.0
Variable-parameter pendulum Ground truth HiLNN
1.5
Ground truth HiLNN
0.4
1.0 0.2
0.5
0.0
−0.5
−0.5
−0.2
−1.0
−0.4
−1.5 0
5
10
15
20
25
30
−0.6 0
4
Ground truth HiLNN
3
0.0
q
0.0
q
q
0.5
2
5
10
15
20
25
30
0
5
10
15
20
25
2
Ground truth HiLNN
2
1
0
0
30 Ground truth HiLNN
−1
q̇
0
q̇
q̇
1
−2
−1
−2 −3
−4 −2 0
5
10
15
20
25
30
Forecast step
0
5
10
15
20
Forecast step
25
30
0
5
10
15
20
25
30
Forecast step
Fig. 5. Representative trajectory predictions on the three pendulum systems. HiLNN closely follows the ground-truth position q and velocity q̇ over the 32-step prediction horizon.
benefit of combining history-informed context with structured Lagrangian dynamics. 4.5
Ablation Studies
We conduct ablations on energy regularization, rollout training, initial velocity supervision, and history length. Unless otherwise specified, all ablations are performed on the pendulum setting. Table 8 summarizes the effects of energy regularization, rollout design, and initial velocity supervision. For energy regularization, removing λE weakens physical consistency, yielding an MSE of 0.118 and an Energy MSE of 3.147, while a small weight improves the accuracy–energy trade-off. Specifically, λE = 0.01 gives the best overall MSE and Energy MSE, whereas λE = 0.001 achieves the lowest Final MSE@32 but higher Energy MSE. A larger weight, λE = 0.05, hurts both accuracy and energy consistency, indicating over-regularization; thus, we use λE = 0.01 by default. For rollout training, the Euler variant with detached
History-informed Lagrangian Neural Networks
13
Table 8. Ablation summary of HiLNN on the pendulum system, covering energy regularization, rollout training design, and initial velocity supervision. “–” indicates that the metric is not applicable to the corresponding ablation. Ablation
Setting
MSE ↓ Final MSE@32 ↓ Energy MSE ↓ Init. Vel. MSE ↓
λE = 0 λE = 0.001 Energy weight λE = 0.01 λE = 0.05
0.118 0.116 0.103 0.261
0.261 0.253 0.271 0.495
3.147 2.680 1.705 4.041
– – – –
HiLNN v1a, Euler, detach Rollout design HiLNN v1b, RK4, full BPTT LNN [4], RK4
0.449 0.118 0.279
1.025 0.261 0.482
9.070 3.147 4.222
– – –
0.118 0.117
0.261 0.262
3.147 3.318
0.115 0.245
Init. velocity
λv0 = 0.1 λv0 = 0
states, HiLNN v1a, performs poorly, with an MSE of 0.449 and Final MSE@32 of 1.025. Using RK4 with full backpropagation through time reduces them to 0.118 and 0.261, respectively, and also outperforms the LNN baseline under the same RK4 protocol. This confirms the benefit of differentiable high-order integration and full-horizon gradient propagation. Finally, removing the auxiliary initial velocity loss keeps rollout MSE similar but increases the initial velocity error from 0.115 to 0.245, showing that Lv0 mainly improves the accuracy and interpretability of the inferred initial state. We retain this loss to provide a more physical initialization for open-loop rollout.
5
Conclusion
In this paper, we proposed HiLNN, a history-informed Lagrangian framework for long-horizon mechanical forecasting from position-only observations. By inferring a latent context from observed history, HiLNN estimates the missing initial velocity and adaptively conditions the mass, potential, and damping terms of a structured Lagrangian model. Combined with differentiable RK4 rollout and multi-step supervision, HiLNN preserves mechanical structure while improving long-horizon stability. Experiments on conservative, dissipative, and variable-parameter pendulum systems show that HiLNN achieves more accurate and physically consistent predictions than representative black-box and physicsguided baselines.
Acknowledgements The work is supported by the National Natural Science Foundation of China under Grant No. 62076078, the Fundamental Research Funds for the Central Universities under Grant No. 3072024LJ0403, and the CAAI-Huawei MindSpore Open Fund under Grant No. CAAI–XSJLJJ–2020–033A.
14
T. Zhang et al.
References 1. Battaglia, P.W., Pascanu, R., Lai, M., Rezende, D.J., Kavukcuoglu, K.: Interaction networks for learning about objects, relations and physics. In: Advances in Neural Information Processing Systems. vol. 29, pp. 4502–4510 (2016) 2. Buisson-Fenet, M., Morgenthaler, V., Trimpe, S., Di Meglio, F.: Recognition models to learn dynamics from partial observations with neural odes. Transactions on Machine Learning Research (2023) 3. Chen, R.T.Q., Rubanova, Y., Bettencourt, J., Duvenaud, D.K.: Neural ordinary differential equations. In: Advances in Neural Information Processing Systems. vol. 31, pp. 6572–6583 (2018) 4. Cranmer, M., Greydanus, S., Hoyer, S., Battaglia, P., Spergel, D., Ho, S.: Lagrangian neural networks. In: ICLR 2020 Workshop on Integration of Deep Neural Models and Differential Equations (2020) 5. Desai, S.A., Mattheakis, M., Sondak, D., Protopapas, P., Roberts, S.J.: Port-hamiltonian neural networks for learning explicit timedependent dynamical systems. Physical Review E 104(3), 034312 (2021). https://doi.org/10.1103/PhysRevE.104.034312 6. Finzi, M., Wang, K.A., Wilson, A.G.: Simplifying hamiltonian and lagrangian neural networks via explicit constraints. In: Advances in Neural Information Processing Systems. vol. 33, pp. 13880–13889 (2020) 7. Greydanus, S., Dzamba, M., Yosinski, J.: Hamiltonian neural networks. In: Advances in Neural Information Processing Systems. vol. 32, pp. 15353–15363 (2019) 8. Krishnan, R.G., Shalit, U., Sontag, D.: Deep kalman filters. arXiv preprint arXiv:1511.05121 (2015) 9. Li, M., Xiao, Y., Xing, X.: Trajectory prediction methods based on analytical mechanics and graph neural networks. CAAI Transactions on Intelligent Systems 20(6), 1355–1365 (2025). https://doi.org/10.11992/tis.202501020 10. Li, Y., Ding, K., Yang, C., Chen, S.Y., Tian, Y.: Distilling time series foundation models for efficient forecasting. In: IEEE International Conference on Acoustics, Speech and Signal Processing (2026) 11. Li, Y., Ding, K., Yang, C., Wang, H., Wang, H., Duan, H., Liu, J., Tian, Y.: Ddtime: Dataset distillation with spectral alignment and information bottleneck for time-series forecasting. arXiv preprint arXiv:2511.16715 (2025) 12. Li, Y., Dong, J., Liu, J., Koniusz, P., Zeng, H., Yang, C., Liu, J., Tian, Y., Huang, T., Wu, H.: Evolving multimodal models for physical dynamics: A multiobjective neuroevolution approach. IEEE Transactions on Evolutionary Computation (2026). https://doi.org/10.1109/TEVC.2026.3698641 13. Li, Y., Yang, C., Zeng, H., Dong, Z., An, Z., Xu, Y., Tian, Y., Wu, H.: Frequencyaligned knowledge distillation for lightweight spatiotemporal forecasting. In: Proceedings of the IEEE/CVF International Conference on Computer Vision. pp. 7262–7272 (2025) 14. Lutter, M., Ritter, C., Peters, J.: Deep lagrangian networks: Using physics as model prior for deep learning. In: International Conference on Learning Representations (2019) 15. Nagabandi, A., Kahn, G., Fearing, R.S., Levine, S.: Neural network dynamics for model-based deep reinforcement learning with model-free fine-tuning. In: 2018 IEEE International Conference on Robotics and Automation. pp. 7559–7566 (2018). https://doi.org/10.1109/ICRA.2018.8463189
History-informed Lagrangian Neural Networks
15
16. Rubanova, Y., Chen, R.T.Q., Duvenaud, D.: Latent odes for irregularly-sampled time series. In: Advances in Neural Information Processing Systems. vol. 32 (2019) 17. Sanchez-Gonzalez, A., Godwin, J., Pfaff, T., Ying, R., Leskovec, J., Battaglia, P.W.: Learning to simulate complex physics with graph networks. In: Proceedings of the 37th International Conference on Machine Learning. vol. 119, pp. 8459–8468 (2020) 18. Sosanya, A., Greydanus, S.: Dissipative hamiltonian neural networks: Learning dissipative and conservative dynamics separately. arXiv preprint arXiv:2201.10085 (2022) 19. Takens, F.: Detecting strange attractors in turbulence. In: Dynamical Systems and Turbulence, Warwick 1980, Lecture Notes in Mathematics, vol. 898, pp. 366–381. Springer, Berlin, Heidelberg (1981). https://doi.org/10.1007/BFb0091924 20. Yildiz, C., Heinonen, M., Lahdesmaki, H.: Ode2vae: Deep generative second order odes with bayesian neural networks. In: Advances in Neural Information Processing Systems. vol. 32 (2019) 21. Zhang, T., Zhai, W., Yann, R., Gao, J., Cao, H., Xing, X.: Floating-body hydrodynamic neural networks. arXiv preprint arXiv:2509.13783 (2025) 22. Zhong, Y.D., Dey, B., Chakraborty, A.: Symplectic ode-net: Learning hamiltonian dynamics with control. In: International Conference on Learning Representations (2020)
Related documents
- Spatially Embedded Neural Networks: Convergence Constraints in Scalar Field RL#259793
- Tensor-Train Compressed Separable PINNs: A Curvature-Aware Optimization Framework for Parametric PDEs in High Dimensions#1131007
- A Comparison of Strategies to Embed Physics-Informed Neural Networks in Nonlinear Model Predictive Control Formulations Solved via Direct Transcription#684200
- A Comparison of Strategies to Embed Physics-Informed Neural Networks in Nonlinear Model Predictive Control Formulations Solved via Direct Transcription#682425
- LSR-Net: Learning the Forward Evolution Operator for Nonlinear Fluid Dynamics#1013250
Retrieved via Conceptio: every document is proof-bundled with source, license, and retrieval metadata.
Read the Docs → · View CLI source on GitHub · Conceptio Open Knowledge Archive