Introduction
Symbolic music processing, particularly in the MIDI format, presents unique challenges for deep learning models. While music shares sequential characteristics with natural language, its hierarchical structure and high degree of repetition distinguish it from text. Existing models often suffer from task specialization—either focusing on generation (autoregressive models like GPT) or understanding (bidirectional models like BERT)—and struggle with the computational overhead of long sequences.
PianoBART introduces a unified encoder-decoder framework designed to bridge this gap. By utilizing a compact "Octuple" encoding and a specialized multi-level masking strategy, it addresses the "information leakage" common in repetitive musical structures, outperforming existing music models in both training efficiency and downstream task accuracy.
Methodology
The core of PianoBART is the adaptation of the Bidirectional and Auto-Regressive Transformers (BART) architecture for symbolic piano music. The methodology centers on three primary innovations:
Octuple Representation
Standard music encodings often produce massive sequences that are computationally expensive. PianoBART employs an "Octuple" encoding where each token bundles eight musical elements: Time Signature, Tempo, Bar, Position, Instrument, Pitch, Duration, and Velocity. This bundling significantly shortens sequence lengths and allows the model to learn the simultaneous relationships between these attributes in a single look.
Multi-Level Object Selection Strategy
In music, melodies and motifs often repeat across bars. Standard masking (predicting a single missing note) is often too trivial because the model can "cheat" by copying adjacent notes. To force the model to learn underlying musical logic, the authors implemented a multi-level masking strategy:
- Element/Token Level: Masking individual attributes or entire notes.
- Bar Level: Masking entire measures.
- n-Bar Level: A novel dynamic strategy that selects a range of notes based on cumulative duration. This forces the model to capture long-term structural relations, such as chords and motifs, rather than local patterns.
Experimental Setup
The model underwent large-scale pre-training using a combination of five public MIDI datasets: Pop1K7, ASAP, POP909, Pianist8, and EMOPIA, totaling 4,166 pieces.
For downstream tasks, the model was fine-tuned for:
- Generation: Using the MAESTRO and GiantMIDI-Piano datasets for music continuation.
- Understanding: Using POP909 for melody extraction, EMOPIA for emotion classification, and Pianist8/ASAP for composer classification.
Results and Discussion
PianoBART demonstrated significant improvements over previous state-of-the-art models like MusicBERT and MidiBERT.
Efficiency and Understanding
The model achieved a reconstruction accuracy of 96.67% in just 3.19 days of training, roughly half the time required by its predecessors. In understanding tasks, PianoBART set new benchmarks, reaching 97.45% accuracy in Composer Classification on the ASAP dataset and 73.15% in Emotion Recognition.
Music Generation
In continuation tasks, PianoBART produced more coherent and rhythmically stable music compared to "Music Transformer" baselines. Metrics such as Pitch Fréchet Similarity (PFS) and Grooving pattern Similarity (GS) confirmed that the model's output aligns more closely with human-composed structures.
Despite these successes, the authors noted that Velocity Prediction remains a challenge, with accuracy around 51%. This is attributed to the subjective nature of performance style, which is harder to capture than structural elements like pitch or duration.
Conclusion
PianoBART successfully unifies music generation and understanding within a single, efficient framework. The combination of Octuple encoding and n-Bar masking effectively mitigates the repetition trap in symbolic music. Future work may involve incorporating formal music theory as expert knowledge to further enhance musicality and expanding the architecture to handle multi-instrumental orchestral arrangements.
Summary updated