Abstract
This paper introduces a "contextual block processing" method that enables Transformer-based speech recognition to work in streaming (online) mode without losing vital global information. By passing a "context inheritance" vector from one audio block to the next, the model maintains high accuracy—significantly outperforming naive chunking methods and approaching the performance of full-sequence models.
Introduction
The Transformer architecture has revolutionized Automatic Speech Recognition (ASR) due to its ability to model long-range dependencies through self-attention. However, standard Transformers face two major challenges for real-world applications like live captioning: high latency, as they require the entire audio utterance before processing, and quadratic computational complexity relative to input length.
While "block processing" (dividing audio into small chunks) can mitigate these issues, it often leads to a significant drop in accuracy. Speech signals contain global attributes—such as speaker characteristics, channel noise, and long-range linguistic context—that are lost when processing isolated segments. This work proposes a novel framework to maintain this context in a streaming setting.
Proposed Methodology
The authors propose a Contextual Block Processing framework for the Transformer encoder to bridge the gap between streaming efficiency and global context awareness.
Architecture Overview
The system utilizes a modified Transformer architecture. The encoder incorporates convolutional layers for initial feature extraction followed by a series of encoder layers ($N_e$). The decoder follows a standard structure with character embeddings and positional encodings.
Contextual Block Processing and Inheritance
The core innovation lies in how blocks are processed and how information is shared across them:
- Block Encoding: Input audio is divided into overlapping blocks (e.g., 16 frames long with an 8-frame hop).
- Context Inheritance: To prevent global information loss, a context embedding vector is introduced. This vector is computed at each layer of a block and passed to the corresponding layer of the subsequent block.
- Recursive Context: This layer-by-layer and block-by-block passing mechanism allows deep layers to inherit a distilled summary of all previous blocks. For instance, the 10th block's deep layers can integrate information from several seconds prior.
Efficient Training and Initialization
To maintain training efficiency, the authors developed a novel masking technique that allows for parallel training while simulating sequential block-wise flow. They also explored various initialization strategies for the context vector, finding that a combination of Positional Encoding (PE) and the average of the current block's inputs provided the best performance by balancing local summaries with sequence positioning.
Experimental Results
The model was evaluated on four diverse datasets: Wall Street Journal (WSJ), LibriSpeech (960 hours), VoxForge Italian, and AISHELL-1 (Mandarin).
Performance Comparison
The proposed method consistently outperformed naive block processing and closely approached the performance of "offline" (batch) Transformers. On the WSJ dataset, Contextual Block Processing achieved a 5.7% Word Error Rate (WER), a significant improvement over the 7.5% WER of naive chunking and nearing the 5.0% WER of the offline baseline. On LibriSpeech (Clean), the method reached 4.6% WER, nearly matching the offline baseline of 4.5%.
Key Insights
- Attention Shift: Analysis of attention weights revealed that deeper layers rely more heavily on the context vector. While early layers focus on local audio frames, by the 10th layer, the model shifts attention toward the inherited context to integrate long-range information.
- Robustness: The consistent gains across different languages (English, Italian, Mandarin) demonstrate that the inheritance mechanism effectively captures robust acoustic and linguistic features.
Conclusion and Future Work
Contextual block processing enables streaming Transformer ASR with minimal accuracy loss. While the encoder is now optimized for online processing, the current decoder still processes entire utterances. Future work will focus on adapting the decoder for full end-to-end streaming and further investigating the computational overhead and real-world deployment delays.
Summary updated