Motifs, Phrases, and Beyond: The Modelling of Structure in Symbolic Music Generation

Keshav Bhandari, Simon Colton

Introduction

In the field of artificial intelligence, generating music that is locally coherent—where the next few notes sound "correct"—has largely been mastered. However, the true challenge lies in capturing "global" structure: the intentional repetition, variation, and development of themes that span several minutes. This literature review, "Motifs, Phrases, and Beyond," provides a comprehensive roadmap of how symbolic music generation has evolved from simple note-prediction engines into sophisticated systems capable of modeling hierarchical musical forms.

The Challenge of Musical Hierarchy

Music is inherently hierarchical. Individual notes aggregate into motifs, which form phrases, which in turn constitute sections like verses and choruses. For human listeners, musical meaning is derived from recognizing these patterns and understanding how they transform over time.

Standard deep learning models, such as basic Recurrent Neural Networks (RNNs) or Transformers, often suffer from "musical amnesia." While they maintain local coherence, they struggle to maintain a thematic thread over long durations, often resulting in compositions that wander aimlessly. The central problem addressed in recent research is how to explicitly model this abstract, long-term structure so that AI-generated pieces feel intentional rather than random.

The Evolution of Structural Modeling

The paper categorizes the field's progress into three distinct developmental eras:

1. Symbolic and Rule-Based Methods

Early approaches utilized Markov Models and Genetic Algorithms. These systems relied on explicit templates and "Factor Oracles" to track and generate repetitions. While these methods were structurally sound and followed music-theoretic rules strictly, they lacked the creative flexibility and nuance found in modern data-driven approaches.

2. Foundational Deep Learning

The introduction of RNNs and Transformers marked a shift toward learning structure directly from data. Key innovations during this era included:

  • Relative Attention: This allowed models to better understand the temporal distance between musical events, aiding in the recognition of recurring themes.
  • REMI (Revamped MIDI): A significant shift in data representation that embedded a beat and bar grid directly into the input tokens. This allowed models to "feel" the underlying rhythmic structure more effectively than raw MIDI sequences.

3. Subtask Decomposition

The current frontier involves breaking the generative process into two stages: high-level structural planning and low-level note generation. In this neuro-symbolic hybrid approach, a model first generates a "skeleton" or structural graph—a plan for the piece. A second model then fills in the "texture" (the specific notes) while adhering to the constraints of the plan. This method combines the logical structure of early AI with the fluid creativity of deep learning.

Data Representation and Benchmarks

The review highlights that how music is represented is as important as the model architecture. Models perform significantly better when data mirrors human musical notation (e.g., using "Bar" and "Beat" tokens). Key datasets supporting this research include:

  • Lakh MIDI Dataset: The industry standard for large-scale pre-training.
  • Wikifonia: Frequently used for lead-sheet and melody-focused research.
  • Labeled Motif Dataset: A significant contribution from the R-Transformer study, providing over 500,000 labeled motif repetitions across five distinct types.

Key Insights: Repetition vs. Variation

A central theme of the review is the tension between repetition and change. While endless repetition is monotonous, constant variation leads to cognitive overload and a lack of structure. The most successful models are those that learn "nuanced development"—changing a theme just enough to maintain interest while remaining recognizable.

Models like the Theme Transformer and R-Transformer have demonstrated that by explicitly clustering thematic patterns or modeling repetition types based on music theory, AI can maintain a specific theme throughout a long composition much better than standard prompt-based models.

Results and Performance

Recent models that utilize graph-based structural representations, such as PopMNet and Melons, consistently outperform standard RNNs in human evaluations. These models are rated higher for "humanness" and "enjoyability," suggesting that explicit structural modeling is the key to creating music that resonates with human listeners. Similarly, the R-Transformer has been noted for its high enjoyability ratings among both professional musicians and non-musicians.

Future Directions and Limitations

Despite significant strides, several "missing links" remain in the quest for human-level composition:

  • Sophisticated Development: Current AI can repeat themes but struggles with complex compositional techniques like inversion (flipping a melody), augmentation (stretching it out), or stretto.
  • Standardization: The lack of a universal standard for labeling musical phrases and sections across different genres hinders the training of generalizable models.
  • Iterative Refinement: Most models generate music linearly. The authors suggest that future systems should incorporate a "pause-think-refine" loop, allowing the AI to go back and edit its previous work to ensure it fits the overall structural plan, much like a human composer.

Conclusion

The transition from local note prediction to global structural modeling represents a major leap in AI musicology. By moving toward subtask decomposition and more sophisticated data representations, researchers are closing the gap between algorithmic randomness and intentional musical storytelling.

Summary updated

BibTeX
@inproceedings{bhandari2024motifs,
  author = {Keshav Bhandari and Simon Colton},
  title = {{Motifs, Phrases, and Beyond: The Modelling of Structure in Symbolic Music Generation}},
  booktitle = {EvoMUSART},
  year = {2024},
  doi = {10.1007/978-3-031-56992-0\_3},
}
Figure