SymPAC: Scalable Symbolic Music Generation With Prompts And Constraints

Xingjian Du (杜行健), Haonan Chen, Jordan B. L. Smith, Janne Spijkervet, Ju-Chiang Wang, Pei Zou, Bochen Li, Qiuqiang Kong, Xingjian DuarXiv 2024 · DOI

Introduction

Generative AI has seen rapid advancement in text and image domains, yet symbolic music generation (e.g., MIDI) continues to face significant hurdles. The primary challenge is the chronic scarcity of high-quality, multi-track symbolic datasets compared to the vast availability of raw audio. Furthermore, existing models often lack the precise control mechanisms required by composers, such as specific chord progressions or structural transitions (e.g., Intro to Verse).

Methodology

To address these challenges, the authors propose SymPAC (Symbolic Music Language Model with Prompting And Constrained Generation). The framework is built upon three core technical pillars:

1. Scalable Data Pipeline

Bypassing the need for manually labeled MIDI, the researchers utilized pre-trained Music Information Retrieval (MIR) models to auto-transcribe one million audio tracks. This process extracts beats, chords, sections, and individual instrument tracks (vocals, piano, guitar, bass, drums), creating a massive synthetic symbolic dataset.

2. Prompt Bar Encoding

Inspired by prompting in Large Language Models (LLMs), SymPAC introduces a specialized encoding strategy. Before generating musical notes, the model processes "prompt bars" that consolidate high-level control signals—including genre, tempo, chords, and active instrumentation. This provides the decoder-only Llama-based architecture with a comprehensive "musical plan" before composition begins.

The SymPAC token sequence structure, illustrating the separation of prompt bars (containing control signals) and song bars (containing musical notes).

3. Constrained Generation via Finite State Machines (FSM)

To ensure adherence to musical grammar and user constraints, SymPAC employs FSMs during inference. The FSM acts as a set of guardrails, pruning the model's vocabulary at each time step to ensure tokens are both grammatically valid and compliant with user-defined inputs, such as specific genre styles.

Datasets

The study evaluates performance across three major datasets, emphasizing the impact of scale on symbolic music modeling. The primary engine for SymPAC's performance is the In-House Dataset (IHD), which dwarfs standard public MIDI collections.

Comparison of symbolic and audio music datasets, highlighting the scale of the In-House Dataset (IHD) used to train SymPAC.
  • Lakh MIDI Dataset (LMD): A standard public collection of ~170k multitrack MIDI files.
  • Million Song Dataset (MSD): 1 million audio clips processed through the transcription pipeline.
  • In-House Dataset (IHD): A massive collection of 1 million full-length songs in audio format, auto-transcribed to serve as the primary training engine.

Key Insights

  • Scale Over Perfection: SymPAC demonstrates that symbolic models can be trained effectively on 100% auto-transcribed data. The sheer volume of the 1M-song dataset compensates for imperfect transcriptions, allowing the model to learn robust musical patterns.
  • Prompting as a Musical Primitive: Moving control signals to a dedicated "prompt" section solves the "forgetting" problem in long-form generation, as the model maintains a roadmap of the entire song structure.
  • FSM Reliability: The structured nature of music (bars, beats, chords) is uniquely suited for FSM-based constraints, ensuring 100% grammatical reliability and preventing "hallucinations."

Results

Experimental results confirm that scaling laws apply to symbolic music: models trained on the full IHD significantly outperformed those trained on smaller subsets across chord, structure, and note distribution metrics. In controllability tests, the model achieved 87.2% to 87.6% accuracy in following specific chord progressions. Subjective evaluations by music producers also ranked SymPAC higher than established baselines like FIGARO and MMT in terms of coherence and musicality.

Limitations and Future Work

Current limitations include a fixed 1/16th note quantization, which prevents support for complex time signatures like 3/4 or 6/8. Additionally, chord detection is presently limited to 12 major and minor chords. Future research will explore Byte Pair Encoding (BPE) to handle long token sequences (averaging 8,000 tokens per song) more efficiently and expand the harmonic vocabulary.

Summary updated

BibTeX
@misc{2024sympac,
  author = {Xingjian Du (杜行健) and Haonan Chen and Jordan B. L. Smith and Janne Spijkervet and Ju-Chiang Wang and Pei Zou and Bochen Li and Qiuqiang Kong and Xingjian Du},
  title = {{SymPAC: Scalable Symbolic Music Generation With Prompts And Constraints}},
  year = {2024},
  eprint = {2409.03055},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2409.03055},
}
Figure