Distilling Safety Filters for Filter-free Multi-agent RL
Reinforcement learning (RL) can teach robot teams to navigate shared spaces, but trial and error causes collisions that real robots cannot afford. Control barrier function (CBF) safety filters prevent these collisions by correcting unsafe actions, yet in a team the filter becomes a centralized optimization whose number of constraints grows quadratically with the team size.
From the abstract. Our summary is in progress.
Full paper
Distilling Safety Filters for Filter-free Multi-agent RL
Published under CC BY 4.0. Reproduced with attribution; original at arXiv:2611.19190 (PDF).
Abstract
Reinforcement learning (RL) can teach robot teams to navigate shared spaces, but trial and error causes collisions that real robots cannot afford. Control barrier function (CBF) safety filters prevent these collisions by correcting unsafe actions, yet in a team the filter becomes a centralized optimization whose number of constraints grows quadratically with the team size. We propose an approach that builds the filter’s safety into the RL policy and examine how such a system behaves during filter-free deployment. However, the filter that keeps training safe also hides what the policy must learn: it masks the cost of unsafe actions, which actor-critic methods then overvalue, and it keeps near-collision states out of the training data. Our approach therefore learns only from executed safe actions with implicit Q-learning and distills the filter into the policy at synthetic near-collision states. We prove that filter distillation loss bounds the policy’s constraint violation and hence how far agents can cross their safety margin, so errors never accumulate. When distillation states cover deployed states, the loss also bounds the collision probability at every step. Without a filter and acting only on local observations, our policies have no collisions in 1{,}800 test episodes with multiple agents. A policy trained with three agents transfers zero-shot to teams of twenty at constant per-agent computation and stays collision-free with up to eight agents. We test our policies on Crazyflie quadrotors with up to five flying at the same time.1
1 Introduction
Robots increasingly work in teams that share space, where each robot must reach its goal while avoiding collisions with other robots and obstacles. Reinforcement learning (RL) offers a promising approach to learning such behaviours, but its trial-and-error nature causes collisions during training that can damage hardware, so real-world multi-agent RL requires safe exploration from the start. Control barrier function (CBF) safety filters (Ames et al., 2017; Ames et al., 2019) address this challenge: at each step, the filter minimally modifies the actions proposed by the policy to satisfy the collision-avoidance constraints, so only safe actions are executed during training (Fisac et al., 2019a). In multi-agent systems, however, pairwise constraints couple the team into a centralized quadratic program (QP) whose number of constraints grows quadratically with the team size. Solving it requires every agent’s state and proposed action; for 20 agents, the joint QP takes 16.9 ms, a third of the control period, against 0.6 ms per agent for our policy (Sec. 5.2). This motivates our objective: use a centralized safety filter to guarantee collision-free exploration during training, but learn a decentralized policy that no longer requires the filter at deployment.
Simply removing the filter after training, however, leads to a fundamental distribution mismatch: the policy is trained under filtered action-to-transition mapping but deployed under an unfiltered one. CBF-RL (Yang et al., 2025) adds barrier-based reward shaping so that single-agent policies, trained with the filter, run without it at deployment. Because the filter maps many raw actions to the same safe action (Markgraf et al., 2025), actor-critic methods such as soft actor-critic (SAC) can overvalue unsafe raw actions: SAC trained with the filter in the loop collides in 98\% of episodes when deployed without it (Sec. 5.3).
This observation motivates RL methods that learn only from actions in the data: we extract the policy from the executed safe actions with implicit Q-learning (IQL) (Kostrikov et al., 2022) (Sec. 3.2). IQL alone is insufficient, however: because the filter prevents collisions, the replay buffer lacks the near-collision states that the unfiltered policy may reach. To cover them, off-support safety-filter distillation (OSFD; Sec. 3.3) trains the policy on the actions of the training filter, queried at synthetic near-collision states, without environment interaction. Following centralized training with decentralized execution, only training uses the joint state, and the deployed policy is an attention-based actor on local observations whose parameters do not depend on the team size (Sec. 3.4).
We prove theoretically that this training controls safety once the filter is removed (Sec. 4). The distillation loss bounds a closed-form CBF residual that measures how much the unfiltered policy violates the filter’s constraints, a bounded residual lowers the barrier by a bounded amount uniformly in time, so violations never accumulate, and, when the distillation states cover the deployed states, the loss bounds the collision probability at every step. The training loss thus certifies the safety of the filter-free policy, and every bound held on the 75 trained policies we audited.
Our contributions are summarized as follows: (1) Filter-free multi-agent RL: we propose a novel framework that trains collision-free with a centralized CBF filter and deploys a decentralized policy without it, by combining IQL-based policy extraction with OSFD. (2) Safety guarantees: bounds that tie the distillation loss to the safety of the unfiltered policy under single- and double-integrator dynamics (Sec. 4). (3) Scalable filter-free collision avoidance: our local-sensing policies have no collision in 1{,}800 episodes on the training scenes, where CBF-RL collides in up to 44\%, a policy trained with three agents transfers zero-shot to twenty at a constant 0.6 ms per agent (Sec. 5), and our policies fly up to five Crazyflie quadrotors without a filter (Sec. 5.4).
2 Related Work
Safe RL with safety filters.
Constrained RL (Achiam et al., 2017) bounds expected cumulative costs but not state-wise safety during training. Safety filters enforce constraints at every step through shielding (Alshiekh et al., 2018), safety layers (Dalal et al., 2018), Hamilton-Jacobi reachability (Fisac et al., 2019a; Bansal et al., 2017), also learned by RL (Fisac et al., 2019b), CBFs (Cheng et al., 2019; Pizarro Bejarano et al., 2025) or control barrier-value functions that unify the two (Choi et al., 2021). Learned filters handle model uncertainty (Choi et al., 2020) and black-box dynamics (Lavanakul et al., 2024), but generally remain in loop at execution. CBF-RL (Yang et al., 2025) trains with a CBF filter and shapes reward so the policy runs without it. We instead address coupled multi-agent constraints and decentralized policies under partial observability. We close the train-deploy mismatch by in-support policy extraction and supervision beyond data rather than reward shaping.
Multi-agent collision avoidance and safety constraints.
Learning-based collision avoidance has been explored for ground and aerial swarms (Chen et al., 2017; Long et al., 2018; Batra et al., 2021; Huang et al., 2024). Decentralized barrier certificates (Wang et al., 2017), shields (ElSayed-Aly et al., 2021; Melcer et al., 2022) and CBF filters within multi-agent RL (Cai et al., 2021) avoid a central solve by splitting the constraints among agents, but remain in the loop at deployment, and neural approaches learn decentralized CBFs together with their controllers (Qin et al., 2021; Zhang et al., 2023; Zhang et al., 2025). In centralized training with decentralized execution (CTDE) (Lowe et al., 2017; Yu et al., 2022), critics use joint information during training, while each deployed policy acts on its own observation. We follow CTDE and additionally use a centralized filter for safe exploration and as a teacher for a filter-free decentralized policy.
Data-driven RL, imitation learning and partial observability.
Offline RL counters value overestimation at actions absent from the data (Levine et al., 2020) by constraining the policy to the behavior policy (Fujimoto et al., 2019; Kumar et al., 2019; Wu et al., 2019; Nair et al., 2020; Fujimoto and Gu, 2021), by penalizing out-of-distribution values (Kumar et al., 2020) or by learning values in-sample (Kostrikov et al., 2022; Xu et al., 2023; Garg et al., 2023), also with multiple agents (Yang et al., 2021; Pan et al., 2022). In-sample learning suits filtered transitions, where unsafe raw actions share safe outcomes, but leaves states missing from the buffer unsupervised. DAgger (Ross et al., 2011) queries an expert on the learner’s own roll-outs; OSFD instead queries the training filter at synthetic near-collision states, without environment interaction. As in learning with privileged information (Chen et al., 2020; Lee et al., 2020), we use the global state only during training and our local-observation attention actor builds on Zhang et al. (2025).
3 Our Approach
\Pi_{x} keeps training collision-free, the policy learns with IQL on the filtered buffer \mathcal{B} and with OSFD on filter labels y at sampled states and is deployed without the filter, with local sensing within R. (b) Three Crazyflies and four stacked-bucket obstacles (Sec. 5.4), lines are illustrative paths to the goals.We now present our approach for learning decentralized collision-avoidance policies using a centralized safety filter during training (Fig. 1(a)). The actor is trained with two losses: an RL loss on the executed safe actions (Sec. 3.2) and a distillation loss at synthetic near-collision states (Sec. 3.3).
3.1 Problem Formulation
We consider n disc-shaped agents of radius r navigating toward individual goals g_{i} in an environment with circular obstacles. Each agent follows either single-integrator (SI) or double-integrator (DI) dynamics, discretized with time step \Delta t:
\mathrm{SI}:\ p_{i,t+1}=p_{i,t}+\Delta t\,u_{i,t},\qquad\mathrm{DI}:\ v_{i,t+1}=v_{i,t}+\Delta t\,u_{i,t},\quad p_{i,t+1}=p_{i,t}+\Delta t\,v_{i,t+1}.Here, p_{i}, v_{i} and u_{i} are position, velocity and control, with u\in\mathcal{U}=\{u:\|u_{i}\|_{\infty}\leq u_{\max}\ \forall i\} and, for DI agents, \|v_{i}\|_{\infty}\leq v_{\max}. Unsubscripted norms are Euclidean. Agent i observes o_{i}, either the full scene or its own state and the agents and obstacles within a sensing radius R, and receives an individual reward for goal progress, goal completion and collisions (App. G). We seek a policy shared by all agents, a Gaussian \pi_{\theta} squashed by u_{\max}\tanh\mu_{\theta}(o_{i}), that is trained without collisions and deployed on local observations without a filter or communication.
Safety filter.
During training, a centralized CBF filter corrects unsafe actions. With x joint state, we index by c agent-obstacle, -wall and -agent constraints and give each constraint a barrier h_{c}:
\displaystyle h_{i,o}=\|p_{i}-c_{o}\|-(r_{o}+r+\rho),\quad h_{i,\mathrm{wall}}=(L-r-\rho)\mp(p_{i})_{k},\quad h_{ij}=\|p_{i}-p_{j}\|-(2r+\rho_{\mathrm{pair}}),where obstacle o has center c_{o} and radius r_{o}, L is arena half-width and \rho,\rho_{\mathrm{pair}}>0 are margins. With margin \rho_{c} for c, tightened safe set is \mathcal{S}=\{x:h_{c}(x)\geq 0\ \forall c\}; collision requires h_{c}(x)<-\rho_{c}. A CBF makes \mathcal{S} forward invariant: if the CBF condition \dot{h}_{c}+\alpha h_{c}\geq 0 holds along the trajectory, h_{c} never becomes negative, so a system that starts in \mathcal{S} stays in it (Ames et al., 2017). This condition for SI dynamics and the high-order CBF (HOCBF) condition \dot{\psi}_{1,c}+\alpha_{2}\psi_{1,c}\geq 0 with \psi_{1,c}=\dot{h}_{c}+\alpha_{1}h_{c} (Xiao and Belta, 2019) for DI dynamics each give an affine constraint a_{c}(x)^{T}u\geq b_{c}(x) on the joint control, the row of c in the filter below, with a_{c}=\nabla h_{c} and b_{c}=-\alpha h_{c} under SI dynamics (App. A).
Given the joint action u^{\mathrm{raw}} proposed by the agents, the filter solves (Wang et al., 2017)
\displaystyle\Pi_{x}(u^{\mathrm{raw}})=\operatorname*{arg\,min}_{u\in\mathcal{U},\,s\geq 0} \\ \displaystyle\tfrac{1}{2}\|u-u^{\mathrm{raw}}\|^{2}+\tfrac{\kappa}{2}\|s\|^{2} \\ \displaystyle\text{s.t.} \\ \displaystyle a_{c}(x)^{T}u+\sigma s_{c}\geq b_{c}(x)\quad\forall c.Only u^{\mathrm{safe}}=\Pi_{x}(u^{\mathrm{raw}}) is executed. Under SI dynamics the constraints are hard (\sigma=0), feasible on \mathcal{S}, and keep the system in \mathcal{S} (Prop. 5). Under DI dynamics, states with \psi_{1,c}<0, such as an agent coasting toward an obstacle, are reachable and may admit no feasible acceleration (Xiao and Belta, 2019), so a penalized slack (\sigma=1) keeps the QP feasible (App. A). The transitions (o,u^{\mathrm{raw}},u^{\mathrm{safe}},r,o^{\prime}), with o=(o_{1},\dots,o_{n}) and o^{\prime} as current and next-step observations and rewards r=(r_{1},\dots,r_{n}), are stored in a replay buffer \mathcal{B}.
3.2 Learning from Safe Experience
Under the filter, many raw actions map to the same executed action and to identical transitions. This action aliasing (Markgraf et al., 2025) lets actor-critic methods overvalue unsafe proposals whose consequences the filter corrected, so we extract the policy from the executed safe actions.
We adopt IQL (Kostrikov et al., 2022) with centralized critics and per-agent values (Lowe et al., 2017): with Q^{i}_{\phi_{k}} k-th critic of agent i, V^{i}_{\psi} its value and \bar{\phi}_{k} parameters of target critic, we minimize
\displaystyle\mathcal{L}_{V}=\sum_{i}\mathbb{E}_{\mathcal{B}}\Big[\ell_{\tau}\Big(\min_{k}Q^{i}_{\bar{\phi}_{k}}(o,u^{\mathrm{safe}})-V^{i}_{\psi}(o)\Big)\Big],\quad\mathcal{L}_{Q}=\sum_{i,k}\mathbb{E}_{\mathcal{B}}\Big[\Big(Q^{i}_{\phi_{k}}(o,u^{\mathrm{safe}})-r_{i}-\gamma V^{i}_{\psi}(o^{\prime})\Big)^{2}\Big],where \ell_{\tau}(z)=|\tau-\mathbf{1}[z<0]|\,z^{2} is the expectile regression loss. The policy is then extracted through advantage-weighted regression (Peng et al., 2019),
\mathcal{L}_{\mathrm{AWR}}=\mathbb{E}_{\mathcal{B}}\bigg[\sum_{i=1}^{n}W_{i}\Big\|\tanh\mu_{\theta}(o_{i})-\frac{u^{\mathrm{safe}}_{i}}{u_{\max}}\Big\|^{2}\bigg],\qquad W_{i}\propto\exp(\beta A_{i}),\quad A_{i}=Q^{i}_{\phi}(o,u^{\mathrm{safe}})-V^{i}_{\psi}(o),with temperature \beta>0. Minimizing it regresses the policy onto the executed safe actions, weighted toward higher advantage (weights are clipped, normalized and up-weighted where the filter intervened; App. B). Since every regression target satisfies the filter’s constraints, the population optimum satisfies every obstacle, wall and agent-agent constraint the agent senses.
Why IQL?
Unlike SAC, IQL never maximizes the critic over arbitrary raw actions. Most offline RL methods (Fujimoto et al., 2019; Kumar et al., 2020; Fujimoto and Gu, 2021) still bootstrap in the next actions sampled from the policy, each of which would need a joint filter to follow the executed dynamics (App. C). IQL instead bootstraps from V_{\psi}(o^{\prime}) and evaluates only buffered actions.
3.3 Off-support Safety-Filter Distillation
To supervise the policy beyond the replay buffer, OSFD queries the training filter at synthetic safety-critical states instead of executing additional actions. At each update, we draw joint states from a distribution \mathcal{D}_{q} that mixes buffer states, perturbed buffer states and synthetic configurations \mathcal{D}_{\mathrm{off}} that place agents close to obstacles, walls or one another, moving toward them. Under DI dynamics, these include states with \psi_{1,c}<0, which the filtered trajectories rarely visit. Each state is labeled by the training filter, y(x)=\Pi_{x}\big(u^{\mathrm{ref}}(x)\big), where u^{\mathrm{ref}} is a goal-directed reference controller with a tangential component against deadlock (Reis et al., 2021). The actor imitates these labels with
\mathcal{L}_{\mathrm{OSFD}}=\mathbb{E}_{x\sim\mathcal{D}_{q}}\bigg[\frac{1}{|\mathcal{A}|}\sum_{i\in\mathcal{A}}\Big\|\tanh\mu_{\theta}(o_{i})-\frac{y_{i}(x)}{u_{\max}}\Big\|^{2}\bigg],where \mathcal{A} excludes agents held at their goals (“active agents”).
OSFD needs no environment interaction and, unlike DAgger (Ross et al., 2011), never executes the learner’s action, so training remains collision-free. A penalty on the part of the policy’s action that violates the filter’s constraints further sharpens the policy at the constraint boundary (App. B).
3.4 Partial Observability and Decentralized Execution
We follow CTDE (Lowe et al., 2017) with a strict split: the filter, critics and OSFD labels use the joint state x only during training, and the deployed system is the actor alone, acting on local observations. Agent i senses the set \mathcal{N}_{i}(x) of agents whose center, and obstacles whose surface, lies within R of p_{i}. It observes an ego vector e_{i} (goal direction and distance, wall clearances, previous action and, under DI dynamics, its velocity) and one token \tau_{ik}=(n_{ik},h_{ik},r_{k},v_{k}-v_{i},\chi_{k}) per sensed entity k. Each token holds the normal n_{ik}=\nabla_{p_{i}}h_{ik} and value of the filter’s barrier (2) between i and k, the radius, the relative velocity and the type \chi_{k} (one-hot: agent or obstacle), so the actor perceives safety in the filter’s coordinates. The ego features query the encoded tokens \phi_{\theta}(\tau_{ik}) by cross-attention (Vaswani et al., 2017),
\mu_{\theta}(o_{i})=f_{\theta}\Big(e_{i},\ \mathrm{CrossAttn}\big(e_{i},\ \{\phi_{\theta}(\tau_{ik})\}_{k\in\mathcal{N}_{i}\cup\{\varnothing\}}\big)\Big),where \varnothing is a learned empty token and f_{\theta} is an MLP. Attention aggregates any number of tokens into one fixed-size vector, so the actor’s parameters depend on neither the number of agents nor that of obstacles, and a policy trained with three agents runs unchanged on larger teams. Each agent’s computation grows with |\mathcal{N}_{i}| and needs no communication.
The actor minimizes \beta_{d}\mathcal{L}_{\mathrm{AWR}}+w\mathcal{L}_{\mathrm{OSFD}}, where the weights \beta_{d} and w balance reward against imitation of the filter (Sec. 5.3), with the constraint-violation penalty and an entropy term (App. B). Gradients never pass through the QP. At deployment, each agent executes u_{i}=u_{\max}\tanh\mu_{\theta}(o_{i}).
4 Deployment-Time Safety Analysis
The deployed system is the closed loop (1) under the joint action \pi(x)=(\pi_{\theta}(o_{1}),\dots,\pi_{\theta}(o_{n})) without a filter. For the filter row a_{c}(x)^{T}u\geq b_{c}(x) of a constraint c in (3) and the OSFD label y(x), we define the policy’s CBF residual, its label error and the label’s own violation,
\nu_{c}(x)=\big[b_{c}(x)-a_{c}(x)^{T}\pi(x)\big]_{+},\qquad e_{\theta}(x)=\big\|\pi(x)-y(x)\big\|,\qquad\epsilon_{c}(x)=\big[b_{c}(x)-a_{c}(x)^{T}y(x)\big]_{+},where [z]_{+}=\max(z,0). The residual is closed-form and needs no QP. OSFD minimizes the label error, \mathbb{E}_{\mathcal{D}_{q}}[e_{\theta}^{2}]\leq nu_{\max}^{2}\mathcal{L}_{\mathrm{OSFD}} when every agent active. The label violation vanishes wherever the hard rows are feasible, in particular on \mathcal{S} under SI dynamics, and is at most the slack under DI dynamics (App. A). Our guarantee chains three bounds,
\underbrace{\mathcal{L}_{\mathrm{OSFD}}}_{\text{training loss}}\ \xrightarrow{\ \eqref{eq:osfd}\ }\ \underbrace{e_{\theta}}_{\text{label error}}\ \xrightarrow{\ \text{Prop.~\ref{prop:lossres}}\ }\ \underbrace{\nu_{c}}_{\text{CBF residual}}\ \xrightarrow{\ \text{Thm.~\ref{thm:cert}}\ }\ \underbrace{h_{c}}_{\text{barrier}},and in the following, Corollary 3 turns the last bound into a collision probability.
Proposition 1 (Distillation bounds the residual).
For every labeled state x and every constraint c, \nu_{c}(x)\leq\|a_{c}\|e_{\theta}(x)+\epsilon_{c}(x). Consequently, with every agent active,
\Big(\mathbb{E}_{\mathcal{D}_{q}}\big[\nu_{c}^{2}\big]\Big)^{1/2}\ \leq\ \|a_{c}\|\,u_{\max}\sqrt{n\,\mathcal{L}_{\mathrm{OSFD}}}\ +\ \Big(\mathbb{E}_{\mathcal{D}_{q}}\big[\epsilon_{c}^{2}\big]\Big)^{1/2},where \|a_{c}\|=\|\nabla h_{c}\| equals 1 for obstacle and wall constraints and \sqrt{2} for pair constraints, under both dynamics.
Proof.
b_{c}-a_{c}^{T}\pi=(b_{c}-a_{c}^{T}y)+a_{c}^{T}(y-\pi)\leq\epsilon_{c}+\|a_{c}\|e_{\theta} by Cauchy–Schwarz, and the right side is non-negative. Minkowski’s inequality and \mathbb{E}_{\mathcal{D}_{q}}[e_{\theta}^{2}]\leq n\,u_{\max}^{2}\mathcal{L}_{\mathrm{OSFD}} give (10). ∎
Proposition 1 uses only the label’s feasibility, so it holds for any reference controller, both dynamics and any observation model. Under SI dynamics, a_{c}^{T}\pi=\dot{h}_{c}, so \nu_{c} is the rate at which the policy decreases h_{c} beyond the rate \alpha h_{c} that the CBF condition allows.
Theorem 2 (The residual bounds the barrier).
Let \alpha>0 be the CBF gain, \Delta t the time step with a=\alpha\Delta t\in(0,1), and \rho_{c} the margin of constraint c. Along the unfiltered SI loop, for every constraint c and every t\geq 0,
h_{c}(x_{t})\ \geq\ (1-a)^{t}\,h_{c}(x_{0})\ -\ \Delta t\sum_{k=0}^{t-1}(1-a)^{k}\,\nu_{c}(x_{t-1-k}).Consequently, for x_{0}\in\mathcal{S}: (i) if \nu_{c}(x_{t})\leq\bar{\nu} for all t, then h_{c}(x_{t})\geq-\bar{\nu}/\alpha for all t, for any horizon; (ii) if \nu_{c}(x_{t})<\alpha\rho_{c} for all t<T, there is no collision on c during the first T steps.
Proof sketch.
Convexity of the barriers (Lemma 4) and (8) give one-step bound h_{c}(x_{t+1})\geq(1-a)\,h_{c}(x_{t})-\Delta t\,\nu_{c}(x_{t}). Unrolling it gives (11), and summing the geometric series gives (i) and (ii) (full proof in App. D). ∎
Residual errors therefore do not accumulate: (11) contracts at rate 1-\alpha\Delta t, so the barrier falls below -\rho_{c} only after a sustained run of large residuals. By convexity of the barriers, the bound is exact in discrete time and needs no Lipschitz constant of the policy or the dynamics. To bound the collision probability, the deployed states must also be represented in \mathcal{D}_{q}.
Assumption 1 (Coverage).
There is a constant C\geq 1 such that, for every t\leq T, the distribution d_{t} of the deployed state x_{t} satisfies d_{t}(E)\leq C\mathcal{D}_{q}(E) for every set of states E.
C is a concentrability coefficient, standard in offline RL (Munos, 2003; Chen and Jiang, 2019). It bounds how much more often the deployed policy visits any region than OSFD samples it, and, as in offline RL, coverage of the deployed policy alone suffices (Rashidinejad et al., 2021). Unlike a fixed dataset, \mathcal{D}_{q} is ours to design, and since the proof uses C only through \mathbb{E}_{d_{t}}[\nu_{c}^{2}]\leq C\,\mathbb{E}_{\mathcal{D}_{q}}[\nu_{c}^{2}], C can be measured (App. F).
Corollary 3 (Collision probability).
Under Assumption 1 and SI dynamics, with x_{0}\in\mathcal{S}, for every constraint c and every step t\leq T,
\Pr\big(h_{c}(x_{t})<-\rho_{c}\big)\ \leq\ \frac{C\,\mathbb{E}_{\mathcal{D}_{q}}\big[\nu_{c}^{2}\big]}{(\alpha\rho_{c})^{2}}\ \leq\ \frac{C}{(\alpha\rho_{c})^{2}}\Big(\|a_{c}\|\,u_{\max}\sqrt{n\,\mathcal{L}_{\mathrm{OSFD}}}+\big(\mathbb{E}_{\mathcal{D}_{q}}\big[\epsilon_{c}^{2}\big]\big)^{1/2}\Big)^{2}.Consequently, the probability of a collision on c within T steps is at most T times the right side.
Proof sketch.
By (11), a collision at step t requires the discounted residual sum \Delta t\sum_{k}(1-\alpha\Delta t)^{k}\nu_{c}(x_{t-1-k}) to exceed \rho_{c}. By Minkowski’s inequality and Assumption 1, its second moment is at most C\,\mathbb{E}_{\mathcal{D}_{q}}[\nu_{c}^{2}]/\alpha^{2}. Markov’s inequality gives the first bound, Proposition 1 the second, and a union bound over the T steps the last claim (App. D). ∎
Corollary 3 turns the training loss into a deployment guarantee: every term on its right side is set during training, and the bound holds at every step for any horizon. It also shows why filtered data fall short: the unfiltered loop departs from the filtered one only where the residual is positive (Lemma 6), reaching states absent from the buffer that only OSFD covers. On 75 trained policies, every link of (9) held, and a smaller loss went with a smaller residual and fewer collisions (App. F).
Local observation and double integrators.
These results hold for any observation model. A decentralized policy cannot match the pair labels, which depend on the neighbor’s intent (Prop. 7), but if every agent keeps the violation of its own half of each pair row below \frac{1}{2}\alpha\rho_{\mathrm{pair}}, no two agents collide (Prop. 8). Under DI dynamics, Proposition 1 applies unchanged, and two nested contractions bound the barrier uniformly in time up to an O(\Delta t) discretization term (Theorem 10, App. E). This term can use most of the margin at our control step, so we measure DI safety empirically.
5 Experiments
- 1 / 4
- full
- 0.3 / 99.3
- 0.3 / 99.3
- 0.0 / 100
- 4.0 / 97.3
- No data
- local
- 0.0 / 100
- 0.0 / 99.3
- 0.0 / 100
- 2.7 / 99.0
- 3 / 2
- full
- 0.0 / 100
- 3.3 / 94.3
- 0.3 / 100
- 23.7 / 100
- No data
- local
- 0.0 / 100
- 5.7 / 37.7
- 0.0 / 100
- 22.7 / 99.3
- 3 / 4
- full
- 7.3 / 99.7
- 20.7 / 0.2
- 8.3 / 98.9
- 67.3 / 12.4
- No data
- local
- 0.0 / 95.4
- 4.7 / 0.0
- 0.0 / 93.4
- 44.0 / 11.4
We evaluate filter-free safety against CBF-RL (Sec. 5.1), zero-shot scaling and its cost against the joint QP (Sec. 5.2), the role of each component (Sec. 5.3) and transfer to hardware (Sec. 5.4).
Setup.
Agents of radius 0.15 m move in a 10\times 10 m arena with 2 or 4 circular obstacles of radius 0.4–1.2 m, redrawn every episode (\Delta t=0.05 s, v_{\max}=2 m/s, DI u_{\max}=6 m/s2). In the training circle layout, agents start on a circle with antipodal goals, so every episode is an n-way crossing through the obstacles at the center, a stress test hardening with n; in the random layout, starts and goals are uniform. Policies use full observation (MLP actor) or local observation (attention actor, R=2.5 m for SI, 3 m for DI). We evaluate the final policy without filter on 3 seeds of 100 episodes each, reporting collisions (\% of episodes with any collision) and goals reached (\% of agents reaching their goal). Every training run of our method recorded zero collisions (App. G).
Baselines.
CBF-RL (Yang et al., 2025) trains with the same filter and adds its barrier-condition reward and intervention penalty, on the multi-agent SAC of our ablations, so it differs from “SAC only” only in the reward (weight screened in App. H).
5.1 Filter-Free Safety
With local observation, our method had no collision in any of the 1{,}800 episodes across both dynamics and all three settings (Table 1). CBF-RL matches it with one agent, but with several it collides in 23–67\% of DI episodes and, with four obstacles, reaches almost no goals, even with its training filter in place (App. H): its barrier reward penalizes approaching any constraint, and in a crowded crossing every route approaches one. Our full-observation MLP collides noticeably only at 3 agents and 4 obstacles (7–8\%, all with obstacles), cutting inside the margin where two obstacles leave a narrow gap; the local actor waits instead, at a cost of 4–6\% of goals, a ceiling set by the scenes, where the filter itself reaches only 95\%. Local sensing is thus the safer observation model.
5.2 Zero-Shot Scaling under Partial Observability
\times 100 episodes; band: per-seed range. (c) Median per-step compute on one CPU thread: agent’s policy versus joint CBF-QP.We deploy the three-agent DI policies, without retraining, on teams up to twenty (Figs. 2 and 3). Safety degrades gracefully: up to eight agents, no episode collides in either layout, and in random layouts collisions stay below 1\% up to sixteen agents and reach 3.3\% at twenty, nearly seven times the training team, reaching over 99\% of goals. In the circle stress test, collisions appear only beyond twelve, mostly with obstacles, whose small margin leaves the smallest residual budget (Sec. 4).
Computational cost.
Each agent’s local observation policy takes 0.6 ms at every team size, without communication (Fig. 3c), whereas the joint QP grows from 0.3 ms at three agents to 16.9 ms at twenty, a third of the 50 ms control period, before any state is gathered. Removing the filter thus removes the one component whose cost grows with the team.
5.3 Ablations
We remove one component at a time on the hardest setting (DI, local observations, 3 agents and 4 obstacles) and also evaluate each policy zero-shot with 16 agents, where the default policy is not saturated (Table 2).
- Ours
- IQL
- ✓
- 0.0 / 93.4
- 7.0 / 99.6
- OSFD only
- –
- ✓
- 0.0 / 93.2
- 2.0 / 92.6
- IQL only
- IQL
- –
- 8.0 / 99.9
- 100.0 / 99.9
- SAC + OSFD
- SAC
- ✓
- 0.0 / 95.4
- 13.0 / 99.6
- SAC only
- SAC
- –
- 98.3 / 100.0
- 100.0 / 99.7
OSFD makes the policy safe beyond the data.
Without OSFD, SAC collides in 98.3\% of episodes with the filter removed, the failure predicted by action aliasing, and IQL in 8.0\%; zero-shot with 16 agents, both collide in every episode, since the buffer contains no crowded near-collision states, the coverage gap of Assumption 1. With OSFD, no variant collides in training and zero-shot collisions fall to 2–13\%, where in-support extraction with IQL has about half of SAC’s (7.0\% vs. 13.0\%).
The RL term drives the policy toward optimality.
OSFD alone imitates the filtered reference controller and receives no reward signal, so it cannot improve on that controller. The RL term supplies this signal: strengthened relative to OSFD, through a larger AWR weight \beta_{d} or a smaller OSFD weight w, it raises goal reaching from 93.2\% up to 97.9\%, while every setting remains collision-free on the training setting (Table 5, App. H). Zero-shot collisions grow with it, so w sets how far beyond the training distribution safety extends.
5.4 Hardware Experiments
We fly the 3-agent DI policies on three and five Crazyflie quadrotors (Giernacki et al., 2017; Preiss et al., 2017) in a plane at fixed height, with no filter at any point: first the full-observation policies of Table 1, with 2 and 4 obstacles, then the local-sensing policy, all without retraining. Motion capture provides positions, a ground computer builds each drone’s observation and runs the policy, and each drone tracks the training dynamics in a scaled copy of the training arena with stacked-bucket obstacles (App. I).
With both observation models, every drone reached its goal without contact in 17 of 18 flights: 8 with full observation, 7 with local sensing and 2 with five local-sensing drones (Fig. 1(b), Table 6 in App. I). No two drones came closer than 0.18 m center to center in these flights (propellers touch at 0.13 m). With local sensing, drones start beyond each other’s sensing radius and resolve crossing from local information alone.
6 Conclusion
We present a multi-agent RL framework that trains collision-free with a centralized CBF filter and deploys a decentralized policy with no filter, no communication and only local sensing. This removes the centralized solve whose cost grows with the number of agents. In-support extraction with IQL makes the policy agree with the filter on the data, and off-support safety-filter distillation extends this agreement to near-collision states that the filtered data never contain. The distillation loss provably bounds a closed-form CBF residual of the unfiltered policy, which bounds the barrier uniformly in time and, under coverage, the collision probability at every step. Without a filter, our local-sensing policies had no collisions on their training settings, transferred zero-shot from 3 to 20 agents at constant per-agent cost and flew up to five Crazyflie quadrotors. Since each agent can evaluate its share of every residual locally, future work will monitor the residuals online to decide where to distill next, and will replace motion capture with on-board sensing.
Generative AI Use
Generative AI tools were used to search the literature, to implement code and experiments, to assist with some mathematical derivations and proofs and to write and edit the paper. The research ideas and methodology are the authors’ own. The authors reviewed and verified all AI-assisted content and take responsibility for the final content of the paper.
Acknowledgments
This work was supported by the NSF Safe Learning Enabled Systems project, the DARPA TIAMAT project, the U.S. Army Research Laboratory and the U.S. Army Research Office under Grant W911NF2010219, the Office of Naval Research and the National Science Foundation. It used Jetstream2 at Indiana University through allocation CIS251274 from the Advanced Cyberinfrastructure Coordination Ecosystem: Services & Support (ACCESS) program, which is supported by National Science Foundation grants #2138259, #2138286, #2138307, #2137603 and #2138296. We thank Alex Zalles and the HSL group members for reviewing project ideas and manuscript revisions. We also thank Ebonye Smith, Ian Chuang and JoonHo Lee for their help with the hardware experiments.
References
Appendix A Safety Filter: Coefficients, Feasibility and Training-Time Safety
Coefficients.
Let \mathcal{K}(x)=\{u\in\mathcal{U}:a_{c}(x)^{T}u\geq b_{c}(x)\ \forall c\} denote the admissible CBF action set. Each constraint gives one row a_{c}(x)^{T}u\geq b_{c}(x) of (3), with a_{c}=\nabla h_{c} under both dynamics. For SI dynamics, b_{c}=-\alpha h_{c}. For DI dynamics, \psi_{1,c}=\nabla h_{c}^{T}v+\alpha_{1}h_{c} and \dot{\psi}_{1,c}+\alpha_{2}\psi_{1,c}\geq 0 give
b_{c}=-\big[v^{T}\nabla^{2}h_{c}\,v+(\alpha_{1}+\alpha_{2})\nabla h_{c}^{T}v+\alpha_{1}\alpha_{2}h_{c}\big],where v^{T}\nabla^{2}h\,v=(\|v\|^{2}-(n^{T}v)^{2})/d for a distance barrier at distance d (center to center distance) with unit normal n (relative velocity for pairs), and 0 for walls. The DI filter also carries hard rows u_{i,k}\leq(v_{\max}-v_{i,k})/\Delta t and u_{i,k}\geq-(v_{\max}+v_{i,k})/\Delta t, which keep the velocity bound inactive, and it pins the action of agents held at their goals to zero.
Lemma 4 (Convexity).
Each barrier in (2) is convex in the joint position p, so h_{c}(p_{w})\geq h_{c}(p)+\nabla h_{c}(p)^{T}w for every displacement w, with equality for walls.
Proof.
Obstacles and pair barriers are a Euclidean norm of an affine function of p minus a constant; wall barriers are affine. ∎
Proposition 5 (SI: feasibility and collision-free training).
For SI dynamics, 0\in\mathcal{K}(x) for every x\in\mathcal{S}, so the hard filter (\sigma=0) is feasible on \mathcal{S}. If x_{0}\in\mathcal{S} and \alpha\Delta t\leq 1, the filtered loop satisfies h_{c}(x_{t})\geq(1-\alpha\Delta t)^{t}h_{c}(x_{0})\geq 0 for every c and t: training never collides and the replay buffer contains no collision.
Proof.
At u=0 each row reads 0\geq-\alpha h_{c}(x), which holds on \mathcal{S}. For the executed action u_{t}\in\mathcal{K}(x_{t}), Lemma 4 with w=\Delta t\,u_{t} gives h_{c}(x_{t+1})\geq h_{c}(x_{t})+\Delta t\,\nabla h_{c}^{T}u_{t}\geq(1-\alpha\Delta t)\,h_{c}(x_{t}); induct on t. ∎
DI feasibility.
For DI dynamics, \{\psi_{1}\geq 0\}\subsetneq\{h\geq 0\} and states with \psi_{1}<0 are reachable from \mathcal{S}, for example by coasting toward an obstacle. There the HOCBF row may be unattainable within \mathcal{U}, so the filter uses the relaxing slack (\sigma=1): every u\in\mathcal{U} is then feasible, and at an active row the executed action violates the row by at most s_{c}=\lambda_{c}/\kappa (from the KKT condition of the slack, with \lambda_{c} the row’s multiplier), which is small at \kappa=10^{4}. This slack bounds the label violation \epsilon_{c} of Sec. 4. On a radial approach along \psi_{1}=0, the row is attainable without slack whenever \alpha_{1}v_{\max}\leq u_{\max} (4\leq 6 at our gains). We claim no discrete-time training guarantee for DI dynamics; every DI replay buffer recorded zero collisions.
Appendix B Learning Objectives in Full
The value and critic losses are (4), with twin critics (k\in\{1,2\}), the bootstrap term multiplied by 1-d for a termination flag d, and one output head per agent, since the game is general-sum.
Advantage weights.
In (5), A_{i}=\min_{k}Q^{i}_{\bar{\phi}_{k}}(o,u^{\mathrm{safe}})-V^{i}_{\psi}(o) and
W_{i}=\frac{\tilde{W}_{i}}{\mathbb{E}_{\mathcal{B}}[\tilde{W}_{i}]},\qquad\tilde{W}_{i}=\big(1+\beta_{c}\,\mathrm{corr}\big)\min\!\big(\exp(\beta\,\mathrm{clip}(A_{i},\pm C)),\,100\big),\qquad\mathrm{corr}=\min\!\Big(\frac{\|u^{\mathrm{safe}}-u^{\mathrm{raw}}\|}{u_{\max}},1\Big).The factor \beta_{c}=5 up-weights the transitions in which the filter intervened. Every target remains an executed safe action, so the weights change which safe actions the policy prefers, not whether its targets are safe.
Constraint-violation penalty.
At the OSFD query states,
\mathcal{L}_{\mathrm{CBF}}=\mathbb{E}_{x\sim\mathcal{D}_{q}}\Big[\tfrac{1}{n}\textstyle\sum_{i}\sum_{c\ni i}\big(\hat{\nu}^{i}_{c}/u_{\max}\big)^{2}\Big],where \hat{\nu}^{i}_{c} is the violation, by agent i’s own action \pi_{\theta}(o_{i}), of its share of row c: a row at least as strict as the filter’s for obstacles and walls, and for pairs the reciprocal half n_{ij}^{T}u_{i}\geq n_{ij}^{T}\tfrac{1}{2}(y_{i}+y_{j})-\tfrac{1}{2}\alpha h_{ij}, an antisymmetric shift of the halves in (13) that the joint label satisfies whenever it satisfies the pair row. Under DI dynamics the HOCBF rows are used, with each target capped at u_{\max}\|n_{c}\|_{1} so that it stays attainable. The penalty only sharpens the policy at the constraint boundary. The analysis uses the exact rows and bounds the residual through \mathcal{L}_{\mathrm{OSFD}}.
Full actor objective.
The actor minimizes \beta_{d}\mathcal{L}_{\mathrm{AWR}}+w(\mathcal{L}_{\mathrm{OSFD}}+w_{\nu}\mathcal{L}_{\mathrm{CBF}})+\alpha_{\mathrm{ent}}\mathbb{E}[\log\pi_{\theta}(\tilde{u}\mid o_{i})], where \tilde{u} is a sampled action and \alpha_{\mathrm{ent}} is tuned toward a target entropy as in SAC (Haarnoja et al., 2018). The entropy term only keeps exploration alive. The regression terms act on the mean \tanh\mu_{\theta}, which is the deployed action.
Appendix C Why IQL over CQL?
CQL (Kumar et al., 2020) penalizes Q at actions sampled from the policy, so it evaluates the critic at exactly the raw actions whose values action aliasing leaves unidentified. Its Bellman target must also follow the filtered dynamics: the executed policy is \Pi_{x}\circ\pi_{\theta}, so every sampled next action must pass through the joint filter. That is one QP per transition, 8{,}192 per environment step at our batch size and update ratio, or about 3 s at 0.4 ms per solve, a cost that dominates training and grows with the team. IQL samples no new action: it bootstraps from V_{\psi}(o^{\prime}) and reads only (o,u^{\mathrm{safe}},r,o^{\prime}) from the buffer, so value learning never calls the filter. The same cost arises for every method whose Bellman target uses a next action sampled from the policy, such as the policy-constraint methods (Fujimoto et al., 2019; Kumar et al., 2019; Fujimoto and Gu, 2021); in-sample methods (Kostrikov et al., 2022; Xu et al., 2023; Garg et al., 2023) avoid it.
Appendix D Proofs and local observation certificate for Section 4
We analyze the deployed loop without collision handling, i.e., loop up to the first collision. Agents held at their goals execute zero action, and so do their labels, so they contribute to neither side of Proposition 1. For pairs, \|a_{c}\|=\sqrt{2} because the pair barrier has gradient (n_{ij},-n_{ij}) in the joint position.
Proof of Theorem 2.
Each barrier in (2) is convex in the positions, so h_{c}(p+w)\geq h_{c}(p)+\nabla h_{c}(p)^{T}w for every displacement w (Lemma 4). The SI step is w=\Delta t\pi(x_{t}), and (8) gives \nabla h_{c}^{T}\pi(x_{t})\geq-\alpha h_{c}(x_{t})-\nu_{c}(x_{t}). Hence
h_{c}(x_{t+1})\ \geq\ h_{c}(x_{t})+\Delta t\,\nabla h_{c}(x_{t})^{T}\pi(x_{t})\ \geq\ (1-a)\,h_{c}(x_{t})-\Delta t\,\nu_{c}(x_{t}),and unrolling gives (11). For (i), the geometric sum is at most \Delta t\,\bar{\nu}/a=\bar{\nu}/\alpha. For (ii), it is less than \Delta t\,\alpha\rho_{c}/a=\rho_{c}, so h_{c}(x_{t})>-\rho_{c}, whereas a collision requires h_{c}<-\rho_{c}. ∎
Proof of Corollary 3.
Fix c, let a=\alpha\Delta t and S_{t}=\Delta t\sum_{k=0}^{t-1}(1-a)^{k}\nu_{c}(x_{t-1-k}). By Theorem 2 and h_{c}(x_{0})\geq 0, \{h_{c}(x_{t})<-\rho_{c}\}\subseteq\{S_{t}>\rho_{c}\}. Assumption 1 applied to \nu_{c}^{2}\geq 0 gives \mathbb{E}_{d_{t}}[\nu_{c}^{2}]\leq C\mathbb{E}_{\mathcal{D}_{q}}[\nu_{c}^{2}] for every step s<T, so by Minkowski’s inequality
\big(\mathbb{E}[S_{t}^{2}]\big)^{1/2}\ \leq\ \Delta t\sum_{k\geq 0}(1-a)^{k}\big(C\,\mathbb{E}_{\mathcal{D}_{q}}[\nu_{c}^{2}]\big)^{1/2}\ =\ \tfrac{1}{\alpha}\big(C\,\mathbb{E}_{\mathcal{D}_{q}}[\nu_{c}^{2}]\big)^{1/2}.Markov’s inequality gives \Pr(S_{t}>\rho_{c})\leq\mathbb{E}[S_{t}^{2}]/\rho_{c}^{2}, the first bound of (12); Proposition 1 gives the second, and a union bound over t\leq T the episode-level claim. The proof uses only the moment condition \mathbb{E}_{d_{t}}[\nu_{c}^{2}]\leq C\mathbb{E}_{\mathcal{D}_{q}}[\nu_{c}^{2}], which we measure in App. F. ∎
Lemma 6 (The train-deploy shift arises only through the residual).
For the hard SI filter, if \nu_{c}(x_{t})=0 for every c along the filtered trajectory from x_{0}, then the unfiltered trajectory from x_{0} coincides with it.
Proof.
If \pi(x_{t})\in\mathcal{K}(x_{t}), then (u,s)=(\pi(x_{t}),0) attains the minimum 0 of (3), so \Pi_{x_{t}}(\pi(x_{t}))=\pi(x_{t}); induct on t. ∎
Local observation.
The following results hold for SI dynamics.
Proposition 7 (The pair label depends on the neighbour’s intent).
With only the pair row (i,j) active and the box inactive, the filter’s output for agent i is y_{i}=r_{i}-\tfrac{1}{2}(\alpha h_{ij}+n_{ij}^{T}r_{i}-n_{ij}^{T}r_{j})\,n_{ij}, where r_{i},r_{j} are the actions passed to the filter. If o_{i} does not determine n_{ij}^{T}r_{j}, every decentralized policy has \mathbb{E}[\|\pi_{\theta}(o_{i})-y_{i}\|^{2}\mid o_{i}]\geq\tfrac{1}{4}\mathrm{Var}(n_{ij}^{T}r_{j}\mid o_{i}) when the row is active.
Proof.
Projecting onto the active half-space, with a=(n_{ij},-n_{ij}) and \|a\|^{2}=2, moves r by \lambda a with \lambda=[-\alpha h_{ij}-a^{T}r]_{+}/2. Given o_{i}, the only random term in y_{i} is \tfrac{1}{2}(n_{ij}^{T}r_{j})\,n_{ij}, and the best squared-loss predictor is its conditional mean, whose error is the conditional variance. ∎
Safety does not require matching the label. A pair row splits into half per agent,
n_{ij}^{T}(u_{i}-u_{j})+\alpha h_{ij}=\underbrace{\big(n_{ij}^{T}u_{i}+\tfrac{1}{2}\alpha h_{ij}\big)}_{\text{agent }i}+\underbrace{\big(n_{ji}^{T}u_{j}+\tfrac{1}{2}\alpha h_{ij}\big)}_{\text{agent }j},\qquad n_{ji}=-n_{ij},and agent i’s violation of its half, \hat{\nu}_{ij}^{i}=\big[-\big(n_{ij}^{T}\pi_{\theta}(o_{i})+\tfrac{1}{2}\alpha h_{ij}\big)\big]_{+} depends only on its own action and its token \tau_{ij}.
Proposition 8 (Decentralized pair certificate).
For every pair, \nu_{ij}\leq\hat{\nu}_{ij}^{i}+\hat{\nu}_{ij}^{j}. Hence, if every agent keeps \hat{\nu}_{ij}^{i}<\frac{1}{2}\alpha\rho_{\mathrm{pair}} for every agent j at every step, no agent-agent collision occurs.
Proof.
With A,B the two halves in (13), \nu_{ij}=[-(A+B)]_{+}\leq[-A]_{+}+[-B]_{+}<\alpha\rho_{\mathrm{pair}}, and Theorem 2(ii) applies to the pair barrier. ∎
The same holds for any antisymmetric shift of the halves, such as the reciprocal split used in training (App. B), and the HOCBF rows of DI dynamics split in the same way.
Unsensed constraints are inactive.
An unsensed agent has h_{ij}>R-2r-\rho_{\mathrm{pair}}; so agent i’s half-row holds for every admissible action whenever \frac{1}{2}\alpha(R-2r-\rho_{\mathrm{pair}})\geq\sqrt{2}u_{\max}; at our SI settings the two sides are 3.0 and 2.83 m/s. An unsensed obstacle’s row holds since \alpha(R-r-\rho)\approx 6.8\geq 2.83\,m/s, and walls are always observed. No constraint that the policy could violate lies outside the sensing radius.
Obstacles and walls, agent by agent.
For any obstacle or wall row of agent i, a_{c} acts only on agent i’s action, has unit norm, and is determined by o_{i} when the obstacle is sensed. The proofs above then go through with \nu_{c}\leq\|\pi_{\theta}(o_{i})-y_{i}(x)\|+\epsilon_{c} and with Assumption 1 stated for the distribution of agent i’s observation rather than the joint state.
Appendix E Double Integrator Certificate
The DI labels satisfy each HOCBF row up to the slack, so \epsilon_{c}\leq s_{c} and Proposition 1 applies unchanged. For the barrier, write a_{i}=\alpha_{i}\Delta t; for a distance constraint let w be the relative velocity and d_{c} the contact distance (r_{o}+r or 2r). We assume, up to step T, that the velocity bound is inactive and that \|w_{k}\|\leq V_{c} with \Delta tV_{c}<d_{c}. Before the first collision, every segment between samples then stays at distance at least d_{*,c}=d_{c}-\Delta tV_{c} from the obstacle center (or the other agent), since each sample is at distance at least d_{c} and each segment has length at most \Delta t\,V_{c}. Along such segments, \|\nabla^{2}h\|\leq 1/d_{*,c} and \nabla^{2}h is Lipschitz with constant L_{H,c}=2/(\sqrt{3}d_{*,c}^{2}) (Lemma 9); for walls both are zero. These are hypotheses on the deployed trajectory, not consequence of training.
Lemma 9 (Curvature of a distance barrier).
Let h(p)=\|p-c_{o}\|-\bar{d} on \mathbb{R}^{2} and, at a point with d=\|p-c_{o}\|>0, let n=(p-c_{o})/d. Then \nabla^{2}h(p)=(I-nn^{T})/d, so 0\preceq\nabla^{2}h(p)\preceq I/d and \|\nabla^{2}h(p)\|=1/d. If the segment from q to p stays at distance at least d_{*} from c_{o}, then |v^{T}(\nabla^{2}h(p)-\nabla^{2}h(q))\,v|\leq L_{H}\|p-q\|\,\|v\|^{2} for every v, with L_{H}=2/(\sqrt{3}\,d_{*}^{2}).
Proof.
Since \nabla h=n and \nabla n=(I-nn^{T})/d, the Hessian is (I-nn^{T})/d, with eigenvalue 0 along n and 1/d along the tangent n^{\perp}. For the Lipschitz bound, fix a unit v and differentiate g(p)=v^{T}\nabla^{2}h(p)\,v=(1-(n^{T}v)^{2})/d along a unit direction u, using \partial_{u}n=(u-(n^{T}u)\,n)/d and \partial_{u}d=n^{T}u:
\partial_{u}g=-\frac{2(n^{T}v)\big(u^{T}v-(n^{T}u)(n^{T}v)\big)+(n^{T}u)\big(1-(n^{T}v)^{2}\big)}{d^{2}}.Writing v=\cos\vartheta\,n+\sin\vartheta\,n^{\perp}, this is \partial_{u}g=-\big(\sin^{2}\!\vartheta\,(n^{T}u)+\sin 2\vartheta\,(n^{\perp T}u)\big)/d^{2}, whose largest magnitude over unit u is \sqrt{\sin^{4}\vartheta+\sin^{2}2\vartheta}\,/d^{2}=|\sin\vartheta|\sqrt{4-3\sin^{2}\vartheta}\,/d^{2}. Over \vartheta this peaks at \sin^{2}\vartheta=2/3, where it equals 2/(\sqrt{3}\,d^{2}). Integrating \partial_{u}g along the segment from q to p, on which d\geq d_{*}, and scaling by \|v\|^{2} gives the bound. ∎
Theorem 10 (Sampled-data DI certificate).
Let a_{1}\in(0,1) and a_{2}(1+a_{1})\in(0,1]. Start at rest in \mathcal{S}, assume the conditions above up to step T, and let \bar{\nu}=\max_{k<T}\nu_{c}(x_{k}) for the HOCBF row of constraint c. Then for all t\leq T,
h_{c}(x_{t})\ \geq\ -\frac{\bar{\nu}}{\alpha_{1}\alpha_{2}(1+\alpha_{1}\Delta t)}\ -\ \Gamma_{c},with
\Gamma_{c}=\frac{\bar{\gamma}_{c}}{\alpha_{1}\alpha_{2}\Delta t\,(1+a_{1})},\qquad\bar{\gamma}_{c}=\Delta t^{2}\Big(\tfrac{L_{H,c}}{2}V_{c}^{3}+\tfrac{\alpha_{1}+\alpha_{2}}{d_{*,c}}V_{c}^{2}+\alpha_{1}^{2}\alpha_{2}\,\rho_{c}\Big),so \Gamma_{c}=O(\Delta t). In particular, if \Gamma_{c}<\rho_{c} and \bar{\nu}<\alpha_{1}\alpha_{2}(1+a_{1})(\rho_{c}-\Gamma_{c}), no collision on c occurs before step T.
Proof.
Position step. Lemma 4 with w=\Delta t\,v_{k+1} gives h_{k+1}\geq(1-a_{1})h_{k}+\Delta t\,\psi_{k}, with the discrete HOCBF function \psi_{k}=n_{k}^{T}v_{k+1}+\alpha_{1}h_{k}. Velocity step. Let \eta=n_{k+1}^{T}v_{k+1} and c=v_{k+1}^{T}\nabla^{2}h(p_{k+1})\,v_{k+1}. The residual’s definition at x_{k+1} gives n_{k+1}^{T}u_{k+1}\geq-c-(\alpha_{1}+\alpha_{2})\eta-\alpha_{1}\alpha_{2}h_{k+1}-\nu_{k+1}, so
\psi_{k+1}=\eta+\Delta t\,n_{k+1}^{T}u_{k+1}+\alpha_{1}h_{k+1}\ \geq\ (1-a_{1}-a_{2})\,\eta-\Delta t\,c-\Delta t\,\nu_{k+1}+\alpha_{1}(1-a_{2})\,h_{k+1}.Since n_{k+1}-n_{k}=\Delta t\,M_{k}v_{k+1} with M_{k}=\int_{0}^{1}\nabla^{2}h(p_{k}+s\Delta t\,v_{k+1})\,ds\succeq 0, we have \eta=\psi_{k}-\alpha_{1}h_{k}+\Delta t\,C_{k} with C_{k}=v_{k+1}^{T}M_{k}v_{k+1}. Substituting this and the position step,
\psi_{k+1}\ \geq\ \lambda\,\psi_{k}-\Delta t\,\nu_{k+1}-\gamma_{k},\quad\lambda=1-a_{2}(1+a_{1})\in[0,1),\quad\gamma_{k}=\Delta t\big(c-(1-a_{1}-a_{2})C_{k}\big)-\alpha_{1}a_{1}a_{2}\,h_{k}\ \leq\ \bar{\gamma}_{c},using |c-C_{k}|\leq\tfrac{L_{H,c}}{2}\Delta t\,V_{c}^{3} (Lemma 9 with p_{k+1}-(p_{k}+s\Delta t\,v_{k+1})=(1-s)\Delta t\,v_{k+1} and \int_{0}^{1}(1-s)\,ds=\tfrac{1}{2}), 0\leq C_{k}\leq V_{c}^{2}/d_{*,c} (Lemma 9) and h_{k}\geq-\rho_{c} before the first collision. Cascade. At rest, \psi_{0}\geq-\Delta t\,\bar{\nu}. Unrolling the velocity step, \psi_{k}\geq-(\Delta t\,\bar{\nu}+\bar{\gamma}_{c})/(a_{2}(1+a_{1})); unrolling the position step from h_{0}\geq 0 gives h_{k}\geq-(\Delta t\,\bar{\nu}+\bar{\gamma}_{c})/(\alpha_{1}a_{2}(1+a_{1})), which is (14). ∎
For a pair, the same argument applies in relative positions and velocities: in the joint position, v^{T}\nabla^{2}h_{ij}\,v=w^{T}H\,w with w=v_{i}-v_{j} and H the Hessian of Lemma 9 at p_{i}-p_{j}. The bound is conservative, but not by much at our control step: in simulation, an adversarial tangential approach at \Delta t=0.05\,s, (\alpha_{1},\alpha_{2})=(2,4) and \rho=0.1\,m produces clearance deficits of 0.08-0.10\,m, nearly the whole margin, while radial approaches produce none. This is why we measure DI safety empirically.
Appendix F Audit of the Bounds
Protocol.
For each trained policy we rebuild \mathcal{D}_{q} at its training cell as in training, label it with the training filter, and run 100 unfiltered episodes of the deterministic policy, recording the label error e_{\theta}, the residual \nu_{c} and the barrier h_{c} of every row at every step. We audit 75 policies: 21 SI policies (ours with full and local observation, CBF-RL and SAC) and the 54 DI policies of Tables 2 and 5 and of the 2-obstacle setting, at the training cell and, for the 51 ablation policies, zero-shot with 16 agents.
- SI
- Ours, local
- 5/4
- 0.012
- 0.49
- 0.05
- 0.40
- 0.05
- 0.7
- SI
- Ours, local, zero-shot
- 16/2
- 0.012
- 0.49
- 0.05
- 1.70
- 0.17
- 16.3
- SI
- Ours, full obs.
- 5/4
- 0.060
- 1.09
- 0.10
- 1.00
- 0.05
- 4.3
- SI
- Ours, full obs.
- 8/4
- 0.083
- 1.63
- 0.13
- 1.46
- 0.13
- 10.7
- SI
- Ours, full obs.†
- 3/8
- 0.327
- 1.98
- 0.38
- 1.95
- 0.26
- 98.0
- SI
- SAC only†
- 3/4
- 0.938
- 3.36
- 0.78
- 3.47
- 0.13
- 100.0
- SI
- CBF-RL (w=3)†
- 3/4
- 1.459
- 4.18
- 0.81
- 3.39
- 0.04
- 22.0
- DI
- Ours, local
- 3/4
- 0.032
- 1.78
- 1.16
- 1.12
- 0.06
- 0.0
- DI
- Ours, local, zero-shot
- 16/2
- 0.032
- 1.78
- 1.16
- 5.09
- 0.50
- 7.7
- DI
- OSFD only, zero-shot
- 16/2
- 0.026
- 1.63
- 1.18
- 5.29
- 0.29
- 0.7
- DI
- IQL only
- 3/4
- 0.550
- 7.38
- 4.43
- 5.63
- 1.98
- 8.3
- DI
- SAC only
- 3/4
- 1.802
- 13.45
- 9.07
- 15.48
- 10.19
- 97.7
Each link of the chain holds.
The three links of (9) were checked directly. Loss to label error: on \mathcal{D}_{q}, \mathbb{E}[e_{\theta}^{2}] equals n\,u_{\max}^{2}\mathcal{L}_{\mathrm{OSFD}} for SI policies and is 87-97\% of it for DI policies, whose goal-held agents are excluded from the loss. Label error to residual: Proposition 1 held on all 6.8\times 10^{7} rows evaluated. Residual to barrier: along the unfiltered SI roll-outs, the one-step inequality behind (11) held on all 2.8\times 10^{7} row-steps before the first collision, and each of the 724 SI collisions, 503 of them by SAC and CBF-RL, was preceded by a discounted residual sum above \rho_{c}, as Theorem 2 requires.
Lowering one quantity lowers the next.
Across the 21 policies, Spearman rank correlations along the chain are 0.97 from \mathcal{L}_{\mathrm{OSFD}} to e_{\theta}, 0.98 from e_{\theta} to \nu on \mathcal{D}_{q}, and 0.88 from \nu to the collision rate; the loss alone predicts collisions at 0.86 (Table 3, top). Under DI dynamics, \mathcal{L}_{\mathrm{OSFD}} and e_{\theta} on \mathcal{D}_{q} are ranked identically, and on the deployed states e_{\theta} predicts \nu at 0.90. On \mathcal{D}_{q} itself, the DI residual of every policy trained with OSFD is 1.15–1.25 m/s2 whatever its loss: the synthetic states include approaches that no admissible acceleration can stop, where the label’s own violation \epsilon_{c} dominates \nu_{c}. The two variants trained without OSFD have losses of 0.55 and 1.8, against at most 0.063 with OSFD, residuals on \mathcal{D}_{q} of 4.4 and 9.1 m/s2, and are the only DI policies that collide on the training scenes.
Coverage.
The proof Corollary 3 needs only \mathbb{E}_{d_{t}}[\nu_{c}^{2}]\leq C\mathbb{E}_{\mathcal{D}_{q}}[\nu_{c}^{2}], which we measure as the smallest such C over 50-step windows. On the training scenes it is at most 0.83 for the obstacle and wall rows of every SI policy of our method and 0.04 for every DI policy trained with OSFD, since \mathcal{D}_{q} concentrates on near-collision states; pair rows need up to 8 (SI) and 0.18 (DI).
Appendix G Implementation Details
- Environment
- \Delta t=0.05 s, v_{\max}=2 m/s, r=0.15 m, 1000 steps
- same, u_{\max}=6 m/s2
- Filter
- \alpha=3, \rho=0.075, \rho_{\mathrm{pair}}=0.2
- \alpha_{1}=2, \alpha_{2}=4, \kappa=10^{4}, \rho=0.1
- IQL
- \tau=0.7, \beta=3, weight cap 100, \beta_{d}=10, \beta_{c}=5, target entropy -0.2\,\dim u_{i}
- OSFD
- w=50, w_{\nu}=10, 256 states, mixture (0.4, 0.3, 0.3)
- same, adverse speed \mathcal{U}[0,1]v_{\max}
- Sensing
- R=2.5 m
- R=3.0 m
- Optimization
- Adam, lr 6\times 10^{-4}, batch 4096, \gamma=0.99, Polyak 0.005, 2 updates/step, 16 envs
- Exploration
- 5k goal-directed warm-up steps (noise 0.5); goal-directed proposals w.p. 0.3 per env
- Training
- 200k steps (1 agent), 300k steps (3 agents)
Scenes and reward.
The arena is [-5,5]^{2} (L=5\,m), r=0.15\,m, and obstacle radii lie in [0.4,1.2]\,m, redrawn every episode. Circle layout: starts evenly spaced on a circle of radius 4 m with antipodal goals. Random layout: starts and goals uniform in [-4,4]^{2}, pairwise at least 1 m apart, each start at least 4 m from its goal. An agent within 0.5 m of its goal is held at rest. The reward is r_{i}=\gamma\Phi(p_{i}^{\prime})-\Phi(p_{i})+0.02\langle\hat{u}_{i},\hat{g}_{i}\rangle+300(1+\tfrac{1}{2}(1-t/T))\mathbf{1}[\text{reach}]-30\,\mathbf{1}[\text{obstacle}]-10\,\mathbf{1}[\text{wall}]-30\,\mathbf{1}[\text{agent}]-20\,\mathbf{1}[\text{timeout}], with \Phi=-\|p_{i}-g_{i}\| (Ng et al., 1999); under DI dynamics the directional term uses the velocity, and under the filter the collision terms never fire.
Observations and networks.
Full observation: own position, goal offset, offsets to all agents and obstacles, obstacle radii, wall clearances, previous action and, under DI dynamics, all velocities divided by v_{\max}. Local observation: the tokens of Sec. 3.4, 8-dimensional, whose motion slot holds the relative velocity divided by v_{\max} (DI) or the neighbor’s last action (SI); masking by R is applied before any learned layer. Actor: squashed Gaussian, a 2\times 256 MLP with LayerNorm (full observation) or a per-token MLP of width 128 and 4-head attention followed by a 2\times 256 trunk (local observation). Twin critics and value network: 2\times 512 MLPs with LayerNorm (Ba et al., 2016) over all agents’ observations, one head per agent. All networks use orthogonal initialization and Adam (Kingma and Ba, 2015).
Training loop and OSFD.
Sixteen environments run in parallel. For the first 5k steps, proposals are goal-directed with Gaussian noise; afterwards each agent samples u^{\mathrm{raw}}_{i}\sim\pi_{\theta}(\cdot\mid o_{i}), replaced by the goal-directed proposal with probability 0.3 per environment to keep goal-reaching transitions in the buffer. Each environment step is followed by two updates, each sampling 4096 transitions and building 256 OSFD query states. \mathcal{D}_{q} mixes synthetic boundary states (40\%), buffer states (30\%) and buffer states with positions perturbed by \mathcal{N}(0,0.3^{2}) and DI velocities by \mathcal{N}(0,0.5^{2}) (30\%). A synthetic state keeps a buffer row’s obstacles and goals and places agents within 0.6 m of an obstacle, a wall or one another, heading toward it (under DI dynamics at speed \mathcal{U}[0,1]\,v_{\max}). The reference is u^{\mathrm{ref}}_{i}=u_{\max}w_{i}/\|w_{i}\| with w_{i}=\hat{g}_{i}+\sum_{k}[1-\Delta_{ik}]_{+}[-\hat{g}_{i}^{T}n_{ik}]_{+}\,t(n_{ik}), clearance \Delta_{ik} and clockwise tangent t(n)=(n_{y},-n_{x}); under DI dynamics, u^{\mathrm{ref}}_{i}=\mathrm{clip}(3(v_{\max}w_{i}/\|w_{i}\|-v_{i}),\pm u_{\max}). All QPs are solved with the Goldfarb-Idnani method (Goldfarb and Idnani, 1983). The reported policy is the final actor.
Training curves.
Figure 4 shows the training of the full-observation policies of Table 1 with 3 agents and 4 obstacles. Every 10k steps, the current policy is evaluated without the filter on 50 episodes of the training scenes. The filtered training rollouts never collide, yet the unfiltered policy initially collides in almost every episode. As the OSFD loss falls, filter-free collisions drop below 20\% within 50k (SI) and 80k (DI) steps and stay near 5\% over the last 100k steps, while goal reaching rises above 99\% (final values in Table 1). The actor loss follows the OSFD term, which makes up most of it at w=50.
\mathcal{L}_{\mathrm{OSFD}}+w_{\nu}\mathcal{L}_{\mathrm{CBF}} and (d) the full actor objective (App. B), logged every 2k steps on one batch and smoothed by a running median over 10k steps; logarithmic axes.Appendix H Baselines and Hyperparameters
- OSFD weight w
- 10
- 0.0 / 97.9
- 36.0 / 99.7
- No data
- 25
- 0.0 / 94.7
- 18.3 / 99.7
- No data
- 50⋆
- 0.0 / 93.4
- 7.0 / 99.6
- No data
- 100
- 0.0 / 93.3
- 1.3 / 99.6
- AWR weight \beta_{\mathrm{d}}
- 3
- 0.0 / 93.8
- 1.7 / 99.5
- No data
- 10⋆
- 0.0 / 93.4
- 7.0 / 99.6
- No data
- 30
- 0.0 / 96.4
- 36.0 / 99.6
- Expectile \tau
- 0.6
- 0.0 / 93.2
- 4.3 / 99.6
- No data
- 0.7⋆
- 0.0 / 93.4
- 7.0 / 99.6
- No data
- 0.8
- 0.0 / 94.2
- 12.0 / 99.6
- No data
- 0.9
- 0.0 / 94.2
- 13.3 / 99.4
- Training radius R (m)
- 1.5
- 0.0 / 94.7
- 13.0 / 99.8
- No data
- 2.0
- 0.0 / 93.9
- 12.0 / 99.6
- No data
- 2.5
- 0.0 / 94.2
- 15.7 / 99.6
- No data
- 3.0⋆
- 0.0 / 93.4
- 7.0 / 99.6
- No data
- \infty (full)
- 0.0 / 95.0
- 13.0 / 99.6
All baselines use the same filter, environment, networks and evaluation. CBF-RL adds to each agent’s reward w\big[\sum_{c}\min(a_{c}^{T}u^{\mathrm{raw}}-b_{c},0)/(s_{c}u_{\max})+\exp(-\|u^{\mathrm{raw}}-u^{\mathrm{safe}}\|^{2}/\sigma^{2})-1\big], the barrier term and bounded intervention penalty of Yang et al. (2025), computed with the rows of the joint filter (a pair row is charged to both agents), with \sigma=0.25u_{\max} and s_{c} the row scale, and trains with multi-agent SAC. A screen over w\in\{0.3,1,3\} (3 agents, 4 obstacles, one seed) gave the fewest collisions at w=3 on both dynamics. With its training filter still on, CBF-RL reaches only 0–13\% of goals with 3 agents and 4 obstacles, so its low goal rate there is not caused by removing the filter. SAC only runs SAC on the raw action, with the filter treated as part of the environment; SAC + OSFD adds the OSFD terms; IQL only sets w=0; OSFD only sets \beta_{d}=0, so the critics train but do not reach the actor. Table 5 varies one hyperparameter at a time around the default.
Appendix I Hardware Setup
- Local sensing, 3 drones, 4 obstacles
- Scattered
- 6
- 0
- 100
- 0.25
- 0.03
- 10.7–13.4
- Row, spread
- 1
- 0
- 100
- 0.19
- 0.23
- 9.4
- Row, tight
- 1
- 1
- 66.7
- contact
- –
- –
- Local sensing, 5 drones, 2 obstacles (zero-shot)
- Circle layout
- 2
- 0
- 100
- 0.20
- 0.16
- 10.4–11.4
- Full observation, 3 drones
- 4 obstacles
- 2
- 0
- 100
- 0.26
- 0.16
- 12.9–13.6
- 2 obstacles
- 3
- 0
- 100
- 0.30
- 0.10
- 10.1–18.2
- 2 virtual obstacles
- 3
- 0
- 100
- 0.18
- 0.04
- 9.5–13.6
Platform and scaling.
Three or five Crazyflie 2.x quadrotors (Giernacki et al., 2017) fly at 0.8 m through Crazyswarm2 (Preiss et al., 2017), tracked by a Vicon system at 100 Hz, with a Mellinger controller tracking full-state setpoints. With length scale s=0.375, time stretch k=2 and arena center c, we map p^{\mathrm{lab}}=c+s\,p, v^{\mathrm{lab}}=(s/k)\,v, u^{\mathrm{lab}}=(s/k^{2})\,u and \Delta t to k\Delta t, so a trajectory of the training plant is a lab trajectory slowed down by k: walls at \pm 1.875 m, a 10 Hz loop and a sensing radius of 1.125 m.
Control loop.
Every 0.1 s a laptop maps the Vicon positions to the training frame, builds each drone’s observation exactly as in training (masked to the sensing radius), evaluates u_{i}=u_{\max}\tanh\mu_{\theta}(o_{i}) in 0.46 ms for all three drones (0.60 ms for five) with no QP, integrates it with the training plant from the measured position, and sends the result to the drone as a setpoint, which was tracked to within 2.4 cm (95th percentile) in every flight. The velocities the policy sees are the commanded plant velocities. A drone within 0.6 training units of its goal (0.5 in training, enlarged so that a real drone has room to brake) is held in place. The drones exchange nothing; motion capture stands in for on-board sensing.
Obstacles and flights.
Each obstacle is a stack of three buckets of rim radius 0.16 m, declared to the policy with radius 0.30 m (0.8 training units) to absorb the drone’s size, its tracking error and the gap between the lab and the training plant; over the 18 flights, the agent’s disc entered a declared disc in four, and no propeller came within 3 cm of a rim. The five-drone flights use the training policy (3 agents, 4 obstacles) unchanged, with five starts and antipodal goals evenly spaced on the training circle and two obstacles; neighbouring drones start 4.6 training units apart, beyond the sensing radius of 3, so the drones sense each other only once the crossing begins. The first full-observation flights used virtual obstacles. Each flight starts with the drones hovering at rest at the starts of the circle layout and ends when all are held at their goals. In the tight row layout, two drones met in the central opening and the policy’s setpoints converged until they touched, so the contact came from the policy rather than from tracking error. Videos of the flights are available at srikarbabug.github.io/ff-safemarl.