## 3 Materials and Methods
### Decoding Algorithms  
The commonly used decoding methods include attention decoding, CTC greedy search, and CTC prefix beam search. The attention decoding algorithm decodes the input sequence using an autoregressive search method, calculating context vectors and weights at each step while considering all previously generated words, thereby ensuring high accuracy. However, this method has high computational complexity and consumes significant resources. In contrast, the CTC greedy search method selects the most likely character at each step, which is efficient but less accurate in complex scenarios. The CTC prefix beam search improves upon greedy search by retaining multiple likely prefix paths at each step, calculating the total probability for each prefix to select the best path. Although this increases accuracy, it also consumes more memory and computational resources. These traditional methods each have their strengths and weaknesses, but they often struggle to balance accuracy and computational efficiency when dealing with complex speech signals. To overcome these limitations and enhance the model's generalization ability and decoding performance, we propose an adaptive attention fusion rescoring method (AAF rescoring). This approach combines nonlinear function connections and a penalty mechanism to rescore the outputs of decoders. The specific process is illustrated in Figure 7.  
First, the CTC prefix beam search is used to perform an initial decoding of the speech input, generating potential candidate decoding results. Although CTC prefix beam search may lack precision when handling complex backgrounds, it provides an efficient initial decoding outcome that serves as a foundation for subsequent processing. Next, attention beam search is applied to further process the candidate results generated by the CTC. Nonlinear functions are employed to connect these candidate paths, resulting in richer decoding outputs. This method enhances the accuracy and flexibility of the decoding process while preserving global contextual information. Additionally, it significantly improves recognition accuracy and reduces the required computational resources. Finally, a penalty mechanism is introduced to rescore the newly generated decoding results. The penalty mechanism limits the weights to prevent the model from becoming overly dependent on the output of a single decoder, thereby enhancing the model's robustness. The specific formula is as follows:  
Figure 6: Model fusion process. \[S_{combined}^{AFF} =\sigma(\omega_{r})\cdot\log P_{att}(y_{t}\mid y_{<t},x)+\sigma( \omega_{c})\cdot\log P_{CTC}(y_{t}\mid x) \tag{11}\] \[-\lambda\cdot\left(\sigma(\omega_{r})^{2}+\sigma(\omega_{c})^{2}\right)\]  
where \(P_{att}(y_{t}\mid y_{<t},x)\) represents the output of the attention-based decoder, indicating the conditional probability of generating the current output given the previous outputs and the input \(x\); \(P_{CTC}(y_{t}\mid x)\) represents the output of the CTC decoder, indicating the probability of generating the current output given the entire sequence \(x;\sigma()\) denotes the nonlinear activation function, with the sigmoid function being used in this context. \(\lambda\) is a regularization coefficient used to penalize excessively large weight values, limiting the model's tendency to rely heavily on the output of a single decoder, thereby enhancing the model's robustness. In summary, the adaptive dynamic rescoring decoding algorithm proposed in this paper introduces improvements in three key ways: First, we effectively integrate the CTC and attention decoding methods, leveraging the efficiency of CTC and the high accuracy of attention through an adaptive dynamic rescoring mechanism. This combination significantly improves recognition accuracy and computational efficiency, allowing for more precise identification and analysis of features in diverse and uncertain audio signals.