Robots That Learn to Move Safely

Author: Denis Avetisyan


A new framework empowers robots to learn complex motions from demonstrations while providing guarantees on stability and safety.

The S2-NNDS framework learns robust neural dynamics from demonstrations, iteratively refining them with Lyapunov and barrier constraints via counterexamples, and ultimately provides formal statistical guarantees on both safety and stability through conformal prediction.
The S2-NNDS framework learns robust neural dynamics from demonstrations, iteratively refining them with Lyapunov and barrier constraints via counterexamples, and ultimately provides formal statistical guarantees on both safety and stability through conformal prediction.

This review details S2-NNDS, a neural network-based approach utilizing conformal prediction and Lyapunov functions for robust robot motion planning.

Achieving both safety and stability in robot motion planning remains a significant challenge, particularly when learning from complex, real-world demonstrations. This paper introduces Safe and Stable Neural Network Dynamical Systems (S$^2$-NNDS), a novel learning-from-demonstration framework that simultaneously learns expressive motion dynamics alongside neural network-based safety and stability certificates. By leveraging neural networks and probabilistic verification via conformal prediction, S$^2$-NNDS overcomes limitations of traditional polynomial parameterizations and provides guarantees for robust performance. Could this approach unlock more adaptable and reliable robotic systems capable of navigating dynamic and unpredictable environments?


The Challenge of Robotic Adaptation

Historically, robotic control has been heavily dependent on meticulously crafted, hand-engineered solutions designed for specific tasks and environments. This approach, while effective in highly structured settings, proves brittle when confronted with the inherent unpredictability of real-world scenarios. Each new environment or even slight variation in the task often necessitates substantial reprogramming, limiting a robot’s ability to function autonomously and adapt to unforeseen circumstances. The limitations stem from the difficulty of anticipating every possible contingency and encoding appropriate responses, hindering the deployment of robots in dynamic and unstructured environments where flexibility and improvisation are crucial. This reliance on pre-programmed instructions restricts a robot’s capacity for genuine learning and adaptation, demanding a shift towards more robust and generalized control strategies.

Achieving both safety and stability in robotic movements presents a significant engineering challenge, as traditional control methods often fall short when confronted with real-world unpredictability. Conventional techniques frequently prioritize one aspect over the other – a robot might execute a precise trajectory but risk collisions, or maintain balance at the expense of task completion. This arises because these methods typically rely on pre-programmed models of the robot and its environment, which are inevitably imperfect and unable to account for unforeseen disturbances or variations. Guaranteeing consistently safe operation requires robustly preventing unintended contact with obstacles and humans, while maintaining stability demands precise control of the robot’s center of gravity and momentum-a delicate balance made even more difficult by the inherent complexities of dynamic systems and the limitations of sensor data. Consequently, researchers are actively exploring novel approaches, such as reinforcement learning and model predictive control, to create robots capable of autonomously adapting to changing conditions and ensuring reliable, secure performance.

A significant obstacle to deploying robots beyond controlled settings lies in their limited ability to generalize from a small number of demonstrated examples. Current machine learning techniques often require extensive datasets to achieve robust performance, a demand impractical for many robotic applications where acquiring such data is costly or even dangerous. This struggle stems from a robot’s difficulty in discerning the underlying principles governing a task from just a few instances – it may memorize the specific motions shown but fail to adapt to novel situations, changes in object properties, or unexpected disturbances. Consequently, a robot trained on a limited demonstration might perform flawlessly in a lab but falter when faced with the variability inherent in real-world environments, severely restricting its usefulness beyond highly structured tasks. Overcoming this generalization challenge is crucial for unlocking the full potential of robotic automation and enabling widespread deployment in dynamic and unpredictable settings.

Our approach successfully learns safe trajectories (pink and brown) within a dynamically feasible region (green) for both handwriting and robotic tasks, as demonstrated using five initial conditions (blue) and visualized with directional flow arrows.
Our approach successfully learns safe trajectories (pink and brown) within a dynamically feasible region (green) for both handwriting and robotic tasks, as demonstrated using five initial conditions (blue) and visualized with directional flow arrows.

A Framework for Learning from Demonstration

The S2-NNDS framework enables the learning of time-invariant dynamical systems through the analysis of demonstrated trajectories. This is achieved by directly mapping observed state transitions to system parameters, bypassing the need for explicit system identification or hand-engineered models. The framework accepts a dataset of demonstrations, consisting of state and control sequences, and utilizes neural networks to approximate the underlying dynamics. This learned representation allows the system to predict future states given current states and control inputs, effectively replicating the demonstrated behavior. Importantly, the learned dynamics are time-invariant, meaning they do not change over time, simplifying analysis and ensuring consistent performance across different execution instances. The resultant model $f(x, u)$ represents the learned dynamical system, where $x$ is the state and $u$ is the control input.

The S2-NNDS framework utilizes Neural Networks to represent both the robot’s dynamical model and associated control constraints. Specifically, the robot’s dynamics – governing its movement based on inputs – are parameterized by a neural network, allowing for complex, non-linear behavior to be learned from demonstration data. Simultaneously, a separate neural network is employed to parameterize Lyapunov stability certificates, providing a quantifiable measure of system stability. This dual-network approach enables the framework to not only learn how the robot should move, but also to mathematically certify that these movements remain stable and within defined safety boundaries, effectively encoding safety constraints directly into the learned dynamics.

The S2-NNDS framework achieves behavioral replication by learning a dynamical system directly from demonstrated trajectories. Critically, this learning process is coupled with the simultaneous derivation of safety and stability certificates, expressed as Lyapunov functions and collision avoidance constraints. These certificates function as verifiable guarantees that the robot’s learned behavior remains within pre-defined operational boundaries, preventing unstable motions or collisions even when generalizing to novel situations. The framework ensures that mimicking expert demonstrations does not compromise safety; the learned policy is provably safe and stable within the constraints established by the certificates, providing a level of robustness not typically found in purely imitation-based learning approaches.

Our approach learns barrier functions that tightly conform to obstacles, resulting in less conservative trajectories compared to S2-NNDS and ABC-DS, as quantified in Table III.
Our approach learns barrier functions that tightly conform to obstacles, resulting in less conservative trajectories compared to S2-NNDS and ABC-DS, as quantified in Table III.

Formalizing Safety and Stability

Barrier Functions within the S2-NNDS framework provide a formal mechanism for defining safety constraints during robot operation. These functions, typically represented as $h(x) \ge 0$, are designed such that if a state $x$ violates a safety constraint, $h(x)$ becomes negative. The control strategy is then modified to ensure that the time derivative of $h(x)$, denoted as $\dot{h}(x)$, remains positive definite. This ensures the robot never reaches states where $h(x) \le 0$, effectively preventing it from entering undesirable or dangerous configurations. The function’s value remains non-negative as long as the robot stays within the defined safe operating region, providing a mathematically rigorous guarantee of safety.

Lyapunov Functions are analytical tools used to mathematically prove the stability of a dynamical system. Specifically, a Lyapunov Function, $V(x)$, is a scalar function that is positive definite – meaning $V(x) > 0$ for all states $x$ except at the equilibrium point where $V(x) = 0$ – and whose time derivative, $\dot{V}(x)$, is negative definite. This indicates that the system’s state will converge towards the equilibrium point following any disturbance. By demonstrating the existence of such a function for the S2-NNDS robot control system, it is formally guaranteed that the robot will return to a stable operating configuration after being subjected to external forces or modeling inaccuracies, ensuring robust and predictable behavior.

Optimization and verification of Barrier and Lyapunov functions within S2-NNDS rely on Sum-of-Squares (SOS) Optimization and Satisfiability Modulo Theories (SMT). SOS optimization transforms the problem of analyzing polynomial functions into a linear program, allowing efficient determination of positivity – a key requirement for stability and safety guarantees. Specifically, a function is considered positive if it can be expressed as a Sum-of-Squares of other polynomial functions. SMT solvers are then utilized to determine the satisfiability of constraints defined by these functions, ensuring the robot’s behavior adheres to predefined safety specifications. This combined approach provides rigorous mathematical guarantees regarding the system’s stability and prevents unsafe states by formally verifying the constraints defined by the Lyapunov and Barrier functions.

Despite generating plausible trajectories, the ABC-DS method fails to navigate cluttered environments because any practical semi-algebraic approximation of the demonstrated motion results in collisions with obstacles, unlike the S2-NNDS approach.
Despite generating plausible trajectories, the ABC-DS method fails to navigate cluttered environments because any practical semi-algebraic approximation of the demonstrated motion results in collisions with obstacles, unlike the S2-NNDS approach.

Demonstrating Robustness and Generalization

The S2-NNDS framework incorporates conformal prediction to move beyond simple trajectory reproduction and provide quantifiable assurances regarding the reliability of its learned safety certificates. This statistical approach doesn’t merely predict a safe path, but also assigns a probability to the correctness of that prediction, effectively communicating the framework’s confidence in its assessment. By leveraging conformal prediction, S2-NNDS can generate certificates accompanied by a defined error rate – for instance, ensuring a predicted trajectory is truly safe with 95% probability. This is achieved without requiring prior knowledge of the underlying dynamics or noise distribution, making the system adaptable and robust in real-world scenarios where uncertainties are inherent. The result is a more trustworthy system, capable of not only navigating successfully but also communicating the level of certainty associated with its decisions, a crucial feature for safety-critical applications.

The framework’s capacity to faithfully replicate observed motion is quantitatively assessed through the use of Mean Squared Error (MSE). Results indicate a demonstrably higher degree of accuracy in trajectory reproduction compared to the ABC-DS method, as evidenced by consistently lower MSE values. This signifies that the learned model more closely aligns with the demonstrated behaviors, suggesting a superior ability to capture the underlying dynamics of the system. The reduction in MSE is not merely a statistical difference; it translates to a more precise and reliable reconstruction of the intended movements, which is critical for applications demanding high fidelity, such as robotics and control systems. This improved accuracy forms a foundational element for ensuring both safe and effective operation within complex environments.

The framework demonstrates a capacity for robust generalization, effectively accommodating variations in demonstrated trajectory speed and timing through the implementation of Dynamic Time Warping. Evaluation reveals that S2-NNDS consistently achieves lower DTW distances compared to ABC-DS, signifying a superior ability to recognize similar trajectories even with temporal distortions. This adaptability extends to safety margins, as the learned barrier functions generate a demonstrably larger safe set area than those produced by ABC-DS; this indicates less conservative behavior and allows for greater operational flexibility without compromising safety constraints. The resulting system offers a balance between adherence to demonstrated behaviors and the capacity to navigate real-world scenarios with inherent timing and speed fluctuations.

Our approach successfully generates a 3D C-shaped motion with NeuralDS, navigating obstacles using only ten demonstrations, as illustrated by the legend in Figure 2.
Our approach successfully generates a 3D C-shaped motion with NeuralDS, navigating obstacles using only ten demonstrations, as illustrated by the legend in Figure 2.

The pursuit of robust and reliable robotic systems, as detailed in the framework of S2-NNDS, mirrors a fundamental tenet of elegant design. The emphasis on verifiable safety and stability through techniques like conformal prediction and Lyapunov functions demonstrates a commitment to paring away unnecessary complexity. As Donald Knuth aptly stated, “Premature optimization is the root of all evil.” This principle resonates deeply; the work doesn’t prioritize sheer computational speed but instead focuses on building a foundation of provable correctness. The framework elegantly seeks to minimize potential failure modes, striving for a system where every component contributes meaningfully to overall performance and safety, embodying the ideal of perfection through subtraction.

Where To Now?

The pursuit of demonstrably safe robotic systems, as exemplified by S2-NNDS, reveals a fundamental tension. Rigorous verification, currently achieved via conformal prediction and Lyapunov functions, exacts a computational cost. Future work must address this directly. The minimization of this cost – not merely in cycles, but in conceptual complexity – remains paramount. Clarity is the minimum viable kindness.

Current approaches largely assume access to reasonably clean demonstrations. A more pressing, and perhaps intractable, challenge lies in learning from imperfect, noisy, or incomplete data. Robustness to such imperfections isn’t simply a matter of adding more data; it requires a rethinking of the underlying assumptions about system identification. The field often prioritizes what a system does, neglecting how it arrives at a solution.

Ultimately, the true measure of success isn’t the creation of increasingly complex algorithms, but the development of simpler systems capable of demonstrably safe and stable operation. The elimination of unnecessary layers – both algorithmic and conceptual – will define progress. The goal is not intelligent robots, but reliable ones.


Original article: https://arxiv.org/pdf/2511.20593.pdf

Contact the author: https://www.linkedin.com/in/avetisyan/

See also:

2025-11-27 00:28