Audio Mamba: Bidirectional State Space Model for Audio Representation Learning

Mehmet Hamza Erol, Arda Senocak, Jiu Feng, Joon Son Chung

Abstract

Audio Mamba (AuM) is the first purely State Space Model (SSM)-based architecture designed for audio classification, eliminating the need for self-attention. By leveraging the linear scaling properties of the Mamba block, AuM addresses the quadratic computational bottleneck inherent in the widely used Audio Spectrogram Transformer (AST). Through a bidirectional processing approach and strategic classification token placement, AuM achieves state-of-the-art performance across multiple audio benchmarks. Experimental results demonstrate that AuM is significantly more memory-efficient and faster than AST, especially as audio sequence lengths increase, enabling the processing of much longer audio clips on standard hardware.

Introduction

In audio representation learning, the Audio Spectrogram Transformer (AST) has established itself as the standard. However, the self-attention mechanism at its core suffers from quadratic complexity ($O(n^2)$) relative to the input sequence length. This limitation makes high-resolution or long-duration audio processing computationally prohibitive. While State Space Models (SSMs) like Mamba have recently revolutionized language and vision tasks by offering linear scaling ($O(n)$), their application to audio remained unexplored. This paper introduces Audio Mamba (AuM), a high-performing model entirely free of self-attention.

Methodology

AuM adopts a patch-based pipeline similar to vision transformers but replaces the attention layers with bidirectional SSM blocks.

  1. Patchification & Embedding: Audio spectrograms are treated like images and divided into a sequence of square patches. These are flattened and projected into a high-dimensional space, with learnable positional embeddings added to maintain temporal and frequency information.
  2. Middle CLS Token: Unlike traditional models that prepend a classification (CLS) token at the start, AuM places it in the middle of the sequence. This strategic choice allows the model to better aggregate context from both directions in its non-causal architecture.
  3. Bidirectional SSM Encoder: The core engine consists of a stack of Mamba blocks. Since audio spectrograms contain global dependencies across time and frequency, a bidirectional scan is employed. The model processes the sequence in both forward and backward directions to capture global context effectively, proving that the quadratic cost of self-attention is not a requirement for high performance.
The Audio Mamba (AuM) architecture, featuring patchification, a middle CLS token, and bidirectional SSM blocks.

Experimental Results

AuM was rigorously evaluated across six diverse benchmarks, including AudioSet, VGGSound, and Speech Commands V2. When trained from scratch (without ImageNet pre-training), AuM-B/16 outperformed AST-B/16 on almost every dataset, notably gaining +3.33 mAP on AudioSet and +6.32% accuracy on Speech Commands V2.

The primary advantage of AuM lies in its efficiency at scale. As shown in the scaling analysis, AuM maintains linear growth in memory and time consumption, whereas AST quickly encounters Out-of-Memory (OoM) errors. For instance, AuM-Base can be trained on 80-second audio clips, whereas AST-Base runs out of memory at just 20 seconds on the same hardware. During inference, AuM is approximately 1.6x faster than AST when processing sequences of 4096 tokens.

Comparison of memory consumption and inference time between AuM and AST across varying sequence lengths.

Discussion and Conclusion

Audio Mamba demonstrates that SSMs are a viable and highly efficient alternative to Transformers for audio representation learning. While the model is more sensitive to architectural choices—such as CLS token position and Conv1D directions—than Transformers, its scaling benefits are undeniable.

A current limitation is the "pre-training gap," as the Mamba ecosystem lacks the massive pre-trained weights available for Vision Transformers. However, the authors suggest that future work in Self-Supervised Learning (SSL), such as creating an "Audio Masked Autoencoder" based on Mamba, could further close this gap and solidify AuM as a foundational architecture for audio AI.

Summary updated

BibTeX
@article{erol2024audio,
  author = {Mehmet Hamza Erol and Arda Senocak and Jiu Feng and Joon Son Chung},
  title = {{Audio Mamba: Bidirectional State Space Model for Audio Representation Learning}},
  journal = {IEEE Signal Processing Letters},
  year = {2024},
  doi = {10.1109/lsp.2024.3483009},
}
Figure