betaFeedback

WorksComputer Science

Beyond Safe Execution: Safe Online Reinforcement Learning for Autonomous Driving with Value Calibration and Adaptive Guidance

Abstract

Online reinforcement learning (RL) enables driving policies to adapt to changing deployment conditions, but requires safe exploration throughout training. Safety filtering alone does not ensure stable policy improvement or reduced dependence on corrections. We propose Safe Online Adaptive Refinement (SOAR-Flow), a framework for safe and stable online fine-tuning of offline-initialized Flow-based driving policies. A control barrier function (CBF)–model predictive control (MPC) filter corrects potentially unsafe actions before execution. To support stable policy updates, we introduce Gaussian-return-aware value calibration based on calibrated Q-learning (Cal-QL), using recorded behavior returns and predicted return variability to smooth conservative critic updates and mitigate policy degradation. Paired corrective learning teaches feasible action adjustments, while an intervention-to-go predictor encourages decisions requiring fewer future corrections. Its predictions also regulate guidance strength, allowing recovery supervision to weaken as predicted dependence decreases. Together with gradually reduced calibration regularization, this supports continued task improvement while preserving hard execution constraints. We analyze conditions for safe execution at control steps and diminishing auxiliary learning influences. We evaluate SOAR-Flow in simulation and on an uncrewed ground vehicle (UGV). The results demonstrate improved driving performance and reduced reliance on safety corrections during protected online fine-tuning. The demonstration video and project overview are available at https://lzqw.github.io/SOAR-Flow/.

Introduction

Learning safe and efficient driving behavior in changing environments remains a central challenge in autonomous driving [1]. Online RL enables continued policy improvement through interaction, with offline demonstrations providing useful initial skills [2], [3]. On UGVs, however, trial-and-error exploration can lead to collisions and other accidents, making safety essential throughout online learning [4].

Preventing failures before they occur is a practical approach to safe exploration. Failure-Aware Offline-to-Online Reinforcement Learning (FARL) follows this principle through failure prediction and preventive recovery in robotic manipulation [5]. Model-based safety filters check actions against explicit constraints and compute feasible corrections before execution [6]. However, successful protected execution can still depend on repeated corrections, while online updates may degrade previously learned behavior [2], [6]. Going beyond safe execution therefore requires learning effectively from protected experience to improve task performance and reduce correction demand.

Reliable value estimates are central to this improvement. Overestimation may favor actions with limited data support, whereas excessive pessimism can undervalue established behaviors as new experience is incorporated [2]. Filtering also changes the executed action, so observed rewards and transitions need to be associated with the action actually applied [6]. Cal-QL addresses value-scale mismatch by calibrating conservative estimates against a reference behavior’s return [2]. This motivates calibration that uses recorded execution outcomes while accounting for return variability during continued online learning.

Learning from corrected actions can reduce repeated interventions [6]. Human–AI Copilot Optimization (HACO) estimates cumulative human intervention costs to guide policy optimization [7], motivating consideration of future assistance alongside immediate corrections. In driving, earlier position or speed choices can determine whether later corrections are needed. Moreover, optimizing a finite-horizon MPC cost need not maximize long-horizon task return. Corrective guidance should therefore combine feasible local adjustments with anticipation of future interventions, while allowing its influence to diminish as dependence decreases. This leaves room for continued reward-driven improvement under unchanged safety constraints.

To address these challenges, we propose SOAR-Flow, a framework for safe online refinement of offline-initialized Flow-based driving policies. CBF–MPC certifies references before execution to protect online interaction. We introduce Gaussian-return-aware value calibration by extending Cal-QL with the Gaussian return model of distributional soft actor–critic (DSAC) [2], [8]. Recorded behavior returns provide calibration references, while predicted return variability smooths conservative critic updates. Paired corrective learning teaches feasible action adjustments, and an intervention-to-go predictor encourages earlier adjustments to reduce subsequent corrections. The same predictions regulate guidance strength, allowing recovery supervision to weaken as predicted dependence decreases. Together with decaying calibration regularization, this supports continued task improvement under unchanged execution constraints. The main contributions are as follows:

  • A Gaussian-return-aware extension of Cal-QL combines recorded behavior returns with predicted return variability to smooth conservative critic updates and support stable online learning from protected execution.

  • An adaptive guidance mechanism combines paired corrective learning with intervention-to-go prediction. The predictor guides policy actions and regulates guidance strength to reduce filter reliance while retaining task optimization.

  • We establish conditions for sample-time safety of pro

tected execution and vanishing auxiliary gradient contributions. Safety-filtered (SF) and policy-only (PO) tests in MetaDrive and on a UGV assess learning stability, safety, and autonomy with nominal MPC tracking retained.

Safe RL and intervention-based learning. Safe RL addresses safety through policy optimization and execution-time protection. Constrained policy optimization regulates expected costs in policy updates [9], whereas recovery policies and predictive safety filters intervene using learned risk estimates or model-based feasibility checks [10, 11]. For pretrained policies, SafeFlow enforces barrier conditions during test-time flow-based trajectory generation [12], while FARL uses an offline-trained world model and recovery policy to prevent failures during online refinement, keeping both protection components fixed online [5]. Beyond execution protection, interventions also provide information for policy learning. Safety Filtering While Training studies how filtering and correction penalties affect learned behavior [6], while CBF-RL combines training-time filtering with barrier-inspired rewards to encourage safer actions without runtime correction [13]. HACO estimates cumulative human intervention costs to guide policy optimization [7]. Building on this connection between protection and learning, SOAR-Flow combines paired corrective supervision with prediction of future filter use. The predictions guide policy actions and regulate supervision strength, while CBF–MPC certification remains active.

Value learning and online policy refinement. Online refinement seeks to improve from new experience while retaining useful pretrained behavior. Offline RL addresses unsupported actions through conservative value estimation in conservative Q-learning or in-dataset value learning in implicit Q-learning [14, 15]. However, excessive pessimism can hinder the transition to online learning, motivating Cal-QL’s calibration against a reference behavior’s return [2]. Policy regularization and objective alignment offer complementary approaches: PROTO evolves its policy regularizer during fine-tuning [16], while Uni-O4 uses a shared on-policy objective across offline and online stages [17]. Generative policies complement these optimization methods by representing diverse behaviors in prior data. Flow Q-learning combines flow-based action modeling with value-driven training of an expressive one-step actor [3]; RL-100 connects imitation, iterative offline RL, and online refinement for diffusion-based robotic policies [18]. Building on Cal-QL and DSAC’s Gaussian return model [2, 8], SOAR-Flow uses predicted return variability to smooth behavior-referenced calibration of values learned from certified execution. This value-learning objective complements adaptive intervention guidance during protected online policy refinement.

Methodology

Building on Cal-QL [2], SOAR-Flow performs safe online refinement of a Flow policy and task critics initialized from offline data. CBF-MPC checks policy actions before execution. The resulting transitions support Gaussian-return-aware value calibration, while corrections and intervention sequences guide policy improvement. Adaptive guidance reduces auxiliary learning influences as predicted filter dependence decreases. Figure 1 summarizes this protected interaction and update loop.

Figure 1. Overall framework of SOAR-Flow.

Autonomous driving is modeled as a continuous-action Markov decision process (MDP) M=⟨S,A,P,R,γ⟩\mathcal{M} = \langle\mathcal{S}, \mathcal{A}, \mathcal{P}, \mathcal{R}, \gamma\rangle, where S\mathcal{S} and A\mathcal{A} are the state and driving-reference spaces, P\mathcal{P} is the transition kernel, R\mathcal{R} is the task reward function, and γ∈[0,1)\gamma\in[0,1) is the discount factor. The policy maximizes the entropy-augmented objective of soft actor–critic (SAC) [19]

Jπ=E(si≥t,ai≥t)∼ρπ[∑i=t∞γi−t[ri+αH(π(⋅∣si))]](1)J_{\pi} = \mathbb{E}_{(s_i \geq t,a_i \geq t) \sim\rho_{\pi}}\left[\sum_{i=t}^{\infty} \gamma^{i-t}\left[r_i + \alpha\mathcal{H}(\pi(\cdot\mid s_i))\right]\right] \tag*{(1)}

where rir_i is the task reward, ρπ\rho_{\pi} is the policy-induced trajectory distribution, α≥0\alpha\geq0 is the temperature coefficient, and H(π(⋅∣s))=Ea∼π(⋅∣s)[−log⁡(π(a∣s))]\mathcal{H}(\pi(\cdot\mid s)) = \mathbb{E}_{a \sim\pi(\cdot\mid s)}[-\log(\pi(a \mid s))]. The optimal policy satisfies π⋆∈arg⁡max⁡πJπ\pi^{\star} \in\arg\max_{\pi} J_{\pi}.

A conditional Flow policy transforms Gaussian noise into driving references through a state-conditioned vector field vϕv_{\phi} [3, 20]. Given state ss and z∼N(0,I)z \sim\mathcal{N}(0,I), the flow satisfies

dxτdτ=vϕ(xτ,τ,s),x0=z,τ∈[0,1],(2)\frac{\mathrm{d}x_{\tau}}{\mathrm{d}\tau} = v_{\phi}(x_{\tau},\tau,s), \qquad x_{0}=z, \qquad\tau\in[0,1], \tag*{(2)}

where τ\tau denotes flow time. The endpoint μϕ(s,z)=x1\mu_{\phi}(s,z) = x_1 induces the policy distribution πϕ(⋅∣s)\pi_{\phi}(\cdot\mid s). Given an offline dataset Doff\mathcal{D}_{\mathrm{off}} of state-reference pairs, we sample (s,a)∼Doff(s,a) \sim\mathcal{D}_{\mathrm{off}} and τ∼U[0,1]\tau\sim\mathcal{U}[0,1] independently of zz, and let x~τ=(1−τ)z+τa\tilde{x}_{\tau} = (1-\tau)z + \tau a. Flow-based behavior cloning (Flow-BC) initializes the policy by minimizing

LFM(ϕ)=E[∥vϕ(x~τ,τ,s)−(a−z)∥22].(3)\mathcal{L}_{\mathrm{FM}}(\phi) = \mathbb{E}\left[\left\|v_{\phi}(\tilde{x}_{\tau},\tau,s) - (a-z)\right\|_2^2\right]. \tag*{(3)}

Calibrated Value Learning under Safety Filtering

Maintaining safe exploration. CBF–MPC checks policy actions using a prescribed nominal model and the same MPC tracking solution used for execution [6]. Let ξt\xi_t denote the prediction state. Barrier functions hjh_j define C={ξ∈X:hj(ξ)≥0, ∀j}\mathcal{C} = \{\xi\in\mathcal{X}: h_j(\xi) \geq0,\ \forall j\}, where X\mathcal{X} is the admissible state set. For reference aa, the predicted tracking trajectory satisfies the discrete-time CBF condition [13, 21]

hj(ξ^k+1∣ta)≥ρjhj(ξ^k∣ta),ρj∈[0,1).(4)h_j(\hat{\xi}_{k+1|t}^{a}) \geq\rho_j h_j(\hat{\xi}_{k|t}^{a}), \qquad\rho_j \in[0,1). \tag*{(4)}

Here, ξ^0∣ta=ξt\hat{\xi}_{0|t}^{a} = \xi_t, k=0,…,Np−1k = 0,\ldots,N_p-1, and j=1,…,nhj = 1,\ldots,n_h, with prediction horizon NpN_p. The set Acert(ξt)\mathcal{A}_{\mathrm{cert}}(\xi_t) contains references whose tracking solutions satisfy this condition, admissible state and input constraints, and a terminal condition in Xf⊆C\mathcal{X}_f \subseteq\mathcal{C}. The terminal set admits a feasible backup controller that keeps the nominal state within it. For example, if tracking a reference would violate obstacle clearance, the filter searches for a feasible bypass reference before execution. Online interaction follows

atraw∼πϕ(⋅∣st),atcert=Fξt(atraw),(5)a_t^{\mathrm{raw}} \sim\pi_\phi(\cdot\mid s_t), \qquad a_t^{\mathrm{cert}} = \mathcal{F}_{\xi_t}(a_t^{\mathrm{raw}}), \tag*{(5)}

where Fξt\mathcal{F}_{\xi_t} retains certifiable references or returns feasible corrections. The first input of the associated MPC tracking solution is applied as ut=u0∣t∗u_t = u^*_{0\mid t}, with certification repeated at the next control step. We store Tt=(st,atraw,atcert,ιt,rt,st+1,dt)\mathcal{T}_t = (s_t, a_t^{\mathrm{raw}}, a_t^{\mathrm{cert}}, \iota_t, r_t, s_{t+1}, d_t), where ιt=1\iota_t = 1 denotes a certification-triggered correction and dt=1d_t = 1 denotes true termination. The generator input and prediction states are retained for paired updates and target certification. These transitions form Don\mathcal{D}_{\mathrm{on}}, with mixed replay D=Doff∪Don\mathcal{D} = \mathcal{D}_{\mathrm{off}} \cup\mathcal{D}_{\mathrm{on}}. The reward rtr_t and next state st+1s_{t+1} result from tracking atcerta_t^{\mathrm{cert}} and therefore supervise the task critics at (st,atcert)(s_t, a_t^{\mathrm{cert}}) [6]. Recorded corrections provide action targets for learning references that pass certification directly.

Avoiding policy degradation. Cal-QL uses a reference behavior’s return to limit excessive pessimism during O2O learning [2]. For each transition from a completed episode ending at TT, we store the discounted task return bt=∑k=tT−1γk−trkb_t = \sum_{k=t}^{T-1} \gamma^{k-t}r_k as its calibration reference. This quantity is computed from recorded offline and online trajectories; for online data, it includes rewards from both unmodified and corrected execution. Cal-QL’s candidate term max⁡{Q(st,a),bt}\max\{Q(s_t,a),b_t\} retains conservative pressure above the reference and stops it below, producing an abrupt change in its mean gradient. We extend this construction with DSAC’s Gaussian return model [8] to smooth calibration using predicted return variability. For return variable Zπ(s,a)Z^\pi(s,a), its mean satisfies Qπ(s,a)=E[Zπ(s,a)]Q^\pi(s,a) = \mathbb{E}[Z^\pi(s,a)]. Each critic predicts the mean QQ and variance σ2>0\sigma^2 > 0 of a Gaussian approximation:

Z(⋅∣s,a)=N(Q(s,a),σ2(s,a)).(6)\mathcal{Z}(\cdot\mid s,a) = \mathcal{N}\left(Q(s,a),\sigma^2(s,a)\right). \tag*{(6)}

For a candidate a∼πϕ(⋅∣st)a \sim\pi_\phi(\cdot\mid s_t), let Qi=Qθi(st,a)Q_i = Q_{\theta_i}(s_t,a) and σi=σθi(st,a)>0\sigma_i = \sigma_{\theta_i}(s_t,a) > 0 denote the outputs of critic i∈{1,2}i \in\{1,2\}. We define

Gi(st,a;bt):=Eϵ∼N(0,1)[max⁡{Qi+σiϵ,bt}]=bt+(Qi−bt)Φ(νi)+σiφ(νi).(7)G_i(s_t,a;b_t) := \mathbb{E}_{\epsilon\sim\mathcal{N}(0,1)}\left[\max\{Q_i+\sigma_i\epsilon,b_t\}\right] = b_t + (Q_i-b_t)\Phi(\nu_i)+\sigma_i\varphi(\nu_i). \tag*{(7)}

The standardized offset is νi=(Qi−bt)/σi\nu_i = (Q_i-b_t)/\sigma_i; Φ\Phi and φ\varphi denote the standard normal cumulative distribution and density functions. For fixed reference and standard deviation (SD), ∂Gi/∂Qi=Φ(νi)\partial G_i/\partial Q_i = \Phi(\nu_i), so the conservative pressure changes continuously around btb_t. The predicted SD determines the smoothing width, and the mean-only truncation is recovered in the zero-variance limit. Gradients through σi\sigma_i are disabled in GiG_i to avoid directly shrinking the return dispersion; the SD remains trainable in the Bellman term.

At the recorded execution pair, write Qicert=Qθi(st,atcert)Q_i^{\mathrm{cert}} = Q_{\theta_i}(s_t,a_t^{\mathrm{cert}}) and σicert=σθi(st,atcert)\sigma_i^{\mathrm{cert}} = \sigma_{\theta_i}(s_t,a_t^{\mathrm{cert}}). The complete critic objective is

Ltask,i=βcal,nED,a′[Gi(st,a;bt)−Qicert]+ED,a′,Z′[(YtZ−Qicert)22(σicert)2+log⁡σicert],(8)\mathcal{L}_{\mathrm{task},i} = \beta_{\mathrm{cal},n}\mathbb{E}_{\mathcal{D},a'}\left[G_i(s_t,a;b_t)-Q_i^{\mathrm{cert}}\right] + \mathbb{E}_{\mathcal{D},a',Z'}\left[ \frac{(Y_t^Z-Q_i^{\mathrm{cert}})^2}{2(\sigma_i^{\mathrm{cert}})^2} +\log\sigma_i^{\mathrm{cert}} \right], \tag*{(8)}

where βcal,n≥0\beta_{\mathrm{cal},n} \ge0 controls calibration at update nn. The first expectation samples current policy actions at replay states and uses only records with available btb_t; its unweighted value is RCal,i\mathcal{R}_{\mathrm{Cal},i}. The second uses all replay transitions to fit the Gaussian return distribution. Its mean gradient is scaled by the inverse predicted variance. Together, these terms fit recorded execution outcomes while calibrating candidate values against observed behavior.

The Bellman target follows the same protected execution rule as data collection. For (s′,ξ′)=(st+1,ξt+1)(s',\xi') = (s_{t+1},\xi_{t+1}), we use

a′∼πϕˉ(⋅∣s′),a′cert=Fξ′(a′),a' \sim\pi_{\bar{\phi}}(\cdot\mid s'), \qquad a'^{\mathrm{cert}} = \mathcal{F}_{\xi'}(a'),
Z′∼Z(⋅∣s′,a′cert),Z' \sim\mathcal{Z}(\cdot\mid s',a'^{\mathrm{cert}}),
YtZ=rt+γ(1−dt)Z′.(9)Y_t^Z = r_t + \gamma(1-d_t)Z'. \tag*{(9)}

Bars denote target quantities. At each (s′,acert)(s', a^{\mathrm{cert}}), Z‾\overline{Z} is the Gaussian distribution of the target critic with the smaller mean, using that same critic’s variance [22]. The sample Z′Z' represents the continuation return under protected execution; terminal transitions use YtZ=rtY_t^Z = r_t. The objective is used for both offline initialization and online refinement, with actor parameters, Bellman targets, and recorded behavior returns fixed during critic updates.

Adaptive Guidance for Autonomous Policy Improvement

Calibrated critics support policy improvement from protected experience, but successful execution can still rely on repeated corrections. Moreover, minimizing a finite-horizon MPC cost need not maximize long-horizon task return. We therefore use corrections as local guidance while allowing the policy to discover higher-return behavior within the prescribed safety constraints.

Learning from task values and corrections. Online records provide two complementary learning signals. For ι=0\iota= 0, the task critic guides improvement of the policy action; for ι=1\iota= 1, the executed correction provides a feasible action target. Including the entropy term in (1), we use

LQ(ϕ)=−EDon[Q‾θ(s,μϕ(s,z))∣ι=0]−αEs∼Don[H(πϕ(⋅∣s))],(10)\mathcal{L}_{Q}(\phi) = -\mathbb{E}_{\mathcal{D}_{\mathrm{on}}}\left[\overline{Q}_{\theta}(s,\mu_{\phi}(s,z)) \mid\iota=0\right] -\alpha\mathbb{E}_{s\sim\mathcal{D}_{\mathrm{on}}}\left[\mathcal{H}(\pi_{\phi}(\cdot\mid s))\right], \tag*{(10)}
Lcorr(ϕ)=EDon[∥μϕ(s,z)−acert∥Wa2∣ι=1].(11)\mathcal{L}_{\mathrm{corr}}(\phi) = \mathbb{E}_{\mathcal{D}_{\mathrm{on}}}\left[\left\|\mu_{\phi}(s,z)-a^{\mathrm{cert}}\right\|_{W_a}^{2}\mid\iota=1\right]. \tag*{(11)}

The clipped value is Q‾θ=min⁡iQθi\overline{Q}_{\theta}=\min_i Q_{\theta_i}, α\alpha is the entropy coefficient, and Wa≻0W_a\succ0 weights the corrective error. The recorded generator input zz is reused for these paired updates, associating each correction with the action that triggered it. Entropy is evaluated using fresh samples from the current raw policy. The intervention labels select replay records; updated actions are checked again during execution.

Anticipating future interventions. An earlier position or speed choice can determine whether a later correction is needed. Motivated by intervention-value learning [7], we estimate discounted future filter use:

Pπ(st,atraw)=(1−γP)Eπ,F[∑ℓ=0∞γPℓιt+ℓ∣st,atraw].(12)P^{\pi}(s_t,a_t^{\mathrm{raw}}) =(1-\gamma_P)\mathbb{E}_{\pi,\mathcal{F}}\left[\sum_{\ell=0}^{\infty}\gamma_P^{\ell}\iota_{t+\ell}\mid s_t,a_t^{\mathrm{raw}}\right]. \tag*{(12)}

The discount factor satisfies γP∈[0,1)\gamma_P\in[0,1); subsequent actions follow π\pi, and transitions follow certified execution. Interventions after termination are zero, giving Pπ∈[0,1]P^{\pi}\in[0,1]. To propagate delayed interventions, we use contiguous segments of KK transitions ending at termination or a collection boundary. The observed interventions provide a partial target, and the endpoint estimate supplies the remaining continuation:

ytP=(1−γP)∑ℓ=0K−1γPℓιt+ℓ+γPK(1−dt+K−1)Ea′∼πϕ[Pψ(st+K,a′)],(13)y_t^P=(1-\gamma_P)\sum_{\ell=0}^{K-1}\gamma_P^{\ell}\iota_{t+\ell} +\gamma_P^K(1-d_{t+K-1})\mathbb{E}_{a'\sim\pi_{\phi}}\left[P_{\psi}(s_{t+K},a')\right], \tag*{(13)}
LP(ψ)=12EDon[(Pψ(st,atraw)−ytP)2].\mathcal{L}_{P}(\psi)=\frac{1}{2}\mathbb{E}_{\mathcal{D}_{\mathrm{on}}}\left[\left(P_{\psi}(s_t,a_t^{\mathrm{raw}})-y_t^P\right)^2\right].

The bootstrap action a′∼πϕ(⋅∣st+K)a'\sim\pi_{\phi}(\cdot\mid s_{t+K}) is sampled from the raw policy. True termination removes the continuation term. Targets are fixed during regression, and PψP_{\psi} is bounded in [0,1][0,1]. Setting K=1K=1 gives the one-step target; longer segments propagate observed intervention signals farther in each update. These targets approximate current-policy evaluation from collected data.

The complete actor objective is

Lπ(ϕ)=LQ(ϕ)+λF,n[βcorrLcorr(ϕ)+Es,a[Pψ(s,a)]].(14)\mathcal{L}_{\pi}(\phi)=\mathcal{L}_{Q}(\phi) +\lambda_{F,n}\left[\beta_{\mathrm{corr}}\mathcal{L}_{\mathrm{corr}}(\phi)+\mathbb{E}_{s,a}\left[P_{\psi}(s,a)\right]\right]. \tag*{(14)}

where s∼Dons\sim\mathcal{D}_{\mathrm{on}}, a∼πϕ(⋅∣s)a\sim\pi_{\phi}(\cdot\mid s), and βcorr>0\beta_{\mathrm{corr}}>0. Task values favor higher returns, corrections teach feasible adjustments, and PψP_{\psi} discourages actions leading to later assistance. The critics, correction targets, and coefficients are fixed during actor optimization; gradients pass through the generated actions.

Relaxing corrective guidance. Corrective supervision helps the policy acquire feasible behavior, but its influence should diminish as the policy learns to operate with less assistance. We therefore reuse the intervention-to-go estimate in (12) to regulate guidance strength. At round nn, we evaluate Pψ(s,a)P_{\psi}(s,a) on states from the latest online batch and raw actions a∼πϕ(⋅∣s)a\sim\pi_{\phi}(\cdot\mid s) sampled from the current policy. The average predicted dependence is smoothed and used to update the guidance weight:

P‾n=(1−βP)P‾n−1+βPEs,a[Pψ(s,a)],(15)\overline{P}_n=(1-\beta_P)\overline{P}_{n-1}+\beta_P\mathbb{E}_{s,a}\left[P_{\psi}(s,a)\right], \tag*{(15)}
λF,n+1=Π[0,λmax⁡][λF,n+η(P‾n−κλF,n)].\lambda_{F,n+1}=\Pi_{[0,\lambda_{\max}]}\left[\lambda_{F,n}+\eta(\overline{P}_n-\kappa\lambda_{F,n})\right].

The operator Π\Pi denotes interval projection, with βP∈(0,1]\beta_P\in(0,1], η,κλ>0\eta,\kappa_{\lambda}>0, and 0<ηκλ<10<\eta\kappa_{\lambda}<1. The feedback statistic is computed without gradient propagation, and λF,n+1\lambda_{F,n+1} is held fixed during the subsequent actor updates. Predicted intervention demand counteracts weight decay; vanishing feedback gives λF,n→0\lambda_{F,n}\to0. Together with the decaying calibration weight βcal,n\beta_{\mathrm{cal},n}, this reduces the influence of recovery supervision and value regularization, allowing continued task improvement under unchanged execution constraints.

Safety and Asymptotic Guidance Analysis

SOAR-Flow separates execution protection from learning guidance. The following result characterizes sampling-time safety and the asymptotic removal of auxiliary contributions.

Theorem 1. Certified Safety and Vanishing Auxiliary Guidance. Starting from a feasible ξ0∈C\xi_0\in\mathcal{C}, suppose CBF–MPC remains feasible and the realized transitions satisfy hj(ξt+1)≥ρjhj(ξt)−ϵj,th_j(\xi_{t+1})\geq\rho_jh_j(\xi_t)-\epsilon_{j,t}, with 0≤ρj<10\leq\rho_j<1 and 0≤ϵj,t≤ϵ‾j0\leq\epsilon_{j,t}\leq\overline{\epsilon}_j. Then

hj(ξt)≥ρjthj(ξ0)−1−ρjt1−ρjϵ‾j.(16)h_j(\xi_t)\geq\rho_j^t h_j(\xi_0)-\frac{1-\rho_j^t}{1-\rho_j}\overline{\epsilon}_j. \tag*{(16)}

In particular, zero residual bounds preserve nonnegative barriers at every sampling instant throughout online learning. Let the guidance weight follow (15), with P‾0∈[0,1]\overline{P}_0\in[0,1], λF,0∈[0,λmax⁡]\lambda_{F,0}\in[0,\lambda_{\max}], and 0<ηκλ<10<\eta\kappa_{\lambda}<1. Suppose

Pˉn→0\bar{P}_n \to0, βcal,n→0\beta_{\mathrm{cal},n} \to0, and the actor gradients of Lcorr\mathcal{L}_{\mathrm{corr}} and Es,a[Pψ(s,a)]E_{s,a}[P_\psi(s,a)], as well as the critic-mean gradients ∇θiQθi(s,a)\nabla_{\theta_i}Q_{\theta_i}(s,a) at all calibration samples, are uniformly bounded along the learning iterates. Then λF,n→0\lambda_{F,n} \to0 and

∥∇ϕLπ−∇ϕLQ∥→0,\left\|\nabla_\phi\mathcal{L}_\pi-\nabla_\phi\mathcal{L}_Q\right\|\to0,
∥βcal,n∇θiRGCal,i∥→0.(17)\left\|\beta_{\mathrm{cal},n}\nabla_{\theta_i}\mathcal{R}_{\mathrm{GCal},i}\right\|\to0. \tag*{(17)}

All gradients follow the fixed-target, fixed-coefficient, and fixed-calibration-scale conventions specified above.

The barrier bound follows by iterating the realized CBF inequality. The guidance recursion has contraction factor 1−ηλκλ∈(0,1)1-\eta\lambda\kappa_\lambda\in(0,1), while ∂Gi/∂Qi=Φ(νi)∈[0,1]\partial\mathcal{G}_i/\partial Q_i=\Phi(\nu_i)\in[0,1] bounds the calibration gradient under the stated assumptions. Thus, the direct influence of corrective, dependence, and calibration terms vanishes as predicted dependence and calibration weights tend to zero. The task and entropy objective remains active without a persistent gradient penalty for departing from the guardian’s particular recovery choices, preserving scope for higher-return behavior within the certified region while execution constraints remain enforced.

Simulation Experiments

We evaluate whether SOAR-Flow improves an initialized driving policy while limiting training violations and reducing reliance on safety corrections across different simulated scenarios. Baseline comparisons and ablations examine the contributions of value calibration and adaptive guidance.

Experimental Setup

We conduct experiments in SafeMetaDriveEnv of MetaDrive [23], where scenario seeds specify different road layouts and obstacle configurations. Figure 2 shows a scenario and the experimental workstation. An MPC controller collects offline trajectories on ten fixed scenario seeds to initialize the Flow policy and Gaussian task critics. Twenty additional seeds, excluded from offline training, are used for online fine-tuning and evaluation. The actor receives a 259-dimensional observation comprising 19 ego-state and navigation variables, including speed, heading, steering state, road-boundary distances, and upcoming checkpoints, together with 240 light detection and ranging (LiDAR)-like range measurements. Four additional safety-context variables are provided only to the task critics. The normalized actor output at=[atlon,atlat]∈[−1,1]2a_t=[a_t^{\mathrm{lon}},a_t^{\mathrm{lat}}]\in[-1,1]^2 is decoded into a local target in the ego frame:

MetaDrive scenario and experimental workstation

Figure 2. MetaDrive scenario and experimental workstation.

xtref=12(atlon+1)L,ytref=atlatW,(18)x_t^{\mathrm{ref}}=\frac{1}{2}(a_t^{\mathrm{lon}}+1)L,\qquad y_t^{\mathrm{ref}}=a_t^{\mathrm{lat}}W, \tag*{(18)}

with L=10L=10 m and W=3.7W=3.7 m. CBF–MPC certifies or corrects the reference before a nominal nonlinear model predictive control (NMPC) tracker produces steering and longitudinal commands. Task reward and safety cost are recorded separately. The maximum commanded speed is 10.75 m/s. Online training uses 10610^6 environment steps per run and five independent training seeds.

Comparisons and metrics. Baselines include fixed CBF–MPC, offline Flow-BC, Cal-QL [2], PROTO-SAC [16], Gaussian-DSAC, and Flow-Q-only. Ablations examine corrective learning, intervention-to-go, and calibration. PO evaluation disables CBF correction but retains NMPC, whereas SF evaluation retains certification. PO reports episodic return, SS, and evaluation safety cost. SS requires arrival without collision, road departure, or nonzero episode cost. Protected training reports cumulative safety cost. In SF evaluation, certification-based intervention counts and rates are defined using ιt\iota_t. Repeated trials are averaged within each training seed, followed by the mean and sample SD across seeds.

Results and Analysis

Online improvement. Figure 3(a) and Table I present the learning curves and final comparison. The final return listed for SOAR-Flow is 352.3±2.1352.3\pm2.1, compared with 309.1±4.8309.1\pm4.8 for Flow-BC and 343.5±3.0343.5\pm3.0 for Gaussian-DSAC. This value

Figure 3. (a) Episodic return (PO). (b) Training cost (SF). (c) Correction rate (SF). Ours; Gaussian-DSAC; PROTO-SAC; Cal-QL; Flow-Q-only; Flow-BC; CBF-MPC. Simulation learning curves.

MethodReturn ↑\uparrowSS (%) ↑\uparrowEval. Cost ↓\downarrowTrain Cost ↓\downarrowCorr. Rate (%) ↓\downarrow
CBF–MPC350.0±0.6350.0 \pm0.6100.0±0.0\mathbf{100.0 \pm0.0}0.00±0.00\mathbf{0.00 \pm0.00}––
Flow-BC309.1±4.8309.1 \pm4.870.0±7.170.0 \pm7.15.42±0.765.42 \pm0.76–3.33±0.353.33 \pm0.35
Cal-QL [2]335.9±3.5335.9 \pm3.588.0±3.288.0 \pm3.21.94±0.541.94 \pm0.546.94±1.466.94 \pm1.465.25±0.405.25 \pm0.40
PROTO-SAC [16]340.3±3.4340.3 \pm3.491.6±2.691.6 \pm2.61.14±0.481.14 \pm0.484.66±1.024.66 \pm1.023.86±0.403.86 \pm0.40
Gaussian-DSAC343.5±3.0343.5 \pm3.096.0±3.296.0 \pm3.20.38±0.280.38 \pm0.280.85±0.320.85 \pm0.322.68±0.282.68 \pm0.28
Flow-Q-only278.2±12.1278.2 \pm12.142.0±9.542.0 \pm9.56.24±0.876.24 \pm0.8718.22±3.2018.22 \pm3.2037.11±4.4037.11 \pm4.40
Ours w/o correction335.8±4.3335.8 \pm4.386.4±4.886.4 \pm4.81.82±0.601.82 \pm0.602.26±0.552.26 \pm0.554.98±0.754.98 \pm0.75
Ours w/o PP341.6±3.6341.6 \pm3.691.6±3.891.6 \pm3.80.82±0.350.82 \pm0.351.32±0.351.32 \pm0.351.98±0.531.98 \pm0.53
Ours w/o calibration338.0±4.5338.0 \pm4.592.0±3.292.0 \pm3.21.20±0.351.20 \pm0.351.50±0.401.50 \pm0.402.50±0.452.50 \pm0.45
Ours w/ mean calibration348.0±2.8348.0 \pm2.898.0±2.098.0 \pm2.00.20±0.120.20 \pm0.120.50±0.180.50 \pm0.181.20±0.201.20 \pm0.20
Ours352.3±2.1\mathbf{352.3 \pm2.1}100.0±0.0\mathbf{100.0 \pm0.0}0.00±0.00\mathbf{0.00 \pm0.00}0.18±0.10\mathbf{0.18 \pm0.10}0.72±0.12\mathbf{0.72 \pm0.12}

Table 1. Comparison in the simulation experiment, including safe success (SS).

is close to the fixed CBF–MPC reference of 350.0±0.6350.0 \pm0.6, whereas Flow-Q-only falls below the offline baseline to 278.2±12.1278.2 \pm12.1. The main contrast is improvement over offline initialization; the fixed controller provides a performance reference rather than a learning curve.

Safety and dependence. Figure 3(b–Figure 3c) and Table I summarize training cost and correction demand. SOAR-Flow is listed with a training cost of 0.18±0.100.18 \pm0.10 and a correction rate of 0.72±0.12%0.72 \pm0.12\%, compared with 0.85±0.320.85 \pm0.32 and 2.68±0.28%2.68 \pm0.28\% for Gaussian-DSAC. The table also lists 100% SS and zero evaluation cost under PO evaluation. These metrics distinguish protected collection from execution without reference correction: low training cost alone does not establish autonomous task completion.

Ablations. The ablation comparison is presented in Table I. The variants without corrective learning and without PP have correction rates of 4.98%4.98\% and 1.98%1.98\%, respectively, compared with 0.72%0.72\% for the full method. Removing calibration and using mean-only calibration give return entries of 338.0 and 348.0, respectively. Mean-only calibration narrows the return gap, but its listed correction rate remains higher at 1.20%1.20\%. The full-method entry combines the highest return with the lowest training cost among these variants. PO safe-success entries are also lower without correction or PP, linking the tabulated comparison to task completion as well as correction demand.

Real-World Experiments

We examine protected online adaptation on a UGV and the development of driving behavior requiring fewer safety corrections. A frozen-policy test on a held-out cornering task further assesses execution beyond the training layouts.

Experimental Setup

Our UGV in Figure 4 is equipped with LiDAR, cameras, radar, and an integrated navigation system (INS). Policy inputs combine ego motion, surrounding obstacle distances, and navigation checkpoints [4]. Policy inference and NMPC run onboard at 10 Hz and 20 Hz, respectively. The actor specifies a local reference; following certification, NMPC generates steering and longitudinal commands transmitted through the base adapter unit (BAU).

UGV experimental platform

Figure 4. UGV experimental platform.

Offline data are collected by a human driver in the two-sided obstacle-bypass layout of Figure 5(a). We record 24 demonstration trajectories, with 12 passing on each side, to pretrain the UGV Flow policy and Gaussian critics. Online refinement alternates between Blocked-Side Bypass in Figure 5(b), where one demonstrated passing route is blocked, and 8-shaped Maneuver in Figure 5(c), which requires successive turns in opposite directions around two obstacles. The first task changes which demonstrated bypass remains feasible; the second requires the exit from one bypass to accommodate the following turn. A single policy is updated across both tasks under CBF–MPC protection, with their experience stored in the same online replay buffer. Checkpoints

UGV refinement with SOAR-Flow

Figure 5. UGV refinement with SOAR-Flow. (a) Multimodal initialization. (b–c) Recorded blocked-side and 8-shaped trajectories at different refinement stages. Red segments indicate corrections; the late 8-shaped run uses PO execution with MPC tracking retained. (d) Held-out SOAR-Flow success and fixed CBF–MPC collision. (e–f) Blocked-side curves; vertical dashed lines mark training stages.

MethodBlocked-Side Bypass8-shaped ManeuverHeld-out Cornering
SS (%) ↑\uparrowReturn ↑\uparrowCorr. Rate (%) ↓\downarrowSS (%) ↑\uparrowTime (s) ↓\downarrowMin. Clr. (m) ↑\uparrowSS (%) ↑\uparrow
CBF–MPC100345.7±1.5345.7 \pm1.5–9516.72±0.3116.72 \pm0.310.779±0.0180.779 \pm0.01885
Flow-BC85311.2±3.8311.2 \pm3.84.31±0.414.31 \pm0.416518.21±0.5618.21 \pm0.560.681±0.0390.681 \pm0.03955
Gaussian-DSAC95343.3±2.6343.3 \pm2.62.46±0.322.46 \pm0.329015.96±0.2915.96 \pm0.290.776±0.0170.776 \pm0.01790
Ours100350.8±1.8350.8 \pm1.80.68±0.110.68 \pm0.1110015.36±0.2415.36 \pm0.240.801±0.0190.801 \pm0.01995

Table 2. UGV comparison. SS is reported as a percentage; other metrics are mean ±\pm SD.

are evaluated on both tasks without parameter updates to assess performance on each layout. The final policy is frozen and tested zero-shot on Cornering with Obstacle Avoidance in Figure 5(d), which combines a 90∘90^\circ bend with two obstacles. This layout is excluded from demonstrations, online training, tuning, and checkpoint selection. The UGV protocol uses three independent training seeds. The completion time is 15.36±0.2415.36 \pm0.24 s, versus 16.72±0.3116.72 \pm0.31 s for CBF–MPC, a reduction of 1.361.36 s (approximately 8.1%8.1\%). The corresponding minimum clearances are 0.801±0.0190.801 \pm0.019 m and 0.779±0.0180.779 \pm0.018 m. Thus, shorter completion time accompanies slightly larger mean clearance.

Comparisons and metrics. UGV comparisons use CBF–MPC, Flow-BC, and Gaussian-DSAC. We use the PO and SF evaluation modes and SS criterion described in Sec. IV-A. Each method’s reported SS is computed from 20 evaluation trials per task. Learned-policy SS and return use PO; correction rates use SF. Fixed CBF–MPC runs independently. Table II groups results by task, with continuous metrics reported as mean ±\pm SD.

Results and Analysis

Online adaptation. Figure 5(e–Figure 5f) and Table II show blocked-side adaptation. SOAR-Flow achieves 100% SS and a return of 350.8±1.8350.8 \pm1.8, compared with 343.9±2.6343.9 \pm2.6 for Gaussian-DSAC. Its correction rate is 0.68±0.11%0.68 \pm0.11\%, versus 2.46±0.32%2.46 \pm0.32\% for Gaussian-DSAC and 4.31±0.41%4.31 \pm0.41\% for Flow-BC. The 39.6 return gain over Flow-BC accompanies reduced correction demand after one demonstrated route is blocked.

Autonomous execution and efficiency. Figure 6 shows 8-shaped refinement from corrected early and intermediate runs to late execution without CBF correction, with nominal MPC tracking retained. The first turn must prepare for the following opposite-direction turn. In Table II, SOAR-Flow reaches 100% 8-shaped SS, compared with 95% for CBF–MPC and 90% for Gaussian-DSAC. Its completion

8-shaped refinement with SOAR-Flow showing early CBF-MPC correction, intermediate refinement, and autonomous refinement

Figure 6. 8-shaped refinement with SOAR-Flow: early protected execution, intermediate refinement, and late execution without CBF correction. Red segments mark correction intervals in the early and intermediate runs.

Zero-shot cornering. On held-out cornering, SOAR-Flow attains 95% SS, compared with 85% for fixed CBF–MPC, 55% for Flow-BC, and 90% for Gaussian-DSAC. Figure 5(d) contrasts SOAR-Flow clearing both obstacles with fixed CBF–MPC contacting the downstream obstacle, highlighting the need to preserve clearance for subsequent avoidance. The frozen policy transfers without further updates, although not every evaluation succeeds.

Conclusion

This paper presented SOAR-Flow for safe online refinement of offline-initialized Flow-based driving policies under CBF–MPC protection. Gaussian-return-aware calibration uses recorded behavioral outcomes to regulate critic updates, while paired corrections and intervention-to-go learning guide policy improvement. Intervention-responsive guidance and decaying calibration weights reduce auxiliary influences under the stated conditions. The analysis establishes conditional sample-time safety of protected execution and vanishing auxiliary gradients. Together, these components connect protected data collection with continued task optimization, aiming to reduce reliance on particular recovery behaviors while retaining the prescribed execution constraints.

References

  1. [1]B. R. Kiran, I. Sobh, V. Talpaert, P. Mannion, A. A. Al Sallab, S. Yogamani, and P. Pérez, “Deep reinforcement learning for autonomous driving: A survey,” IEEE Transactions on Intelligent Transportation Systems, vol. 23, no. 6, pp. 4909–4926, 2022.arxiv.org/abs/2002.00444
  2. [2]M. Nakamoto, Y. Zhai, A. Singh, M. S. Mark, Y. Ma, C. Finn, A. Kumar, and S. Levine, “Cal-QL: Calibrated offline RL pre-training for efficient online fine-tuning,” in Advances in Neural Information Processing Systems, 2023.
  3. [3]S. Park, Q. Li, and S. Levine, “Flow Q-learning,” in Proceedings of the International Conference on Machine Learning, ser. Proceedings of Machine Learning Research, vol. 267, 2025, pp. 48 104–48 127.arxiv.org/abs/2502.02538
  4. [4]Z. Li, Y. Wang, H. Wang, Z. Li, P. Li, W. Liu, and Z. Zuo, “From learning to mastery: Achieving safe and efficient real-world autonomous driving with human-in-the-loop reinforcement learning,” arXiv:2510.06038, 2025.arxiv.org/abs/2510.06038
  5. [5]H. Li, K. Lei, S. Zang, K. Hu, Y. Liang, B. An, X. Li, and H. Xu, “Failure-aware RL: Reliable offline-to-online reinforcement learning with self-recovery for real-world manipulation,” arXiv:2601.07821, 2026.arxiv.org/abs/2601.07821
  6. [6]F. Pizarro Bejarano, L. Brunke, and A. P. Schoellig, “Safety filtering while training: Improving the performance and sample efficiency of reinforcement learning agents,” IEEE Robotics and Automation Letters, 2025.DOI
  7. [7]Q. Li, Z. Peng, and B. Zhou, “Efficient learning of safe driving policy via Human-AI copilot optimization,” in International Conference on Learning Representations, 2022. [Online]. Available: https://arxiv.org/abs/2202.10341
  8. [8]J. Duan, Y. Guan, S. E. Li, Y. Ren, and B. Cheng, “Distributional soft actor-critic: Off-policy reinforcement learning for addressing value estimation errors,” IEEE Transactions on Neural Networks and Learning Systems, vol. 33, no. 11, pp. 6584–6598, 2022.DOI
  9. [9]J. Achiam, D. Held, A. Tamar, and P. Abbeel, “Constrained policy optimization,” in Proceedings of the International Conference on Machine Learning, ser. Proceedings of Machine Learning Research, vol. 70, 2017, pp. 22–31.arxiv.org/abs/1705.10528
  10. [10]B. Thananjeyan, A. Balakrishna, and S. Nair, “Recovery RL: Safe reinforcement learning with learned recovery zones,” IEEE Robotics and Automation Letters, vol. 6, no. 3, pp. 4915–4922, 2021.arxiv.org/abs/2010.15920
  11. [11]K. P. Wabersich and M. N. Zeilinger, “A predictive safety filter for learning-based control of constrained nonlinear dynamical systems,” Automatica, vol. 129, no. 109597, 2021.arxiv.org/abs/1812.05506
  12. [12]X. Dai, Z. Yang, D. Yu, F. Liu, H. Sadeghian, S. Haddadin, and S. Hirche, “SafeFlow: Safe robot motion planning with flow matching via control barrier functions,” arXiv:2504.08661, 2025, version 3.arxiv.org/abs/2504.08661
  13. [13]L. Yang, B. Werner, M. de Sa, and A. D. Ames, “CBF-RL: Safety filtering reinforcement learning in training with control barrier functions,” in Proceedings of the IEEE International Conference on Robotics and Automation, 2026, arXiv:2510.14959.arxiv.org/abs/2510.14959
  14. [14]A. Kumar, A. Zhou, G. Tucker, and S. Levine, “Conservative Q-learning for offline reinforcement learning,” in Advances in Neural Information Processing Systems, vol. 33, 2020, pp. 1179–1191.arxiv.org/abs/2006.04779
  15. [15]I. Kostrikov, A. Nair, and S. Levine, “Offline reinforcement learning with implicit Q-learning,” in International Conference on Learning Representations, 2022.
  16. [16]J. Li, X. Hu, H. Xu, J. Liu, X. Zhan, and Y.-Q. Zhang, “PROTO: Iterative policy regularized offline-to-online reinforcement learning,” arXiv:2305.15669, 2023.arxiv.org/abs/2305.15669
  17. [17]K. Lei, Z. He, C. Lu, K. Hu, Y. Gao, and H. Xu, “Uni-O4: Unifying online and offline deep reinforcement learning with multi-step on-policy optimization,” in International Conference on Learning Representations, 2024.arxiv.org/abs/2311.03351
  18. [18]K. Lei, H. Li, D. Yu, Z. Wei, L. Guo, Z. Jiang, Z. Wang, S. Liang, and H. Xu, “RL-100: Performant robotic manipulation with real-world reinforcement learning,” arXiv:2510.14830, 2025.arxiv.org/abs/2510.14830
  19. [19]T. Haarnoja, A. Zhou, P. Abbeel, and S. Levine, “Soft actor-critic: Off-policy maximum entropy deep reinforcement learning with a stochastic actor,” in Proceedings of the International Conference on Machine Learning, ser. Proceedings of Machine Learning Research, vol. 80, 2018, pp. 1861–1870.arxiv.org/abs/1801.01290
  20. [20]Y. Lipman, R. T. Q. Chen, H. Ben-Hamu, M. Nickel, and M. Le, “Flow matching for generative modeling,” in International Conference on Learning Representations, 2023.arxiv.org/abs/2210.02747
  21. [21]A. Agrawal and K. Sreenath, “Discrete control barrier functions for safety-critical control of discrete systems with application to bipedal robot navigation,” in Proceedings of Robotics: Science and Systems, Cambridge, MA, USA, 2017.DOI
  22. [22]J. Duan, W. Wang, L. Xiao, J. Gao, S. E. Li, C. Liu, Y.-Q. Zhang, B. Cheng, and K. Li, “Distributional soft actor-critic with three refinements,” IEEE Transactions on Pattern Analysis and Machine Intelligence, vol. 47, no. 5, pp. 3935–3946, 2025.DOI
  23. [23]Q. Li, Z. Peng, L. Feng, Q. Zhang, Z. Xue, and B. Zhou, “MetaDrive: Composing diverse driving scenarios for generalizable reinforcement learning,” IEEE Transactions on Pattern Analysis and Machine Intelligence, vol. 45, no. 3, pp. 3461–3475, 2023.DOI

Paper details

vlnc:W_8mhv3cnd
Version
v1 · latest
Published
Fresh — added to the Hub within the last 30 days
Added
License
CC BY 4.0
Usage

views · 2

downloads · 0

A view counts once per browser per day, a download each time the PDF is requested.

  • Computer Science

Not recorded for this paper

View statement
Looking for related papers…
Contents