MAE-AST: Masked Autoencoding Audio Spectrogram Transformer

Alan Baade, Puyuan Peng, David Harwath

Abstract

In this paper, we propose a simple yet powerful improvement over the recent Self-Supervised Audio Spectrogram Transformer (SSAST) model for speech and audio classification. Specifically, we leverage the insight that the SSAST uses a very high masking ratio (75%) during pretraining, meaning that the vast majority of self-attention compute is performed on mask tokens. We address this by integrating the encoder-decoder architecture from Masked Autoencoders are Scalable Vision Learners (MAE) into the SSAST, where a deep encoder operates on only unmasked input, and a shallow decoder operates on encoder outputs and mask tokens. We find that MAE-like pretraining can provide a 3x speedup and 2x memory usage reduction over the vanilla SSAST using current audio pretraining strategies with ordinary model and input sizes. When fine-tuning on downstream tasks, which only uses the encoder, we find that our approach outperforms the SSAST on a variety of downstream tasks. We further conduct comprehensive evaluations into different strategies of pretraining and explore differences in MAE-style pretraining between the visual and audio domains.

Introduction

Transformer models have revolutionized audio processing, but they are notoriously compute-intensive due to the quadratic complexity of self-attention. Previous state-of-the-art models like the Self-Supervised Audio Spectrogram Transformer (SSAST) utilize self-supervised learning by masking 75% of the input audio spectrogram and tasking the model with predicting the missing segments.

However, SSAST is inherently inefficient: it feeds the entire sequence—including the "empty" mask tokens—through the full depth of the Transformer encoder. Since 75% of the input is masked, the model spends the vast majority of its compute power processing placeholders that contain no actual information. MAE-AST addresses this by redesigning the architecture to ignore masked data during the most expensive part of the computation.

Methodology

MAE-AST adopts an asymmetric encoder-decoder architecture designed to maximize computational efficiency during pretraining.

The MAE-AST architecture featuring a sparse encoder and a shallow decoder for joint generative and discriminative pretraining.
  1. Input Processing: Audio is converted into a log Mel spectrogram and split into patches (e.g., 16x16 pixels) or frames.
  2. Heavy Masking: 75% of these patches are randomly removed from the input stream.
  3. The Sparse Encoder: Only the remaining 25% (unmasked) patches are fed into a deep Transformer encoder. This significantly reduces the sequence length, leading to the observed speedups.
  4. The Shallow Decoder: After encoding, mask tokens are reintroduced and concatenated with the encoder's output. This full sequence is processed by a thin, 2-layer Transformer decoder.
  5. Joint Pretext Task: The model is trained using two simultaneous goals: a generative Mean Squared Error (MSE) loss for reconstructing original pixels, and a discriminative InfoNCE loss to help the model distinguish between correct and incorrect patches.

For downstream tasks, the decoder is discarded, and only the encoder is fine-tuned.

Evaluation and Datasets

The model was pretrained on a massive combination of AudioSet 2M and LibriSpeech (960 hours) with labels removed. Downstream evaluation covered a diverse range of tasks:

  • AudioSet (AS) & ESC-50: General and environmental audio classification.
  • Speech Commands (KS1, KS2): Keyword spotting.
  • VoxCeleb (SID): Speaker identification.
  • IEMOCAP (ER): Emotion recognition.

Key Results

MAE-AST demonstrates that mask tokens are effectively "dead weight" in the early layers of a transformer. By delaying their introduction until the shallow decoder, the model achieves a 3x speedup in training time and a 2x reduction in GPU memory usage compared to the vanilla SSAST.

Performance comparison across various downstream tasks using different layer configurations.

Beyond efficiency, the model shows superior performance. On the AudioSet classification task, MAE-AST achieved a Mean Average Precision (mAP) of 30.6, outperforming the SSAST base model (28.6). The model proved robust across diverse tasks, matching or beating the baseline in 5 out of 6 downstream benchmarks. Interestingly, the model converges in roughly the same number of iterations (approx. 500k) as the more expensive baseline, despite the reduced compute per iteration.

Discussion and Insights

  • Information Bottleneck: MAE-AST performs better with only a generative objective than SSAST does. Forcing the model to reconstruct the whole image from just 25% of the data creates a powerful bottleneck that encourages the learning of abstract, useful features.
  • Masking Strategies: Unlike images, audio features are highly correlated across time. "Chunked masking" (masking contiguous blocks) is often more effective than purely random masking, as it prevents the model from simply interpolating from immediate neighbors.
  • Limitations: The model struggled with Speaker Identification (SID) on VoxCeleb. The authors suggest that the high-level abstraction learned by the MAE-style bottleneck might discard some of the low-level acoustic details necessary for distinguishing individual voices.

Future work will explore a scalable multi-domain strategy, potentially creating a single pretrained model capable of handling vision, audio, and text within this efficient framework.

Summary updated

BibTeX
@inproceedings{baade2022mae,
  author = {Alan Baade and Puyuan Peng and David Harwath},
  title = {{MAE-AST: Masked Autoencoding Audio Spectrogram Transformer}},
  booktitle = {Interspeech},
  year = {2022},
  url = {https://openreview.net/forum?id=UEoZ9KCQv8},
}
Figure