[Paper Review] MusicBERT: Symbolic Music Understanding with Large-Scale Pre-Training
MusicBERT is a large-scale pre-trained model for symbolic music understanding that introduces OctupleMIDI encoding and bar-level masking to efficiently represent and pre-train on long music sequences. It achieves state-of-the-art performance on melody completion, accompaniment suggestion, genre, and style classification using a 1M-song dataset, outperforming prior methods significantly.
Symbolic music understanding, which refers to the understanding of music from the symbolic data (e.g., MIDI format, but not audio), covers many music applications such as genre classification, emotion classification, and music pieces matching. While good music representations are beneficial for these applications, the lack of training data hinders representation learning. Inspired by the success of pre-training models in natural language processing, in this paper, we develop MusicBERT, a large-scale pre-trained model for music understanding. To this end, we construct a large-scale symbolic music corpus that contains more than 1 million music songs. Since symbolic music contains more structural (e.g., bar, position) and diverse information (e.g., tempo, instrument, and pitch), simply adopting the pre-training techniques from NLP to symbolic music only brings marginal gains. Therefore, we design several mechanisms, including OctupleMIDI encoding and bar-level masking strategy, to enhance pre-training with symbolic music data. Experiments demonstrate the advantages of MusicBERT on four music understanding tasks, including melody completion, accompaniment suggestion, genre classification, and style classification. Ablation studies also verify the effectiveness of our designs of OctupleMIDI encoding and bar-level masking strategy in MusicBERT.
Motivation & Objective
- To address the lack of large-scale symbolic music datasets and effective pre-training methods for music representation learning.
- To overcome the limitations of applying NLP pre-training techniques directly to symbolic music due to structural complexity and long sequence lengths.
- To design an efficient, universal music encoding method that reduces sequence length while preserving rich musical information.
- To develop a masking strategy that prevents information leakage and enhances representation learning in symbolic music pre-training.
- To demonstrate the effectiveness of MusicBERT across diverse music understanding tasks using extensive ablation and downstream evaluations.
Proposed method
- OctupleMIDI encoding represents each note as an 8-element tuple: time signature, tempo, bar, position, instrument, pitch, duration, and velocity, enabling compact and universal representation.
- The method reduces average sequence length to 3,607 tokens per song—4× shorter than REMI and 2× shorter than CP—improving computational efficiency.
- A bar-level masking strategy is proposed to mask all tokens of the same type (e.g., pitch, instrument) within a single bar, avoiding information leakage from adjacent identical attributes.
- This strategy prevents easy prediction via copying from neighbors and encourages the model to learn meaningful representations from context.
- MusicBERT is pre-trained on a newly constructed Million MIDI Dataset (MMD) containing over 1 million diverse music songs across genres like Rock, Electronic, Jazz, and Classical.
- The model uses a standard Transformer-based architecture fine-tuned on downstream tasks such as melody completion, accompaniment suggestion, genre, and style classification.
Experimental results
Research questions
- RQ1Can a large-scale pre-trained model significantly improve symbolic music representation learning when trained on a diverse, large-scale dataset?
- RQ2Does OctupleMIDI encoding effectively reduce sequence length while preserving sufficient musical information for downstream tasks?
- RQ3Does bar-level masking outperform random or token-level masking in preventing information leakage and improving representation learning in symbolic music?
- RQ4How does pre-training on a large corpus enhance performance on music understanding tasks compared to random initialization?
- RQ5To what extent does MusicBERT generalize across different music understanding tasks, including phrase-level and song-level classification?
Key findings
- MusicBERT achieves state-of-the-art performance on all four evaluated tasks: melody completion (96.7% accuracy), accompaniment suggestion (87.9% accuracy), genre classification (F1-micro 0.730), and style classification (F1-micro 0.534).
- OctupleMIDI encoding outperforms both CP-like and REMI-like encodings across all tasks, with a 1.0–4.7 percentage point improvement in accuracy and F1 scores.
- The bar-level masking strategy achieves the highest performance (96.7% accuracy on melody, 0.730 F1 on genre), outperforming random and octuple-level masking.
- Pre-training significantly boosts performance, with a 4.3% increase in melody completion accuracy and a 13.5-point gain in genre classification F1 compared to models without pre-training.
- The model’s compact representation via OctupleMIDI reduces computational complexity by 16× compared to REMI-like encoding, enabling efficient training and inference on long sequences.
- Ablation studies confirm that both OctupleMIDI and bar-level masking are essential components, with each contributing significantly to the overall performance gain.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.