MERT: Acoustic Music Understanding Model with Large-Scale Self-supervised Training

Yizhi Li, Ruibin Yuan, Ge Zhang, Yinghao Ma, Xingran Chen, Hanzhi Yin, Chenghao Xiao, Chenghua Lin, Anton Ragni, Emmanouil Benetos, Norbert Gyenge, Roger Dannenberg, Ruibo Liu, Wenhu Chen, Gus Xia, Yemin Shi, Wenhao Huang, Zili Wang, Yike Guo, Jie Fu

TL;DR

MERT (Music undERstanding model with large-scale self-supervised Training) is a new foundation model for music that achieves state-of-the-art performance across 14 diverse music understanding tasks. By combining acoustic and musical "teacher" models in a self-supervised framework, MERT provides a computationally efficient, open-source alternative to massive generative models like Jukebox.

What Problem Does This Paper Address?

While self-supervised learning (SSL) has revolutionized natural language processing and speech, music presents unique challenges. Music is highly structured, polyphonic, and relies heavily on tonal and pitched characteristics that standard speech models often ignore.

Existing music models typically fall into two camps: narrow models designed solely for music tagging, or massive generative models like Jukebox that are too computationally expensive for most researchers to use for downstream tasks. There is a clear need for a general-purpose, "computationally affordable" pre-trained model that can handle everything from beat tracking to instrument classification.

Methods

MERT adopts the Masked Language Modeling (MLM) paradigm, similar to BERT or HuBERT, but tailored for music. The core innovation is a multi-task pre-training strategy that uses two different "teachers" to provide pseudo-labels for masked audio segments:

  1. Acoustic Teacher: Uses Residual Vector Quantization - Variational AutoEncoder (RVQ-VAE), specifically the EnCodec model. This teacher provides discrete tokens that capture acoustic-level details like timbre.
  2. Musical Teacher: Uses the Constant-Q Transform (CQT). Unlike the standard Fourier transform, CQT's frequency bins are aligned with musical octaves, making it ideal for capturing pitch and harmonic information.
Figure 1: Illustration of the MERT Pre-training Framework.

The model architecture consists of a 1D convolutional feature extractor followed by a Transformer encoder. To scale the model from 95M to 330M parameters without training crashes, the authors introduced attention relaxation and transitioned to pre-layer normalization (Pre-LN).

Datasets

  • Pre-training: The authors used a massive 160,000-hour collection of music recordings. They also released a "public" version trained on the music4all dataset (~910 hours).
  • Evaluation: The model was benchmarked on 14 Music Information Retrieval (MIR) tasks across several datasets, including:
  • MTT & MTG-Jamendo: Music tagging.
  • Giantsteps: Key detection.
  • GTZAN: Genre classification and rhythm/beat tracking.
  • Emomusic: Emotion regression.
  • NSynth: Instrument and pitch classification.
  • VocalSet: Singer identification and vocal technique detection.
  • MUSDB18: Music source separation.

Key Insights and Ideas

  • Pitch is Paramount: Standard speech features like MFCCs are insufficient for music. Adding the CQT-based musical teacher dramatically improved performance on tonal tasks like key detection, raising accuracy from ~15% to over 65%.
  • Multi-Teacher Synergy: Timbre (from RVQ-VAE) and pitch (from CQT) are complementary. Blending them allows the model to understand both the "texture" and the "structure" of music.
  • Efficiency Matters: MERT-330M is only about 7% the size of Jukebox-5B but achieves superior results on many understanding tasks, making it much more practical for real-world deployment.
  • Stability at Scale: Scaling acoustic Transformers is notoriously difficult. The authors found that "attention relaxation" (adding a scale constant in softmax) was critical for preventing gradient explosions during large-scale training.

Key Results

MERT-330M achieved an overall state-of-the-art (SOTA) score across the 14 tasks, outperforming both supervised baselines and previous SSL models.

  • SOTA Performance: It set new records on 4 specific metrics and matched the combined best performance of 10 different specialized models.
  • Generalization: Even the version trained on limited public data (MERT-95M-public) remained highly competitive, proving the robustness of the pre-training paradigm.
  • Task Versatility: MERT excels at local-level tasks (beat, pitch, singer ID) while remaining competitive on global tasks (tagging, genre).
Table 1: Experimental Performance of MERT and Baselines on Downstream Tasks (1/2). The baselines are grouped by supervised and unsupervised pre-training paradigms. The superscripts denote the category of the acoustic teacher used by MERT models. “public” refers to the MERT model trained with only open-source dataset. Results with star* are claimed in the references.

Limitations and Future Work

The primary limitation is the short context window. MERT was pre-trained on 5-second audio clips. While the model uses relative positional embeddings to handle longer sequences, it may struggle with tasks requiring a "long-term" understanding of musical form or structure.

Future work aims to extend this context length and further stabilize the training process to eliminate the "inverse-scaling" effects observed in a few specific tasks when moving to the largest model sizes.

Summary updated

Abstract

Self-supervised learning (SSL) has recently emerged as a promising paradigm for training generalisable models on large-scale data in the fields of vision, text, and speech. Although SSL has been proven effective in speech and audio, its application to music audio has yet to be thoroughly explored. This is partially due to the distinctive challenges associated with modelling musical knowledge, particularly tonal and pitched characteristics of music. To address this research gap, we propose an acoustic Music undERstanding model with large-scale self-supervised Training (MERT), which incorporates teacher models to provide pseudo labels in the masked language modelling (MLM) style acoustic pre-training. In our exploration, we identified an effective combination of teacher models, which outperforms conventional speech and audio approaches in terms of performance. This combination includes an acoustic teacher based on Residual Vector Quantisation - Variational AutoEncoder (RVQ-VAE) and a musical teacher based on the Constant-Q Transform (CQT). Furthermore, we explore a wide range of settings to overcome the instability in acoustic language model pre-training, which allows our designed paradigm to scale from 95M to 330M parameters. Experimental results indicate that our model can generalise and perform well on 14 music understanding tasks and attain state-of-the-art (SOTA) overall scores.
BibTeX
@inproceedings{li2024mert,
  author = {Yizhi Li and Ruibin Yuan and Ge Zhang and Yinghao Ma and Xingran Chen and Hanzhi Yin and Chenghao Xiao and Chenghua Lin and Anton Ragni and Emmanouil Benetos and Norbert Gyenge and Roger Dannenberg and Ruibo Liu and Wenhu Chen and Gus Xia and Yemin Shi and Wenhao Huang and Zili Wang and Yike Guo and Jie Fu},
  title = {{MERT: Acoustic Music Understanding Model with Large-Scale Self-supervised Training}},
  booktitle = {International Conference on Learning Representations},
  year = {2024},
  url = {https://openreview.net/forum?id=w3YZ9MSlBu},
}
Figure