Tri-Level Robust Constrained Reinforcement Learning
- Tri-Level RCRL is a framework that integrates nested policy optimization, adversarial model selection, and dual-variable adjustments to ensure robust constraint adherence under uncertainty.
- It employs Lagrangian saddle-point formulations and robust primal-dual algorithms to manage worst-case reward optimization and constraint feasibility across diverse MDPs or attack scenarios.
- Applications include safeguarding power systems in cyber-physical attacks, achieving high constraint satisfaction and sub-millisecond inference in real-time deployment.
Tri-Level Robust Constrained Reinforcement Learning (RCRL) denotes a class of constrained reinforcement learning formulations in which policy optimization is nested with adversarial and feasibility-enforcing subproblems. In the formulation of Wang et al., the tri-level structure arises from maximizing a policy over an uncertainty set of MDPs while simultaneously introducing Lagrange multipliers for constraints, yielding a problem under model uncertainty (Wang et al., 2022). In a later power-system security formulation, the term refers to three explicit nested levels—worst-case attack selection, AC-OPF system response, and defender policy training—used to train real-time defensive control policies against coordinated cyber-physical attacks (Khamaneh et al., 13 Sep 2025). Across these usages, RCRL is characterized by worst-case reward optimization together with explicit constraint satisfaction requirements under uncertainty.
1. Formal tri-level problem statements
In robust constrained RL under model uncertainty, the uncertainty set is
where all MDPs share the same state and action spaces and discount factor , but may differ in transition dynamics and possibly costs. For a stationary policy and , the discounted return from initial distribution is
with analogous quantities for each cost . The objective is to maximize the worst-case reward while satisfying every cost threshold 0 for all MDPs in 1 (Wang et al., 2022).
This yields the tri-level optimization problem
2
Here the three levels are policy optimization, adversarial model selection, and dual-variable adjustment. The formulation is explicitly robust: feasibility must hold for all 3, and reward is evaluated in the worst case over that set (Wang et al., 2022).
In the power-system security framework, the tri-level structure is organized differently. Let 4 be the set of AC-power-network states, 5 the attacker’s budgeted attack set, 6 the feasible AC-OPF dispatch set under attack 7, and 8 the defender’s policy class. The nested problems are: 9
0
and
1
Level 1 identifies worst-case 2 attacks, Level 2 computes the corresponding AC-OPF response, and Level 3 trains a defense policy that mitigates these scenarios across operating conditions without predefined attack patterns (Khamaneh et al., 13 Sep 2025).
A plausible implication is that “tri-level RCRL” is not a single canonical decomposition. In one line of work the three blocks are 3; in another they are attacker, optimizer, and defender. What unifies them is nested robust decision-making with explicit constraint handling.
2. Lagrangian saddle-point structure and robust primal-dual optimization
For the robust MDP-uncertainty formulation, the Lagrangian is
4
and the overall problem is
5
This is a three-block saddle-point problem: minimization over 6, maximization over 7, and maximization over 8 (Wang et al., 2022).
The same source notes that, under mild conditions, one can exchange the inner maxima in 9 to obtain a nonconvex minimax formulation in 0. However, in general there is no zero duality gap because the robust visitation set need not be convex (Wang et al., 2022). This directly addresses a common misconception that the max–min–max structure can always be reduced to an equivalent convex-concave saddle problem.
The robust primal-dual (RPD) algorithm parameterizes the policy by 1 and maintains both primal variables 2 and dual variables 3. At each iteration it first computes an adversarial MDP
4
It then performs a projected dual update
5
followed by a projected primal update
6
Here 7 denotes Euclidean projection (Wang et al., 2022).
Operationally, the algorithm alternates between policy improvement under the current worst-case model and multiplier adjustment according to observed cost-threshold deviation. The paper states that, in practice, one “evaluates” the robust value functions and their gradients under the adversarial transition. Under Lipschitz-smoothness, the gradient-mapping norms tend to zero (Wang et al., 2022).
3. Convergence, robust feasibility, and the 8-contamination construction
For the single-constraint case 9, Wang et al. state convergence and feasibility guarantees under compactness of 0, 1-Lipschitz and 2-smooth parametrization, Lipschitz continuity of robust value functions and gradients in 3, and Slater’s condition for costs (Wang et al., 2022). With diminishing step sizes 4 and a small regularizer 5, Theorem 4.1 gives
6
iterations to ensure
7
where 8 is the standard gradient-mapping at step 9.
Proposition 4.2 gives a robust feasibility statement: if the returned iterate 0 lies in the interior of 1, then the corresponding policy 2 satisfies the constraint in the original problem up to 3 violation for all 4. The statement further specifies that one can guarantee a 5-infeasible margin on the robust cost (Wang et al., 2022).
A concrete uncertainty model is the 6-contamination set. For nominal transition kernel 7, the uncertainty set is
8
for each state-action pair 9. The interpretation given is that, at each 0, the adversary may inject 1 mass arbitrarily to the worst-case next state (Wang et al., 2022).
Under this construction, the robust Bellman operator becomes
2
Because the term 3 is nondifferentiable, the method replaces it by the log-sum-exp smoothing
4
This yields a smooth robust Bellman operator 5 with fixed point 6 approximating 7 up to 8 (Wang et al., 2022).
The resulting smoothed online RPD algorithm, in the tabular setting, runs
9
steps of smoothed robust TD at outer iteration 0 to estimate 1 and 2, forms unbiased-but-small-bias estimates of 3, 4, and 5, and then updates 6 and 7 as in RPD. Theorem 5.3 states that, under the same smoothness and Slater assumptions and with
8
the online algorithm produces with high probability an iterate 9 with
0
and robust constraint violation 1. The total sample complexity is polynomial and is stated explicitly as 2 in the worst tabular bound, dominated by repeatedly estimating the robust value (Wang et al., 2022).
4. Tri-level RCRL for coordinated cyber-physical attacks
The power-system formulation instantiates RCRL in a cyber-physical setting where the three levels correspond to attack synthesis, AC-OPF recourse, and reinforcement learning-based defense (Khamaneh et al., 13 Sep 2025). At Level 1, the attacker solves
3
where 4 measures adversarial economic impact as redispatch cost plus violation penalties, and 5 are relaxed AC power-balance and violation definitions.
At Level 2, the system response is an AC-OPF problem
6
where
7
is the quadratic generation cost, and 8 collects AC power-flow balance, generator limits, line-thermal limits, and voltage limits (Khamaneh et al., 13 Sep 2025).
At Level 3, the defender’s policy is trained by
9
where 0 is the distribution of post-attack states
1
2, and 3 is the implicit AC-OPF response (Khamaneh et al., 13 Sep 2025).
The induced MDP is
4
The state space is
5
the action space is
6
the dynamics are
7
the reward is
8
and 9 (Khamaneh et al., 13 Sep 2025).
The paper describes the framework as generating diverse system states through AC-OPF formulations, identifying worst-case 00 attack scenarios for each state, and training policies to mitigate these scenarios across all operating conditions without requiring predefined attack patterns. Once trained, the policy is intended to control observed cyber-physical attacks in real time (Khamaneh et al., 13 Sep 2025).
5. Constraint handling and learning mechanics
A central feature of the power-system RCRL framework is the separation between safe exploration during training and safe exploitation during deployment (Khamaneh et al., 13 Sep 2025). For training-time exploration, the feasible action set at state 01 is
02
where 03 encodes equality constraints such as power balance and SOC dynamics, and 04 encodes inequalities such as voltages, line flows, and BESS limits.
The projection operator is
05
and the final action is obtained by Beta-blending: 06 As training proceeds, 07, so the policy learns to internalize constraints without projection (Khamaneh et al., 13 Sep 2025).
For deployment-time exploitation, the constrained policy problem is
08
subject to
09
The per-step augmented Lagrangian is
10
with dual updates
11
and primal update
12
This is a primal-dual augmented Lagrangian mechanism specialized to per-step physical feasibility (Khamaneh et al., 13 Sep 2025).
The RL backbone is TD3. The value function is written in Bellman form as
13
with TD3 target
14
and actor objective
15
The condensed training loop initializes 16 and a replay buffer, alternates between baseline AC-OPF, worst-case attack computation, Beta-blended safe exploration, critic TD updates, periodic dual updates, delayed actor updates via the augmented Lagrangian, and target-network soft updates, then returns 17 (Khamaneh et al., 13 Sep 2025).
The reported hyperparameters are batch size 18, actor and critic learning rates 19 with Adam, discount 20, Polyak factor 21, dual learning rates 22, policy delay 23, and dual update every 10 steps (Khamaneh et al., 13 Sep 2025).
6. Empirical characteristics, computational profile, and interpretive issues
The power-system study evaluates the framework on IEEE 30-bus and IEEE 57-bus systems, with 5 BESS placed at buses 24 in the 30-bus case and 4 BESS at buses 25 in the 57-bus case. The adversary budget is 26, and experiments use 24 h load profiles from NREL data (Khamaneh et al., 13 Sep 2025).
The reported performance metrics are constraint satisfaction rate, average cost gap to AC-OPF, inference latency, complexity factor, and voltage/flow recovery profiles. The selected results are: for IEEE 30, constraint satisfaction 27, cost gap 28, and inference 29 ms; for IEEE 57, constraint satisfaction 30, cost gap 31, and inference 32 ms. Recovery times are reported as voltages and flows restored within one time step (sub-second), and training curves show stable convergence in approximately 33 k iterations (Khamaneh et al., 13 Sep 2025).
The real-time deployment profile is also quantified computationally. Online control uses one forward pass of a 3-layer neural network, stated as approximately 34 ms or less on GPU, with measured inference time 35 ms on an NVIDIA RTX 6000 Ada. The complexity factor in Fig. 6 is reported as RCRL-TD3 36 versus MINLP-OPF 37 and MPC 38 (Khamaneh et al., 13 Sep 2025).
Taken together with the earlier robust MDP formulation, these results clarify two interpretive points. First, “tri-level” should not be understood as fixing a unique mathematical template. The robust constrained RL paper uses policy, adversarial MDP, and dual variables as the three blocks, whereas the cyber-physical paper uses attack, AC-OPF response, and defense policy (Wang et al., 2022, Khamaneh et al., 13 Sep 2025). Second, constraint robustness and computational tractability are treated differently across the two lines of work: one emphasizes asymptotic stationarity, robust feasibility, and polynomial sample complexity under uncertainty sets such as 39-contamination, while the other emphasizes physically constrained safe exploration, augmented-Lagrangian deployment, and sub-millisecond inference in benchmark grids (Wang et al., 2022, Khamaneh et al., 13 Sep 2025).
A plausible implication is that tri-level RCRL functions less as a single algorithm than as a design pattern for embedding RL inside nested worst-case and feasibility layers. In the available literature, its defining property is not merely robustness in reward, but robustness of constraint satisfaction under either adversarial model uncertainty or explicit coordinated attack scenarios.