## 3 Dpd3 qn
### Priority Experience Replay
#### 3.2.3 Dual Priority Calculation  
Based on the TD error priority and the segment sampling priority, a comprehensive priority is calculated--that is, a dual priority. For each sample \(i\), its comprehensive priority \(P_{i}\) can be calculated by combining the TD error priority and the segment weight. The comprehensive priority can be expressed as Equation (23):  
\[P(i)=\delta\cdot P_{\text{TD}}(i)+\eta\cdot(w_{\text{position}}(s(i))+w_{\text {speed}}(s(i))) \tag{23}\]  
where \(P_{\text{TD}}(i)\) is the TD error priority of sample \(i\), \(w_{\text{position}}(s(i)\) and \(w_{\text{speed}}(s(i))\) are the weights of the position information and velocity information segments to which the sample belongs, respectively, and \(\delta\) and \(\eta\) are hyperparameters that control the influence of their respective weights. Based on the dual priority \(P(i)\), we then perform weighted sampling to ensure that the model can pay more attention to important samples. Specifically, the sampling probability of sample \(i\) can be determined by the following Equation (24):  
\[P(s(i)=k)=\frac{P_{i}}{\sum\limits_{j}P_{j}} \tag{24}\]  
where the numerator \(P_{i}\) is the comprehensive priority of sample \(i\) and the denominator \(\sum\limits_{j}P_{j}\) is the sum of the comprehensive priorities of all samples. Thus, the likelihood of sample \(i\) being selected is proportional to its overall priority. It is important to note that \(\alpha+\beta\) is not strictly constrained to equal 1. This design provides greater flexibility, allowing the relative importance of TD error and segment-based priority to be dynamically adjusted during different training stages. For example, in the early stages of training, when the model has not yet learned an effective policy and the TD error tends to fluctuate significantly, a higher \(\alpha\) can be used to emphasize learning from large-value errors and accelerate policy correction. In contrast, during the later stages--when the policy becomes more stable--\(\beta\) can be increased to direct the model's attention to rare but critical driving scenarios, such as high-speed lane changes or emergency braking. This helps improve the generalization and real-world adaptability of the learned policy. Moreover, since both the TD error and the segment weights are not inherently bounded, the combined priority value \(P_{i}\) may theoretically exceed 1. To address this, we apply a normalization process during the sampling stage by dividing each priority by the total priority sum \(\sum\limits_{j}P_{j}\), resulting in the normalized sampling probability. This ensures that each sample is selected according to its relative importance, regardless of the absolute value. At the same time, it prevents high-priority samples from dominating the training process, thereby reducing the risk of overfitting or biased learning. This approach not only maintains training efficiency but also enhances the model's ability to learn from diverse types of scenarios with increased robustness. By adjusting \(\alpha\) and \(\beta\), researchers and developers can fine-tune the training process based on specific task demands and environmental complexities. In future versions, we also plan to include a schematic illustration and a numerical example to further improve the transparency and interpretability of the dual-priority formula. A simple calculation example is added in this section to enhance the understanding of the formula, as shown in Table 1.  
This example clearly demonstrates how to combine the TD error and semantic segment weights to compute the comprehensive priority and normalize it into a sampling probability.