SafeMind: A Risk-Aware Differentiable Control Framework for Adaptive and Safe Quadruped Locomotion

ZUKUN ZHANG 1, KAI SHU 2, MINGQIAO MO 3 · 2026

Read SafeMind: A Risk-Aware Differentiable Control Framework for Adaptive and Safe Quadruped Locomotion by ZUKUN ZHANG 1, KAI SHU 2, MINGQIAO MO 3 (2026) in the Tower of Babel, a free online library of public-domain works preserved in clean, searchable text. No sign-up. The full text is served as a plain-text file at a predictable URL, where text is present: https://antarctic-labs.com/tower-of-babel/arxiv-2604-09474.txt.

Introduction

Zhang, Shu, and Mo present SafeMind, a risk-aware differentiable control plan for four-legged walking. Learning-based four-legged controllers are agile but lack safety proof under uncertainty and rough contact. SafeMind joins probabilistic Control Barrier Functions with scene sense and risk tuning. It models uncertainty through a variance-aware barrier limit, with an encoder shifting margins and a learner tuning risk sense. Run on Unitree A1 and ANYmal C at 200 hertz, SafeMind cuts safety breaches by 3 to 10 times and energy use by 10 to 15 percent.

Catalog record

CREATORZUKUN ZHANG 1, KAI SHU 2, MINGQIAO MO 3
YEAR2026
COLLECTIONPAPERS
FORMATTXT
FILE SIZE124441
LICENSEhttp://creativecommons.org/licenses/by/4.0/
RIGHTSCC BY
SOURCEarXiv

Source: https://arxiv.org/abs/2604.09474

Browse the full library · About the Tower of Babel

Full text

The opening of the work, from the library's hosted text:

SafeMind: A Risk-Aware Differentiable Control Framework for Adaptive and Safe Quadruped Locomotion ZUKUN ZHANG 1, KAI SHU 2, MINGQIAO MO 3 Abstract Learning-based quadruped controllers achieve impressive agility but typically lack formal safety guarantees under model uncertainty, perception noise, and unstructured contact conditions. We introduce SafeMind , a differentiable stochastic safety-control framework that unifies probabilistic Control Barrier Functions with semantic context understanding and meta-adaptive risk calibration. SafeMind explicitly models epistemic and aleatoric uncertainty through a variance-aware barrier constraint embedded in a differentiable quadratic program, thereby preserving gradient flow for end-to-end training. A semantics-to-constraint encoder modulates safety margins using perceptual or language cues, while a meta-adaptive learner continuously adjusts risk sensitivity across environments. We provide theoretical conditions for probabilistic forward invariance, feasibility, and stability under stochastic dynamics. SafeMind is deployed on Unitree A1 and ANYmal C at 200 Hz and validated across 12 terrain types, dynamic obstacles, morphology perturbations, and semantically defined tasks. Experiments show that SafeMind reduces safety violations by 3–10 × \times and energy consumption by 10–15% relative to state-of-the-art CBF, MPC, and hybrid RL baselines, while maintaining real-time control performance. † † address: The University of Hong Kong, Pokfulam, Hong Kong, China † † address: Alibaba, Beijing, China † † address: University of Chinese Academy of Sciences, No.1 Yanqihu East Rd, Huairou District, Beijing, China † † corresponding: Corresponding author: Mingqiao Mo (e-mail: [email protected]). I Introduction Ensuring safety in quadruped locomotion remains a fundamental challenge, particularly when robots operate in unstructured environments with uncertain ground contact, modeling errors, perception noise, and rapidly changing terrain conditions. Although model-based controllers such as Model Predictive Control (MPC) have demonstrated strong performance in regulating whole-body dynamics [ 27 , 17 ] , their reliability heavily depends on accurate modeling of friction, contact geometry, and actuator behavior. When these assumptions are violated, constraint feasibility can deteriorate, leading to unsafe joint torques, loss of stability, or unrecoverable foot-slip events. In parallel, learning-based locomotion has achieved remarkable agility and adaptability by leveraging large-scale simulation, domain randomization, and end-to-end policy learning [ 24 , 30 , 34 ] . These approaches enable quadrupeds to traverse highly irregular terrain and execute dynamic gaits that exceed the capabilities of classical controllers. However, such methods rarely incorporate formal safety constraints, and even policies trained with extensive randomization can violate torque bounds, kinematic limits, or support polygon feasibility when deployed under real-world disturbances. Recent studies have shown that learning-based locomotion remains vulnerable to model shift, delayed perception, and contact misclassification, underscoring the need for safety mechanisms that go beyond reward shaping or heuristic penalties [ 34 , 21 ] . Control Barrier Functions (CBFs) offer a formal framework for enforcing safety through forward invariance constraints [ 4 , 3 , 46 ] . CBF-based controllers can be embedded into real-time quadratic programs (QPs) that guarantee constraint satisfaction under nominal dynamics. This approach has been successfully applied to locomotion, manipulation, and aerial systems. Nevertheless, classical CBF formulations rely on deterministic dynamics and require accurate knowledge of system drift, contact models, and sensory feedback. When deployed on legged robots—systems dominated by hybrid dynamics, intermittent contact, and non-smooth terrain interactions—deterministic CBFs often become overly conservative or fail when model mismatch grows beyond acceptable limits [ 35 , 26 ] . Recent progress in differentiable optimization has enabled the integration of QP-based control layers into neural networks, allowing gradients to propagate through constrained solvers [ 5 , 2 ] . This development has motivated several differentiable safety architectures for robotics [ 10 , 18 ] , bridging learning and model-based control. In particular, prior differentiable CBF controllers and BarrierNet-like formulations have shown that safety filters can be embedded into end-to-end trainable architectures, while stochastic MPC has demonstrated improved robustness by explicitly propagating uncertainty through predictive control. However, these lines of work remain individually limited for quadruped locomotion under uncertainty: differentiable CBF methods are typically built on deterministic barrier evolution, stochastic MPC is often computationally heavy and not naturally differentiable end-to-end, and existing safe-learning frameworks rarely incorporate high-level semantic context into the safety layer itself. As a result, existing methods do not jointly provide differentiable safety enforcement, explicit probabilistic treatment of epistemic and aleatoric uncertainty, semantic constraint modulation, and online risk adaptation within a single real-time quadruped control framework. This gap is particularly consequential in legged locomotion, where terrain uncertainty, contact switching, and task-dependent behavioral constraints must be handled simultaneously. Moreover, emerging vision–language and semantic reasoning models have opened new possibilities for grounding robot behavior in high-level contextual instructions [ 8 , 42 ] . Yet, incorporating semantic cues—such as “avoid wet surfaces” or ”maintain distance from humans”—into continuous-time safety constraints remains largely unexplored. Existing approaches typically rely on symbolic planners or heuristic mapping of semantic labels to navigation objectives, without providing differentiable safety guarantees. In quadruped locomotion, this limitation is more pronounced because semantic instructions must ultimately be reconciled with low-level physical safety constraints such as support consistency, actuation limits, slip avoidance, and contact feasibility. Motivated by these gaps, this work proposes SafeMind , a risk-aware differentiable control framework that integrates stochastic barrier modeling, semantic constraint encoding, and meta-adaptive risk calibration to achieve safety-aware quadruped locomotion under uncertainty. SafeMind unifies probabilistic safety constraints with real-time differentiable optimization, enabling end-to-end learning while ensuring formal safety guarantees even when terrain, morphology, and semantic context vary unpredictably. Unlike prior differentiable CBF controllers, SafeMind models safety evolution under uncertainty through stochastic barrier dynamics; unlike stochastic MPC approaches, it preserves an end-to-end differentiable safety layer suitable for learning-based adaptation; and unlike existing semantic-aware locomotion pipelines, it embeds semantic context directly into the safety constraint generation process rather than treating semantics only at the planning or reward-design level. To make the scope of these guarantees precise, the proposed theory is developed for stochastic mode-wise locomotion dynamics and is later discussed in the context of hybrid contact transitions, where the guarantees hold within contact phases and are implemented with practical safeguards across switching events. Accordingly, the central objective of this paper is not merely to combine several existing modules, but to establish a unified framework in which probabilistic safety modeling, differentiable constrained control, semantic context conditioning, and adaptive risk calibration operate coherently at quadruped control rates. The main contributions of this work are summarized as follows: • Risk-Aware Differentiable Safety Modeling: We formulate probabilistic control constraints that capture both epistemic and aleatoric uncertainty through stochastic barrier dynamics while remaining differentiable for end-to-end optimization. • Semantic Context Integration: We introduce a context-encoding mechanism that transforms perception- or language-derived semantic information into task-dependent safety parameters and constraint modulations for real-time control. • Meta-Adaptive Learning Mechanism: We develop an online update procedure for risk parameters using meta-gradient adaptation with bounded safety-margin adjustment, enabling rapid adaptation across terrain conditions while preserving control-loop practicality. • Experimental Validation on Quadruped Platforms: We implement SafeMind on Unitree A1 and ANYmal C robots and evaluate it in extensive simulation and hardware experiments on uneven terrain, dynamic obstacle avoidance, and semantically defined hazards, demonstrating improved safety, robustness, and efficiency relative to strong model-based and learning-based baselines. II Background Safety-critical control aims to ensure that system trajectories remain within predefined safe sets despite model uncertainties and external disturbances. For nonlinear control-affine systems of the form \dot{x}=f(x)+g(x)u, (1) Control Barrier Functions (CBFs)

Read the complete text