Speech-Mamba: Long-Context Speech Recognition with Selective State Spaces Models

Xiaoxue Gao, Nancy F. Chen

Abstract

Traditional Automatic Speech Recognition (ASR) systems based on the Transformer architecture face significant computational challenges when processing long-form audio due to the quadratic complexity of self-attention. This paper introduces Speech-Mamba, a novel end-to-end architecture that integrates Selective State Space Models (Mamba) into a hybrid Transformer framework. By leveraging Mamba’s linear scaling properties, Speech-Mamba maintains high accuracy and computational efficiency on long-duration sequences where standard Transformers typically fail. Our results demonstrate that Speech-Mamba significantly outperforms much larger models, including Whisper-Large-V3 and Gemini 1.5 Pro, on long-context benchmarks while utilizing a fraction of the parameters.

1. Introduction

The dominance of the Transformer architecture in ASR is largely due to its ability to model complex dependencies through the attention mechanism. However, the computational cost of Transformers grows quadratically ($L^2$) with the input sequence length ($L$). This "quadratic complexity barrier" makes the transcription of long-form audio—such as hour-long lectures, podcasts, or corporate meetings—prohibitively expensive in terms of both memory and time.

While State Space Models (SSMs) like S4 have been proposed as linear-time alternatives, they often lack the "selectivity" required to focus on specific acoustic cues within noisy or complex signals. Speech-Mamba addresses this by incorporating the Mamba architecture, a selective SSM that allows the model to dynamically propagate or forget information based on the input, effectively mimicking the filtering capabilities of attention with linear complexity.

2. Methodology

Speech-Mamba utilizes a hybrid design that combines the local feature extraction strengths of Transformers with the long-range modeling efficiency of Mamba.

2.1 Hybrid Architecture

The core of the model consists of specialized Encoder and Decoder blocks. Rather than replacing attention entirely, the architecture wraps Mamba layers around traditional attention mechanisms. A typical block includes:

  • Mamba Layers: Positioned at the beginning and end of the block to handle sequence-wide dependencies.
  • Attention Mechanisms: Multi-Head Attention (RMS-ATT in the encoder and RMS-STA in the decoder) is used to capture local acoustic nuances.
  • Normalization: RMSNorm is applied to stabilize training across deep layers.

2.2 Selective Mechanism and Learning Objective

Unlike static SSMs, Mamba’s selective mechanism is input-dependent, allowing the model to prioritize relevant speech segments. To ensure robust performance, the model is trained using a joint multi-objective loss function: $$L_{total} = \lambda L_{CTC} + (1 - \lambda) L_{S2S}$$ This combination of Connectionist Temporal Classification (CTC) and Sequence-to-Sequence (S2S) losses ensures the model learns both precise monotonic alignment and deep linguistic context.

3. Experimental Setup

The researchers evaluated Speech-Mamba using the LibriSpeech corpus, focusing on both standard and extended contexts.

  • Standard Benchmarks: Performance was first verified on the 100-hour and 960-hour subsets.
  • Long-Context Subsets (L-subsets): To specifically test long-range capabilities, the authors curated new test sets (e.g., dev-clean-L) by merging utterances from the same speaker into continuous sequences lasting 45 to 60 seconds.
  • Extended Stress Tests: The limits were further pushed using synthetic test sets with audio durations ranging from 70 to 100 seconds.

4. Results and Discussion

4.1 Overcoming the Performance Collapse

The most striking finding was the stability of Speech-Mamba compared to traditional Transformers. On standard short clips, both architectures perform similarly. However, as audio length exceeds 45 seconds, the Transformer's performance collapses—with Word Error Rates (WER) jumping from approximately 6% to 48%. In contrast, Speech-Mamba remains stable, achieving a 7.71% WER on the test-clean-L set, representing a relative improvement of over 84%.

4.2 Efficiency and Scaling

Speech-Mamba demonstrates remarkable parameter efficiency. With only 67.6M parameters, it outperformed Whisper-Large-V3 (1550M parameters) on long-context LibriSpeech tasks. Even when compared against massive proprietary models like Gemini 1.5 Pro, Speech-Mamba maintained superior performance on several long-context subsets despite being trained on significantly less data.

In extreme stress tests involving 100-second audio clips, Speech-Mamba maintained a WER of 10.74%, while the Transformer baseline ballooned to 67.87%.

5. Conclusion and Future Work

Speech-Mamba proves that architectural efficiency can be more critical than sheer scale for long-context tasks. By integrating selective SSMs, the model achieves near-linear scaling without sacrificing the accuracy provided by attention mechanisms.

Future research will focus on expanding the model's capabilities to multi-lingual datasets and diverse acoustic environments. Additionally, the authors aim to investigate whether a "pure" Mamba architecture can eventually replace the hybrid model entirely without losing the ability to model lower-level acoustic representations.

Summary updated

BibTeX
@inproceedings{gao2024speech,
  author = {Xiaoxue Gao and Nancy F. Chen},
  title = {{Speech-Mamba: Long-Context Speech Recognition with Selective State Spaces Models}},
  booktitle = {SLT},
  year = {2024},
  doi = {10.1109/slt61566.2024.10832137},
}
Figure