acceptodds
Under review as a conference paper at ICLR 2027

Safe-by-design Learning via Energy-Based Neural Networks

Abstract

Learning neural-network models of dynamical systems with safety guarantees is a fundamental requirement for their deployment in safety-critical settings. Safety is commonly established by proving the invariance of a desired subset in state-space, ensuring that every trajectory initialized in this subset remains confined to it for all time under admissible inputs. Existing frameworks, however, either rely on computationally expensive post-hoc verification or employ safety-enforcing mechanisms without formal correctness guarantees. In this paper, we introduce a novel neural architecture grounded in energy-based modern Hopfield networks to guarantee safety-by-design while retaining sufficient expressiveness to model complex nonlinear dynamics. Specifically, we integrate modern Hopfield networks with a port-Hamiltonian neural ODE, enabling by design the construction of barrier functions yielding explicit admissible-input sets and quantitative robustness radii. Across several benchmarks, including an 12-dimensional nanodrone model, our framework achieves state-of-the-art performance while producing certified invariant sets that are more robust to external solicitations than comparable existing approaches.

Primary area:
foundation or frontier models, including LLMs
Keywords:
Energy-Based Models, Dynamical Systems, Safety Guarantees

Reviews

Among:
Shape:
1234this paper, Bottom 27%
Figure 1. Mean review rating of the reviewed papers at ICLR 2027. This paper averages 2.00 over 3 reviews, above 27% of the others.
Reviewer_wVt8OpenReview ↗
Rating
2
Confidence
3
Informativeness
2
Presentation
2
Soundness
2
Read review
Paper summary

This paper introduces a neural architecture that combines a coercive, nonconvex modern Hopfield Hamiltonian with port-Hamiltonian neural ODEs to support safety by design while capturing complex nonlinear dynamics. The learned energy defines invariant sublevel components under admissible inputs, with robustness margins and disturbance bounds derived from the energy geometry. Experiments on demonstrate competitive predictive accuracy and improved long-horizon boundedness.

Critical strengths
  1. Coercive nonconvex energies permit multiple operating regimes while retaining compact sublevel sets. This offers a meaningful extension beyond architectures organized around one convex energy well.

  2. The framework gives interpretable input and disturbance margins from the same energy used for prediction. The benchmark range, including 12-state drone dynamics and long-horizon extrapolation, supports its usefulness for structured system identification.

Critical weaknesses
  1. The reported robustness radii are not established continuous-state certificates. Appendix C.7 states that shell minima and geometric bounds rely on sampled extrema unless independently bounded. Such estimates can overstate the admissible radius, yet Table 1 and the main text describe them as certified, weakening the central quantitative safety claim.

  2. The method establishes latent energy confinement without showing that the decoder maps the invariant region into the prescribed Y_safe, as Definition 1 requires. Continuity ensures a compact output image but does not establish safety-set containment. The constructed energy components also do not establish the maximal invariant set sought in Problem 1. These gaps concern the learned-model guarantees, independently of the acknowledged model-to-plant limitation.

Questions for authors
  1. Which reported radii have rigorous continuous-boundary lower bounds, rather than ray-sampled estimates? What verification procedure establishes those bounds, and do the tested inputs lie within them?

  2. What prescribed Y_safe is used in each benchmark, and how is decoder containment verified for every admissible input? Is the intended result a sufficient invariant energy component rather than a maximal invariant set?

3 comments

Thank you. We distinguish the architectural guarantee from the numerical estimates and answer the two certification questions directly.

Q1: Which radii are formally certified, and how?

Energy sublevels naturally confine the unforced model. Theorem 1, Equation (10), identifies the input bounds preserving a selected component under forcing. Thus, the certificate candidate comes natively with the learned dynamics. Its input radius can be estimated by sampling (ρ^\hat\rho) or bounded formally (ρˉ\bar\rho) over the complete boundary. Sampling alone, as presented in the paper, is not a continuous-state certificate.

The original table entries are now identified as empirical estimates, and we are adding a formal Duffing certificate. For the right-well energy budget E≃−0.09565E\simeq-0.09565, sampling suggested ρ^≃0.031\hat\rho\simeq0.031. Arb interval arithmetic [1] and our verifier adapting the bound-propagation approach of Mathiesen et al. [2] both certified ρˉ=0.0264\bar\rho=0.0264. The proof encloses the component, establishes boundary regularity and verifies

∇H(z)⊤f(z,u)≤0\nabla H(z)^\top f(z,u)\le0

for every boundary state and every admissible input. The complete proofs took about 36 and 16 minutes, respectively, on 16 workers. This is a verified lower bound, without an optimality claim. We will also try to include formal bounds for the other systems.

Why the architectural guarantee matters.

Our contribution is an architecture for learning input-driven dynamics together with an energy function defining candidate invariant regions. This complements methods that certify a given model through reachability analysis or auxiliary barrier synthesis. Whereas barrier synthesis typically learns a separate certificate and verifies its sign and dynamical conditions, our Hamiltonian already supplies the candidate, and the port-Hamiltonian structure enforces the energy balance in Equation (5).

Q2: What output-safe set is used, and is the invariant set maximal?

Our intended guarantee is an a posteriori output envelope induced by the learned energy, with no a priori prescription of YsafeY_{\rm safe}. For an energy component CC invariant under all admissible KK-valued inputs, define

Ysafe:=h(C,K)=h(z,u):z∈C,u∈K.Y_{\rm safe}:=h(C,K)=\\{h(z,u):z\in C,\\ u\in K\\}.

Then, for every such input,

z(0)∈C⟹z(t)∈C⟹y(t)=h(z(t),u(t))∈Ysafe∀t≥0.z(0)\in C\quad\Longrightarrow\quad z(t)\in C\quad\Longrightarrow\quad y(t)=h(z(t),u(t))\in Y_{\rm safe}\qquad\forall t\ge0.

Output confinement follows directly from latent invariance, including the decoder's full input dependence. No additional decoder-containment verification is needed for this induced envelope. Continuity additionally makes it compact when CC and KK are compact. For identity output maps, the state component itself becomes the output envelope. These guarantees concern the learned model; transfer to a physical plant requires a validated model-error bound and model–plant relation.

Our construction yields a sufficient invariant energy component and its output envelope. We have clarified Problem 1 accordingly: maximal state-space invariance is not claimed. Likewise, the computed input radius is a verified lower bound for the selected component, without establishing the largest admissible input envelope.

References

[1] F. Johansson. Arb: efficient arbitrary-precision midpoint-radius interval arithmetic. IEEE Transactions on Computers 66(8), 1281–1292 (2017).

[2] F. B. Mathiesen, S. C. Calvert and L. Laurenti. Safety Certification for Stochastic Systems via Neural Barrier Functions. IEEE Control Systems Letters 7, 973–978 (2023).

Reviewer_wVt8OpenReview ↗

Further comment

Thank you for your response. But I will keep my score as it is, given the scope of the contributions.

Thank you for the follow-up.

“The scope of the contributions” does not identify a specific scientific limitation or explain which concern remains unresolved.

Our contribution unifies nonlinear dynamics learning, a coercive nonconvex Hamiltonian supporting multiple operating regimes, and quantitative input/disturbance margins guaranteeing confinement of selected energy components while achieving SOTA accuracy on selected low and high-dimensional benchmarks.

Architectural guarantees on learned dynamics are substantive contributions in closely related work [1–3]. Our framework additionally quantifies (and now certifies) robustness of nonconvex invariant components under external forcing.

[1] Roth et al. Stable Port-Hamiltonian Neural Networks. NeurIPS 2025.

[2] Okamoto and Kojima. Learning Deep Dissipative Dynamics. AAAI 2025.

[3] Beik-Mohammadi et al. Neural Contractive Dynamical Systems. ICLR 2024.

Reviewer_x1sTOpenReview ↗
Rating
2
Confidence
3
Informativeness
2
Presentation
3
Soundness
2
Read review
Paper summary

This work introduces the pH-EBM framework, a neural architecture grounded in energy-based modern Hopfield networks to provide safety-by-design. The authors use neural ODEs to learn the energy landscape and geometric differences to characterize input-output trajectories. The evaluation is conducted on common physical system datasets.

Critical strengths
  1. The paper is easy to follow, and the problem formulation and proposed method are clearly presented. 
  2. The evaluation results show good performance improvements compared to the other two baselines.
Critical weaknesses
  1. Although the paper provides theoretical safety guarantees, the robustness of the model under perturbations and model mismatch remains unclear. More empirical verification would help demonstrate whether these guarantees hold in practical settings. 
  2. The role of convexity in the proposed framework is not clearly explained. While the overall energy landscape is nonconvex, Line 207 requires a convex potential. The authors should clarify why convexity is necessary for this component and how it relates to the overall nonconvex energy landscape. 
  3. Several existing methods use neural control barrier functions (CBFs) [R1, R2] to ensure safety. The paper does not clearly demonstrate the advantages of integrating dynamics learning and safety guarantees into a unified architecture rather than modeling them separately. A comparison with existing neural CBF methods would help justify this design choice. 

[R1] Zhang, Hongchao, et al. "Seev: Synthesis with efficient exact verification for relu neural barrier functions." Advances in Neural Information Processing Systems 37 (2024): 101367-101392. [R2] Dawson, Charles, et al. "Safe nonlinear control using robust neural lyapunov-barrier functions." Conference on robot learning. PMLR, 2022.

Questions for authors
  1. What distinguishes the proposed approach from existing safety certification methods, including neural CBFs and reachability-based approaches?
  2. What additional computations are needed to certify the admissible-input radius beyond the guarantees provided by the architecture? How does their cost scale with state dimension and network size?
3 comments
AuthorsOpenReview ↗

Radial and barrier function certificates

Thank you. We address your two questions first, followed by perturbations and convexity.

Q1: What distinguishes our approach from existing CBF and reachability certification methods?

Our contribution is an architecture for learning input-driven dynamics together with an energy function that defines candidate invariant regions. This complements methods that certify a given model through reachability or auxiliary barrier synthesis. Barrier synthesis typically learns a separate certificate and verifies its sign and dynamical conditions. Our Hamiltonian already supplies the candidate, while the port-Hamiltonian structure enforces the energy balance in Equation (5).

For zero input, energy sublevel components are invariant; for bounded inputs, Theorem 1 characterizes the admissible input radius through a boundary condition. No auxiliary barrier network needs to be learned.

The initial submission used sampling to evaluate input robustness across energy levels and investigate trajectory confinement. We now add formal verification and compare with adaptations of Mathiesen et al. [2] and UniQQ [3] on the frozen Duffing RK4 model. Independent NBF synthesis returned only coarse dataset-wide (whole state-input space) certificates. A subsequent energy-based finite-step barrier proof required more than 10 hours of refinement. Direct verification of our continuous-time energy condition took 16 minutes on the same hardware. These are distinct continuous-time and RK4 verification formulations.

Q2: What additional computation certifies the input radius, and how does it scale?

The energy threshold EE selects

CE:=Comp⁡z⋆z:H(z)≤E,E=H(z⋆)+ϵ,C_E:=\operatorname{Comp}_{z^\star}\\{z:H(z)\le E\\},\qquad E=H(z^\star)+\epsilon,

as in Equation (8). The state region is CEC_E, while ρ\rho bounds admissible inputs through ∣u(t)∣≤ρ\\|u(t)\\|\le\rho.

The submitted sampling procedure provides empirical estimates (Appendix C.7). We identify wells and sample the boundary using radial searches, bisection and local corrections (Appendix C.6). The minimum sampled ratio in Equation (10) gives ρ^\hat\rho. Formal certification tests smaller candidate radii with a sound verifier that encloses the component, establishes boundary regularity and proves

∇H(z)⊤fθ(z,u)≤0∀z∈∂CE,∀u∈Uρˉ,\nabla H(z)^\top f_\theta(z,u)\le0\qquad\forall z\in\partial C_E,\quad\forall u\in U_{\bar\rho},

where Uρˉ=u:∣u∣≤ρˉU_{\bar\rho}=\\{u:\\|u\\|\le\bar\rho\\}. We use Arb interval arithmetic [1] or our verifier adapting the bound-propagation approach of Mathiesen et al. [2].

For Duffing's right well, E≃−0.09565E\simeq-0.09565, sampling gave ρ^≃0.031\hat\rho\simeq0.031. Both verifiers certified ρˉ=0.0264\bar\rho=0.0264, taking approximately 36 and 16 minutes, respectively, on the same hardware with 16 workers. Larger model latent spaces increase the cost per enclosure; boundary subdivision can grow exponentially with state dimension.

We are running the remaining benchmarks and will post results as they become available.

Perturbations and model mismatch. Our objective is to learn plant dynamics while ensuring that the learned model admits provably invariant operating regions under admissible inputs. The Duffing certificate establishes this property for every forcing signal within its certified interval. This is valuable for digital twins of independently stabilized plants, long-horizon surrogate simulation and offline controller evaluation: stability of the physical system does not automatically carry over to a learned approximation. Our framework provides confinement guarantees for the model used in these virtual experiments. Transferring these guarantees to the physical plant is a separate direction we are currently investigating. The perturbation-aware theorem provides a starting point by reserving dissipation margin for bounded disturbances; plant-level guarantees additionally require a validated error bound linking model and plant.

Convexity. The total Hamiltonian is allowed to be nonconvex. Convexity concerns only the layer potentials Fh\mathcal F_h, whose gradients define the monotone activations of the Hopfield construction. These potentials enter the energy with negative signs and through composed features. For example, H(z)=z2/2−log⁡cosh⁡(az)H(z)=z^2/2-\log\cosh(az) is nonconvex for a>1a>1, although log⁡cosh⁡\log\cosh is convex. Compact sublevels follow from coercivity. The confinement theorem uses the energy balance and boundary condition, without requiring global convexity of HH.

References

[1] F. Johansson. Arb: efficient arbitrary-precision midpoint-radius interval arithmetic. IEEE Transactions on Computers 66(8), 1281–1292 (2017).

[2] F. B. Mathiesen, S. C. Calvert and L. Laurenti. Safety Certification for Stochastic Systems via Neural Barrier Functions. IEEE Control Systems Letters 7, 973–978 (2023).

[3] D. Zhi et al. Unifying Qualitative and Quantitative Safety Verification of DNN-Controlled Systems (UniQQ). CAV 2024, 401–426.

Thank you for the detailed response and the additional formal verification results. I appreciate the clarifications, which have addressed my questions. However, my main concerns remain unresolved, particularly regarding robustness under model mismatch and the advantages over existing neural CBF approaches.

We thank the reviewer for the comment and for acknowledging our clarifications. We clarify the remaining points below.

Advantages over existing neural CBF approaches

Existing CBF approaches commonly construct a (1) barrier function, often parametrised as a neural network, and a (2) controller to guarantee that a given prescribed set is forward invariant. Our approach considers a complementary problem: we learn a neural dynamical model together with a neural energy function, using a formulation that, by construction, guarantees that every ϵ\epsilon-sublevel set of the energy is ρ\rho-forward invariant.

CBF approaches prescribe safe regions for given learned dynamics; Ph-EBM learns the dynamics from data with input-robustness guarantees.

Certification within our framework reduces to verifying bounds on the already available energy neural network and the relevant set-containment conditions. We do not need to separately verify the Lie derivative of a neural barrier along the learned neural dynamics. Bounding this expression, which involves the barrier gradient and the system dynamics, is arguably one of the key computational challenges in formal neural barrier verification. Because of this advantage, as also emphasized in the previous reply, we can certify non-trivial invariant sets for systems that are otherwise infeasible for standard neural barrier function approaches.

Robustness under model mismatch

We emphasize that our framework provides stability and forward invariance guarantees for the learned model, but does not directly establish robustness to learning errors. Nevertheless, Theorem 2 guarantees that the identified safe sets remain safe under any perturbation of the signal u(t)u(t) with magnitude smaller than ρ\rho, thereby establishing robustness to this class of perturbations.

Reviewer_4VbBOpenReview ↗
Rating
2
Confidence
2
Informativeness
2
Presentation
2
Soundness
2
Read review
Paper summary

The paper aims to learn nonlinear dynamical systems with safety guarantees, motivated by the fact that accurate short-term predictions can still become unreliable over longer rollouts. The authors propose pH-EBM, which combines a port-Hamiltonian neural ODE with a nonconvex Hopfield energy function. They use this energy function to identify regions where trajectories remain confined under bounded external inputs. Experiments on five benchmarks show competitive prediction accuracy and larger estimated robustness margins than the portHNN-u baseline.

Critical strengths

-The same learned energy function is used to model the dynamics and certify invariant regions under bounded inputs. -This is useful because it supports multiple stable regimes while keeping the model amenable to safety analysis.

Critical weaknesses
  • The paper focuses on the theory development, but the experiment setup is very simple.
  • Only using RMSE is not enough for evaluating the performance.
  • The number of methods you compare with is also very limited.
Questions for authors
  • I'd like to see more details about different evaluation benchmark? How much data do you have for training and evaluation, and how many different scenarios are there in each benchmark? This helps me to understand the experiment part. I can consider raising my score if this part of the question is resolved.

From OpenReview, CC BY 4.0. Authors as signed there; shown unedited.

Related papers

Loading the map…

Discussion (0)

Sign in to comment.