Symbolic music generation has emerged as a compelling challenge at the intersection of music information retrieval and deep learning. While autoregressive models have dominated the field, masked language models (MLMs) offer complementary advantages: bidirectional context, controllable infilling, and structured pre-training objectives. In this thesis, we present MIDIT, a BERT-style Masked Language Model for symbolic MIDI music infilling, operating on REMI+ tokenized multi-track MIDI sequences. Our architecture employs a 12-layer Transformer encoder (~42.5M parameters) with a multi-head output layer producing separate predictions for nine REMI+ token types, trained on the Lakh MIDI Dataset through a two-phase pipeline of unconditional MLM pre-training followed by targeted infilling fine-tuning. We adopt token-level masking following BERT and provide a critical analysis of bar-level masking as used in MusicBERT, arguing that it produces inconsistent training signals for REMI+ sequences. A key contribution is the identification and diagnosis of a distribution mismatch between training-time random masking and inference-time contiguous bar masking. An ablation study confirms that this failure is structural rather than quantitative. We introduce BarFillMasking, a targeted fine-tuning strategy that resolves this mismatch, substantially improving pitch accuracy and achieving stable content preservation across 50 validation songs.
Symbolic music generation has emerged as a compelling challenge at the intersection of music information retrieval and deep learning. While autoregressive models have dominated the field, masked language models (MLMs) offer complementary advantages: bidirectional context, controllable infilling, and structured pre-training objectives. In this thesis, we present MIDIT, a BERT-style masked language model for symbolic MIDI music infilling, operating on REMI+ tokenized multi-track MIDI sequences. Our architecture employs a 12-layer Transformer encoder (~42.5M parameters) with a multi-head output layer producing separate predictions for nine REMI+ token types, trained on the Lakh MIDI Dataset through a two-phase pipeline of unconditional MLM pre-training followed by targeted infilling fine-tuning. We adopt token-level masking following BERT and provide a critical analysis of bar-level masking as used in MusicBERT, arguing that it produces inconsistent training signals for REMI+ sequences. A key contribution is the identification and diagnosis of a distribution mismatch between training-time random masking and inference-time contiguous bar masking. An ablation study confirms that this failure is structural rather than quantitative. We introduce BarFillMasking, a targeted fine-tuning strategy that resolves this mismatch, substantially improving pitch accuracy and achieving stable content preservation across 50 validation songs.
MIDIT: multi track symbolic music infilling via BERT-style pre-training and distribution-aware fine-tuning
ZANETTI, SIMONE
2025/2026
Abstract
Symbolic music generation has emerged as a compelling challenge at the intersection of music information retrieval and deep learning. While autoregressive models have dominated the field, masked language models (MLMs) offer complementary advantages: bidirectional context, controllable infilling, and structured pre-training objectives. In this thesis, we present MIDIT, a BERT-style Masked Language Model for symbolic MIDI music infilling, operating on REMI+ tokenized multi-track MIDI sequences. Our architecture employs a 12-layer Transformer encoder (~42.5M parameters) with a multi-head output layer producing separate predictions for nine REMI+ token types, trained on the Lakh MIDI Dataset through a two-phase pipeline of unconditional MLM pre-training followed by targeted infilling fine-tuning. We adopt token-level masking following BERT and provide a critical analysis of bar-level masking as used in MusicBERT, arguing that it produces inconsistent training signals for REMI+ sequences. A key contribution is the identification and diagnosis of a distribution mismatch between training-time random masking and inference-time contiguous bar masking. An ablation study confirms that this failure is structural rather than quantitative. We introduce BarFillMasking, a targeted fine-tuning strategy that resolves this mismatch, substantially improving pitch accuracy and achieving stable content preservation across 50 validation songs.| File | Dimensione | Formato | |
|---|---|---|---|
|
Data_Science_MsC_Thesis_SimoneZanetti.pdf
Accesso riservato
Dimensione
10.23 MB
Formato
Adobe PDF
|
10.23 MB | Adobe PDF |
The text of this website © Università degli studi di Padova. Full Text are published under a non-exclusive license. Metadata are under a CC0 License
https://hdl.handle.net/20.500.12608/115855