## 2 Methods
### Branchformer Block
#### 2.2.3 Merge Module  
To fully utilize the local and global information extracted from different branches, we explored various combination modules. The specific structures of each module are illustrated in Figure 2, and detailed introductions of each module are provided below:  
1. **Add Merge Module:** The method assigns corresponding weights to each branch and adds them together. The calculation process is as follows: \[Y_{Merge}=w_{g}Y_{global}+w_{l}Y_{local},\] (6) where \(w_{g},w_{l}\in R\) are the global and the local branch weights, respectively. This method is advantageous because it is easy to implement and has low model complexity. Additionally, we can choose appropriate weights for each branch. However, its drawbacks are also apparent. It requires the manual setting of weights, and the suitable values for these weights are unknown, necessitating multiple experiments to determine them. In this paper, we set the weights for both branches to 1. 2. **Concat Merge Module:** The Concat merge module simply concatenates two outputs \(Y_{global}\) and \(Y_{local}\) and then applies a linear projection to decrease the dimension back to d: \[Y_{Merge}=Concat(Y_{global},Y_{local})W,\] (7) where \(W\in R^{2d*d}\) is the linear projection trainable weights. 3. **Depth-wise Convolution Merge Module:** We introduce a deep-wise convolution fusion module to consider adjacent features when two branches of information converge. It should be noted that deep-wise convolution is less computational and has little effect on the speed of the model. We believe that using nearby information can improve the fusion of two branches, similar to Inception Transformer [37]. Therefore, we use deep convolution to realize the exchange of spatial information (as shown in Figure 2c). The specific implementation process is as follows: \[Y_{c}=Concat(Y_{global}+Y_{local}),\] (8) \[Y_{d}=DwConv(Y_{c}),\] (9) \[Y_{merge}=(Y_{c}+Y_{d})W,\] (10)where \(DwConv\) stands for the depth-wise convolution and \(W\in R^{2d*d}\) is the linear projection trainable weights. \(Y_{c}\) is the feature vector obtained by concatenating global branches and local branches. \(Y_{d}\) represents the feature vector obtained after deep convolution. \(Y_{Merge}\) represents the final output obtained after the fusion module. 4. **Attention Merge Module:** We consider that the input representations corresponding to certain input timesteps may be unique, and not as crucial for distinguishing languages as other input timesteps. Therefore, we developed an attention fusion module that focuses on prominent timesteps in the input. This module is inspired by human physiological perception of the environment. When humans process information, they naturally filter out less relevant information and focus on the information of interest. We hope that the attention module we set up can dynamically select the more critical timesteps and allocate larger weights to them while allocating fewer weights to the timesteps irrelevant to language identification. Through this approach, the model can focus on learning useful information and ignore irrelevant information to avoid its impact on model performance. The specific implementation process is as follows: \[Y_{a}=Softmax(Y_{c})Y_{c},\] (11) \[[AB]=Split(Y_{a}),\] (12) \[Y_{merge}=Dropout(A+B),\] (13)  
The softmax function computes weights for each speech frame in \(Y_{c}\). \(Y_{a}\) is the feature vector obtained by multiplying each speech frame with its corresponding weight. The split operation transforms vector \(Y_{a}\in R^{T*2d}\) to \(A\in R^{T*d}\) and \(B\in R^{T*d}\), where T represents the length of speech frames and d represents the dimensionality of the speech. Finally, the output of the fusion module is obtained after applying dropout. 5. **Gated Merge Module:** The gate fusion module utilizes multiplicative gates to control the flow of information between local and global information. The inspiration for this idea comes from the flow control mechanism in recurrent neural networks.