Hydraformer: One Encoder for All Subsampling Rates

Yaoxun Xu, Xingchen Song, Zhiyong Wu, Di Wu, Zhendong Peng, Binbin Zhang

In the domain of Automatic Speech Recognition (ASR), balancing recognition accuracy with computational efficiency is a persistent challenge. Cloud-based systems typically prioritize low Word Error Rates (WER), while edge devices, such as smartwatches or automotive systems, require high speed and low Real-Time Factors (RTF). Traditionally, meeting these diverse requirements necessitated training and deploying separate models for each specific "subsampling rate."

HydraFormer introduces a unified architecture designed to handle multiple subsampling rates simultaneously within a single shared encoder, maintaining performance parity with specialized models while drastically reducing maintenance and deployment overhead.

The Challenge of Fixed Subsampling

Subsampling is a standard technique used to reduce the length of audio feature sequences, thereby decreasing memory consumption and increasing inference speed. However, most current ASR research relies on a fixed subsampling rate. This approach presents several drawbacks:

  1. Deployment Complexity: Supporting multiple hardware profiles requires training, storing, and updating $N$ different models.
  2. Scenario Mismatch: A rate optimized for high-end servers may be prohibitively slow for edge devices.
  3. Information Loss: Naive methods like dynamic frame dropping often discard critical acoustic information, leading to degraded performance.

The HydraFormer Architecture

HydraFormer addresses these issues by decoupling the subsampling process from the main encoder logic. The architecture consists of three primary components: a multi-branch front-end (HydraSub), a shared Conformer-based encoder, and a shared BiTransformer-based decoder.

Comparison between traditional single-rate models and the unified HydraFormer architecture.

HydraSub and Dynamic Training

The core innovation is the HydraSub module, which contains parallel convolutional branches. Each branch is tailored for a specific subsampling factor (e.g., $n \in \{4, 6, 8\}$). During inference, the appropriate branch is selected based on the target device's constraints.

Detailed view of the HydraSub module and the overall ASR pipeline.

To ensure the shared encoder learns a generalized representation, the authors employ a Dynamic Training strategy. For each training batch, the model randomly activates only one branch. Forward and backward passes are performed exclusively through that branch and the shared backbone, forcing the encoder to become robust to varying temporal scales.

Key Insights

  • Positional Encoding Sensitivity: A significant finding was that omitting positional encoding within the HydraSub module improved performance. The authors suggest that because different subsampling rates alter the temporal scale, fixed positional encodings can introduce confusion regarding the encoder's perception of time.
  • Parameter Convergence: Visualization via t-SNE indicates that HydraFormer’s internal parameters migrate toward the intersection of where individual single-rate models would reside, effectively learning a "common denominator" of speech features across scales.
  • Transfer Learning Compatibility: HydraFormer can be successfully initialized or fine-tuned from existing single-rate models, facilitating an easy upgrade path for established ASR pipelines.

Experimental Results

The researchers evaluated HydraFormer on the AISHELL-1 (Mandarin) and LibriSpeech (English) benchmarks. Key results include:

  • Efficiency: Training cost is reduced to approximately $1/N$ compared to training $N$ separate models.
  • Accuracy Parity: On AISHELL-1, HydraFormer achieved a WER of 4.99% at a 1/4 subsampling rate, matching the specialized baseline of 5.00%.
  • Speed Gains: Higher subsampling rates yielded significant RTF improvements. At a 1/8 rate, the non-streaming RTF dropped to 0.087, compared to 0.114 at the 1/4 rate, all within the same model file.

Conclusion

HydraFormer demonstrates that a single, unified encoder can effectively serve multiple subsampling rates without sacrificing accuracy. By consolidating multiple models into one, it offers a scalable solution for deploying ASR across a wide spectrum of hardware, from high-performance servers to resource-constrained edge devices. Future work may explore truly continuous dynamic subsampling and the application of this "Hydra" approach to other architectures like Zipformer.

Summary updated

BibTeX
@inproceedings{xu2024hydraformer,
  author = {Yaoxun Xu and Xingchen Song and Zhiyong Wu and Di Wu and Zhendong Peng and Binbin Zhang},
  title = {{Hydraformer: One Encoder for All Subsampling Rates}},
  booktitle = {ICME},
  year = {2024},
  url = {https://openreview.net/forum?id=DyDfdskbnY},
}
Figure