Abstract
In the domain of symbolic music research, the progress of developing scalable systems has been notably hindered by the scarcity of available training data and the demand for models tailored to specific tasks. To address these issues, we propose MelodyT5, a novel unified framework that leverages an encoder-decoder architecture tailored for symbolic music processing in ABC notation. This framework challenges the conventional task-specific approach, considering various symbolic music tasks as score-to-score transformations. Consequently, it integrates seven melody-centric tasks, from generation to harmonization and segmentation, within a single model. Pre-trained on MelodyHub, a newly curated collection featuring over 261K unique melodies encoded in ABC notation and encompassing more than one million task instances, MelodyT5 demonstrates superior performance in symbolic music processing via multi-task transfer learning. Our findings highlight the efficacy of multi-task transfer learning in symbolic music processing, particularly for data-scarce tasks, challenging the prevailing task-specific paradigms and offering a comprehensive dataset and framework for future explorations in this domain.
Introduction
Symbolic music processing—the computational analysis and generation of digital scores—has traditionally been dominated by task-specific architectures. Researchers typically build isolated models for melody generation, chord harmonization, or structural segmentation. This fragmentation creates two significant bottlenecks: models fail to generalize across different musical domains, and the field suffers from a chronic shortage of high-quality, annotated data compared to the massive corpora available for natural language processing (NLP).
MelodyT5 addresses these challenges by adapting the "Text-to-Text Transfer Transformer" (T5) philosophy to the musical domain. By framing diverse musical tasks as "score-to-score" transformations, MelodyT5 leverages multi-task transfer learning to improve performance across the board, particularly in tasks where data is scarce.
The Score-to-Score Framework
At the core of MelodyT5 is the shift from specialized outputs to a unified representation using ABC notation. ABC notation is an ASCII-based shorthand for musical scores that is both human-readable and machine-efficient. By representing music this way, the researchers can treat every task—whether it is adding chords to a melody (harmonization) or identifying phrase boundaries (segmentation)—as a sequence-to-sequence problem.
Technical Innovations
To handle the unique structural requirements of music, MelodyT5 introduces several architectural refinements:
- Bar Patching: Standard Transformers often struggle with the long-range dependencies found in music. MelodyT5 groups characters into "bar patches," which are semantic units representing a single measure of music. This reduces the total sequence length and allows the model to focus on higher-level musical structure.
- Hierarchical Architecture: The model employs a dual-level decoding strategy. A 9-layer patch-level encoder and decoder manage the global musical structure, while a 3-layer character-level decoder handles the fine-grained generation of notes, rhythms, and symbols within each bar.
- Unified Multi-Task Pre-training: The model is trained simultaneously on seven distinct tasks: Cataloging, Generation, Harmonization, Melodization, Segmentation, Transcription, and Variation. This allows the model to learn a holistic "grammar" of music that benefits every individual task.
The MelodyHub Dataset
To support this large-scale training, the researchers introduced MelodyHub, a comprehensive collection of over 261,900 unique melodies. This dataset encompasses over one million task instances, drawing from diverse sources such as the JSB Chorales, FolkWiki, and OpenScore Lieder. The data was rigorously cleaned to remove non-musical metadata, ensuring the model focuses purely on musical syntax and structure.
Results and Insights
MelodyT5 was evaluated against state-of-the-art task-specific baselines using both objective metrics and subjective human assessments.
Objective Performance
In terms of Bits-Per-Byte (BPB), the unified MelodyT5 model consistently outperformed specialized versions. Notable successes include:
- Segmentation: The model achieved an F1 score of 0.9055, significantly surpassing the baseline of 0.8400.
- Controllability: In generation tasks, MelodyT5 demonstrated a superior "CTRL" score (0.8664 vs. 0.8162), indicating a better ability to adhere to structural constraints like specific section lengths.
Multi-Task Synergy
A key finding of the study is that multi-tasking acts as a "force multiplier." Training on harmonization (understanding chords) actually improves the model's ability to generate melodies. This synergy is most evident in data-scarce tasks, where the model "transfers" knowledge gained from data-rich tasks to improve its performance.
Human Evaluation
In A/B testing involving 124 music experts, MelodyT5 was preferred over baselines for its melodic coherence and harmonization quality. While it trailed slightly in "melodization" (generating melody from chords) due to the baseline's specialized rhythmic training, it was generally viewed as more technically proficient across the suite of tasks.
Conclusion and Future Work
MelodyT5 demonstrates that a unified, multi-task approach is not only feasible for symbolic music but often superior to specialized models. By treating music as a language and utilizing hierarchical "bar patching," the framework overcomes traditional hurdles of data scarcity and structural complexity.
Future research will focus on expanding the model's capabilities to handle complex polyphony (multiple independent voices) and refining rhythmic nuance to capture the more subtle, "human" elements of musical performance. As it stands, MelodyT5 provides a robust, scalable foundation for the next generation of symbolic music AI.
Summary updated