Multitrack Music Transformer: Learning Long-Term Dependencies in Music with Diverse Instruments

Hao-Wen Dong, Ke Chen, Shlomo Dubnov, Julian J. McAuley, Taylor Berg-Kirkpatrick · DOI

TL;DR

This paper introduces the Multitrack Music Transformer (MMT), a novel approach to generating complex, multi-instrument music. By proposing a more efficient data representation, MMT significantly reduces memory usage and speeds up inference, enabling longer and more real-time music generation compared to previous transformer-based methods. The authors also introduce a new method for analyzing musical self-attention, revealing that the model learns musically intuitive patterns.

What Problem Does This Paper Address?

Generating realistic and coherent multitrack music, especially with a diverse range of instruments and for extended durations, has been a significant challenge for AI models. Transformer models, while powerful for sequence modeling, struggle with the long input sequences required by existing multitrack music representations. This leads to high memory demands during training and slow inference, making real-time applications like improvisation impractical. The paper aims to overcome these limitations by developing a more compact representation and a more efficient transformer architecture.

Methods

The core innovation is a new multitrack music representation that encodes music as a sequence of events, each described by a six-variable tuple: (xtype, xbeat, xposition, xpitch, xduration, xinstrument). This representation is designed to be more compact than previous methods, allowing for longer sequences to be processed with less memory.

The proposed Multitrack Music Transformer (MMT) is a decoder-only transformer model that leverages this new representation. Unlike standard transformers with one-dimensional inputs/outputs, MMT uses multi-dimensional input and output spaces. This design choice, combined with the efficient representation, leads to reduced memory complexity and faster inference. The model is trained autoregressively to predict these six event variables.

A secondary contribution is a novel method for analyzing musical self-attention. The authors propose metrics to measure average attention weights based on differences in musical features like beat, position, and pitch. This analysis helps understand how the transformer model learns musical relationships.

Datasets

The primary dataset used for training and evaluation is the Symbolic Orchestral Database (SOD). This dataset contains approximately 5,743 songs (357 hours) of orchestral music. The authors processed this data using the MusPy toolkit, discarding tempo, velocity, and drum tracks.

Key Insights and Ideas

  • Compact Representation is Key: The paper demonstrates that a carefully designed data representation can dramatically improve the efficiency of transformer models for music generation, enabling longer sequences and faster processing.
  • MMT Balances Performance and Efficiency: While not always outperforming state-of-the-art in subjective quality, MMT achieves a strong balance, offering significant speedups and memory reductions while maintaining comparable performance.
  • Self-Attention Learns Music Theory: The analysis of musical self-attention reveals that the MMT model learns to attend to notes that form consonant intervals and are rhythmically related (e.g., 4 beats apart), aligning with principles of music theory. This suggests that transformers can learn musically meaningful patterns.
  • Instrument-Informed Generation: The proposed representation facilitates instrument-informed generation, allowing the model to generate music for a specific set of instruments, a capability not well-explored in prior work.

Key Results

  • Speed and Memory: MMT achieves substantial speedups and memory reductions compared to baseline models like MMM and REMI+. Specifically, it generates music 2.6x longer than MMM and is 2x faster, and generates music 3.5x longer than REMI+ and is 3.3x faster.
  • Subjective Listening Test: In a subjective listening test, MMT performed comparably to existing models, scoring between two recently proposed systems in terms of coherence, richness, and arrangement. Its overall mean opinion score (MOS) was 3.33.
  • Objective Evaluation: While REMI+ achieved slightly better objective scores (pitch class entropy, scale consistency), MMT's objective scores were still competitive, and it surpassed REMI+ in subjective listening tests.
  • Self-Attention Patterns: The analysis showed that MMT's attention heads learn to focus on nearby beats, notes at the same rhythmic position, and pitches forming consonant intervals, indicating musically intuitive learning.

Limitations and Future Work

  • Interdependencies: The paper acknowledges a trade-off: while MMT predicts six output fields independently (nonautoregressively), this prevents it from modeling interdependencies between these fields for the same note. For instance, it cannot rule out unsuitable pitches for a specific instrument as effectively as models that generate instrument and pitch sequentially.
  • Future Work: The authors suggest that MMT provides a foundation for future research in longer-form, real-time capable multitrack music generation. Further work could focus on improving the self-attention mechanism for music and exploring more sophisticated ways to model inter-field dependencies.

Summary updated

BibTeX
@inproceedings{dong2023multitrack,
  author = {Hao-Wen Dong and Ke Chen and Shlomo Dubnov and Julian J. McAuley and Taylor Berg-Kirkpatrick},
  title = {{Multitrack Music Transformer: Learning Long-Term Dependencies in Music with Diverse Instruments}},
  booktitle = {IEEE International Conference on Acoustics, Speech and Signal Processing},
  year = {2023},
  doi = {10.1109/icassp49357.2023.10094628},
}
Figure