Do Music Generation Models Encode Music Theory?

Megan Wei, Michael Freeman, Chris Donahue, Chen Sun · DOI

Introduction

Recent advancements in AI music generation, led by models like Meta’s MusicGen and OpenAI’s Jukebox, have demonstrated a remarkable ability to produce high-fidelity audio from text prompts. However, it remains unclear whether these models are merely "stochastic parrots" mimicking acoustic patterns or if they develop an internal structural understanding of music theory—the fundamental notes, chords, and rhythms that underpin musical composition. A recent study by researchers at Brown University and Carnegie Mellon University investigates this by probing the internal representations of these foundation models.

The SynTheory Dataset

To evaluate internal musical knowledge, the researchers introduced SynTheory, a synthetic benchmark designed to isolate specific music theory concepts. Unlike real-world music where tempo, key, and timbre are inextricably linked, SynTheory uses programmatically generated MIDI clips to isolate seven core concepts: Tempo, Time Signatures, Notes, Intervals, Scales, Chords, and Chord Progressions. By utilizing 92 different instrument timbres, the dataset ensures that models cannot rely on specific acoustic signatures to "cheat" on theoretical tasks.

Methodology: Probing the "Inner Ear"

The study utilizes Probing Classifiers to interrogate the frozen internal states of pretrained models. The process involves passing audio through a frozen foundation model, extracting the hidden state vectors, and training a shallow neural network (a probe) to predict specific music theory labels based solely on those vectors.

The experimental pipeline: from the SynTheory dataset through frozen model representations to the probing classifier.

If a simple probe can accurately identify a musical concept like a "Major 7th chord" from these internal states, it indicates that the foundation model has naturally organized this information during its primary training.

Key Insights and Results

The Small Model Paradox

One of the most surprising findings was that smaller model variants often outperformed their larger counterparts in encoding music theory. In the case of MusicGen, the Small version (300M parameters) showed higher probing accuracy than the Large version (3.3B parameters). This suggests that capacity constraints may force smaller models to develop more efficient, theoretically grounded internal representations, whereas larger models might rely on more complex, less interpretable patterns.

Layer-wise Evolution of Knowledge

The researchers found that musical "understanding" is not uniformly distributed. Probing accuracy typically improves as data moves deeper into the model's decoder layers, peaking toward the end before a slight decline in the final layers, which are more specialized for raw audio reconstruction.

Probing evaluation metrics across different model layers, illustrating the "Small Model Paradox" and the peak in theoretical encoding in later layers.

Model Performance Comparison

  • Jukebox as the Standard: Jukebox LM demonstrated exceptional performance, achieving a 0.984 average accuracy across all tasks and perfect accuracy (1.000) in time signature detection.
  • Superiority Over Handcrafted Features: The internal representations of these models frequently outperformed traditional audio features like Chroma (pitch-based) and MFCCs (timbre-based), particularly on complex tasks like chord progressions.
  • Localization of Understanding: For MusicGen, the "understanding" was found to reside primarily in the Language Model (LM) decoder rather than the audio codec (EnCodec), which showed significantly lower theoretical encoding (0.701 average).

Conclusion and Future Directions

This research confirms that music foundation models do indeed encode granular music theory concepts within their hidden states. While the information is present, the next challenge is "intervention"—determining if these internal representations can be manipulated to give artists surgical control over generated output (e.g., changing a key without altering the entire track). Future work will also look to expand SynTheory beyond Western music theory to include a broader range of global musical structures.

Paper Citation: Wei, M., Freeman, M., Donahue, C., & Sun, C. (2024). Do Music Generation Models Encode Music Theory? Proceedings of the 25th International Society for Music Information Retrieval Conference (ISMIR).

Summary updated

BibTeX
@inproceedings{wei2024do,
  author = {Megan Wei and Michael Freeman and Chris Donahue and Chen Sun},
  title = {{Do Music Generation Models Encode Music Theory?}},
  booktitle = {ISMIR},
  year = {2024},
  url = {https://openreview.net/forum?id=90Lv6h1lIe},
}
Figure