Accelerating Transducers through Adjacent Token Merging

Yuang Li, Yu Wu, Jinyu Li, Shujie Liu

Abstract

Modern Automatic Speech Recognition (ASR) systems rely on Transformer encoders that process high-frequency speech signals, leading to quadratic computational complexity relative to sequence length. This paper presents Adjacent Token Merging (A-ToMe), a novel technique that adaptively reduces the number of tokens by merging similar neighboring acoustic frames. A-ToMe achieves up to a 70% boost in GPU inference speed and a 57% reduction in token count with negligible impact on Word Error Rate (WER).

Introduction

Transformer-based architectures have become the standard for ASR. However, their self-attention mechanism's $O(L^2)$ complexity poses a significant challenge for long-form audio processing. While speech signals are high-frequency, they contain substantial redundancy, as adjacent frames often represent the same acoustic information. Traditional fixed-rate subsampling methods lack the flexibility to account for varying phoneme durations. A-ToMe addresses this by providing an adaptive, order-preserving token reduction strategy.

Adjacent Token Merging (A-ToMe)

A-ToMe is inspired by token merging techniques in computer vision but is specifically tailored for the sequential nature of audio. It operates within the Transformer layer, between the Multi-Head Self-Attention (MHSA) and Feed-Forward Network (FFN) blocks.

Overview of the A-ToMe module showing (a) the internal similarity-based merging process and (b) the gradual reduction across multiple layers.

Mechanism

The process involves three main steps:

  1. Similarity Scoring: The cosine similarity between the Key vectors of adjacent tokens is calculated.
  2. Merging: Tokens with similarity scores exceeding a threshold (or those within a top percentage) are merged via feature averaging.
  3. Stacking: By placing A-ToMe modules in successive layers, the model gradually thins the sequence. This allows early layers to capture fine-grained details while deeper layers handle more abstract, high-level representations.

Two primary control strategies are employed: a Fixed Merge Ratio, which ensures predictable speedups, and a Fixed Merge Threshold, which allows for truly adaptive token reduction based on the acoustic content.

Experimental Evaluation

The method was evaluated on the LibriSpeech dataset (960 hours). Performance was measured across standard test sets and in long-form ASR scenarios where multiple utterances are concatenated to provide more context.

Key Results and Discussion

A-ToMe demonstrates significant efficiency gains across hardware platforms. On GPUs, it provides a 70% relative inference speedup. On single-core CPUs, the speedup is approximately 35%.

End-to-end latency comparison on CPU, showing the reduction in latency achieved by merging history and merging all tokens compared to the baseline.

Efficiency and Accuracy

The approach successfully reduces token counts by 57% while maintaining a WER comparable to the baseline. Notably, A-ToMe outperforms traditional convolutional subsampling at equivalent reduction rates, highlighting the benefits of adaptive merging.

Temporal Integrity

A critical finding is that restricting merging to adjacent tokens preserves the temporal order essential for ASR. Unlike global token merging, A-ToMe ensures that the sequential structure of speech is maintained throughout the encoder. Furthermore, the method requires zero extra parameters, as it utilizes existing Key vectors for similarity computation.

Conclusion and Future Work

A-ToMe offers a lightweight, parameter-free solution for accelerating Transformer-based ASR. It provides on-demand flexibility, allowing for a trade-off between accuracy and speed at inference time without retraining. While currently focused on non-streaming ASR, future work will explore adaptations for streaming architectures and more sophisticated merging functions to further enhance performance on edge devices.

Summary updated

BibTeX
@inproceedings{li2023accelerating,
  author = {Yuang Li and Yu Wu and Jinyu Li and Shujie Liu},
  title = {{Accelerating Transducers through Adjacent Token Merging}},
  booktitle = {Interspeech},
  year = {2023},
  doi = {10.21437/interspeech.2023-599},
}
Figure