                                  Safety-Polarized and Prioritized Reinforcement Learning





                          Table 4. The SWU scores of all algorithms, including RESPO and PPOLag.



                SWU Score↑          TwoWay     Merge    Roundabout    Intersection   ACC    Circle   Overall

                SPOM PER (ours)       0.98      0.94        1.04          0.68       1.07    0.96     0.95

                SPOM (ours)           0.88      0.95        0.34          0.96       0.87    0.37     0.73

                SafeQ                 0.73      0.84        0.54          0.75       0.50    0.15     0.59

                Recovery              0.34      0.66        0.69          0.66       0.85    0.25     0.58

                RCDQN                 0.41      0.81        0.41          0.57       0.46    0.14     0.47

                RewsDQN               0.33      0.92        0.41          0.50       0.47    0.11     0.46

                DQN                   0.37      0.56        0.41          0.58       0.46    0.13     0.42

                RESPO                 0.06      0.09        0.09          0.11       0.06    0.01     0.07

                PPOLag                0.06      0.03        0.13          0.11       0.11    0.02     0.08









C.2.2. H YPERPARAMETERS

Network Architectures. In Roundabout and Intersection, to deal with the kinetics type of state, which contains a list of

features about nearby vehicles, we use the ego-attention-based architecture proposed by Leurent & Mercat (2019), which

can handle the permutation of the list input and thus is suitable for these two tasks.

In TwoWay and Merge, we use two-layer multi-layer perceptron (MLP) networks, with hidden layer of size 128. In ACC

and Circle, we also use two-layer MLP, with 256 hidden units.

Parameter Settings for DQN-based Algorithms. The exploration strategy is unified to be ϵ-greedy. In highway-env, we

use replay buffers of size 15000 and hard update for target networks with hard update interval 512, following the default

configuration in Leurent & Mercat (2019); while in ACC and Circle, we use the replay buffers of size 105 and soft update

with soft update coefficient 5 · 10−3 and interval 1, to ensure stable and fast learning. Other hyperparameters are unified

across tasks and can be found in Table 2.

Parameter Settings for PPO-based Algorithms. According to Ganai et al. (2023), RESPO should maintain that the

Lagrange multiplier learning < the REF learning rate < the actor and critic learning rates, in order to ensure a stable

convergence to a local optimum, and so we use their default parameters. For PPOLag, the Lagrange multiplier learning rate

is set to be larger than that of RESPO, to bias more towards constraint violation in the original primal-dual formulation.

The detailed hyperparameters are listed in Table 3.



C.3. Full Results

C.3.1. M AIN E XPERIMENTS

The full training curves of all baselines (DQN-based and PPO-based) and SPOM, SPOM PER are provided in Figure 6

and 7. We find that RESPO and PPOLag fail to optimize under our environments since the cost signal corresponding to a

crash is very sparse. The full SWU scores are presented in Table 4, where SPOM PER achieves the highest overall SWU

score of 0.90, and SPOM secures the second-best score of 0.79. Both algorithms demonstrate significant improvement over

baselines, with SPOM PER achieving over 50% improvement compared to most baselines.

                                                                       1

We also list the average crash rates and episode rewards over the last 10 training steps and all random seeds, per algorithm

and per task, in Table 5. SPOM PER along with SPOM achieves the lowest or one of the lowest crash rates across almost

all tasks while maintaining competitive or superior episode rewards.

Comparison with direct ε-masking approach SafeQ: Across all tasks, SPOM PER and SPOM outperform SafeQ both in

terms of crash rates and rewards. This again validates our insight that a state-agnostic masking threshold is not enough to

ensure maximal safety.

Comparison with action-correction-based method Recovery: In ACC, SPOM PER achieves the best SWU score of 1.07,

outperforming Recovery, which sacrifices rewards to reduce crash rates. Similarly, in Circle, SPOM PER and SPOM

achieve significantly lower crash rates than Recovery while maintaining higher rewards. In Intersection, Recovery trains to

be safe faster but converges to lower rewards compared to SPOM PER. For other tasks, SPOM PER and SPOM achieve a

better trade-off between safety and rewards while being safer than Recovery.



                                                            20

