Manuscript Offprint
arXiv:2611.02888A Universal Policy Wrapper With Guarantees
PREPRINT, COMPILED NOVEMBER 3, 2026
Georgiy Malaniya
Center for Engineering Systems and Sciences,
30 Bolshoy Boulevard, bld. 1, Moscow, 121205, Russia;
Central University,
7 Gasheka St., bld. 1, Moscow, 123056, Russia
Anton Bolychev
Center for Engineering Systems and Sciences,
30 Bolshoy Boulevard, bld. 1, Moscow, 121205, Russia
Pavel Osinenko
Central University, 7 Gasheka St., bld. 1, Moscow, 123056, Russia;
Center for Engineering Systems and Sciences, 30 Bolshoy Boulevard, bld. 1, Moscow, 121205, Russia;
Sirius University of Science and Technology, 1 Olimpiyskiy Avenue, Sirius, 354340, Russia
ABSTRACT
Many control tasks require driving the system into a prescribed goal set and subsequently keeping it there. The considered setting assumes that a working controller is available that provably reaches and maintains the goal, albeit with suboptimal performance. This controller is referred to as the fallback policy. Conversely, although state-of-the-art reinforcement-learning (RL) algorithms can discover policies with impressive empirical performance, the neural networks at their core act as opaque black boxes learned through data-driven exploration and, as such, provide no theoretical mechanism to guarantee that the system will ever reach—and stay within—the prescribed goal set. This article presents CALF-Wrapper, a method that combines the fallback policy with a pretrained RL base policy and uses the critic estimate associated with the base policy to select between them during deployment. The theoretical analysis establishes that CALF-Wrapper inherits the goal-reaching property of the fallback policy under the stated assumptions and provides probability bounds for the settling time and the maximum distance from the goal set over a prescribed time interval. The experimental study evaluates CALF-Wrapper in four simulated control environments of different complexity. Comparisons include the base policy, fallback policy, and constrained reinforcement-learning methods formulated for the same objective. Sensitivity and ablation studies provide direct hyperparameter recommendations. The experiments show how CALF-Wrapper can provide effective task performance while attaining the maximum possible observed goal-reaching rate. CALF-Wrapper requires no additional dynamics model, online learning, or constrained optimization during execution.
Keywords Lyapunov functions · Policy switching · Reinforcement learning
1 INTRODUCTION
Reinforcement learning (RL) has proved to be a powerful framework for solving control problems in complex, high-dimensional settings. Most RL algorithms optimize control policies through direct interaction with a system (often called an environment), relying solely on reward signals observed at each step, without requiring explicit knowledge of system dynamics. The remarkable successes of RL span applications such as robotic manipulation [1,2], board games like Go, chess, and shogi [3], and complex real-time video games [4].
State-of-the-art deep-RL algorithms—including Twin-Delayed Deep Deterministic Policy Gradient (TD3) [5], Soft Actor-Critic (SAC) [6], and Proximal Policy Optimization (PPO) [7]—learn effective control policies in practice, yet they do not establish that a learned policy satisfies a user-specified objective. To make this requirement precise, this work considers a prescribed goal set: a task-dependent subset of the state space that the agent is required to reach and remain in. The geometry of this set is task-dependent—for an inverted pendulum it corresponds to upright configurations within a narrow angular tolerance; in algorithmic trading it might be the region where cumulative profit is positive; and in autonomous driving it can be a small neighborhood surrounding the intended GPS destination. Throughout this work, a nonempty goal set is assumed to be specified in advance. A policy that reaches the prescribed goal set and remains there is said to satisfy the goal-reaching property formalized in Section 2.
Standard reinforcement-learning methods such as PPO and TD3 can discover high-performing policies. However, these methods provide no formal mechanism for establishing whether the learned policy reaches the prescribed goal. This behavior can therefore generally be assessed only empirically. These methods are also often difficult to tune. Rather than attempting to establish this property for opaque learned policies, the formulation assumes the existence of a predefined (possibly suboptimal) controller that already satisfies the goal-reaching property—e.g., a provably stable yet energy-inefficient impedance controller for a robotic arm; a con-
*The first two authors contributed equally.
†Corresponding author.
This work was supported by the Russian Science Foundation (RSF) under Grant 25-21-00872. This article has been accepted for publication in IEEE Access.
servative, capital-preserving rule-based trading strategy; or a heuristic vehicle-routing routine that ensures delivery irrespective of fuel costs. In the remainder of the paper, this controller is referred to as the fallback controller or fallback policy. The focus is to enhance this fallback policy while preserving its goal-reaching property. The origin of the fallback controller—classical control (e.g., proportional-derivative (PD) control, linear-quadratic regulator (LQR), or model predictive control (MPC)), domain heuristics, or engineering practice—is immaterial to the analysis and problem formulation. The sole objective is to improve the performance of the fallback policy without losing its formal goal-reaching property.
To improve the performance of the fallback policy, the method introduces a second ingredient: a performance-seeking policy learned by reinforcement learning, referred to as the base policy. Trained with any standard RL algorithm—TD3, Soft Actor-Critic, PPO, or similar—the base policy is explicitly optimized for high cumulative reward and therefore often attains stronger empirical returns. However, it is not known to satisfy the goal-reaching property for the prescribed goal set.
The approach presented in this paper treats the fallback controller as an anchor for correctness and the learned RL policy as a source of performance gains. The approach is referred to as the CALF-Wrapper. It is designed as a lightweight decision-making mechanism that, at each step, decides whether to execute the learned base policy or revert to the fallback policy. The wrapper can be applied after training to a broad class of RL policies for which a corresponding value estimate is available. This estimate may be provided directly by a critic or obtained by evaluating an action-value critic at the action selected by the base policy.
- No online learning or per-step optimization. CALF continuously updates its policy during execution by solving a constrained optimization problem at each step. In contrast, CALF-Wrapper is a deployment-time wrapper, requiring no additional learning and no per-step optimization.
- Plug-and-play deployment. CALF's fallback policy is tightly integrated into the training loop, making the overall algorithm inseparable from the learning process. The proposed wrapper can be attached to an already-trained policy without modifying the training code or the underlying policy network, yielding immediate applicability across a wide range of domains.
- Adjustable trade-off between performance and the goal-reaching property. CALF's control law is strictly deterministic. CALF-Wrapper introduces a probabilistic decision-making mechanism that provides an adjustable trade-off between performance and the goal-reaching property.
The differences between the original CALF algorithm and CALF-Wrapper are summarized in Table 1.
Table 1: Comparison of the original CALF algorithm and CALF-Wrapper.
| Aspect | Original CALF [8] | CALF-Wrapper (Algorithm 1) |
|---|---|---|
| Operation | Online learning | Deployment after training |
| Policy | Actions are obtained by optimizing the critic over the action space or are generated by an actor model | Fixed pretrained base policy |
| Critic | The critic model is updated online through constrained optimization | The critic is loaded from the same saved training checkpoint as the base policy and remains fixed during deployment |
| Online optimization | Critic-loss minimization subject to a decrease constraint and critic bounds | No critic-weight or action optimization |
| Decision at each step | The constrained critic-update problem is solved. The action generated by the learning algorithm is applied if a feasible solution is found; otherwise, the fallback-policy action is applied. | The decision requires only one critic forward pass, one uniform random-number sample, and scalar comparisons. No optimization problem is solved. |
| RL training | Modifies the critic update | Does not modify training |
Achieving these contributions required a substantial reorganization of the theoretical results. The inheritance of the goal-reaching property from the fallback policy—though conceptually similar to CALF—was the least demanding part, yet it still required several techniques to accommodate the probabilistic decision mechanism. In contrast, the analysis of the uniform properties of the goal-reaching behavior of CALF-Wrapper required substantially more extensive theoretical development. The analysis is presented in this article in two alternative forms. Section 5 develops a fundamentally new theoretical analysis under weaker assumptions on the fallback policy and establishes uniform properties of the goal-reaching behavior of CALF-Wrapper. Specifically, it provides a single finite bound on the expected distance from the goal set that holds at every time and gives probability bounds on when the trajectory enters and subsequently remains in a prescribed neighborhood of the goal set. Appendix C provides an alternative analysis under stronger assumptions and establishes correspondingly stronger claims.
Beyond CALF, related work includes runtime assurance, shielding, safety filters, and methods that use intervention or recovery policies. The Simplex architecture switches from an unverified advanced controller to a certified backup controller when a runtime monitor predicts loss of safety [9]. Shielding similarly rejects or replaces actions that violate a formal safety specification [10, 20]; recent work extends this principle to realizable shields in continuous state and action spaces [11]. Predictive safety filters instead modify proposed actions through a model-based feasibility or optimization problem so that state and input constraints remain satisfied [12, 13]. These approaches primarily prevent violations of formal safety specifications or state and input constraints. CALF-Wrapper instead addresses whether the system reaches a prescribed goal set and remains there.
Several related methods replace an action proposed by a performance-seeking policy when that action may lead to a constraint violation. Recovery RL uses a task policy for performance and a recovery policy for constraint satisfaction. A safety critic, initialized from offline examples of constraint violations, estimates the discounted probability of a future violation for the action proposed by the task policy. If the estimate exceeds a threshold, the recovery-policy action is applied instead [14]. SAILR compares each action proposed by the policy being trained with the action selected by a predefined backup policy that is expected to satisfy the constraints. If the proposed action has a sufficiently higher estimated future constraint cost, it is replaced by the backup-policy action. SAILR also penalizes such proposed actions in a surrogate unconstrained problem, which trains the policy to avoid actions that would require replacement by the backup policy [15]. Dynamic Model Predictive Shielding uses local planning when the action proposed by the learned policy may lead to a safety violation. The planner selects an alternative action that preserves safety while also improving task progress [16].
These methods generally require additional learning, system models, online planning, or a formal safety specification. CALF-Wrapper instead operates after the base policy and critic have been trained. It uses the base policy and critic stored at a selected training checkpoint together with a fixed fallback policy. During deployment, CALF-Wrapper updates none of these components and requires neither a system model nor the solution of a planning or constrained optimization problem. CALF-Wrapper addresses a different objective from shields and safety filters. It does not detect or prevent violations of state or input constraints. The predefined fallback policy is used so that the closed-loop trajectory reaches the prescribed goal set and remains there under the stated assumptions, rather than to prevent constraint violations. Consequently, the methods discussed above do not provide direct baselines for CALF-Wrapper in their original formulations because applying them to the present problem would require reformulating their objectives and requirements.
However, the constrained reinforcement-learning framework can be formulated for the goal-reaching objective considered in this article and therefore provides a suitable baseline for the
experimental evaluation of CALF-Wrapper in Section 6. This methodology is widely used in safe reinforcement learning, where undesirable outcomes are represented by cost functions and a policy is trained to maximize the expected cumulative reward subject to limits on expected cumulative costs [17–19,21–23]. For the present comparison, failure under the environment-specific goal-reaching criterion is represented by a binary cost.
A standard way to solve this constrained training problem is to introduce a nonnegative Lagrange multiplier for the cost limit and update both the policy and the multiplier during training [19, 22]. In this article, the resulting Lagrangian variants of PPO and TD3 are referred to as PPO-Lagrangian and TD3-Lagrangian, respectively. Their constrained problems and implementations are described in Appendix H. Using these baselines retains the reinforcement-learning algorithm used in each environment while changing whether the requirement on reaching the prescribed goal set is addressed during constrained training or by applying CALF-Wrapper after training.
To conclude this section, Table 2 summarizes the comparison with the related methods discussed above.
1.2 Key Contributions
-
A deployment-time policy wrapper that can be applied to a broad class of trained RL policies for which a corresponding value estimate is available. This estimate may be provided directly by a critic or obtained by evaluating an action-value critic at the action selected by the base policy. CALF-Wrapper combines the base policy with a predefined fallback policy, keeps all components fixed during deployment, and requires neither online learning nor online constrained optimization.
-
A theoretical analysis establishing that CALF-Wrapper inherits the goal-reaching property of the fallback policy under the stated assumptions. The analysis of the uniform properties of the goal-reaching behavior of CALF-Wrapper is presented in two alternative forms. Section 5 establishes these properties using a uniform bound on the rate at which the expected distance from the goal set decreases under the
Table 2: Conceptual comparison with representative safe-RL and runtime-intervention approaches.
| Approach | Objective or property | Operation during execution | Principal requirements | Relation to policy training |
|---|---|---|---|---|
| Simplex and shielding [9–11] | Formal safety-specification satisfaction | Switches controller or rejects or replaces the proposed action | Runtime monitor and certified backup controller, or model or abstraction and safety specification | May be constructed separately or incorporated into training |
| Predictive safety filters [12, 13] | State and input constraint satisfaction | Modifies the proposed action through a model-based feasibility or optimization problem | Dynamics model, constraints, and feasible set or certificate | Can wrap a fixed policy and solves an online problem |
| Recovery and intervention methods [14–16] | Constraint satisfaction or reduced violation probability | Replaces the proposed action with a recovery, backup, or planned action | Safety critic and recovery or backup policy, or dynamics model and planner | Requires additional learning, online planning, or both |
| Constrained safe RL [17–19] | Expected return subject to expected cumulative cost limits | Executes the trained policy directly | Reward, constraint-cost signal, and cost limit | Includes cost constraints in policy training |
| PPO-Lagrangian and TD3-Lagrangian implemented and used as baselines in this article [5,7,19] | Expected return subject to a bound on failure probability under the environment-specific goal-reaching criterion | Executes the trained policy directly | Goal-set predicate, episode horizon, binary cost, and cost limit | Adds cost estimation and Lagrange-multiplier updates to PPO and TD3 training |
| CALF-Wrapper | Goal-reaching property inherited from the fallback policy | Selects the base-policy or fallback-policy action at each step | Base policy, its fixed value-function estimate, and fallback policy satisfying the goal-reaching property | Keeps all components fixed and solves no online optimization problem |
fallback policy. It provides a single finite bound on the expected distance from the goal set that holds at every time and gives probability bounds on when the trajectory enters and subsequently remains in a prescribed neighborhood of the goal set. Appendix C provides an alternative analysis using a stronger uniform almost-sure bound on the rate at which the distance from the goal set decreases under the fallback policy and establishes correspondingly stronger claims.
• An open-source implementation https://github.com/aidagroup/calf-wrapper that can be integrated with existing RL frameworks without modifying the policy-training procedure (e.g., [24,25]).
An empirical evaluation in four simulated control environments using PPO and TD3 base policies. The evaluation includes comparisons with PPO-Lagrangian and TD3-Lagrangian, sensitivity to the critic threshold, robustness to additive critic noise, execution-latency measurements, and statistical comparisons.
2 PROBLEM STATEMENT
This section establishes the formal reinforcement-learning framework and mathematical foundations necessary to rigorously define the goal-reaching property.
2.1 Markov Decision Process
A Markov decision process (MDP) is defined as
where is the state space (a finite-dimensional Banach space), is the action space (a compact topological space), is the initial state probability density function, is the transition probability density, i.e., the probability density of the next state given the current state and action , and is the immediate reward of taking action in state . For the theoretical results, an upper semicontinuous function is assumed to exist such that, for any and , the next state sampled from satisfies , effectively bounding the system's one-step transition magnitude.
2.2 Policies and Value Functions
Two types of policies are considered:
-
Stationary policies . For any stationary policy , represents the probability density of selecting action a in state s.
-
Non-stationary policies . For any non-stationary policy , represents the probability density of selecting action in state at time . By definition, , since any stationary policy can be viewed as a special case of a non-stationary policy that remains constant across time steps.
For a discount factor and a policy , the value function is
where , and for .
The corresponding action-value function is defined by
For a stationary policy , the state-value and action-value functions satisfy
The standard RL objective is to maximize the expected discounted return:
where , , and for .
For a given policy and initial state , the state at time is denoted by .
2.3 Goal Set and Goal-Reaching Property
While traditional RL focuses on reward maximization, many control problems require driving the system to a specific target region. This requirement is formalized as follows:
Definition 1 (Goal set). A goal set is a compact set representing the target region that the system must eventually reach and remain in. Typically, is chosen as a compact neighborhood of a desired operating point. Without loss of generality, the desired operating point is assumed to be the origin, with .
The goal set may be specified directly as a target region or may be related to the reward function. For instance, when the reward is maximal at a target state or target region and decreases away from it, a neighborhood of the reward maximizer can be used as the goal set.
Remark 1 (Reward function and goal set). Throughout this paper, the reward function is assumed to be bounded above: . Without this condition, the return in (2) may be unbounded above, and the optimization problem may not have a finite objective scale. Working with rewards that are not bounded above therefore requires additional conditions that exclude returns that diverge to . In addition, the function is assumed to attain a local maximum at a state in . This condition reflects the intended relation between the reward function and the goal set. More generally, it is desirable that reaching the goal set be favorable under the return objective. Otherwise, return maximization and reaching the goal set may represent competing objectives.
The distance from state to the goal set is defined as: , where if and only if .
The following two properties characterize policies that reliably drive the system to the goal:
Definition 2 (-improbable goal-reaching property). A policy satisfies the -improbable goal-reaching property for some if, for all initial states ,
In other words, the system reaches the goal set in the limit with probability at least .
Definition 2 is intentionally asymptotic: it does not assert finite-time entry into G. Properties concerning finite-time entry into prescribed neighborhoods of G are studied in Section 5 and Appendix C.
More precise control over the convergence rate requires a stronger condition. The definition uses the standard notion of class- functions, which are fundamental to control theory and provide the mathematical framework for characterizing convergence behavior.
Definition 3 (Class- function). A continuous mapping is said to be of class if and only if the following two properties hold:
- For every fixed time , the function is of class ; that is
(a) and for all d>0,
(b) is strictly increasing in d and continuous.
- For every fixed , the function is monotonically decreasing and satisfies .
Definition 4 (Uniform goal-reaching property). A stationary policy satisfies the uniform goal-reaching property if there exists a function such that, for every initial state and every ,
Uniformity means that the same function applies to every initial state.
Remark 2. The uniform goal-reaching property in Definition 4 is used to establish Theorem 2 in Section 5. Appendix C introduces the stronger uniform almost-sure goal-reaching property and establishes an analogue of Theorem 2 with stronger uniform bounds for CALF-Wrapper.
3 PROPOSED APPROACH
CALF-Wrapper offers a general methodology for strengthening RL policies through an adaptive policy-selection mechanism. This approach dynamically switches between a performance-optimized base RL policy and a fallback controller that satisfies the goal-reaching property in Definition 2 or Definition 4. The selection mechanism uses value-function evaluations.
The setup in Algorithm 1 assumes access to
-
A base policy parameterized by a deep neural network, learned via a standard RL procedure to optimize (2), aided by a value-function estimate .
-
A fallback policy assumed to satisfy either the -improbable goal-reaching property in Definition 2 for some or the uniform goal-reaching property in Definition 4. The fallback policy need not be reward-optimal in terms of (2).
Remark 3. Not every RL algorithm provides a state-value estimate directly. For example, deep deterministic policy gradient (DDPG), TD3, and SAC learn action-value critics [5, 6, 26]. If an action-value estimate is available, then, for a deterministic base policy, the simplest construction is . For a stochastic base policy, the corresponding expectation can be approximated by sampling actions, while a cheaper alternative is to evaluate the action-value estimate at a representative action, such as . If computational efficiency is prioritized, a fixed representative action can also be used, such as the zero action when it belongs to the action space or the center of a bounded action space. This choice avoids evaluation of the base policy when constructing the critic estimate. These constructions need not equal the expectation over the action distribution. More generally, critics learned in practice are imperfect estimates of the theoretical quantities they are intended to represent [27]. CALF-Wrapper does not require a critic estimate to coincide exactly with its theoretical counterpart and can operate with such imperfect estimates. The experiments in Section 6.6 show substantial degradation of the episode return only for sufficiently large fluctuations in the critic estimate.
3.1 Action Selection Mechanism and Its Benefits
3.1.1 Critic and Random Acceptance Conditions
At each time step, CALF-Wrapper decides whether to continue using the performance-seeking base policy or to apply the fallback policy. This decision is guided by the base-policy critic. A sufficiently large increase in the critic value indicates that another action from the base policy may improve the accumulated return. An insufficient increase causes CALF-Wrapper to prefer the fallback policy.
To identify such increases, CALF-Wrapper stores a reference critic value , initialized as in line 1 of Algorithm 1, and uses an improvement threshold . If the current critic value exceeds by at least , the base policy is selected and the reference value is updated. Otherwise, the reference value remains unchanged. Because a learned critic is an imperfect estimate, CALF-Wrapper can still select the base policy with probability when the required increase is not observed.
The rule also allows the fallback policy to be selected unconditionally at prescribed states. Let denote the set of these states. The default choice selects the fallback policy unconditionally on the goal set. The choice introduces no unconditional selections and leaves the remaining selection rule unchanged.
The complete decision rule is implemented in lines 4–7 of Algorithm 1 and illustrated in Fig. 1. If , CALF-
Wrapper selects the fallback policy. Otherwise, either of two conditions can select the base policy. The critic condition is
The random acceptance condition is
where is sampled uniformly from [0, 1]. The random acceptance condition therefore holds with probability and selects the base policy when it holds. If neither condition holds, CALF-Wrapper selects the fallback policy. The reference value is updated to only when the critic condition holds; it remains equal to in all other cases, as specified in line 9.
The functions may be selected subject to
This condition implies that the probability that the random acceptance condition holds converges uniformly to zero.
3.1.2 Intuition Behind the Mechanism
The critic serves as an indicator of ongoing performance, so the rule checks whether the state's value remains above the running benchmark . If so, it indicates that the trajectory has improved markedly since the most recent update of the running benchmark value . Accordingly, the rule treats the trajectory as favorable and accepts the calculated risk of executing the base-policy action in pursuit of long-term gains. Conversely, a value below the benchmark indicates that the trajectory has deviated from the desired course, so the rule reverts to the fallback policy . The random acceptance probability helps avoid rejecting prematurely due to minor fluctuations in , acting like a simulated annealing mechanism that occasionally permits risk-taking for potential long-term gains.
An analogy can be drawn with Lyapunov functions in control theory. In control systems, provable stability is achieved by ensuring the controller moves toward decreasing the Lyapunov function. Similarly, outside , selecting the base policy when increases can be interpreted as steering the system toward decreasing , analogous to moving toward a decrease of a Lyapunov function. This interpretation motivates the name CALF-Wrapper (Critic as Lyapunov Function Wrapper).
3.1.3 Adjustable Trade-off Between Performance and the Goal-Reaching Property
The implementation uses , where and , as the summable majorant of . The implementation sets by default. The hyperparameter represents the initial trust in the base policy, and determines how quickly this trust decays over time. On finite horizons, setting and makes the behavior nearly identical to the original base policy, preserving its performance advantages. By tuning and , one can bias the policy toward (thus recovering its performance) or impose more frequent switches to . In many cases, this approach can even outperform both and in terms of cumulative reward (see Section 6).
Algorithm 1 Critic as Lyapunov Function Wrapper
Require:
-
: Fallback policy satisfying Definition 2 or Definition 4.
-
: Base policy trained via an RL method.
-
: A value-function estimate trained alongside via the RL method.
-
: Minimum improvement threshold for updating the best observed critic value .
-
: States at which the fallback policy is selected unconditionally. The default choice is . The choice leaves the remaining selection rule unchanged.
-
: Random acceptance probabilities. They are assumed to be bounded by a summable majorant , meaning and .
1: Initialize:
-
or set for some
-
2: for do
3: Sample independently from Uniform[0,1]
4: if then
5: sampled from
6: else
7: sampled from
8: end if
9:
10: sampled from
11: end for
3.1.4 Seamless Integration
CALF-Wrapper is designed for seamless integration into existing RL pipelines. It is implemented as a wrapper around the vectorized environment that follows the Gymnasium wrapper pattern [28]: at each step, it receives the action of the base policy, replaces it with the action of the fallback policy when required, and passes the resulting action to the environment. It operates as a non-intrusive wrapper around trained RL policies, requiring no modifications to the original training algorithm.
3.1.5 Rigorous Theoretical Analysis
The theoretical analysis establishes how the goal-reaching properties assumed for the fallback policy lead to corresponding properties of CALF-Wrapper. Theorem 1 establishes that CALF-Wrapper inherits the -improbable goal-reaching property in Definition 2 from the fallback policy under the stated assumptions. Section 5 establishes uniform properties of CALF-Wrapper when the fallback policy satisfies the uniform goal-reaching property in Definition 4. Appendix C establishes stronger claims under a uniform almost-sure condition on the fallback policy.
3.2 Computational Complexity
Consider execution over T time steps, and let be the number of time steps at which the base policy supplies the applied

Figure 1: Diagram of Algorithm 1.
action. By definition, . The selection rule in line 4 of Algorithm 1 selects the base policy only when the state lies outside and either the critic condition or the random acceptance condition holds. The number of such selections is . Outside , decreasing reduces selections based on the random acceptance condition but does not prevent selection of the base policy when the critic condition holds. Deployment of the base policy without CALF-Wrapper requires base-policy evaluations. When is provided directly by a state-value critic or obtained by evaluating an action-value critic at one fixed representative action, as described in Remark 3, CALF-Wrapper requires
critic evaluations
base-policy evaluations
fallback-policy evaluations
scalar operations.
The scalar operations consist, at each time step, of one uniform random-number sample, evaluation of , evaluation of whether , a constant number of comparisons, and the update of . In the reported implementation, membership in is evaluated using the corresponding environment-specific goal-neighborhood condition. These operations require only scalar arithmetic and comparisons and therefore have a small computational cost compared with evaluations of the neural-network policies and critic.
When is obtained from an action-value critic as for a deterministic base policy or as for a stochastic base policy, the corresponding base-policy output must be computed before the critic is evaluated. In this case, CALF-Wrapper requires
base-policy evaluations
critic evaluations
fallback-policy evaluations
scalar operations.
The persistent memory required by the wrapper consists of the fixed critic parameters and a constant number of scalar values, including and the current random acceptance probability. Algorithm 1 stores no trajectory, replay buffer, or sequence of previous critic values.
Consider a fully connected perceptron with layers and layer widths , where is the input dimension and is the output dimension. One forward evaluation requires arithmetic operations for the matrix multiplications. The bias additions and elementwise activation functions require additional operations and do not change this order. If the base policy, fallback policy, and critic have this form, the evaluation counts above give an overall time complexity of . Thus, CALF-Wrapper increases the number of forward evaluations but does not change the asymptotic time complexity with respect to and the layer widths.
4 GOAL-REACHING PROPERTY OF CALF-WRAPPER
This section proves that CALF-Wrapper inherits the goal-reaching property from the fallback policy under the stated assumptions. The central result of this section is Theorem 1. The superscript P in the assumption and claim labels in this section denotes “pathwise.” Together with the superscript U introduced in Section 5, this convention makes every assumption and claim label unique and identifies the analysis to which it belongs.
The proof uses the following explicit form of the policy defined by Algorithm 1.
Definition 5. Let be the policy defined by Algorithm 1. The subscript w indicates that is the “wrapped policy” produced by CALF-Wrapper. Specifically, for every , set
Theorem 1. Consider Algorithm 1.
Assume that:
(A ) The fallback policy satisfies the -improbable goal-reaching property in Definition 2.
Then the following claim holds:
(C ) The policy satisfies the -improbable goal-reaching property in Definition 2.
Proof. See Appendix A.
Assumption requires . Remark 1 assumes that . For , the exact value function of every policy therefore satisfies, for every ,
Consequently, the exact value of the base policy does not exceed the theoretical upper bound in the displayed inequality. A learned critic does not necessarily satisfy unless this condition is imposed on its output. Using this theoretical upper bound as a clipping value for the learned critic is a natural choice because critic outputs above this value cannot represent an exact policy value attainable in the underlying control problem. The clipping can be applied when the critic is evaluated by Algorithm 1 at deployment and does not restrict how the critic is trained.
Remark 4. For an infinite horizon with , the boundedness of the reward from above is not sufficient for this argument. If for every and , then every partial return is nonpositive. If the value function exists as a finite real-valued function as in Section 2, then for every . In this case, zero is a theoretical upper bound for the learned critic.
All experiments reported in Section 6 evaluate the learned critic after clipping its output at the environment-specific upper value in Table 3. The reported results therefore use the critic that satisfies the finite upper bound required by Assumption .
Table 3: Upper clipping values used in the evaluations in Section 6 for the environments described in Appendix E.
| Environment | Upper clipping value |
|---|---|
| Pendulum | 0 |
| CartPole Swing-Up | 0 |
| Treasure-Collecting Robot | 50 |
| Contaminated-Zone AUV Navigation | 0 |
The value 0 applies to Pendulum, CartPole Swing-Up, and Contaminated-Zone Autonomous Underwater Vehicle (AUV) Navigation because their rewards are nonpositive at every step, as specified in Appendix E. For the Treasure-Collecting Robot, the treasure-collection bonus is 50 and can be received at most once per episode. The distance-to-goal term and every reward after the treasure has been collected are nonpositive. Therefore, the return of every episode is at most 50.
The evaluations use upper clipping to impose a finite upper bound on the critic output in the considered environments.
5 UNIFORM BOUNDS UNDER THE GOAL-REACHING PROPERTY
This section establishes Theorem 2 when the fallback policy satisfies the uniform goal-reaching property in Definition 4. The superscript U in the assumption and claim labels in this section denotes “uniform.” Theorem 2 establishes three claims:
-
Claim bounds the expected value of the distance from uniformly over time and bounds the probability of exceeding a prescribed distance during a finite time interval.
-
Claim gives a lower bound on the probability of entering a prescribed neighborhood of by a specified time and establishes that the hitting time is finite almost surely.
-
Under the additional assumptions, Claim gives a lower bound on the probability that the trajectory enters the prescribed neighborhood of and remains there at every subsequent time, and establishes that the settling time is finite almost surely.
To state Theorem 2, fix and define the following quantities, whose interpretations are given in Remark 5.
For and , define
Definition 6 (Hitting and settling times). For an initial state and , define the following times, where the time indices and range over :
where .
Consider Algorithm 1 initialized at any satisfying . The following assumptions are used:
For every initial state satisfying , whenever .
The function is continuous, and the set in (5) is bounded.
The fallback policy satisfies the uniform goal-reaching property in Definition 4 with .
The conclusions concerning for a prescribed use the following additional assumptions:
The set satisfies .
The series satisfies .
Remark 5 (Interpretation). The quantities in (4)–(13) have the following engineering interpretations.
-
The quantity is the radius of the prescribed initial neighborhood of . The bounds in Theorem 2 hold uniformly over every initial state satisfying .
-
The quantity is the radius of the prescribed target neighborhood of . The quantity is the first time at which the trajectory initialized at enters this neighborhood. The quantity is the first time after which the trajectory remains in this neighborhood at every subsequent time.
-
The set is the critic superlevel set determined by the smallest critic value in the prescribed -neighborhood of .
-
The quantity bounds how many increases of the stored critic value by at least can occur. It bounds the number of selections of the base policy based on the critic condition and does not bound the time of their final occurrence.
-
The quantity bounds the norm of every state that can occur after one transition from under an admissible action.
-
The quantity bounds the prescribed initial distance from , the distance at every state at which the base policy can be selected, and the distance after an action supplied by the base policy.
-
The quantity is the probability that the random acceptance condition does not hold at or after time t when each random acceptance probability is replaced with its upper bound . For , this probability has the explicit positive lower bound stated in Proposition 3 in Appendix B.1.
-
The quantity bounds the expected total number of base-policy selections. The quantity bounds the expected number of states consisting of the initial state and the states immediately after base-policy actions.
-
On the event that the random acceptance condition does not hold at or after time t, the first actions, where , contain at least consecutive actions supplied by the fallback policy.
-
The quantity bounds the expected distance from uniformly over time. Claim also uses this quantity to bound the probability that the distance from exceeds a prescribed value during a finite time interval.
Remark 6 (Practical computation). The quantities , , and are required only to evaluate the bounds in Theorem 2. As a rule of thumb, the computation of can be simplified by replacing its exact value in (7) with the theoretical upper value used to clip the critic, as described in Section 4. The quantity can be estimated by projected gradient descent from multiple initial states with projection onto , but this procedure does not certify the global minimum of a nonconvex critic. Among the available neural network verification solvers, the open-source -CROWN implementation supports -norm input sets for and computes certified output bounds [29]. Its bound-propagation methods include CROWN, auto_LiRPA, -CROWN, and -CROWN [30–33]. For a critic with rectified linear unit (ReLU) activations, -CROWN provides branch and bound with ReLU split constraints, while GenBaB extends branch and bound to general nonlinearities, including tanh [33, 34]. This remark is provided for practical reference, since the experiments in Section 6 do not require these quantities.
Theorem 2 (Uniform bounds for CALF-Wrapper). Consider Algorithm 1 initialized at any satisfying . Under Assumptions , Claims and hold. If Assumptions and also hold, then Claim holds.
The distance from satisfies
Consequently, for every and ,
For every , , and ,
(18)
In particular,
For every , , and ,
(20)
In particular, .
Proof. See Appendix B.
Remark 7. The right-hand sides of Claims do not depend on the particular initial state . The same bounds therefore hold for every initial state satisfying .
5.1 Discussion of the Assumptions
5.1.1 Assumptions and
Assumption (A_U) restricts the region in which the selection mechanism can select the base policy. Its feasibility follows directly from the implementation choice of , which can be set to zero whenever . Assumption (A_4^U) is directly feasible by choosing to contain the prescribed -neighborhood of .
5.1.2 Assumptions and
Assumptions (A ) and (A ) specify the rate at which the expected distance from converges to zero when the fallback policy is applied. Since is increasing and , for every ,
Assumption and the dominated convergence theorem for series therefore imply
To obtain a sufficient condition for Assumption (A ), consider a standard decomposition of class- functions (see [35, Lemma 8]). To provide insight into how this decomposition is obtained, Appendix D gives a proof and constructs the functions and using the notation of this paper.
Definition 7 (Class- function). A function belongs to if it is continuous, strictly increasing, satisfies , and satisfies as .
This decomposition gives (see Definition 7) such that
For the property considered here, a sufficient condition for Assumption is the existence of constants , , and such that
Under this condition, for all sufficiently large , and therefore . The inequality then gives
Since as , the same bound also gives
5.1.3 Assumption
Assumption (A ) is primarily technical. It consists of two requirements: must be continuous and the set defined in Assumption (A ) must be bounded.
The continuity requirement is considered first. This requirement is satisfied by standard feedforward neural critics. A neural network composed of affine layers and continuous activation functions is continuous as a composition of continuous mappings. Networks with smooth activation functions are differentiable and therefore continuous. Networks with ReLU activations are continuous piecewise-affine functions. Output clipping and finite minima of continuous critic estimates are also continuous. Discontinuous neural critics require explicitly discontinuous components and are uncommon in RL practice. Consequently, continuity is a standard property of the neural critics used in RL implementations.
The second requirement in Assumption (A ) is that be bounded. The set over which is defined is compact because is compact and is finite-dimensional. Continuity of therefore implies that exists. Continuity also implies that is closed. Assumption (A ) requires this specific set to be bounded.
There are several ways to ensure that is bounded. One way is to require to have bounded superlevel sets.
Definition 8. Let be a metric space and . The function has bounded superlevel sets if, for every , the set is bounded in .
Although functions with bounded superlevel sets do not appear as a separate concept in the literature, this condition is closely related to radial unboundedness.
Definition 9 (Radially unbounded function). A function is said to be radially unbounded if as .
The relation is stated precisely in the following proposition.
Proposition 1 (Connection to radial unboundedness). A function has bounded superlevel sets if and only if either of the following conditions holds:
(i) -f is radially unbounded;
(ii) there exists such that for every and is radially unbounded.
Proof. See Appendix F.
Lyapunov critics and learned Lyapunov functions are used in safe RL to impose stability, reachability, or safety conditions on a learned policy [36, 37]. The conditions imposed on these functions commonly include positivity, a decrease condition, and lower and upper comparison bounds. For example, the Lyapunov critics in [36, 37] are bounded below and above by positive multiples of a state cost. Some works require lower and upper bounds given by functions (see Definition 7). For example, the original CALF formulation requires for its critic [8]. Such lower and upper bounds imply that the critic is radially unbounded.
CALF-Wrapper does not require the critic to satisfy these lower and upper bounds. It is sufficient for to have bounded superlevel sets, which, by condition (ii) of Proposition 1, also permits critics that are bounded from below, as is the case, for example, when the rewards are uniformly nonnegative. The critic can also be modified only outside a prescribed bounded region, as stated in the following proposition.
Proposition 2. Let be continuous, and let . For every , there exists a continuous function that equals on , has bounded superlevel sets, and has infimum equal to .
Proof. See Appendix F. The appendix gives explicit modifications of the critic in (51) for and in (52) for finite .
The radius in Proposition 2 can be chosen from the data used to train the base policy and its critic. In practice, a finite training run can produce only finitely many sampled states for critic training. These sampled states form a bounded set. It is therefore natural to preserve the critic on a region that contains the states represented in the training data. The critic values at states outside this region are extrapolations that are not directly supported by sampled training states. Accordingly, can be chosen so that the ball contains every sampled training state. Outside this ball, the critic can be replaced by one of the continuous extensions given in (51) and (52). Proposition 2 shows that the resulting critic agrees with the trained critic throughout the prescribed ball and has bounded superlevel sets. This modification does not require retraining the critic or changing the base policy.
In some control environments, this modification is not needed. Such environments are constructed so that every possible trajectory lies entirely in a closed and bounded subset . Because is finite-dimensional, is compact. In this case, the theorem can be formulated with as the state space instead of . This replacement does not change any step of the proof. The set is closed by continuity of and is a subset of the compact state space . Therefore, is bounded, so the second requirement in Assumption () holds automatically.
6 EXPERIMENTAL STUDY
The experimental study addresses the following questions:
-
How does CALF-Wrapper respond to changes in the quality of the supplied actor-critic checkpoint? Evaluating actor-critic checkpoints obtained at different stages of training and exhibiting low, intermediate, and high observed returns shows whether CALF-Wrapper can compensate for weak base policies through the fallback policy and benefit from better-trained base policies while using their corresponding critic estimates.
-
How do different configurations of the policy-selection mechanism affect episode return, goal-reaching rate, and the frequency with which the fallback policy supplies the applied action?
-
Does CALF-Wrapper exhibit consistent behavior across different environments and with base policies trained using different actor-critic algorithms, specifically PPO and TD3?
-
How does CALF-Wrapper compare with the base policy, the fallback policy, and the PPO-Lagrangian and
TD3-Lagrangian baselines implemented in this article?
-
How sensitive is CALF-Wrapper to the critic threshold and to perturbations of the critic estimate?
-
What computational overhead does CALF-Wrapper introduce during deployment?
The remainder of this section is organized as follows:
-
Section 6.1 defines the four environments in which CALF-Wrapper is evaluated.
-
Section 6.2 states which algorithms were used to train the base policies and defines the Low-, Mid-, and High-return checkpoints selected from the resulting sequences of actor-critic checkpoints.
-
Section 6.3 defines a broad range of operating modes for evaluating CALF-Wrapper. Each mode is specified by a target lower bound on the expected fraction of episode steps assigned to the base policy and by and . For each positive target lower bound, the reported modes set and determine from that target. An additional sensitivity study varies while holding the target value fixed to support this choice.
-
Section 6.4 examines the remaining hyperparameter, the critic threshold . The sensitivity and ablation study relates to the reward scale of the problem and determines the values used in the main evaluation.
-
Section 6.5 reports the main evaluation across the Low-, Mid-, and High-return checkpoints and the six operating modes. This evaluation compares CALF-Wrapper with the base policy, the fallback policy, and the PPO-Lagrangian and TD3-Lagrangian baselines. The results show how the observed behavior of CALF-Wrapper changes with the quality of the supplied checkpoint and with the selected operating mode.
-
Finally, Section 6.6 evaluates CALF-Wrapper under perturbations of the critic estimate, and Section 6.7 measures its per-step latency and computational overhead during deployment.
6.1 Environments
The evaluation considers four control environments spanning classic control and continuous robotic navigation. Complete descriptions of their dynamics, observations, actions, reward functions, goal sets, and initial conditions are provided in Appendix E. The implementations of all fallback policies are available in the project repository https://github.com/aidagroup/calf-wrapper.
-
Pendulum, in which a control torque must stabilize the pendulum in the upright position, is described in Appendix E.1 and Fig. 6.
-
CartPole Swing-Up, in which a horizontal force must swing the pole to the upright position while keeping the cart near the center, is described in Appendix E.2 and Fig. 7.
-
Contaminated-Zone Autonomous Underwater Vehicle Navigation, in which an AUV must reach a surface opening while avoiding a low-reward region, is described in Appendix E.3 and Fig. 8.
-
Treasure-Collecting Robot, in which a constant-speed mobile robot can improve its return by intercepting a moving treasure before reaching its goal, is described in Appendix E.4 and Fig. 9.
Pendulum and CartPole Swing-Up are classical-control benchmarks. However, to make the CartPole task more challenging, the standard task of balancing an initially upright pole was replaced with a swing-up task. The controller must first raise the pole to the upright position and then balance it while keeping the cart near the center. Both Pendulum and Cart-Pole Swing-Up have low-dimensional states and scalar actions. Therefore, the evaluation also includes Contaminated-Zone Autonomous Underwater Vehicle Navigation and Treasure-Collecting Robot, which have higher-dimensional states and more complex objectives.
6.2 Low-, Mid-, and High-Return Checkpoints
The subsequent experiments examine the behavior of CALF-Wrapper when it is supplied with actor-critic checkpoints of different observed quality. This comparison is intended to show how CALF-Wrapper behaves with relatively poorly trained, intermediately trained, and well-trained base policies. Checkpoint quality is assessed using the observed return of the base policy executed without CALF-Wrapper. The terms Low-return, Mid-return, and High-return therefore refer to the observed performance of the base policy and not directly to the number of training steps.
Each training run produces a sequence of saved actor-critic checkpoints. For each training run, the range of base-policy returns observed over these checkpoints is divided into three equal-width intervals. Low-, Mid-, and High-return refer to the lower, middle, and upper intervals, respectively. The checkpoints with base-policy returns closest to the centers of their respective intervals are selected for evaluation. The selected checkpoints are used as representative poorly trained, intermediately trained, and well-trained actor-critic checkpoints in terms of their observed base-policy returns. Each selected checkpoint supplies both the base policy and its corresponding critic estimate to CALF-Wrapper.
One evaluation campaign was conducted in each of the four environments summarized in Section 6.1 and described in Appendix E. In every campaign, the base policy is the pretrained neural policy supplied to CALF-Wrapper, whereas the fallback is the corresponding environment-specific controller described in Appendix E. The base policies for Pendulum and CartPole Swing-Up were trained using PPO, whereas the base policies for Contaminated-Zone AUV Navigation and the Treasure-Collecting Robot were trained using TD3.
The critic output is clipped at the environment-specific upper value specified in Table 3. The evaluations set for Contaminated-Zone AUV Navigation. The boundary through which the AUV reaches is the one-dimensional surface opening in the
two-dimensional position space. The intersection of the 0.16-neighborhood with the underwater region forms a strip of nonzero width in which the fallback policy is selected before the AUV reaches . Thus, is a natural choice for this environment. The goal sets in Pendulum, CartPole Swing-Up, and the Treasure-Collecting Robot already define regions of nonzero width, so this geometric issue does not arise. The evaluations therefore use and set in these three environments.
6.3 Operating Modes
CALF-Wrapper determines at every time step whether to apply the action proposed by the pretrained base policy or the action supplied by the fallback policy. A fixed configuration of this selection rule is called an operating mode.
For the evaluations in this paper, the majorant of the random acceptance probabilities is chosen as
For a simple interpretation of the operating modes, consider the setting in which and for every state. The hyperparameters for the operating modes are selected using this setting.
For a finite episode of steps, the normalized acceptance budget (NAB) is defined as the expected fraction of time steps on which CALF-Wrapper selects the base policy:
For this schedule, the probability of selecting the base policy at time satisfies
Averaging this inequality over the episode steps gives the following lower bound for NAB:
In the simplified setting above, a target specifies a lower bound on the expected fraction of episode steps assigned to the base policy. The evaluation considers six operating modes: Conservative, Guarded, Moderate, Balanced, High, and Almost Open. Their target values increase progressively. The target provides a common scale for the random acceptance probability schedules of the six modes. The mode names describe progressively greater reliance on the base policy:
-
Conservative places no reliance on the random acceptance condition. Outside , the fallback policy is selected unless the critic condition permits the base policy.
-
Guarded places limited reliance on the base policy and is intended to retain predominant use of the fallback policy in the absence of selections based on the critic condition.
-
Moderate places greater reliance on the base policy than Guarded while keeping the target below one half.
-
Balanced places the target at the midpoint value of 0.5.
-
High places greater reliance on the base policy by assigning most of the target acceptance budget to it.
-
Almost Open places near-complete reliance on the base policy through the random acceptance condition outside .
Their exact parameter settings are listed in Table 4.
Table 4: CALF-Wrapper parameters used in the reported evaluations. The horizons are for Pendulum, for CartPole and the Treasure-Collecting Robot, and for the AUV.
| Mode | Target | ||||||
|---|---|---|---|---|---|---|---|
| Conservative | 0 | 0.00 | 0 | 0 | 0 | ||
| Guarded | 1 | 0.10 | 0.950002 | 0.990000 | 0.993334 | ||
| Moderate | 1 | 0.35 | 0.986695 | 0.997343 | 0.998229 | ||
| Balanced | 1 | 0.50 | 0.992010 | 0.998406 | 0.998937 | ||
| High | 1 | 0.70 | 0.996178 | 0.999238 | 0.999492 | ||
| Almost Open | 1 | 0.95 | 0.999480 | 0.999896 | 0.999931 | ||
For the Conservative mode, . For each positive-budget mode, , and is obtained numerically as the unique solution in [0, 1) of
For each operating mode, the value of Target is taken from the corresponding column of Table 4.
A larger target increases the influence of the base policy outside and generally leaves fewer steps for the fallback policy. For the Balanced mode, the expected number of base-policy selections in the simplified setting is at least the expected number of fallback-policy selections. The High and Almost Open modes can select the base policy more frequently. The Moderate mode also gives the base policy substantial influence, which the critic condition can increase further. If the base policy stabilizes the system poorly, the fallback policy may not receive enough steps to reach the goal set within the episode, and the goal-reaching rate can be below 100% from the Moderate mode onward. The Conservative and Guarded modes, and sometimes the Moderate mode, can give the fallback policy enough influence to produce a higher goal-reaching rate. Conversely, larger targets allow a well-performing base policy to influence more of the episode. Section 6.5 reports this trade-off across all modes and checkpoint levels.
The target can equivalently be adjusted by fixing and varying . To assess the choice , Fig. 2 varies at fixed for the Mid-return checkpoints in the Balanced and High modes. These settings give base policies that are not yet well trained a substantial influence and make the effect of the fallback policy on the observed goal-reaching rate visible. Exact paired McNemar tests with Holm correction identify no statistically significant reduction in the goal-reaching rate at and identify statistically significant increases in several comparisons. These results support the common choice used in Table 4.

Figure 2: Goal-reaching rates for the Mid-return checkpoints as varies at fixed target for the Balanced mode and 0.70 for the High mode. Each point is computed from 100 evaluation trials. AUV and Robot denote Contaminated-Zone AUV Navigation and the Treasure-Collecting Robot, respectively.
Remark 8. The operating modes concern the majorant of the random acceptance probabilities and not the functions themselves. The dependence of on the state allows the assumptions of the theoretical results, such as Assumption () of Theorem 2, to be satisfied. The feasibility of all assumptions of Theorems 1 and 2 is discussed separately in Sections 4 and 5.1.
6.4 Choice and Ablation of the Critic Threshold
To isolate the effect of , consider the Conservative mode with and . For simplicity of the following reasoning, suppose that . This supposition is used only in the explanation below and does not change the experimental configuration stated above.
CALF-Wrapper then selects the base policy precisely when . Otherwise, CALF-Wrapper selects the fallback policy. The threshold therefore determines the smallest increase above the stored critic value that is sufficient for selecting the base policy. For CALF-Wrapper to generate a trajectory that both reaches the goal set and attains a high accumulated return, the base policy must be sufficiently effective for the control task. The trained base policy nevertheless has no established goal-reaching property and may fail to reach the goal set from some initial states. CALF-Wrapper compensates for this possibility by using the fallback policy when it is needed.
The base policy has the greatest potential to improve the trajectory near the beginning of an episode, when the state can be far from the goal set and a substantial part of the trajectory remains. The value of should therefore be small enough to accept meaningful increases of the critic in this part of the episode. After the state has approached the goal set, most of the motion from the initial state toward the goal set has already been completed, and the remaining time must still be sufficient to reach the goal set. In this region, the possible additional improvement from selecting the base policy is smaller, whereas, in practice, there is no evidence that selecting it will continue to move the state toward the goal set. The value of should therefore be large enough that ordinary local variations of the critic do not repeatedly cause CALF-Wrapper to select the base policy near the goal set.
The preceding discussion leads to the following idealized reference for . Suppose that the reward design is consistent with the control task, the base policy approximates an optimal policy that reaches the goal set, and the critic accurately approximates the corresponding optimal value function . Under these assumptions, a natural candidate for a rule of thumb is to set equal to the maximum variation of in a prescribed -neighborhood of the goal set:
Computing this variation directly is generally intractable. However, this direct computation is not required for the sensitivity study and ablation considered in this subsection.
It is sufficient to select an appropriate environment-specific scale for the range of values over which is varied. Remark 9 in Appendix G provides a formal motivation for such a scale. The remark is not a central result of the paper, and its assumptions are not required by CALF-Wrapper or by the theoretical results in Sections 4 and 5. For the sensitivity and ablation study, (56) from Remark 9 provides the insight that can be reparameterized as follows:
where and are the minimum and maximum of over , respectively.
is evaluated in all four environments by varying over
Each setting is evaluated over 100 trials from the same initial conditions. The value corresponds to and makes CALF-Wrapper select the fallback policy at every time step. This setting provides the ablation in which selection of the base policy based on the critic is removed. The results for are shown in Fig. 3.
Fig. 3 supports as a practical rule of thumb based on the behavior observed across the four environments.
For Pendulum, increasing above one initially produces only a slow upward change in the mean return, and the magnitude of this change is small before the return begins to decrease at approximately . For the Contaminated-Zone AUV and the Treasure-Collecting Robot, lies well within a broad range of stable, near-maximum mean returns, while a pronounced deterioration begins around . For CartPole Swing-Up, the mean return has an overall downward tendency as increases. After , this tendency is accompanied by irregular upward and downward changes, including both temporary recoveries and pronounced decreases. Thus, increasing beyond one provides only a small improvement for Pendulum, no material improvement before eventual deterioration for the AUV and the Robot, and unstable changes with an overall downward tendency for CartPole Swing-Up. The sensitivity and ablation study yields the rule-of-thumb values of reported in Table 5.

Figure 3: Sensitivity of Conservative CALF-Wrapper to the critic threshold at the High-return actor-critic checkpoint for each environment. The curves show mean episode return, and the shaded regions show 95% confidence intervals over 100 trials. The goal-reaching rate is 100% in every evaluation shown. The vertical dashed line marks the reward-based reference , for which . The point is the ablation in which selection of the base policy based on the critic is removed, and CALF-Wrapper selects the fallback policy at every time step.
Table 5: Reward-based reference values for the critic threshold.
| Environment | |||
|---|---|---|---|
| Pendulum | -0.015502 | 0 | 0.015502 |
| CartPole Swing-Up | -0.050876 | 0 | 0.050876 |
| Contaminated-Zone AUV | -0.040000 | 0 | 0.040000 |
| Treasure-Collecting Robot | -0.050000 | 0 | 0.050000 |
6.5 Results
The experimental evaluation examines whether CALF-Wrapper attains both a high episode return and a high observed goal-reaching rate. The evaluation uses four environments and base policies trained with PPO or TD3. Low-, Mid-, and High-return actor-critic checkpoints are selected from different parts of each training run to evaluate CALF-Wrapper with base policies of different observed quality.
At every checkpoint, the evaluation includes the following comparisons:
- The six CALF-Wrapper operating modes are compared with the corresponding base policy and fallback policy.
- PPO-Lagrangian and TD3-Lagrangian are included as constrained reinforcement-learning baselines formulated for the same goal-reaching objective. These baselines provide a comparison with policies trained to balance episode return and goal reaching through a constraint. Their formulation and implementation are described in Appendix H.
The central results are reported in Table 6. A graphical representation of these results is provided in Fig. 4. For every environment and checkpoint, the table reports the mean episode return, the observed goal-reaching rate, and the percentage of
Preprint – A Universal Policy Wrapper With Guarantees
15
actions supplied by the fallback policy for each CALF-Wrapper operating mode. The same table reports the corresponding results for the base policy, the fallback policy, and the PPO-Lagrangian or TD3-Lagrangian baseline.
Each reported entry is computed from 100 evaluation trials. The goal-reaching rate is the percentage of evaluation trials in which the state at the end of the episode belongs to G. The base policy, fallback policy, and CALF-Wrapper modes use the same initial conditions within each environment and checkpoint.
6.5.1 Episode Return at the High-Return Checkpoints
At the High-return checkpoints, CALF-Wrapper produces strong episode-return results across the six operating modes. Relative to the fallback policy, 23 of the 24 environment and operating-mode comparisons have a significant return difference and a higher observed mean return for CALF-Wrapper. No significant difference is detected in the remaining comparison. Relative to the base policy, 11 comparisons have a significant return difference and a higher observed mean return for CALF-Wrapper, and no significant difference is detected in 12 comparisons. Only Conservative on the Treasure-Collecting Robot has a significant return difference and a lower observed
Table 6: Episode returns and goal-reaching rates at the Low-, Mid-, and High-return checkpoints in each environment. The PPO-Lagrangian and TD3-Lagrangian rows report checkpoints from the corresponding stages of their training runs. Episode return is shown as mean ± 95% confidence-interval half-width over 100 evaluation trials. Goal-reaching rate is shown as a percentage. The Fallback actions columns report the mean percentage of episode time steps at which the fallback policy supplied the applied action. At each checkpoint, the episode-return and goal-reaching-rate cells of the first-, second-, and third-ranked methods are shown in bold black, bold dark blue, and bold dark orange, respectively. Methods are ordered first by goal-reaching rate and then by episode return; ties receive the same marking.
| Method | Low-return checkpoint | Mid-return checkpoint | High-return checkpoint | ||||||
|---|---|---|---|---|---|---|---|---|---|
| Episode return | Goal-reaching rate (%) | Fallback actions (%) | Episode return | Goal-reaching rate (%) | Fallback actions (%) | Episode return | Goal-reaching rate (%) | Fallback actions (%) | |
| Pendulum-v1 (PPO) | |||||||||
| Fallback | -373.28 ± 52.71 | 100.0 | 100.0 | -373.28 ± 52.71 | 100.0 | 100.0 | -373.28 ± 52.71 | 100.0 | 100.0 |
| Conservative | -372.17 ± 52.80 | 100.0 | 99.5 | -254.28 ± 28.94 | 100.0 | 92.0 | -214.91 ± 22.60 | 100.0 | 88.3 |
| Guarded | -375.69 ± 48.25 | 100.0 | 90.4 | -257.72 ± 22.54 | 100.0 | 85.1 | -203.10 ± 24.56 | 100.0 | 84.7 |
| Moderate | -526.50 ± 32.97 | 99.0 | 69.9 | -387.25 ± 25.89 | 99.0 | 68.8 | -215.49 ± 28.04 | 100.0 | 76.8 |
| Balanced | -674.58 ± 38.25 | 72.0 | 55.5 | -481.76 ± 28.96 | 94.0 | 56.1 | -219.53 ± 30.41 | 100.0 | 73.5 |
| High | -889.25 ± 34.06 | 12.0 | 32.3 | -592.44 ± 28.24 | 44.0 | 34.5 | -274.33 ± 47.65 | 92.0 | 66.7 |
| Almost Open | -1050.67 ± 31.78 | 2.0 | 6.7 | -674.34 ± 25.42 | 3.0 | 7.3 | -305.74 ± 58.93 | 84.0 | 59.6 |
| Base policy | -1096.20 ± 12.02 | 0.0 | 0.0 | -703.05 ± 12.81 | 0.0 | 0.0 | -341.05 ± 68.16 | 77.0 | 0.0 |
| PPO-Lagrangian | -1147.65 ± 28.27 | 0.0 | - | -360.21 ± 57.33 | 70.0 | - | -273.77 ± 39.58 | 100.0 | - |
| CartPole Swing-Up (PPO) | |||||||||
| Fallback | -762.58 ± 128.49 | 100.0 | 100.0 | -762.58 ± 128.49 | 100.0 | 100.0 | -762.58 ± 128.49 | 100.0 | 100.0 |
| Conservative | -752.70 ± 118.38 | 100.0 | 90.8 | -759.51 ± 131.32 | 100.0 | 87.4 | -665.18 ± 113.04 | 100.0 | 89.5 |
| Guarded | -614.14 ± 93.33 | 100.0 | 83.0 | -464.05 ± 73.14 | 100.0 | 82.7 | -481.28 ± 70.69 | 100.0 | 84.8 |
| Moderate | -845.76 ± 131.69 | 100.0 | 71.2 | -471.22 ± 86.32 | 99.0 | 75.8 | -410.80 ± 42.70 | 100.0 | 78.7 |
| Balanced | -784.91 ± 130.06 | 96.0 | 64.9 | -503.33 ± 72.93 | 100.0 | 72.7 | -460.12 ± 65.71 | 100.0 | 75.8 |
| High | -719.52 ± 100.53 | 77.0 | 56.2 | -594.43 ± 113.03 | 100.0 | 67.4 | -440.06 ± 52.51 | 100.0 | 73.1 |
| Almost Open | -853.83 ± 54.30 | 75.0 | 26.7 | -661.57 ± 127.63 | 98.0 | 60.2 | -518.43 ± 92.81 | 99.0 | 67.3 |
| Base policy | -1156.17 ± 56.37 | 8.0 | 0.0 | -883.55 ± 251.92 | 90.0 | 0.0 | -625.10 ± 144.78 | 92.0 | 0.0 |
| PPO-Lagrangian | -1118.55 ± 271.26 | 97.0 | - | -873.94 ± 171.32 | 96.0 | - | -557.28 ± 63.60 | 100.0 | - |
| Contaminated-Zone AUV Navigation (TD3) | |||||||||
| Fallback | -660.17 ± 15.57 | 100.0 | 100.0 | -660.17 ± 15.57 | 100.0 | 100.0 | -660.17 ± 15.57 | 100.0 | 100.0 |
| Conservative | -1148.02 ± 101.25 | 100.0 | 88.8 | -824.54 ± 41.11 | 100.0 | 88.0 | -559.83 ± 32.95 | 100.0 | 87.9 |
| Guarded | -1888.85 ± 92.40 | 100.0 | 82.9 | -1293.43 ± 115.10 | 100.0 | 82.0 | -498.23 ± 25.71 | 100.0 | 83.4 |
| Moderate | -3478.32 ± 206.15 | 77.0 | 63.1 | -1555.73 ± 125.43 | 98.0 | 63.3 | -518.23 ± 26.91 | 100.0 | 80.7 |
| Balanced | -4041.75 ± 251.20 | 45.0 | 50.6 | -1643.67 ± 122.66 | 97.0 | 55.3 | -520.85 ± 27.06 | 100.0 | 80.2 |
| High | -4862.36 ± 210.37 | 18.0 | 31.8 | -2166.47 ± 184.10 | 73.0 | 38.3 | -522.27 ± 27.10 | 100.0 | 79.7 |
| Almost Open | -5647.09 ± 221.84 | 10.0 | 9.2 | -2932.75 ± 129.47 | 2.0 | 5.6 | -536.52 ± 39.42 | 100.0 | 79.1 |
| Base policy | -5823.79 ± 158.87 | 5.0 | 0.0 | -2983.37 ± 120.32 | 1.0 | 0.0 | -539.18 ± 40.56 | 100.0 | 0.0 |
| TD3-Lagrangian | -6459.84 ± 102.57 | 1.0 | - | -995.06 ± 105.04 | 100.0 | - | -577.19 ± 31.20 | 100.0 | - |
| Treasure-Collecting Robot (TD3) | |||||||||
| Fallback | -30.15 ± 8.40 | 100.0 | 100.0 | -30.15 ± 8.40 | 100.0 | 100.0 | -30.146 ± 8.395 | 100.0 | 100.0 |
| Conservative | -23.89 ± 8.94 | 100.0 | 92.1 | -8.15 ± 9.41 | 100.0 | 78.1 | 23.392 ± 6.030 | 100.0 | 69.8 |
| Guarded | -116.27 ± 18.72 | 100.0 | 61.1 | -7.61 ± 13.53 | 100.0 | 55.5 | 33.348 ± 3.387 | 100.0 | 55.7 |
| Moderate | -236.59 ± 38.74 | 100.0 | 45.9 | -16.90 ± 22.05 | 100.0 | 47.4 | 34.277 ± 2.638 | 100.0 | 47.5 |
| Balanced | -305.47 ± 53.81 | 97.0 | 41.4 | -8.19 ± 20.32 | 81.0 | 44.2 | 34.286 ± 2.636 | 98.0 | 43.9 |
| High | -377.47 ± 62.79 | 17.0 | 29.0 | -0.63 ± 15.87 | 5.0 | 28.8 | 34.025 ± 2.705 | 6.0 | 28.3 |
| Almost Open | -426.14 ± 68.75 | 0.0 | 4.8 | 2.10 ± 15.51 | 3.0 | 4.8 | 34.290 ± 2.636 | 5.0 | 4.7 |
| Base policy | -455.38 ± 68.54 | 0.0 | 0.0 | 2.08 ± 15.50 | 3.0 | 0.0 | 34.290 ± 2.636 | 5.0 | 0.0 |
| TD3-Lagrangian | -187.11 ± 60.23 | 79.0 | - | 14.15 ± 8.79 | 95.0 | - | 29.83 ± 2.85 | 99.0 | - |

Figure 4: Episode returns and goal-reaching rates for the base policy, fallback policy, six CALF-Wrapper operating modes, and the corresponding PPO-Lagrangian or TD3-Lagrangian baseline at the Low-, Mid-, and High-return checkpoints reported in Table 6. Each black point shows the mean episode return, and each colored rectangle shows its 95% confidence interval over 100 evaluation trials. The numbers inside each panel show the goal-reaching rates in percent. The episode-return axes for the AUV and the Treasure-Collecting Robot change scale at -675.74 and -38.541, respectively, to show the differences above these values.
mean return for CALF-Wrapper. The complete comparisons are reported in Tables 7 and 8. The complete statistical design and all adjusted p-values are reported in Appendix I.
CALF-Wrapper can also produce a return higher than the returns of both constituent policies. At the High-return checkpoints, nine operating-mode comparisons are significantly
higher than both the base policy and the fallback policy according to the intersection-union tests. The corresponding comparisons with each constituent policy are reported in Tables 7 and 8. All adjusted p-values for the intersection-union tests are reported in Table 11.
6.5.2 Episode Return at the Low- and Mid-Return Checkpoints
The Low-return checkpoints provide a less favorable but expected result. Relative to the fallback policy, only one of the 24 CALF-Wrapper comparisons has a significant return difference and a higher observed mean return for CALF-Wrapper, 15 have a significant return difference and a lower observed mean return for CALF-Wrapper, and eight have no detected significant difference. These comparisons are reported in Table 7. In 22 of the 24 comparisons with the Low-return base policy, a significant return difference and a higher observed mean return for CALF-Wrapper are obtained. This improvement primarily shows that the fallback policy compensates for the poor behavior of the weak base policy. CALF-Wrapper cannot be expected to create a strong reward-seeking policy when the supplied base policy contains little useful behavior.
The Mid-return checkpoints show the transition between these two cases. On Pendulum, Conservative and Guarded have a significantly higher return than both the base policy and the fallback policy. On CartPole, the same result is obtained for Guarded and Moderate. No operating mode has a significantly higher return than both policies on the AUV or the Treasure-Collecting Robot at the Mid-return checkpoints. The adjusted p-values for these joint comparisons are reported in Table 11. Useful combined behavior can therefore appear before the base policy reaches the High-return checkpoint, but the most consistent return results are obtained with the High-return checkpoints.
Overall, CALF-Wrapper can compensate for a weak base policy, but its strongest return results are obtained when the base policy is already well trained. Across the 48 separate comparisons with the base policy and the fallback policy at the High-return checkpoints, all but one comparison has either a significant return difference and a higher observed mean return for
Table 7: Paired return comparisons with the fallback policy at the Low-, Mid-, and High-return checkpoints. The paired evaluations use the same initial conditions within each environment and checkpoint. Each row reports the result of two-sided paired Wilcoxon signed-rank tests over 100 evaluation trials after Holm correction across the 24 environment and operating-mode combinations within the stated checkpoint stage. The paired return difference is the CALF-Wrapper return minus the fallback-policy return. For rows with a significant test, the table reports whether the observed mean paired return difference is positive or negative.
| Return | Statistical result | Count | Environment and operating modes |
|---|---|---|---|
| Low | Significant difference; observed mean paired difference positive | 1/24 | Pendulum: Conservative. |
| Low | Significant difference; observed mean paired difference negative | 15/24 | Pendulum: Moderate, Balanced, High, Almost Open; AUV: Conservative, Guarded, Moderate, Balanced, High, Almost Open; Robot: Guarded, Moderate, Balanced, High, Almost Open. |
| Low | No significant return difference from the fallback policy | 8/24 | Pendulum: Guarded; CartPole: Conservative, Guarded, Moderate, Balanced, High, Almost Open; Robot: Conservative. |
| Mid | Significant difference; observed mean paired difference positive | 11/24 | Pendulum: Conservative, Guarded; CartPole: Guarded, Moderate, Balanced; Robot: Conservative, Guarded, Moderate, Balanced, High, Almost Open. |
| Mid | Significant difference; observed mean paired difference negative | 9/24 | Pendulum: Balanced, High, Almost Open; AUV: Conservative, Guarded, Moderate, Balanced, High, Almost Open. |
| Mid | No significant return difference from the fallback policy | 4/24 | Pendulum: Moderate; CartPole: Conservative, High, Almost Open. |
| High | Significant difference; observed mean paired difference positive | 23/24 | Pendulum: Conservative, Guarded, Moderate, Balanced, High, Almost Open; CartPole: Guarded, Moderate, Balanced, High, Almost Open; AUV: Conservative, Guarded, Moderate, Balanced, High, Almost Open; Robot: Conservative, Guarded, Moderate, Balanced, High, Almost Open. |
| High | Significant difference; observed mean paired difference negative | 0/24 | None. |
| High | No significant return difference from the fallback policy | 1/24 | CartPole: Conservative. |
Table 8: Paired return comparisons with the base policy at the Low-, Mid-, and High-return checkpoints. The paired evaluations use the same initial conditions within each environment and checkpoint. Each row reports the result of two-sided paired Wilcoxon signed-rank tests over 100 paired evaluation trials after Holm correction across the 24 environment and operating-mode combinations within the stated checkpoint stage. The paired return difference is the CALF-Wrapper return minus the base-policy return. For rows with a significant test, the table separately reports whether the observed mean paired return difference is positive or negative.
| Return | Statistical result | Count | Environment and operating modes |
|---|---|---|---|
| Low | Significant difference; observed mean paired difference positive | 22/24 | Pendulum: Conservative, Guarded, Moderate, Balanced, High, Almost Open; CartPole: Conservative, Guarded, Moderate, Balanced, High, Almost Open; AUV: Conservative, Guarded, Moderate, Balanced, High; Robot: Conservative, Guarded, Moderate, Balanced, High. |
| Low | Significant difference; observed mean paired difference negative | 0/24 | None. |
| Low | No significant return difference from the base policy | 2/24 | AUV: Almost Open; Robot: Almost Open. |
| Mid | Significant difference; observed mean paired difference positive | 14/24 | Pendulum: Conservative, Guarded, Moderate, Balanced, High, Almost Open; CartPole: Guarded, Moderate; AUV: Conservative, Guarded, Moderate, Balanced, High, Almost Open. |
| Mid | Significant difference; observed mean paired difference negative | 3/24 | Robot: Conservative, Guarded, Balanced. |
| Mid | No significant return difference from the base policy | 7/24 | CartPole: Conservative, Balanced, High, Almost Open; Robot: Moderate, High, Almost Open. |
| High | Significant difference; observed mean paired difference positive | 11/24 | Pendulum: Guarded, Moderate, Balanced, High, Almost Open; CartPole: Almost Open; AUV: Guarded, Moderate, Balanced, High, Almost Open. |
| High | Significant difference; observed mean paired difference negative | 1/24 | Robot: Conservative. |
| High | No significant return difference from the base policy | 12/24 | Pendulum: Conservative; CartPole: Conservative, Guarded, Moderate, Balanced, High; AUV: Conservative; Robot: Guarded, Moderate, Balanced, High, Almost Open. |
CALF-Wrapper or no detected significant difference. In several operating modes, the intersection-union tests identify a CALF-Wrapper return significantly higher than the returns of both policies.
6.5.3 Goal-Reaching Rate
CALF-Wrapper possesses the goal-reaching property established by the theoretical analysis. Nevertheless, the observed goal-reaching rate is not 100% in every operating mode. There is no contradiction between these results. The goal-reaching property concerns the eventual behavior of the system, whereas each experimental episode terminates after a prescribed number of steps. In the more open operating modes, the base policy supplies more actions and can move the system farther from the goal set. The influence of the fallback policy may then become sufficient only when too few steps remain to bring the system to the goal set. Thus, the existence of the goal-reaching property does not imply that every choice of and produces an observed goal-reaching rate of 100%. The Low- and Mid-return checkpoints serve as a stress test that makes the effect of the operating-mode parameters visible.
This dependence does not limit the practical applicability of CALF-Wrapper. The wrapper can be configured so that the fallback policy receives sufficient influence. Conservative and Guarded attained a goal-reaching rate of 100% in every reported evaluation, including all Low-, Mid-, and High-return checkpoints.
Conservative provides the most restrictive configuration, whereas Guarded allows the base policy to make a greater contribution to the episode return. At the High-return checkpoints, Guarded was among the three highest-ranked methods in Table 6 on Pendulum, the AUV, and the Treasure-Collecting Robot. On CartPole, its observed mean return was higher than the observed mean returns of both the base policy and the fallback policy.
Guarded therefore provides the strongest default operating mode among those evaluated. It attained a goal-reaching rate of 100% at every checkpoint while retaining a useful contribution from the base policy to the episode return.
6.5.4 Sensitivity to the Operating Mode
Except for Conservative, the reported operating modes use and differ in the value of selected for the corresponding target . The evaluation across Guarded, Moderate, Balanced, High, and Almost Open therefore also evaluates the sensitivity of the episode return and goal-reaching rate to and the corresponding acceptance budget. Conservative supplies the boundary case with zero probabilistic acceptance budget. Since the Conservative mode has no random acceptance, the difference between its results and those of the fallback policy in Table 6 is due only to selection of the base policy based on the critic.
6.5.5 Comparison with the Lagrangian Baselines
Guarded is selected for comparison with PPO-Lagrangian and TD3-Lagrangian because it provides the strongest default operating mode among those evaluated. Guarded attained an ob-
served goal-reaching rate of 100% at every Low-, Mid-, and High-return checkpoint while retaining a useful contribution from the base policy to the episode return. The comparison is reported in Table 6.
The Lagrangian baselines produce strong results after sufficient training. At the High-return checkpoints, their observed goal-reaching rates are 100% on Pendulum, CartPole, and the AUV and 99% on the Treasure-Collecting Robot. Their episode returns also show that the constrained formulation can produce standalone neural policies that combine a high return with a high observed goal-reaching rate. Strong goal-reaching behavior is already present at the Mid-return checkpoints, where the corresponding rates are 70%, 96%, 100%, and 95%. These rates exceed the corresponding rates of 0%, 90%, 1%, and 3% produced by the ordinary PPO and TD3 base policies.
However, this behavior must first be acquired through training. At the Low-return checkpoints, the observed goal-reaching rates of the Lagrangian baselines are 0%, 97%, 1%, and 79%. The resulting standalone neural policy has no deployment-time mechanism that directly supports goal-reaching behavior after training. Its observed goal-reaching rate therefore depends on the behavior acquired during constrained training.
Guarded CALF-Wrapper differs in that its goal-reaching behavior is supported by a deployment-time policy-selection mechanism rather than being acquired solely through training. At the Low-return checkpoints, Guarded attains an observed goal-reaching rate of 100% and a higher observed mean return than the corresponding Lagrangian baseline in all four environments. At the Mid-return checkpoints, Guarded retains a goal-reaching rate of 100% in every environment. Its observed mean return is higher than that of the Lagrangian baseline on Pendulum and CartPole and lower on the AUV and the Treasure-Collecting Robot.
At the High-return checkpoints, Guarded has a higher observed mean return than the corresponding Lagrangian baseline in all four environments. Both methods attain an observed goal-reaching rate of 100% on Pendulum, CartPole, and the AUV, while Guarded attains 100% and TD3-Lagrangian attains 99% on the Treasure-Collecting Robot. The Lagrangian baselines therefore show that constrained training can produce standalone neural policies with high returns and high observed goal-reaching rates. Guarded CALF-Wrapper addresses a different deployment-time case by supporting goal-reaching behavior at every evaluated checkpoint, including checkpoints from the early parts of actor-critic training.
6.6 Robustness to Critic Noise
The effect of critic error is evaluated by replacing the critic value used by Conservative CALF-Wrapper with , where , before applying the upper clipping value. The Conservative mode is used because it selects the base policy only through the critic condition, so that the effect of critic error is not combined with that of random acceptance. The values are evaluated at the High-return checkpoint in each environment. Each value is evaluated over the same 100 initial conditions, and the same sequence of standard-normal draws is used for corresponding trials at every value of . The condition reproduces the corresponding
Conservative entry in Table 6 to the displayed precision. The results are shown in Fig. 5.

Figure 5: Conservative CALF-Wrapper under additive critic noise at the High-return checkpoints. The upper row shows the mean episode return, with shaded 95% confidence intervals, and the lower row shows the goal-reaching rate and the percentage of time steps at which the fallback policy supplied the applied action. Every point is computed from 100 paired evaluation trials.
The goal-reaching rate remains 100% across all 16 combinations of environments and noise levels in Fig. 5. For and , the changes in mean return remain limited relative to the results at . A pronounced reduction in mean return appears only at , where the AUV mean return decreases from -559.8 to -658.3 and the Robot mean return decreases from 23.4 to -22.3. The Pendulum and CartPole mean returns remain close to their values at even at . The fallback-action percentage generally increases with as CALF-Wrapper relies more frequently on the fallback policy. These results demonstrate substantial empirical robustness of CALF-Wrapper to additive noise in the critic estimate: the observed goal-reaching rate remains 100% at every evaluated noise level, and a pronounced performance degradation occurs only when the critic-noise scale is 200 times the critic threshold.
6.7 CALF-Wrapper Per-Step Latency
To exclude overhead introduced by Python and NumPy, the experiment used a corresponding native Rust implementation of CALF-Wrapper. The implementation processes one environment and one observation at a time and does not use a vectorized environment or batched observations. Rust evaluates the base policy and critic through ONNX Runtime 1.26.0 and its CUDA execution provider on an NVIDIA GeForce RTX 3090 GPU.
A fixed history of 1000 observations was recorded for each environment. One measurement block processes these observations sequentially and reports the elapsed time divided by 1000 as the mean per-step latency. The same observation history was replayed for the base policy and all six CALF-Wrapper operating modes. The measurement excludes the environment tran-
Table 9: Measured mean per-step latency of the native Rust implementation on an NVIDIA GeForce RTX 3090 GPU. The base-policy and critic latencies are means over all 180 measurement blocks for each environment. The mode-dependent values are computed from 30 paired blocks of 1000 sequential observations processed one at a time. Added latency is the CALF-Wrapper latency minus the corresponding base-policy latency; its intervals are paired block-bootstrap 95% confidence intervals.
| Env. | Mode | Fallback policy actions (%) | Base-policy latency (µs) | Critic latency (µs) | Other operations latency (µs) | CALF-Wrapper latency (µs) | Added latency (µs) (95% CI) |
|---|---|---|---|---|---|---|---|
| Pendulum (PPO) | Conserv. | 89.8 | 0.013 | 68.9 | -1.3 [-2.2, -0.4] | ||
| Guarded | 84.6 | 0.014 | 76.3 | 3.4 [2.0, 4.8] | |||
| Moderate | 76.0 | 0.016 | 84.6 | 10.0 [8.1, 11.8] | |||
| Balanced | 71.3 | 73.6 | 64.9 | 0.014 | 85.4 | 13.5 [12.6, 14.5] | |
| High | 65.2 | 0.015 | 95.2 | 18.6 [17.0, 20.2] | |||
| Almost Open | 58.8 | 0.014 | 98.7 | 23.2 [21.5, 24.9] | |||
| CartPole (PPO) | Conserv. | 91.7 | 0.027 | 69.6 | -2.0 [-3.0, -0.9] | ||
| Guarded | 85.8 | 0.027 | 75.5 | 1.6 [0.4, 2.7] | |||
| Moderate | 80.1 | 73.6 | 64.1 | 0.027 | 81.8 | 5.7 [3.9, 7.3] | |
| Balanced | 79.0 | 0.025 | 79.9 | 6.8 [5.5, 8.1] | |||
| High | 78.2 | 0.024 | 81.7 | 7.9 [6.7, 9.2] | |||
| Almost Open | 77.2 | 0.024 | 81.2 | 8.2 [7.0, 9.4] | |||
| AUV (TD3) | Conserv. | 70.0 | 0.014 | 260.6 | 178.6 [175.8, 181.4] | ||
| Guarded | 69.3 | 0.015 | 265.4 | 181.4 [177.8, 184.8] | |||
| Moderate | 67.0 | 83.3 | 173.6 | 0.015 | 265.4 | 180.3 [177.6, 183.0] | |
| Balanced | 66.3 | 0.015 | 264.5 | 181.1 [178.2, 184.3] | |||
| High | 66.0 | 0.015 | 263.3 | 180.3 [177.7, 182.8] | |||
| Almost Open | 65.6 | 0.014 | 262.8 | 180.4 [177.6, 183.3] | |||
| Robot (TD3) | Conserv. | 95.4 | 0.053 | 262.2 | 184.2 [181.3, 187.0] | ||
| Guarded | 89.0 | 0.050 | 251.5 | 178.5 [176.3, 180.9] | |||
| Moderate | 65.8 | 76.0 | 174.6 | 0.044 | 254.6 | 180.2 [176.8, 183.8] | |
| Balanced | 50.0 | 0.040 | 262.8 | 185.6 [183.1, 188.3] | |||
| High | 30.4 | 0.033 | 260.1 | 182.2 [178.9, 185.1] | |||
| Almost Open | 5.1 | 0.016 | 260.6 | 185.2 [182.3, 188.0] |
sition, model export, training, and construction of the recorded observation history.
The “Base-policy latency” column in Table 9 includes one base-policy evaluation. The “Critic latency” column includes one critic evaluation. For TD3, this evaluation uses the previously computed base-policy action to report the critic cost separately from the base-policy cost. The “Other operations latency” column includes clipping the critic value, handling the start of an episode, evaluating the goal-neighborhood condition, applying the conditions in Algorithm 1, updating , and computing the fallback action when the fallback policy is selected. The “Fallback policy actions” column reports the percentage of the 1000 observations for which the fallback policy supplied the applied action during the runtime measurement. The “CALF-Wrapper latency” column reports the complete CALF-Wrapper computation. The “Added latency” column reports the CALF-Wrapper latency minus the base-policy latency within the corresponding paired measurement.
The largest measured mean per-step latency in the “CALF-Wrapper latency” column is 265.4 µs, or 0.2654 ms. The largest value in the “Added latency” column is 185.6 µs, or 0.1856 ms. Thus, the complete CALF-Wrapper computation remains below 0.3 ms per step, and its additional latency relative to the base policy remains below 0.2 ms in all reported configurations.
The PPO checkpoints provide a state-value critic directly, as discussed in Remark 3 and Section 3.2. The PPO critic can therefore be evaluated without first evaluating the base policy. The PPO base policy and critic used in the experiment have comparable network sizes, and their measured evaluation times are also comparable. The base policy is evaluated only when Algorithm 1 selects it, and the fallback policies in these environments require only simple scalar computations. Consequently, “Added latency” ranges from −1.3 to 23.2 µs for Pendulum and from −2.0 to 8.2 µs for CartPole across the six operating modes.
The TD3 checkpoints instead provide two action-value critics. The implementation first evaluates the base policy and then evaluates both action-value critics at the resulting action; their smaller output is used as . This construction accounts for the larger critic cost reported for TD3. A less expensive construction could evaluate one action-value critic at a fixed representative action, such as the zero action, as described in Remark 3. The reported experiment retains the more expensive construction to measure its actual overhead. “Added latency” nevertheless remains between 178.6 and 181.4 µs for the AUV and between 178.5 and 185.6 µs for the Robot.
Across all six operating modes, “Other operations latency” is only 0.013–0.053 µs per observation. The scalar operations performed by CALF-Wrapper and the simple fallback policies therefore contribute negligibly to the measured latency compared with the neural-network evaluations, which is consistent with the computational complexity analysis in Section 3.2.
7 CONCLUSION, LIMITATIONS, AND FUTURE WORK
7.1 Conclusion
CALF-Wrapper is designed for control tasks in which an agent must reach a prescribed goal set while obtaining a high accumulated reward. CALF-Wrapper combines a base policy intended to obtain high reward with a predefined fallback policy.
The article provides the following results:
- The goal-reaching capabilities of CALF-Wrapper were analyzed theoretically and evaluated on two classical-control environments and two more challenging environments with higher-dimensional state spaces and more complex dynamics.
- The experiments provide a comparison with related constrained safe-reinforcement-learning methods formulated for the same objective.
- Sensitivity and ablation studies provide straightforward recommendations for selecting the hyperparameters of CALF-Wrapper without an additional hyperparameter search. The main experiments show how these recommendations combine effective task performance with a high observed goal-reaching rate.
- The computational complexity analysis and hardware measurements show that CALF-Wrapper has a comparatively simple deployment-time implementation and low per-step latency in the evaluated configurations. Recommendations are also provided for reducing this overhead.
Taken together, these results provide the theoretical and practical basis for applying CALF-Wrapper to the stated class of control tasks.
7.2 Limitations
CALF-Wrapper addresses whether the system reaches a prescribed goal set. It does not include a mechanism for detecting or preventing violations of state or action constraints, which are widely studied in safe reinforcement learning. Therefore, the theoretical results and experiments do not establish constraint satisfaction, collision avoidance, or other safety properties, and the reported goal-reaching rates should not be interpreted as constraint-violation rates.
CALF-Wrapper requires a base policy with a corresponding critic estimate and a predefined fallback policy that satisfies the goal-reaching property under the stated assumptions. It therefore belongs to the broader class of methods that assume access to a separately designed backup or fallback policy with the required properties, including the methods discussed in Section 1.1 [9, 15]. Within this scope, CALF-Wrapper has a direct implementation, requires limited additional computation, and provides explicit parameters for controlling the influence of the base policy and the fallback policy.
7.3 Future Work
The ideas developed for CALF-Wrapper can be extended in several directions.
- Evaluation on physical systems is a natural next step. The theoretical results, simulation study, and implementation guidance provide a foundation for addressing the additional requirements of practical deployment.
- CALF-Wrapper can be extended to address the limitation discussed above by developing a method that establishes both the goal-reaching property and satisfaction of specified state and action constraints.
- Another direction is to develop a reinforcement-learning method that attains high goal-reaching rates throughout training. The resulting method should ultimately produce a standalone neural policy that does not use the fallback policy during deployment, attains a high goal-reaching rate, and maximizes the accumulated reward.
A PROOF OF THEOREM 1
Proof. The key observation is that Algorithm 1 eventually uses only the fallback policy, thus inheriting its goal-reaching property. This follows because the total number of base-policy selections is almost surely finite.
Let denote the total number of times the base policy is chosen. denotes the indicator of an event ; it equals one when occurs and zero otherwise. By Definition 5, the base policy can be selected only when . At such a state, the base policy is selected when either (i) the critic condition holds or (ii) the random acceptance condition holds. Therefore,
where
The quantity counts selections based on the critic condition, and counts selections based on the random acceptance condition. Both terms are finite:
Finiteness of : At every time counted by , the value increases by at least . By Assumption ( ), is bounded above by . Since starts at , the value can increase only finitely many times. Thus, .
Finiteness of : Since for all and , and by assumption, the Borel–Cantelli lemma [38] ensures that the event occurs only finitely many times almost surely. Therefore, almost surely.
Combining these results gives almost surely. For , let
Since the number of base-policy activations is almost surely finite, the events are increasing and . Let denote the event that the trajectory generated by CALF-Wrapper converges to . The event is the complement of and denotes the event that this trajectory does not converge to . For every deterministic , the Markov property, Assumption ( ), and Definition 2 give
On , CALF-Wrapper follows the fallback policy from time onward, and hence . Therefore, continuity of probability from below yields
Thus, satisfies the -improbable goal-reaching property. ☐
B PROOF OF THEOREM 2
The set
is nonempty and compact because is compact and is finite-dimensional. Continuity of therefore implies that exists and is finite. The set is nonempty and closed by continuity of , and it is bounded by Assumption . It is therefore compact. Consequently, exists and is finite, and
The function is upper semicontinuous, and is compact. Hence, is finite. The definitions in (7) and (9) then show that and are finite.
The series is finite by the conditions of Algorithm 1. Therefore, the product defining exists, and . The quantities and are also finite. Assumption ( ) implies that is finite. Thus, is finite. The convention makes and well defined with values in for every initial state . The nonnegative series is well defined with a value in . Assumption ( ) and monotonicity of make this series finite for every .
Lemma 1 (States at which the base policy is selected). Suppose that Assumption ( ) holds. Whenever Algorithm 1 selects the base policy at time t,
and
Proof. If the base policy is selected because the critic condition holds, then
If the base policy is selected because the random acceptance condition holds, then . Assumption ( ) then implies . Thus, in both cases. Equation (27) follows from the definition of . The one-step transition bound gives
almost surely, which proves (28).
Lemma 2 (Number of selections based on the critic condition). Suppose that Assumption ( ) holds. The number of times at which the base policy is selected because the critic condition holds satisfies
Proof. Every selection based on the critic condition counted by increases by at least . At every such time, . Hence, the corresponding state belongs to , where the critic value is at most . The stored value is initially at least . Therefore,
Lemma 3 (Total number of base-policy selections). Let
Suppose that Assumptions and hold. Then
Proof. Define
Every base-policy selection satisfies at least one of the two conditions in line 4 of Algorithm 1. Therefore,
Since ,
Lemma 2 and (11) give
A nonnegative integer-valued random variable with finite expectation is finite almost surely. This proves (30).
Lemma 4 (A consecutive sequence of fallback-policy selections). Suppose that Assumption holds. By Lemma 2, the number of selections of the base policy based on the critic condition is at most . On the event
the first actions, where , contain at least consecutive actions supplied by the fallback policy.
Proof. Before time , there are at most action positions. After time , the stated event excludes every selection based on the random acceptance condition because . There are at most selections of the base policy based on the critic condition. Thus, the first actions contain at most actions supplied by the base policy. The at most actions supplied by the base policy divide the remaining actions into at most consecutive sequences of actions supplied by the fallback policy. By the pigeonhole principle, at least one of these sequences contains at least actions. Otherwise, the total number of actions would be at most , which is less than . Substitution of proves the claim.
Lemma 5 (Expected-distance bound during consecutive fallback-policy selections). Suppose that Assumption holds. Let be a stopping time at which . Consider the state process generated by the fallback policy from . For every ,
Consequently, for every ,
If Algorithm 1 selects the fallback policy at times , then its state at time coincides with the state in (31) under the same realizations of the fallback-policy actions and system transitions.
Proof. The strong Markov property, Definition 4, and monotonicity of in its first argument give (31). Markov's inequality gives (32). The final statement follows because both state processes apply the fallback policy for the stated time steps.
Lemma 6 (Probability of a subsequent exit under the fallback policy). Suppose that Assumption holds. Let , and let be a stopping time such that . For the state process generated by the fallback policy from ,
(33)
Proof. By the strong Markov property, conditionally on , the state process after time has the same transition law as the state process generated by the fallback policy and initialized at . Definition 4 therefore gives
for every , where the second inequality follows from and monotonicity of in its first argument. Conditional Markov's inequality then gives
Finally, the countable union bound gives
which proves (33).
Proof. Let contain the history through the state and before the policy is selected at time . The initial-state condition gives . Lemma 1 gives
almost surely whenever Algorithm 1 selects the base policy at time k. Thus, the initial state and every state immediately following an action supplied by the base policy satisfy the same bound.
Claim ( ). If is selected at time t, then the current consecutive selections of the fallback policy begin either at time zero or immediately after an earlier selection of the base policy. Partitioning according to the most recent time before t at which is selected gives
Multiplying this identity by and taking expectations gives the corresponding decomposition of the expectation. On the first event, the state at time is generated by actions supplied by from . On every event in the sum, the state at time is generated by actions supplied by from . Dropping the restrictions on the policy selections after time and using nonnegativity give
Lemma 5, (34), and monotonicity of in its first argument then give
For the complementary policy-selection case, Lemma 1 gives
Consequently,
Taking the supremum over t proves (16). Moreover,
which proves (17).
Claim . Define
Independence of the uniform random variables gives
For any state satisfying , define
Equation (32) gives
For every , the same equation and (34) give
Define the event
The event that the base policy is selected at time k is -measurable. Therefore, for every ,
The union bound, the conditional-expectation identity, and (30) therefore give
On , no selection of the base policy based on the random acceptance condition occurs at or after time . Lemmas 2 and 4 therefore show that the first actions contain at least consecutive actions supplied by the fallback policy. These consecutive actions begin either at the initial state or at a state immediately following a selection of the base policy. If also holds, then the state after these consecutive actions has distance greater than from . Consequently, the event
is contained in . Hence,
which proves (18). Since
This proves (19).
Claim (C ). For any state satisfying , define
Lemmas 5 and 6 give
Lemma 1 gives almost surely on the event that the base policy is selected at time k. Conditional application of the preceding bound therefore gives, on this event,
Define the event
The same conditional-expectation identity used for and the union bound give
The definition of and (30) give
(37)
Fix and suppose that Assumption (A ) holds. On , Lemmas 2 and 4 provide at least consecutive actions supplied by the fallback policy among the first actions. These actions begin either at the initial state or at a state immediately following a selection of the base policy. If does not occur, the state after these actions has distance at most
from , and the trajectory generated by the fallback policy from that state remains within distance of . Since . Assumption requires Algorithm 1 to continue selecting the fallback policy. The trajectory generated by CALF-Wrapper therefore remains within distance of from that time onward. Consequently,
Equations (35) and (37) then give
which proves (20). Let . Assumption (A ) permits the successive selection of , , and such that
Substitution into (20) gives
Since is arbitrary, . This proves the final statement of Claim .
B.1 Explicit Probability Bound for Geometrically Decaying Random Acceptance Probabilities
The probability bounds in Claims (C ) and (C ) contain . When , the following proposition gives an explicit lower bound on .
Proposition 3. Suppose that for every , where and . Then, for every ,
Proof. Under the stated choice of ,
For every , . The function is zero at x = 0 and has a nonnegative derivative on . Therefore, for every ,
Exponentiating this inequality proves (38).
C UNIFORM ALMOST-SURE BOUNDS FOR CALF-WRAPPER
The following assumption is an alternative to Assumption ( ). The superscript distinguishes the alternative uniform assumption and claims in this appendix from those in Section 5.
The fallback policy satisfies the uniform almost-sure goal-reaching property: there exists a function such that, for every initial state ,
The same function applies to every initial state.
Assumption is stronger than Assumption when both assumptions use the same function . Indeed, (39) directly implies the expected-distance bound in Definition 4. For the statement below, define
Let satisfy for every and , as provided by the class decomposition in [35, Lemma 8] and Appendix D. For every , define
This construction gives and
Theorem 3 (Uniform almost-sure bounds for CALF-Wrapper). Consider Algorithm 1 initialized at any satisfying . Under Assumptions , , and , the following claims hold.
The distance from satisfies
For every , , and the integer constructed above,
In particular,
For every , suppose additionally that Assumption holds for this prescribed value of . There exists such that
For every and the integer constructed above,
In particular,
Lemma 7. Suppose that Assumption holds. Let be a stopping time such that . For the state process generated by the fallback policy from ,
If Algorithm 1 selects the fallback policy at times , then its state at time coincides with the state in (45) under the same realizations of the fallback-policy actions and system transitions.
Proof. By the strong Markov property, conditionally on , the state process after time has the same transition law as the state process generated by the fallback policy and initialized at . Assumption and monotonicity of in its first argument give (45). The final statement follows because both state processes apply the fallback policy for the stated time steps.
Proof of Theorem 3. Lemma 1 shows that the initial state and every state immediately following an action supplied by the base policy are within distance of . Lemma 7 shows that, during every consecutive sequence of actions supplied by the fallback policy, the distance from is at most . The time indices at which such sequences can begin are countable. The two bounds therefore hold simultaneously almost surely at every time and prove Claim .
Fix and . The construction preceding the theorem gives
Define
Independence of the uniform random variables gives
Lemma 2 and Lemma 4 show that, on , the first actions contain at least consecutive actions supplied by the fallback policy. This sequence is contained in a maximal consecutive sequence of actions supplied by the fallback policy that begins either at time zero or immediately after an action supplied by the base policy. The initial state of the maximal sequence is therefore within distance of by Lemma 1. The maximal sequence contains at least actions. Lemma 7 then gives
almost surely for the initial time of this sequence. Consequently,
which proves (41). Since as , (42) follows.
Suppose that Assumption holds. Continuity of in its first argument and imply that there exists satisfying . The construction preceding the theorem gives . Applying the preceding argument with in place of shows that, on , the trajectory enters the -neighborhood no later than .
After this entry, Algorithm 1 selects the fallback policy by Assumption . Assumption gives, almost surely,
for every subsequent time k. Therefore,
which proves (43). Letting proves (44).
D A DECOMPOSITION OF CLASS- FUNCTIONS
The following lemma proves the decomposition used in Section 5.1. The proof follows the construction in [35, Lemma 8] and states the construction in the notation used in this paper.
Lemma 8. For every , there exist such that
Proof. Define
Then , , and belongs to for every fixed . It is therefore sufficient to establish the decomposition for .
For d > 0, define
The inequality shows that . The function is nonincreasing because is nonincreasing for every fixed .
It remains to show that as . Fix . Since
and belongs to , there exist such that whenever . Hence, for every and every . For ,
The right-hand side converges to zero as . Thus, it is smaller than for all sufficiently large , uniformly for . Consequently, .
Choose a continuous function that is strictly decreasing, converges to zero, and satisfies for every . Such a function can be constructed by choosing an increasing sequence such that for and linearly interpolating the values . Define
Then and
Define and
The function is continuous and strictly increasing on [0,1]. Extend it to by setting
Then and for every . Therefore,
which proves (46).
The factor contains the dependence on the initial distance . The factor contains the dependence on time and converges to zero because and . The decomposition does not require itself to decrease exponentially in . The function transforms the exponential quantity into the time dependence required to bound .
E ENVIRONMENT DESCRIPTIONS
E.1 Pendulum Environment

Figure 6: Pendulum environment. The state is , where is the angle and is the angular velocity. The action is the control torque N·m. The shaded sector shows the constraint on in the goal set defined in (47). Adapted from the official Gymnasium rendering and redrawn with an AI image-generation tool (see Acknowledgment).
The Pendulum [39] environment from Gymnasium has the following dynamics:
where is the angle, is the angular velocity, N·m is the control torque (action), kg is the mass of the pendulum, m is the length of the pendulum, and m/s is the gravitational acceleration. The initial state is randomly sampled from . The observation is . The goal is to stabilize the pendulum in the upright position, which corresponds to . The goal set is
The dynamics are integrated using the Euler scheme at 20 Hz. Episodes are truncated after 200 steps. The reward function is
E.2 CartPole Swing-Up Environment

Figure 7: CartPole Swing-Up environment. The state is , where is the pole angle, is the pole angular velocity, is the cart position, and is the cart velocity. The action is the force N applied to the cart. The shaded regions show the constraints on and in the goal set defined in (48). Adapted from the official Gymnasium rendering and redrawn with an AI image-generation tool (see Acknowledgment).
The system dynamics are described by
Here, is the cart position, is the cart velocity, is the pole angle, is the pole angular velocity, kg is the cart mass, kg is the pole mass, m is half the pole length, m/s is the gravitational acceleration, and N is the force applied to the cart. The initial state is randomly sampled from . The goal is to swing up and balance the pole in the upright position, which corresponds to , while keeping the cart near . The goal set is
The system is integrated using the Euler scheme at 50 Hz. The PPO base policy and the PPO-Lagrangian baseline are trained with the same 1000-step episode limit used during evaluation. Episodes do not terminate when the cart position, cart velocity, or pole angular velocity reaches a prescribed bound. Instead, during training, after every integration step, x, v, and are clipped to , , and , respectively.
If is clipped and points away from the interval, is set to zero. During evaluation, the state is not clipped. Every training episode and evaluation trial therefore continues until the 1000-step time limit. The 5D observation is with reward function
The fallback policy applies the maximum force opposite to the cart velocity whenever and during these evaluations.
E.3 Contaminated-Zone Autonomous Underwater Vehicle Navigation

Figure 8: Contaminated-Zone AUV Navigation. Left: a representative trajectory generated by the fallback policy. It reaches G along a direct path through the contaminated region, leaving scope for the base policy to achieve a higher return. Right: task layout and desired behavior; the green region is the contaminated low-reward region, and the flag marks the goal set G defined in (50). The trajectory in the right panel bypasses the contaminated region on the way to G.
Dynamics and interface. The task in Fig. 8 represents an AUV moving in a vertical plane. Its continuous-time dynamics are
The physical state contains position, orientation, translational velocity, and angular velocity. The policy receives the angle-embedded observation and selects the body-frame thrusts . The parameters are , , , , and . Equation (49) is integrated by explicit Euler steps of 0.02 s, and each episode contains at most 1500 steps.
Objective, reward, and initialization. The goal is the surface opening
The green region in Fig. 8 is the parabolic contaminated zone
The per-step reward penalizes displacement from the surface opening, excessive translational and angular velocities, and entry into this zone:
Initial states are sampled as
so that the vehicle starts in the lower part of the water column with small velocities and an approximately upward orientation.
Fallback policy. The fallback is a closed-form PD controller that first computes the desired inertial-frame forces
and then transforms them to body-frame thrusts:
with each component clipped to the action bounds. It reliably directs the AUV to the surface opening but does not use the contaminated-zone geometry, which explains the suboptimal sample trajectory in the left panel of Fig. 8.
E.4 Treasure-Collecting Robot

Figure 9: Treasure-Collecting Robot. Left: representative behavior of the fallback policy. The black marker on the left boundary indicates the goal, and the orange disk denotes the collectible treasure. The fallback policy steers directly toward the goal and does not intercept the treasure. Right: desired behavior induced by the learned policy. The learned policy first deviates toward the collectible treasure and then returns toward the goal, instead of following a direct goal-seeking trajectory.
Environment description. The robot moves with a constant linear speed. Its dynamics are given by
where are the robot's coordinates, is the robot's heading, m/s denotes the robot's constant linear speed, and is the angular velocity serving as the control input.
During the episode, the robot must collect a treasure whose position is known to the robot. The treasure is considered collected when the following condition holds:
The treasure moves stochastically in the workspace. Let and denote its position and velocity at time , and let s. Its initial velocity has a random heading and fixed speed . At each time step, the velocity is perturbed by random variables , which are independent across components and time, and the resulting velocity is clipped to magnitude . The velocity and position updates are given by
The update is followed by reflection at the workspace boundaries for and , implemented as component-wise velocity sign flips.
After collecting the treasure, the robot must reach a goal region that is specified explicitly and is also favored by the distance-to-goal term in the reward. The goal set is defined as
where is the goal position.
The state vector is nine-dimensional and is defined as
where is a binary indicator of treasure availability:
Although the treasure velocity is part of the state, the implementation excludes it from the inputs of all policies and critic estimates used in this environment. The dynamics are integrated using an explicit Euler scheme at 20 Hz. Each episode lasts at most 1000 steps (50 s) and terminates early if the goal set is reached. Representative rollouts for this task are shown in Fig. 9.
Reward function and objective. The reward function is defined as
where denotes the Euclidean norm. Thus, the task rewards both collecting the treasure and reaching the goal as quickly as possible.
Initial conditions. The components of the initial state are sampled independently as follows:
where .
Fallback policy design. The fallback employs a simple geometric steering law that turns the robot toward the provided target point. From the observation , the controller reconstructs the current heading as and computes the desired heading to the goal as . The wrapped angle error is , and the action is the clipped proportional control
The parameters are set to and . When the robot is numerically at the goal, is set to to avoid an ill-defined direction. This fallback reliably reaches the goal but optimizes only the goal-reaching objective; it is not designed to capture the high-reward treasure, which results in suboptimal behavior with respect to the full reward function. This behavior is illustrated in the left panel of Fig. 9.
F TECHNICAL PRELIMINARY RESULTS FOR FUNCTIONS WITH BOUNDED SUPERLEVEL SETS
Proposition 4. has bounded superlevel sets if and only if both of the following hold:
(i)
(ii)
Proof. Set and treat two mutually exclusive cases.
Case 1. b = -∞.
( ) Suppose has bounded superlevel sets. Fix an arbitrary . Because , there exists with . Boundedness of the -superlevel set gives an such that
Thus, (i) holds. Condition (ii) is automatic for .
( ) Conversely, assume . Given , choose so that . Then , proving boundedness.
Case 2. b > -∞.
( ) Assume f has bounded superlevel sets.
Step 1: show (ii). If , the b-superlevel set would equal , contradicting boundedness. Thus for all , establishing (ii).
Step 2: show (i). Let be arbitrary with . Because has bounded superlevel sets, there is an such that , or equivalently, . Because and for every , one can pick arbitrarily close to ; this completes the proof of (i).
( ) Now assume (i) and (ii). From (ii) it follows that . If as , then for any there exists such that
Thus, for all (and, consequently, for all ) the superlevel set lies within the ball and is therefore bounded.
Proof of Proposition 1. The result follows directly from Proposition 4 by examining the two cases:
(i): Property (i) corresponds to Case 1 in the proof of Proposition 4 where . In this case, has bounded superlevel sets if and only if , which is equivalent to the negative of being radially unbounded.
(ii): Property (ii) corresponds to Case 2 in the proof of Proposition 4 where . The function has bounded superlevel sets if and only if as and for all , which for finite is equivalent to
The function in Proposition 2 can be constructed as follows.
Case 1: If , then
where is an arbitrary continuous function with .
Case 2: If , then
(52)
where is an arbitrary continuous function with .
Proof of Proposition 2. Continuity can be checked directly by substituting an arbitrary with and verifying that .
Moreover, both functions have infimum equal to since is bounded on , is never equal to , and . Therefore, by Proposition 4, both functions have bounded superlevel sets.
G A BOUND ON THE VALUE-FUNCTION DIFFERENCE
This appendix states and proves a bound on the difference between the values of two states near the goal set. The assumptions of the remark are used only to give a formal interpretation of the scale used for the sensitivity study. They are not assumptions required by CALF-Wrapper.
Remark 9. Consider deterministic dynamics described by a transition map and a deterministic base policy. For every and , is the next state obtained after applying a at s. For every initial state s, define the resulting states by
Thus, is the state obtained after consecutive applications of the base policy from the initial state . Let the goal set consist of one point, . Assume that the reward under the base policy has a local maximum at and is locally quadratic around this point, and that the base policy locally exponentially stabilizes .
Specifically, these assumptions mean that there exist , , , and such that the relations (53)–(55) hold for every and every :
Then, for every ,
where .
Proof. For every , (55) gives
for every . Thus, every state on the trajectory generated by the base policy from remains in .
For every , (55) and (54) give
Hence, for every , both rewards lie in the same interval with upper endpoint and width . Therefore,
Multiplication by and summation over give
H PPO-LAGRANGIAN AND TD3-LAGRANGIAN BASELINES
PPO-Lagrangian is evaluated on Pendulum and CartPole Swing-Up, and TD3-Lagrangian is evaluated on Contaminated-Zone AUV Navigation and the Treasure-Collecting Robot. These algorithms were used because PPO and TD3 are also used to train the corresponding base policies. The comparison therefore retains the policy class used in each environment and changes whether the goal-reaching objective is addressed by constrained training or by CALF-Wrapper after training. Unlike shielding and predictive safety filtering methods, these baselines require neither a dynamics model nor an additional safe-set specification that is absent from the four experimental tasks.
Let T denote the episode horizon, and let be the smaller of T and the first environment termination time. For Pendulum and CartPole Swing-Up, the terminal cost is
For Contaminated-Zone AUV Navigation and the Treasure-Collecting Robot, the terminal cost is
The two definitions agree with the goal-reaching-rate event used for each environment. The constrained training problem is
where . Since is binary, the constraint in (59) requires a goal-reaching probability of at least 0.95 under the environment's initial-state distribution and the finite evaluation horizon. This finite-horizon expected constraint is not the uniform almost-sure goal-reaching condition in Assumption ( ).
Both baselines use the Lagrangian
and update the multiplier according to
The physical observation is augmented with so that one stationary actor and critic can represent the finite-horizon problem. The cost discount is . Thus, the sum of costs in a completed episode equals the binary event in (57) or (58). Reward and cost targets stop at both environment termination and time-limit truncation, and the terminal observation before automatic environment reset is used to evaluate membership in .
PPO-Lagrangian adds a cost value function to PPO and computes separate reward and cost generalized-advantage estimates. The policy update uses their Lagrangian combination and a bounded tanh-squashed Gaussian policy. The multiplier estimate is the mean binary cost over complete newly finished episodes.
TD3-Lagrangian retains the twin reward critics and delayed actor updates of TD3 and adds a bounded cost critic that estimates the probability of terminal failure. Its actor maximizes the reward critic minus the multiplier times the cost critic. Its multiplier estimate is computed from the current deterministic actor and the cost critic at newly sampled initial states. Failures generated by exploratory behavior actions are recorded but are not used for this update.
I STATISTICAL DESIGN FOR THE EPISODE-RETURN COMPARISONS
The statistical comparisons summarized in Tables 7 and 8 condition on the selected actor-critic checkpoints. For each environment, checkpoint stage, and CALF-Wrapper operating mode, the 100 CALF-Wrapper episode returns are paired separately with the 100 base-policy returns and the 100 fallback-policy returns. Each pair uses the same initial condition.
A paired difference is computed as the CALF-Wrapper episode return minus the episode return of the policy used for comparison. Each comparison uses a two-sided paired Wilcoxon signed-rank test. Zero paired differences are excluded from the ranking according to the Wilcoxon convention. The p-values are computed using the automatic exact or asymptotic method
selection provided by the SciPy implementation. When an adjusted p-value is below 0.05, the direction reported in Tables 7 and 8 is determined by the sign of the observed mean paired difference.
The multiplicity correction is applied separately for every checkpoint stage and every policy used for comparison. Each family therefore contains the 24 comparisons formed by the four environments and six CALF-Wrapper operating modes. The 24 unadjusted p-values in each family are adjusted using the Holm procedure. Statistical significance is assessed at the adjusted level of 0.05. All 144 adjusted p-values from these six families are reported in Table 10.
The claim that a CALF-Wrapper return is higher than both the base-policy return and the fallback-policy return uses an intersection-union test. Two one-sided paired Wilcoxon signed-rank tests compare CALF-Wrapper separately with the base policy and the fallback policy. The unadjusted p-value for the intersection-union test is the larger of these two one-sided p-values. For each checkpoint stage, the 24 intersection-union p-values are adjusted together using the Holm procedure. All 72 adjusted p-values are reported in Table 11.
Table 10: Holm-adjusted p-values for the two-sided paired Wilcoxon signed-rank comparisons of the CALF-Wrapper episode return with the fallback-policy return and the base-policy return. Each checkpoint-stage and reference-policy column is a separate family of 24 comparisons. Bold values are below 0.05.
| Environment | Mode | Comparison with fallback policy | Comparison with base policy | ||||
|---|---|---|---|---|---|---|---|
| Low | Mid | High | Low | Mid | High | ||
| Pendulum | Conservative | 0.172 | |||||
| Guarded | 0.989 | 0.002 | |||||
| Moderate | 0.616 | ||||||
| Balanced | 0.002 | ||||||
| High | 0.019 | ||||||
| Almost Open | 0.04 | ||||||
| CartPole | Conservative | 1 | 0.886 | 0.168 | 1 | 0.066 | |
| Guarded | 0.603 | 0.006 | 0.011 | 1 | |||
| Moderate | 0.603 | 0.007 | 0.111 | ||||
| Balanced | 1 | 0.045 | 0.005 | 0.053 | 1 | ||
| High | 1 | 0.387 | 0.003 | 1 | 1 | ||
| Almost Open | 0.088 | 0.886 | 0.023 | 0.063 | 0.009 | ||
| AUV | Conservative | 1 | |||||
| Guarded | |||||||
| Moderate | |||||||
| Balanced | |||||||
| High | |||||||
| Almost Open | 0.918 | ||||||
| Robot | Conservative | 1 | 0.003 | ||||
| Guarded | 0.012 | 0.007 | 0.517 | ||||
| Moderate | 0.063 | 0.203 | |||||
| Balanced | 0.007 | 0.512 | |||||
| High | 0.047 | 0.063 | 1 | ||||
| Almost Open | 0.155 | 1 | 1 | ||||
Table 11: Holm-adjusted -values for the intersection–union tests of whether the CALF-Wrapper episode return is higher than both the base-policy return and the fallback-policy return. Each checkpoint-stage column is a separate family of 24 comparisons. Bold values are below 0.05.
| Environment | Mode | Low | Mid | High |
|---|---|---|---|---|
| Pendulum | Conservative | 1 | 0.12 | |
| Guarded | 1 | 0.003 | ||
| Moderate | 1 | 1 | ||
| Balanced | 1 | 1 | ||
| High | 1 | 1 | 0.038 | |
| Almost Open | 1 | 1 | 0.129 | |
| CartPole | Conservative | 1 | 1 | 1 |
| Guarded | 1 | 0.009 | 1 | |
| Moderate | 1 | 0.011 | 0.076 | |
| Balanced | 1 | 0.091 | 1 | |
| High | 1 | 1 | 1 | |
| Almost Open | 1 | 1 | 1 | |
| AUV | Conservative | 1 | 1 | 1 |
| Guarded | 1 | 1 | ||
| Moderate | 1 | 1 | ||
| Balanced | 1 | 1 | ||
| High | 1 | 1 | ||
| Almost Open | 1 | 1 | ||
| Robot | Conservative | 1 | 1 | 1 |
| Guarded | 1 | 1 | 1 | |
| Moderate | 1 | 1 | 1 | |
| Balanced | 1 | 1 | 1 | |
| High | 1 | 1 | 1 | |
| Almost Open | 1 | 1 | 1 |
All tests are conditional on the reported actor-critic checkpoints and describe variation over initial conditions, which corresponds to the deployment of CALF-Wrapper with a fixed base policy, critic estimate, and fallback policy. The Low-, Mid-, and High-return checkpoints are taken from different stages of the actor-critic training run in each environment and supply base policies and critic estimates of substantially different quality. The training scripts with the configurations of the reported training runs, all evaluated checkpoints, including those of the Lagrangian baselines, the evaluation code and data, and the code that reproduces the reported figures and tables are available in the project repository https://github.com/aidagroup/calf-wrapper. PPO-Lagrangian and TD3-Lagrangian modify policy training rather than deployment and are therefore compared descriptively using the 95% confidence intervals in Table 6. Failure to reject the null hypothesis is not interpreted as evidence of equivalence or noninferiority.
CONFLICT OF INTEREST
The authors declare no conflict of interest.
DATA AVAILABILITY
All simulation code required to reproduce the experimental runs and the resulting run data are available in the project repository: https://github.com/aidagroup/calf-wrapper.
ACKNOWLEDGMENT
The illustrations of the Pendulum and CartPole Swing-Up environments in Figs. 6 and 7 are based on the official Gymnasium renderings of these environments and were redrawn with an image-generation model accessed through OpenAI Codex. AI coding assistants (Claude by Anthropic and Codex by OpenAI) were used to improve the visual rendering of the simulations of the Contaminated-Zone AUV Navigation and Treasure-Collecting Robot environments shown in Figs. 8 and 9, to refactor and document the code in the project repository, and to prepare it as a ready-to-use reproduction package. The CALF-Wrapper algorithm, its original implementation, the theoretical results, and the experimental design were developed by the authors, and AI assistance was limited to polishing the existing code, refining the presentation of the derivations, and improving the exposition. AI tools were also used to survey and verify the related literature, for language editing and grammar checking, and to verify bibliographic details. The authors reviewed all AI-assisted changes and take full responsibility for the content of this article.
REFERENCES
[1] OpenAI et al., “Solving Rubik’s cube with a robot hand,” 2019, arXiv:1910.07113. [2] V. Kumar, E. Todorov, and S. Levine, “Optimal control with learned local models: Application to dexterous manipulation,” in Proc. IEEE Int. Conf. Robot. Autom. (ICRA), 2016, pp. 378–383. [3] D. Silver et al., “A general reinforcement learning algorithm that masters chess, shogi, and Go through self-play,” Science, vol. 362, no. 6419, pp. 1140–1144, 2018. [4] O. Vinyals et al., “Grandmaster level in StarCraft II using multi-agent reinforcement learning,” Nature, vol. 575, no. 7782, pp. 350–354, 2019. [5] S. Fujimoto, H. van Hoof, and D. Meger, “Addressing function approximation error in actor-critic methods,” in Proc. 35th Int. Conf. Mach. Learn. (ICML), ser. Proceedings of Machine Learning Research, vol. 80, 2018, pp. 1587–1596. [6] T. Haarnoja et al., “Soft actor-critic algorithms and applications,” 2019, arXiv:1812.05905. [7] J. Schulman, F. Wolski, P. Dhariwal, A. Radford, and O. Klimov, “Proximal policy optimization algorithms,” 2017, arXiv:1707.06347. [8] P. Osinenko, G. Yaremenko, R. Zashchitin, A. Bolychev, S. Ibrahim, and D. Dobriborsci, “Critic as Lyapunov function (CALF): A model-free, stability-ensuring agent,” in Proc. IEEE 63rd Conf. Decis. Control (CDC), 2024, pp. 2517–2524. [9] D. Seto, B. Krogh, L. Sha, and A. Chutinan, “The Simplex architecture for safe online control system upgrades,” in Proc. Amer. Control Conf. (ACC), vol. 6, 1998, pp. 3504–3508. [10] M. Alshiekh, R. Bloem, R. Ehlers, B. Könighofer, S. Niekum, and U. Topcu, “Safe reinforcement learning via shielding," in Proc. 32nd AAAI Conf. Artif. Intell. (AAAI), 2018, pp. 2669–2678.
[11] K. Kim et al., “Realizable continuous-space shields for safe reinforcement learning,” in Proc. 7th Annu. Learn. Dyn. Control Conf. (L4DC), ser. Proceedings of Machine Learning Research, vol. 283, 2025, pp. 932–945.
[12] K. P. Wabersich and M. N. Zeilinger, “A predictive safety filter for learning-based control of constrained nonlinear dynamical systems,” Automatica, vol. 129, p. 109597, 2021.
[13] W. Lavanakul, J. Choi, K. Sreenath, and C. Tomlin, “Safety filters for black-box dynamical systems by learning discriminating hyperplanes,” in Proc. 6th Annu. Learn. Dyn. Control Conf. (L4DC), ser. Proceedings of Machine Learning Research, vol. 242, 2024, pp. 1278–1291.
[14] B. Thananjeyan et al., “Recovery RL: Safe reinforcement learning with learned recovery zones,” IEEE Robot. Autom. Lett., vol. 6, no. 3, pp. 4915–4922, 2021.
[15] N. C. Wagener, B. Boots, and C.-A. Cheng, “Safe reinforcement learning using advantage-based intervention,” in Proc. 38th Int. Conf. Mach. Learn. (ICML), ser. Proceedings of Machine Learning Research, vol. 139, 2021, pp. 10630–10640.
[16] A. Banerjee, K. Rahmani, J. Biswas, and I. Dillig, “Dynamic model predictive shielding for provably safe reinforcement learning,” in Proc. Adv. Neural Inf. Process. Syst. (NeurIPS), vol. 37, 2024, pp. 100 131–100 159.
[17] E. Altman, Constrained Markov Decision Processes. Chapman and Hall/CRC, 1999.
[18] J. Achiam, D. Held, A. Tamar, and P. Abbeel, “Constrained policy optimization,” in Proc. 34th Int. Conf. Mach. Learn. (ICML), ser. Proceedings of Machine Learning Research, vol. 70, 2017, pp. 22–31.
[19] C. Tessler, D. J. Mankowitz, and S. Mannor, “Reward constrained policy optimization,” in Proc. 7th Int. Conf. Learn. Represent. (ICLR), 2019.
[20] N. Jansen, B. Könighofer, S. Junges, A. Serban, and R. Bloem, “Safe reinforcement learning using probabilistic shields,” in Proc. 31st Int. Conf. Concurrency Theory (CONCUR), ser. Leibniz Int. Proc. Inform. (LIPIcs), vol. 171, 2020, pp. 3:1–3:16.
[21] A. Ray, J. Achiam, and D. Amodei, “Benchmarking safe exploration in deep reinforcement learning,” OpenAI, Tech. Rep., 2019. [Online]. Available: https://cdn.openai.com/safexp-short.pdf
[22] A. Stooke, J. Achiam, and P. Abbeel, “Responsive safety in reinforcement learning by PID Lagrangian methods,” in Proc. 37th Int. Conf. Mach. Learn. (ICML), ser. Proceedings of Machine Learning Research, vol. 119, 2020, pp. 9133–9143.
[23] S. Ha, P. Xu, Z. Tan, S. Levine, and J. Tan, “Learning to walk in the real world with minimal human effort,” in Proc. Conf. Robot Learn. (CoRL), ser. Proceedings of Machine Learning Research, vol. 155, 2021, pp. 1110–1120.
[24] A. Raffin, A. Hill, A. Gleave, A. Kanervisto, M. Ernestus, and N. Dormann, “Stable-Baselines3: Reliable reinforcement learning implementations,” J. Mach. Learn. Res., vol. 22, no. 268, pp. 1–8, 2021. [Online]. Available: http://jmlr.org/papers/v22/20-1364.html
[25] S. Huang et al., “CleanRL: High-quality single-file implementations of deep reinforcement learning algorithms,” J. Mach. Learn. Res., vol. 23, no. 274, pp. 1–18, 2022. [Online]. Available: http://jmlr.org/papers/v23/21-1342.html
[26] T. P. Lillicrap et al., “Continuous control with deep reinforcement learning,” in Proc. 4th Int. Conf. Learn. Represent. (ICLR), 2016, arXiv:1509.02971.
[27] J. Fu, A. Kumar, M. Soh, and S. Levine, “Diagnosing bottlenecks in deep Q-learning algorithms,” in Proc. 36th Int. Conf. Mach. Learn. (ICML), ser. Proceedings of Machine Learning Research, vol. 97, 2019, pp. 2021–2030. [Online]. Available: https://proceedings.mlr.press/v97/fu19a.html
[28] “Gymnasium wrapper,” Farama Foundation, Accessed: Mar. 17, 2025. [Online]. Available: https://gymnasium.farama.org/api/wrappers/
[29] Verified-Intelligence, “α,β-CROWN: A fast and scalable neural network verifier with efficient bound propagation,” GitHub repository, 2026, Accessed: Oct. 24, 2026. [Online]. Available: https://github.com/Verified-Intelligence/alpha-beta-CROWN
[30] H. Zhang, T.-W. Weng, P.-Y. Chen, C.-J. Hsieh, and L. Daniel, “Efficient neural network robustness certification with general activation functions,” in Proc. Adv. Neural Inf. Process. Syst. (NeurIPS), vol. 31, 2018. [Online]. Available: https://proceedings.neurips.cc/paper_files/paper/2018/hash/d04863f100d59b3eb688a11f95b0ae60-Abstract.html
[31] K. Xu et al., “Automatic perturbation analysis for scalable certified robustness and beyond,” in Proc. Adv. Neural Inf. Process. Syst. (NeurIPS), vol. 33, 2020, pp. 1129–1141. [Online]. Available: https://proceedings.neurips.cc/paper_files/paper/2020/hash/0cbc5671ae26f67871cb914d81ef8fc1-Abstract.html
[32] K. Xu et al., “Fast and complete: Enabling complete neural network verification with rapid and massively parallel incomplete verifiers,” in Proc. 9th Int. Conf. Learn. Represent. (ICLR), 2021. [Online]. Available: https://openreview.net/forum?id=nVZtXBI6LNn
[33] S. Wang et al., “Beta-CROWN: Efficient bound propagation with per-neuron split constraints for neural network robustness verification,” in Proc. Adv. Neural Inf. Process. Syst. (NeurIPS), vol. 34, 2021, pp. 29 909–29 921. [Online]. Available: https://proceedings.neurips.cc/paper_files/paper/2021/hash/fac7fead96dafceaf80c1daffea82a4-Abstract.html
[34] Z. Shi, Q. Jin, J. Z. Kolter, S. Jana, C.-J. Hsieh, and H. Zhang, “Neural network verification with branch-and-bound for general nonlinearities,” in Proc. Int. Conf. Tools Algorithms Construction Anal. Syst. (TACAS), ser. Lecture Notes in Computer Science, vol. 15696. Springer, 2025, pp. 315–335.
[35] E. D. Sontag, “Comments on integral variants of ISS,” Syst. Control Lett., vol. 34, no. 1–2, pp. 93–100, 1998.
[36] M. Han, L. Zhang, J. Wang, and W. Pan, “Actor-critic reinforcement learning for control with stability guarantee,” IEEE Robot. Autom. Lett., vol. 5, no. 4, pp. 6217–6224, 2020.
[37] D. Du, S. Han, N. Qi, H. B. Ammar, J. Wang, and W. Pan, “Reinforcement learning for safe robot control using control Lyapunov barrier functions,” in Proc. IEEE Int. Conf. Robot. Autom. (ICRA), 2023, pp. 9442–9448.
[38] P. Billingsley, Probability and Measure, 3rd ed. John Wiley & Sons, 1995.
[39] “Pendulum-v1 environment in Gymnasium,” Farama Foundation, Accessed: Mar. 17, 2025. [Online]. Available: https://gymnasium.farama.org/environments/classic_control/pendulum/