Equipping Pretrained Unconditional Music Transformers with Instrument and Genre Controls

Weihan Xu, Julian J. McAuley, Shlomo Dubnov, Hao-Wen Dong · DOI

Introduction

In the field of AI-generated music, a significant gap exists between unconditional models—which produce high-quality but unsteerable output—and fine-grained editing systems that require extensive musical knowledge. Researchers from Duke University and UC San Diego have introduced a middle ground: a method to equip large-scale, pretrained "unconditional" music Transformers with high-level controls for genre and instrumentation. By leveraging a "pretraining-and-finetuning" paradigm, the authors demonstrate that users can guide music generation using simple "control tokens" without compromising musicality.

Methodology: Prefixing and Control Tokens

The core of the approach is a two-stage training process. First, a large Transformer-decoder model is pretrained on a massive, unlabeled dataset to learn the fundamental grammar of music. Second, the model is finetuned using a technique called prefixing.

In this second stage, special structural tokens are prepended to the music data sequences. These tokens act as "prompts" that steer the model's generation:

  • <start-of-tags>: Precedes genre labels (e.g., Jazz, Rock).
  • <start-of-program>: Precedes instrument lists (e.g., Violin, Cello).
  • <start-of-notes>: Signals the beginning of the actual musical content.
Comparison of event sequences across model variants, highlighting the introduction of control tokens (yellow) for genre and instrument steering.

By training the model to process these metadata tags before the notes, it learns to associate specific musical patterns with the provided labels. The music itself is represented using a hybrid of REMI+ (for expressiveness) and MMT (for multi-instrument handling), converted into a 1D string of integers.

Data Landscape: The MuseScore Dataset

The study leverages the MuseScore dataset, which represents the largest symbolic music collection used for this purpose to date. The dataset is divided into three tiers: a full set of 1.5 million songs for pretraining, a metadata-rich set of 821,000 songs for instrument conditioning, and a genre-tagged set of 175,000 songs.

Comparison of the MuseScore dataset with other major symbolic music datasets, showing its superior scale and public availability.

As shown in the table above, MuseScore significantly exceeds previous benchmarks like the Lakh MIDI Dataset (LMD) in both scale and accessibility, providing the necessary volume of data to train billion-parameter-scale models effectively.

Key Insights

  1. The Efficiency of Prefixing: Adding control does not require complex architectural changes. Simple prefixing with metadata tokens is sufficient to steer large models.
  2. Synergistic Control: Conditioning on both genre and instruments (MMT-GI) improved adherence compared to single-attribute conditioning. The model seemingly benefits from the inherent relationship between certain instruments and genres (e.g., piano in classical music).
  3. Quality Enhancement: Surprisingly, adding controls improved subjective musical quality. Controlled models outperformed the unconditional baseline in both harmony and coherence, suggesting that the constraints help the model focus on more probable, high-quality musical structures.

Results and Performance

The researchers evaluated three model variants: MMT-I (Instrument only), MMT-G (Genre only), and MMT-GI (Joint control).

  • Subjective Evaluation: In listening tests, the MMT-GI model achieved the highest Mean Opinion Scores (MOS), with 3.90/5 for coherence and 3.80/5 for harmony, compared to the baseline's ~3.4 and ~3.2.
  • Objective Metrics: The models maintained high technical standards, with over 94% Scale Consistency (staying in key) and over 92% Groove Consistency (rhythmic stability).
  • Condition Adherence: The MMT-GI model successfully delivered the requested attributes with an adherence score of 3.60/5.

Limitations and Future Directions

Despite its success, the system faces challenges related to data imbalance. The MuseScore dataset is heavily weighted toward classical music and piano, leading to superior performance in those categories compared to "Hip Hop" or "World Music." Additionally, as a community-sourced dataset, it contains "noisy" data such as incomplete sketches. Future work may involve expanding control "knobs" to include composer style, time signatures, and quality-based filtering.

Summary updated

BibTeX
@inproceedings{xu2023equipping,
  author = {Weihan Xu and Julian J. McAuley and Shlomo Dubnov and Hao-Wen Dong},
  title = {{Equipping Pretrained Unconditional Music Transformers with Instrument and Genre Controls}},
  booktitle = {IEEE Big Data},
  year = {2023},
  doi = {10.1109/bigdata59044.2023.10386311},
}
Figure