Meridia Insight Tech for Good Frontiers

The Right Split: How Separating Optimization from Tracking Makes Multi-Agent Systems Safer

A new control framework separates optimization from tracking to guarantee that multi-agent systems never violate safety constraints during the journey to the op

Robots that optimize and stay safe: a new control framework fixes the gap between theory and practice.

Imagine a team of robots navigating a shared workspace — a warehouse floor, a disaster zone, a surgical theater. Their job is simple: agree on where to go. Their job is also impossibly hard: get there safely, at every moment, not just when they finally stop.

This is the challenge at the heart of a new paper from researchers at MIT and Shanghai Jiao Tong University. The problem, called safe optimal output agreement, sounds abstract, but it touches everything from drone swarms to power grids. The goal is deceptively simple: a network of agents must converge to the same optimal output value while never — not even briefly — violating safety constraints. Most existing approaches guarantee safety at the finish line. Almost none guarantee it along the way.

The reason is a fundamental tension in control theory. To optimize, you need to move. To stay safe, you sometimes need to slow down or redirect. Apply the optimization directly to the robot's motors, and safety constraints become complicated, finicky mathematical objects called high-order control barrier functions — HOCBFs for short. Design them wrong, and you get two problems: the system either becomes hypersensitive to parameter choices, or it settles at the wrong answer entirely, a spurious equilibrium that looks stable but isn't the optimum.

The paper's core contribution is architectural: a two-layer framework that separates the "what to do" from the "how to get there." The upper layer figures out where the agents should converge. The lower layer actually drives them there. By enforcing safety at the reference level rather than the motor level, the authors sidestep the need for HOCBFs entirely — using simpler first-order constraints instead.

The Science

The setting is a network of nonlinear agents. Each agent $i$ has a state $x_i$, an input $u_i$ (the control signal sent to its actuators), and an output $y_i$ (what the world sees — position, voltage, temperature). The agents communicate over a weighted directed graph that's strongly connected and weight-balanced, meaning information flows both ways and every agent has a roughly equal influence on the network.

Each agent also has local safety constraints on its output: $\eta_i(y_i) \geq 0$ encodes things like workspace boundaries or collision avoidance zones. The shared goal is to find a common output value $r^\star$ that minimizes the sum of all local cost functions while staying within everyone's safety constraints. This is the static optimization problem — what you'd want if you could pause time and compute the perfect agreement point.

But the real problem emerges when you add dynamics. The agents can't teleport to $r^\star$. They have to move through state space, and along the way, their outputs $y_i(t)$ might violate $\eta_i(y_i) \geq 0$ even if the target $r^\star$ is safe. The paper calls this transient output safety, and it matters enormously for systems where even momentary constraint violations cause damage — a robot arm crashing into an obstacle, a power grid breaching voltage limits.

Existing safe feedback optimization methods typically implement gradient-flow dynamics directly through the plant input. Think of gradient flow as pointing downhill along the cost landscape: at each moment, the control action nudges the system toward lower cost. To keep this process safe, you filter the gradient through a quadratic program — a constrained optimization problem solved at each timestep — that projects unsafe directions onto the nearest safe alternatives.

The trouble is that output safety constraints, viewed from the input side, become high-relative-degree conditions. The math gets complicated quickly, requiring HOCBFs whose performance depends critically on a cascade of derivative calculations. Tune one parameter wrong, and the whole thing destabilizes. More insidiously, the safety filter can introduce its own equilibrium conditions, pulling the system away from the true optimum. The steady state you converge to isn't the one you computed offline.

The paper proposes a cleaner separation. The upper layer generates a time-varying reference $g_i$ for each agent — a moving target that encodes the optimization trajectory. The lower layer tracks this reference using an internal-model-based regulator, a classic control design that learns the steady-state input needed to hold a given output. The key insight is that enforcing safety on the reference $g_i$ — rather than the actual motor command — only requires first-order control barrier functions, which are far more tractable.

But here's the subtlety: keeping the reference safe doesn't automatically keep the output safe. While $g_i$ is inside the safe region, the actual output $y_i$ might lag behind or overshoot, especially when the reference moves quickly. To handle this, the authors construct dynamic safety margins (DSMs) — quantities that measure, through a Lyapunov function, how much transient energy remains before the output could reach a safety boundary. If the DSM is positive, the system has headroom; the reference can keep moving without risking a constraint violation.

What They Found

The paper's main theoretical result is a proof that under the two-layer architecture, three things hold simultaneously: the safe set is forward invariant (meaning once the system starts safe, it stays safe), the steady-state optimality structure is preserved (you converge to the true $r^\star$, not some distorted version), and the coupled tracking-governor dynamics converge via a Lyapunov small-gain argument.

The small-gain condition essentially says that the tracking error and the optimization dynamics don't amplify each other beyond a critical threshold. If the tracking controller is aggressive enough to reject disturbances from the reference governor, and the reference governor is smooth enough not to demand impossible tracking performance, then the closed loop is stable.

The DSM-compatibility conditions are critical. A reference $g_i$ must be compatible with the current tracking state $\chi_i$ — meaning the margin $\mathcal{M}_{ik}^S(\chi_i, g_i) > 0$ — for the safety certificate to hold. If a reference pushes too close to a safety boundary while the output is still far behind, the margin evaporates and the CBF constraint on $\dot{g}_i$ activates, slowing the reference down until tracking catches up.

The simulations validate the approach. The authors compare against two baselines: an SGF-HOCBF method (safe gradient flow with high-order CBFs) and a projected primal-dual feedback optimizer. In the SGF-HOCBF case, the high-order derivative chains create tuning sensitivity that becomes severe under anisotropic tracking — when different agents have different control authority or sensor noise profiles.

Figure 2: Trajectories of the SGF-HOCBF baseline under isotropic and anisotropic pre-stabilization.
Figure 2: Trajectories of the SGF-HOCBF baseline under isotropic and anisotropic pre-stabilization. Source: Zhanglin Shangguan, Wei Xiao

shows trajectories for both isotropic and anisotropic pre-stabilization, illustrating how the HOCBF approach degrades when the network is heterogeneous.

Figure 3: Trajectories of the projected primal-dual feedback optimization baseline. The method handles steady-state inequality constraints, but transient output safety is not guaranteed.
Figure 3: Trajectories of the projected primal-dual feedback optimization baseline. The method handles steady-state inequality constraints, but transient output safety is not guaranteed. Source: Zhanglin Shangguan, Wei Xiao

shows the projected primal-dual baseline, which handles steady-state constraints elegantly but provides no transient guarantees. The output trajectories overshoot the safety boundary before converging — acceptable if you only care about the final answer, catastrophic if you're navigating around an obstacle.

The paper's method, illustrated in

(a) Proposed method.
(a) Proposed method. Source: Zhanglin Shangguan, Wei Xiao

a, maintains both reference safety and output safety throughout the trajectory. Compared to the HOCBF baseline (

(b) SGF-HOCBF baseline.
(b) SGF-HOCBF baseline. Source: Zhanglin Shangguan, Wei Xiao

b), the reference-governed approach produces smoother, less aggressive corrections.

There's also an intriguing result about nonconvex obstacles. Standard CBF filtering can get trapped at spurious equilibria — points on the boundary of a nonconvex safe set where the safety correction exactly cancels the optimization gradient. The system thinks it's at a local optimum when it's actually stuck against a wall. The paper proposes adaptive tangential objective shaping: when a spurious equilibrium is detected, the cost function is modified locally to introduce a component tangent to the boundary, effectively "pushing" the system along the safe edge toward the true optimum. This converts what would be a stable equilibrium into a saddle point, allowing escape.

Why This Changes Things

The practical implications are significant for any networked system where safety and optimization must co-occur. In power grids, for instance, you want generators to agree on frequency and voltage setpoints while respecting thermal limits and stability margins. In robotics, you want coordinated motion that avoids collisions. In synthetic biology, you might want gene circuits to synchronize expression levels while staying within viability constraints.

The two-layer architecture isn't just cleaner mathematically — it's more robust. First-order CBFs are easier to tune than HOCBFs because they don't require estimating higher derivatives of the safety barrier. The DSM framework provides a natural tuning knob: a larger margin means more conservative reference motion, trading off optimization speed for safety headroom. This trade-off is explicit, not buried in a chain of derivative gains.

The preservation of the KKT (Karush-Kuhn-Tucker) geometry under the DSM-compatibility condition is particularly elegant. The KKT conditions are the necessary conditions for optimality in constrained optimization — essentially, the balance equations that define where the cost gradient meets the constraint boundaries. By filtering at the reference level, the paper ensures that the steady-state problem the system converges to is exactly the original one, not a distorted version with extra stationarity conditions.

For practitioners, this means you can design the optimization layer and the tracking layer independently, then connect them through the DSM interface. The separation of concerns mirrors modern software architecture, where modular components can be developed and tested in isolation before integration.

The adaptive tangential objective shaping addresses a subtle but practical failure mode. In nonconvex environments — real warehouses, cluttered terrain, adversarial networks — the straightforward safe gradient flow may not converge to the global optimum. The ability to detect and escape spurious equilibria without relaxing safety constraints is a genuine advance.

What's Next

Several open questions remain. The DSM construction relies on a reference-dependent Lyapunov function whose existence is assumed but not constructively proven for general nonlinear systems. The paper provides conditions but not a universal recipe. For practical deployment, someone would need to either construct such functions for their specific plant dynamics or accept a more conservative margin.

The network scalability of the QP-based reference governor also deserves attention. Each agent solves a local quadratic program at every timestep, with constraints coupling its reference to neighbors. For large networks, this could become computationally intensive, especially if communication delays or packet loss corrupt the constraint evaluations.

The nonconvex case with adaptive tangential shaping is promising but still nascent. The method requires detecting when the system is stuck — not trivial in practice — and choosing the right tangential direction. The paper provides intuition but not yet a complete algorithm.

What the paper does deliver is a principled framework that makes the right conceptual split: separate the optimization from the execution, enforce safety at the level where it's easiest to express, and use dynamic margins to account for the inevitable lag between reference and response. For engineers building multi-agent systems that must move fast and stay safe, this is a roadmap worth following.

The code for the simulations is available, which means other researchers can reproduce the results, stress-test the assumptions, and extend the approach to new domains. The architecture is general enough to apply beyond the specific multi-robot coordination example — anywhere a network of dynamical systems must agree on an optimum while respecting shared constraints.

Safety-critical systems have traditionally sacrificed performance for predictability. This work suggests that, with the right architecture, you might not have to.

By enforcing safety at the reference level rather than the motor level, the authors sidestep the need for HOCBFs entirely — using simpler first-order constraints instead.

Comments (0)

No comments yet. Be the first to share your thoughts.