Teaching the Planner to Stop Leaning on the Safety Layer

Robots built from hand-written state machines and fixed thresholds break when friction, stiffness or terrain change. The usual replacement is a two-level controller: a learned high-level policy proposes motions, and a low-level optimizer, called a whole-body follower, tracks them while enforcing torque, joint and contact limits. This makes the robot safe at every instant, but it hides a problem. The high-level policy never learns that it is asking for unsafe things. It keeps proposing motions the follower must clip or override. That costs task performance, and it leaves the robot one bad friction estimate away from a fall. The policy also still needs a pile of hand-weighted reward terms for posture, energy and smoothness, and those weights rarely transfer between robots or terrains.

We propose to measure how hard the follower has to work and to treat that as a budgeted cost the high-level policy must keep small. The follower guarantees safety during every training step. The learning problem asks the planner to stay inside the follower's comfortable operating region, with a formal limit on how often and how much the follower intervenes. Because intervention is graded and nonzero well before any real violation, it gives the safety learner the dense near-boundary signal that rare violations cannot. The same follower also absorbs posture and joint-centering goals as lower-priority tasks, so most multi-objective reward terms disappear from the policy's reward.

Core Claim

The claim has three parts. First, a constrained Markov decision process (a reinforcement learning problem where the agent maximizes reward subject to a limit on expected cumulative cost) is the right way to train the high-level layer, provided its cost is the follower's intervention rather than raw violations. Second, this cost is dense where a violation-only cost is sparse. It should therefore sidestep the "safety paradox" of Breaking Safety Paradox with Feasible Dual Policy Iteration, which shows that safer policies produce too few violation samples to estimate feasibility. Third, budgeting intervention yields policies that keep a margin from constraint boundaries. These policies should degrade less under unmodeled friction and sensor shifts than boundary-hugging ones.

Concretely, let $u^{\text{cmd}}_t$ be the reference the high-level policy commands at step $t$, and let $u^{\text{exec}}_t$ be what the follower's prioritized optimization actually realizes after enforcing constraints. Let $n_t$ be the number of soft constraints active at the follower's solution. The intervention cost is

$$c_t = \lVert u^{\text{exec}}_t - u^{\text{cmd}}_t \rVert_W^2 + \beta\, n_t,$$

with $W$ a fixed normalization by actuator range and $\beta$ a small weight on active constraints. The high-level policy $\pi$ solves

$$\max_\pi \; \mathbb{E}\Big[\textstyle\sum_t \gamma^t r^{\text{task}}_t\Big] \quad \text{s.t.} \quad \mathbb{E}\Big[\textstyle\sum_t \gamma^t c_t\Big] \le \delta,$$

where $r^{\text{task}}_t$ contains only task terms such as velocity tracking or object progress, $\gamma$ is the discount and $\delta$ is the intervention budget. Hard safety is never delegated to the budget; the follower enforces it at every step. The budget governs only how much the planner relies on that enforcement.

Relation to Prior Work

The closest work is Whole-Body Constrained Learning for Legged Locomotion via Hierarchical Optimization. It pairs a reinforcement learning planner with a multi-priority whole-body follower. In simulation it enforces only hard constraints during training and activates friction-cone soft constraints at deployment. It motivates our proposal and supplies its architecture, but its planner is trained without any constraint and with heavy manual reward engineering. The planner can therefore repeatedly propose infeasible motions, and the training-time follower differs from the deployed one. We keep the full follower in the loop during training and add the intervention budget.

Safe and Balanced (CR-MOPO) is the closest work on combining many objectives with safety. It keeps a separate value estimate per objective and per constraint, takes conflict-averse gradient steps inside the safe region, and switches to pure constraint rectification when a constraint is violated. It operates on a flat torque policy and converges to policies on the edge of the safe set. We differ on two points. We move secondary objectives out of the reward and into the follower's priority stack instead of balancing them by gradient geometry. We also aim for a margin rather than the boundary.

HiSaRL also places a safety shield under a planner, using a learned Lyapunov region on 2D navigation. Its shield overrides, but the planner is not trained to reduce overrides, and it handles neither articulated contact nor multiple objectives.

Two papers supply technique. PSRAB resolves secondary goals in a manipulator's kinematic null space and stores only the unbiased action in the replay buffer, so they never interfere with task learning. It assumes task reward depends only on the end effector, which fails once elbows, knees or torso touch things. A prioritized whole-body follower generalizes that idea to contact-rich bodies because it models contacts explicitly, and we borrow PSRAB's choice of which action to store as an ablation. First Order Constrained Optimization in Policy Space (FOCOPS) and the PID-damped Lagrangian methods in SafePO, from Safety Gymnasium, supply the constrained optimizers we run on the high level.

Two lines of work constrain the design. Backward value functions give safety throughout training but are conservative and assume a feasible start. Our follower removes the need for that feasibility assumption, because every executed action is already safe. Multiplicative rewards as in SkillMimic stop agents from neglecting a sub-goal, but they collapse gradients when one factor hits zero. This is a reason not to encode safety multiplicatively.

Research Program

We will build three things. The first is a quadruped whole-body follower in Isaac Gym, modeled on the multi-priority structure of the legged paper. Its top priority is dynamic consistency, then reference tracking, then friction cones, torque limits and self-collision as soft constraints, then posture and joint centering at the lowest priority. The follower runs inside every training rollout.

The second is a high-level policy trained with FOCOPS and with PID-Lagrangian PPO from SafePO under the intervention budget. We will compare two choices for the replay or rollout record: logging $u^{\text{cmd}}$ (following PSRAB) or $u^{\text{exec}}$.

The third is a manipulation instance. We will use robosuite's Operational Space Control setting on Door Opening and Pick-and-Place with a Franka arm, where the follower is the operational-space controller extended with joint-limit and contact-force constraints. In this setting the arm's links may contact the environment, which is exactly where PSRAB's invariance assumption fails.

The analysis question is whether intervention cost predicts real violations under distribution shift. We will check whether low-intervention policies keep measurable margins: friction-cone slack, torque headroom and distance to joint limits.

Baselines

The naive reference is the follower-protected planner trained with an unconstrained reward and the follower's hard constraints only. This reproduces the training recipe of Whole-Body Constrained Learning, including its posture and smoothness reward terms. That paper reports 100% stairs success with 0 collisions and 1 torque violation, against 5 torque violations for end-to-end learning and 6 for Rapid Motor Adaptation. This is the strongest existing hierarchical number in the file and the bar for safety. We will tune it with the same number of reward-weight trials we give our method.

The second baseline adds the full follower, soft constraints included, during training, still without a budget. This isolates whether consistency between training and deployment alone explains any gain.

The third is flat constrained multi-objective learning with CR-MOPO, which reports a Walker move reward above 800 against under 250 for LP3. The fourth is flat FOCOPS, which reports 1106.1 on Humanoid-Circle at a cost limit of 50, against 671.0 for CPO and 697.5 for TRPO-Lagrangian, as reported in the FOCOPS paper. We run both on the Safe Multi-Objective MuJoCo tasks and on our quadruped, with identical environment steps and hyperparameter search budgets.

The key ablations hold the follower and optimizer fixed and swap the cost. One version uses intervention cost as an additive reward penalty swept over a grid of weights. Another uses a sparse cost counting only actual follower-reported violations. A third logs executed rather than commanded actions.

Beating the naive baseline means matching its task return and safety count while cutting follower intervention and violations under shift. Beating CR-MOPO or FOCOPS means higher task return at equal or lower violation, with zero hard violations during training, which they do not provide.

Why not just…?

Why not just add the intervention magnitude to the reward as a penalty? This is the real threat, since it needs no constrained optimizer. Quanyi Li et al. and Al-Hafez et al. document the usual problem with penalties: too small a weight lets violations through, and too large a weight freezes the robot. A fixed budget is expressed in interpretable units of intervention, while a weight is not. The penalty-sweep ablation settles the question directly. If a single penalty weight transfers across nominal friction, low friction and stairs as well as a single budget $\delta$ does, we will report that the constrained formulation is unnecessary and recommend the penalty.

Why not just rely on the follower, since it already guarantees safety? The follower guarantees safety only with respect to its model. When its friction estimate is wrong, a planner that routinely pushes it to the edge has no margin left. The decisive check is the friction-shift and noise test described below, comparing violations of the naive baseline and our policy at matched nominal return. If they are equal, the budget buys nothing.

Why not just train a flat constrained policy, such as CR-MOPO or PPO-Lagrangian, and skip the hierarchy? Flat constrained methods satisfy their limits only in expectation and only near convergence. Satija et al. report that Lagrangian methods violate constraints during training. Safety Gymnasium reports PPO-Lagrangian cutting violations by 98% at a 45% reward cost on velocity tasks, which is not per-step safety. We will count training-time violations for every method; ours should be zero by construction.

Proposed Experiments

The main experiment trains each method on a quadruped in Isaac Gym under nominal friction. The tasks are rough terrain and stairs following the legged paper's protocol, with five seeds and equal sample budgets. We will report task return, follower intervention, and counts of torque, collision and slip violations during training and at test.

The decisive test runs these policies, without retraining, under reduced friction, heavier payloads and observation noise, while the follower keeps its nominal model. The hypothesis is that our policies show fewer violations and falls at matched nominal return. We expect this because a budgeted planner keeps friction-cone slack that a boundary-hugging planner spends.

The second decisive check concerns the safety paradox. We will compare the dense intervention cost against the sparse violation cost and track how stable the cost estimate and dual variable are late in training, when violations become rare. If the paradox paper's diagnosis is right, the sparse variant should oscillate or drift and ours should not.

The third check is on manipulation. On robosuite Door Opening and Pick-and-Place, with link contacts enabled, we will compare our method with PSRAB-style null-space biasing on success rate and contact-force violations. robosuite reports no numerical success rates for these tasks in the file, and no reported result was found on Lacuna for PSRAB numbers on RLBench, so all numbers there are new. We will also count how many reward terms each method needs.

Finally, on Safe Multi-Objective MuJoCo Walker and Humanoid, we will test whether placing posture and torque objectives in the follower matches CR-MOPO's reported Walker move reward above 800 with fewer violations.