New Unit Dot Product Similarity Method and Parallelized Greedy Soup Algorithm in The End-to-end Automatic Speech Recognition

Wei Liu, Zifan Wang, Yiming Sun, Chunyi ChenResearch Square 2024

Abstract

This paper introduces a novel similarity calculation method, called unit dot product similarity method. The proposed method restricts the denominator by the sum of vector modulus. Compared with traditional dot product similarity calculation method, the proposed method can maintain the similarity of equally scaled vector and obtain the bounded similarity result. We develop and compare the proposed method in the attention-based encoder decoder structure. The proposed method brings the recognition results further improvement. For the end-to-end speech recognition model, we select greedy soup instead of the average model parameters in WeNet. A dynamic parallel greedy soup optimization algorithm is proposed to increase computational speed. The experiments show the importance of proposed method and optimization algorithm. The effectiveness is also proved on multiple corpora.

Introduction

In modern End-to-End (E2E) Automatic Speech Recognition (ASR), Transformer and Conformer architectures have become the standard, largely due to their effective self-attention mechanisms. However, standard dot-product similarity exhibits a significant limitation: it is sensitive to the scale of the vectors. If two vectors are scaled by the same ratio, their similarity score changes, despite their relative angular relationship remaining constant. This scale-dependence can lead to numerical instability and suboptimal similarity judgments during training.

Vector relationship illustrating the angle theta between vectors a and b.

Furthermore, while "model averaging" (e.g., Greedy Soup) is a common technique to enhance ASR performance by selectively averaging weights from top-performing epochs, the traditional sequential approach is computationally expensive and slow, creating a bottleneck in large-scale model development.

Methodology

Unit Dot Product Similarity (UDPS)

To address the scale-sensitivity of standard attention, we propose Unit Dot Product Similarity (UDPS). The core idea is to ensure that the similarity metric is bounded and invariant to equal scaling of the query and key vectors. The proposed metric is defined as:

$$S = 4 \cdot \frac{q_i k_j^T}{(|q_i| + |k_j|)^2}$$

By normalizing the dot product by the square of the sum of the vector magnitudes, the result is strictly bounded between [-1, 1]. This approach focuses on the directional relationship between vectors, ensuring that the model's attention remains robust regardless of fluctuations in vector magnitude.

Illustration of unitized and restored vector representations used in the UDPS method.

Parallelized Greedy Soup

To optimize the model selection process, we introduce a Parallelized Greedy Soup algorithm. Unlike the traditional sequential method that evaluates one model at a time, our approach utilizes a "look-ahead" mechanism ($num\_look=N$). The algorithm generates and evaluates multiple combinations of the current parameter "soup" plus the next $N$ candidate models in parallel. This significantly improves GPU utilization and accelerates the identification of the optimal parameter set.

Experimental Results

The proposed methods were validated across three Mandarin Chinese benchmarks: AISHELL-1, WenetSpeech-S (100 hours), and WenetSpeech-L (10,000 hours).

  • Accuracy: On AISHELL-1, the UDPS method achieved a Word Error Rate (WER) of 4.062%, which improved to 4.053% when combined with Greedy Soup, outperforming standard Conformer baselines.
  • Efficiency: The Parallelized Greedy Soup algorithm demonstrated a 1.585x speedup on the WenetSpeech-L dataset compared to the sequential baseline, reducing the processing time from 72 minutes to approximately 45 minutes.
  • Amodal Asymmetry: An important finding was that while UDPS significantly improves encoder performance, it is less effective in the decoder. This is likely because the decoder's cross-attention maps disparate data types (text queries to voice keys), where strict scale-invariance may hinder the mapping process.

Conclusion

This work presents two key innovations for E2E ASR: a scale-invariant UDPS attention mechanism and a parallelized optimization for model averaging. UDPS provides a more robust similarity metric for feature extraction in the encoder, while the parallelized Greedy Soup algorithm offers a practical solution for scaling model selection to massive datasets. Future research will investigate adapting UDPS for cross-modal attention in decoders.

Summary updated

Abstract

<title>Abstract</title> This paper introduces a novel similarity calculation method, called unit dot product similarity method. The proposed method restricts the denominator by the sum of vector modulus. Compared with traditional dot product similarity calculation method, the proposed method can maintain the similarity of equally scaled vector and obtain the bounded similarity result. We develop and compare the proposed method in the attention-based encoder decoder structure. The proposed method brings the recognition results further improvement. For the end-to-end speech recognition model, we select greedy soup instead of the average model parameters in WeNet. A dynamic parallel greedy soup optimization algorithm is proposed to increase computational speed. The experiments show the importance of proposed method and optimization algorithm. The effectiveness is also proved on multiple corpora.
BibTeX
@inproceedings{liu2024new,
  author = {Wei Liu and Zifan Wang and Yiming Sun and Chunyi Chen},
  title = {{New Unit Dot Product Similarity Method and Parallelized Greedy Soup Algorithm in The End-to-end Automatic Speech Recognition}},
  booktitle = {Research Square},
  year = {2024},
  doi = {10.21203/rs.3.rs-4431357/v1},
}
Figure