RSGF-RL: Anytime Safe Constrained RL
- RSGF-RL is an off-policy constrained RL method that guarantees anytime safety by ensuring every policy update satisfies predefined constraints via solving a convex QCQP.
- It is derived from Robust Safe Gradient Flow, leveraging continuous-time dynamics to combine objective descent with safety constraints and robustness margins against estimation errors.
- The algorithm employs off-policy estimation through importance sampling and finite-sample safety buffers, with convergence guarantees to KKT points under proper step-size conditions.
Searching arXiv for the exact method name and primary source paper. Searching arXiv for related acronym collisions and nearby methods to support disambiguation. RSGF-RL is an off-policy method for constrained reinforcement learning derived from the Robust Safe Gradient Flow (RSGF), a continuous-time dynamics for nonlinear constrained optimization. Its defining objective is to provide anytime safety guarantees: with a user-specified probability and sufficient data, each policy update yields a constraint-satisfying policy, and a mildly unsafe policy can be driven back to safety in one step with high probability. The method estimates value functions and their gradients from episodic data and computes each policy update by solving a convex quadratically constrained quadratic program (QCQP) (Mestres et al., 1 Oct 2025).
1. Constrained RL setting and meaning of anytime safety
RSGF-RL is formulated for a finite-horizon discounted constrained Markov decision process
with task reward , safety-cost functions , discount factor , horizon , and parameterized policy , . The paper writes the optimization problem as
The sign of the reward is flipped so that the task is written as a minimization problem (Mestres et al., 1 Oct 2025).
The corresponding feasible parameter set is
Because the value functions induced by a parameterized policy are generally nonconvex in , the method targets convergence to KKT points rather than global optima (Mestres et al., 1 Oct 2025).
In this framework, anytime safety means that if the algorithm generates policy iterates 0, then constraint satisfaction is preserved at every training iterate with prescribed probability. The finite-horizon statement is
1
provided the paper’s per-iteration sample conditions hold (Mestres et al., 1 Oct 2025). This is a training-time property, not merely a guarantee on the terminal policy.
The paper also notes that suitable cumulative constraints can encode state-space safety with confidence. If
2
then satisfying 3 implies
4
This links CMDP constraints to high-probability state safety (Mestres et al., 1 Oct 2025).
2. Continuous-time foundation: Robust Safe Gradient Flow
RSGF-RL is built from a continuous-time constrained optimization dynamics called the Robust Safe Gradient Flow. For the generic nonlinear program
5
the flow direction is defined by the QCQP
6
The associated continuous-time dynamics is
7
The construction is called gradient flow because the objective drives 8 toward 9, safe because the admissible directions are constrained by the safety functions, and robust because the quadratic term 0 creates explicit margin against perturbations and estimation errors (Mestres et al., 1 Oct 2025).
Under MFCQ, if 1 denotes the Lagrange multiplier of the 2-th constraint, the solution has the closed form
3
This makes the direction a scaled combination of the objective gradient and active constraint gradients (Mestres et al., 1 Oct 2025).
A key dissipation inequality follows from feasibility of the QCQP constraints:
4
On the boundary 5, this yields
6
so the vector field lies in the tangent cone of the feasible set. By Nagumo’s theorem, the paper proves that the feasible set is forward invariant under the flow (Mestres et al., 1 Oct 2025).
The equilibrium structure is equally central. The paper proves that if 7, then 8, and under MFCQ, 9 if and only if 0 is a KKT point. Thus, the equilibria of the flow coincide exactly with KKT points of the constrained problem (Mestres et al., 1 Oct 2025).
3. Discrete algorithm and off-policy estimation
The practical algorithm is the forward-Euler discretization
1
with step sizes 2. Since 3 and 4 are unknown, RSGF-RL replaces them with data-driven estimates and computes the sampled direction by solving
5
The actual update is
6
The additional constraint
7
is introduced to enforce a compact parameter set 8 (Mestres et al., 1 Oct 2025).
The algorithm is explicitly off-policy. At iteration 9, estimation may use an offline batch 0 generated by policies in a set 1 together with previous and current batches 2, selecting any subset
3
If the 4-th episode in 5 was generated by behavior policy 6, then the value estimator is
7
where 8 and 9 for 0 (Mestres et al., 1 Oct 2025).
The gradient estimator is REINFORCE-style with baseline:
1
with
2
and 3 (Mestres et al., 1 Oct 2025).
The paper does not formulate RSGF-RL as an actor-critic method. Its formal estimation theory is based on trajectory-wise importance sampling and score-function gradients, with the baseline 4 as the explicit variance-reduction device (Mestres et al., 1 Oct 2025).
4. Finite-sample safety guarantees and recovery mechanism
The safety theorem is based on a step-size condition and a robustness margin. The step size must satisfy
5
where 6 are Lipschitz constants of 7 (Mestres et al., 1 Oct 2025).
For each constraint, the paper defines
8
This is the finite-sample robustness buffer: simultaneous errors in value and gradient estimation smaller than this quantity can be tolerated while preserving one-step safety (Mestres et al., 1 Oct 2025).
The required sample conditions are
9
with 0 the number of episodes in 1 generated by the current policy, 2, and constants 3 determined by the reward bounds, horizon, discount factor, and action-probability lower bound (Mestres et al., 1 Oct 2025).
Under these conditions, if 4, then
5
Thus, a policy estimated safe updates to a truly safe next policy with high probability (Mestres et al., 1 Oct 2025).
The same theorem also yields a recovery guarantee. If 6 but 7 and the sample conditions hold, then
8
This is the one-step recovery statement for a mildly unsafe policy (Mestres et al., 1 Oct 2025).
The mechanism is based on combining the sampled QCQP constraints with the descent lemma
9
The quadratic robustness term in the QCQP is therefore not merely regularization; in the paper’s analysis it is part of the margin that compensates for estimation uncertainty (Mestres et al., 1 Oct 2025).
5. Statistical analysis and asymptotic convergence
RSGF-RL’s statistical analysis begins with unbiasedness:
0
The paper also gives variance expressions for the off-policy estimators and Hoeffding-type concentration inequalities for both values and gradient components (Mestres et al., 1 Oct 2025).
For the value estimator,
1
and the tail bound is
2
For the gradient estimator, the componentwise variance and concentration bounds are given analogously in terms of 3 and 4 (Mestres et al., 1 Oct 2025).
The asymptotic convergence argument rewrites the algorithm as stochastic approximation:
5
Under regularity assumptions, feasibility of the sampled QCQP, initialization in the bounded set, asymptotically vanishing QCQP error
6
and step-size conditions
7
the iterates converge almost surely to the set of KKT points of the constrained RL problem in 8 (Mestres et al., 1 Oct 2025).
The continuous-time convergence result provides the template. Inside the feasible set, the objective 9 is nonincreasing along the flow, and for global convergence the paper introduces the exact-penalty-like function
0
which is nonincreasing along the flow on compact sets for small enough 1 (Mestres et al., 1 Oct 2025). This suggests that the robust flow is designed not only to preserve safety but also to organize descent toward KKT points from both safe and mildly unsafe initial conditions.
6. Empirical behavior, positioning, and disambiguation
The paper evaluates RSGF-RL on a navigation example and the cart-pole system. In the navigation problem, a single-integrator robot in 2 must reach a goal while avoiding obstacles; in cart-pole, the state is 3, the action is a continuous force in 4, the reward is 5, and the safety set requires 6 (Mestres et al., 1 Oct 2025).
The baselines are off-policy RSGF-RL, on-policy RSGF-RL from the conference version, and CPO. The evaluation reports task performance through 7 and safety through 8. Across both tasks, the paper reports that RSGF-RL maintains safety during training or recovers quickly from unsafe initial conditions, that both on-policy and off-policy variants outperform CPO in reward performance, and that off-policy RSGF-RL with clipped importance weights performs best in practice (Mestres et al., 1 Oct 2025). The clipped importance weights are described as an empirical modification; they are not part of the theoretical estimator.
Within safe RL, RSGF-RL is positioned as a policy-parameter update rule that solves a convex QCQP at each iteration rather than using dual ascent or action-level shielding. This suggests a design centered on directly computing a feasible local descent direction in parameter space. The paper’s own comparison emphasizes superior performance with respect to the state of the art on its reported experiments (Mestres et al., 1 Oct 2025).
The acronym is potentially confusable. It should not be conflated with SG-RL, a hierarchical path planning framework combining Simple Subgoal Graphs and LSPI for rational pathfinding in continuous and uncertain environments (Zeng et al., 2018); with RSG, the Robot Skill Graph framework for organizing and inferring quadruped skills (Zhang et al., 2023); or with RSF-GLLM, whose core module is Recurrent Soft-Flow for multi-hop KGQA and which does not use reinforcement learning (Bandyopadhyay et al., 7 Jul 2026). In the literature represented here, RSGF-RL refers specifically to “Off-Policy Reinforcement Learning with Anytime Safety Guarantees via Robust Safe Gradient Flow” (Mestres et al., 1 Oct 2025).