Library learning with e-graphs on jazz harmony
This contribution presents a computational model that leverages library learning on e-graphs to discover concise, generative explanations of jazz harmonic progressions, aiming to capture the human process of internalizing structured musical patterns through the joint optimization of harmony libraries and program refactoring.
Original paper licensed under CC BY 4.0 (http://creativecommons.org/licenses/by/4.0/). This is an AI-generated explanation of the paper below. It is not written or endorsed by the authors. For technical accuracy, refer to the original paper. Read full disclaimer
Imagine you are listening to a jazz band. For a casual listener, it is merely a stream of cool chords. Yet for a musician, this stream is not random; it consists of a handful of familiar "moves" or "licks" that are repeated, adapted, and combined in various ways.
This article is about teaching a computer to hear jazz like a musician. Researchers Zeng Ren, Maddy Bowers, Xinyi Guan, and Martin Rohrmeier developed a system that does not merely memorize chords but identifies the hidden rules and reusable building blocks from which the music is constructed.
Here is how they did it, explained simply:
1. The Problem: Too Many Ways to Explain Music
Imagine you have a sentence like "The cat sat on the mat." You could explain it in many ways:
- "The cat" + "sat" + "on the mat."
- "The" + "cat sat" + "on the mat."
- "The cat sat" + "on" + "the mat."
In jazz, a chord progression (such as C Major, A Minor, D Minor, G Dominant Seventh) can be decomposed into relationships in thousands of different ways. If a computer attempts to list every single possible way to break down a song, it becomes immediately overwhelmed. It is like trying to read every possible sentence in a dictionary to understand a single story.
2. The Solution: The "E-Graph" (A Super-Organized Filing Cabinet System)
To solve this problem, the team used a clever data structure called an E-Graph. Imagine this as a super-organized filing cabinet that does not just store one version of a file but stores all possible versions of a file simultaneously without wasting space.
- The Analogy: Imagine you are building a house. Instead of drawing a new blueprint for every single house, you have a master blueprint showing all possible arrangements of walls, windows, and doors. The E-Graph holds all these possibilities in a compact, shared space.
3. The "Library Learning" (Finding the Lego Sets)
Once the computer has all possible ways to decompose the songs, it searches for patterns. This is the "Library Learning" part.
- The Analogy: Imagine you are a chef. You have a huge cookbook with 100 recipes. You notice that 50 of them use exactly the same "secret sauce" (garlic, lemon, butter).
- Without a library: You write "garlic, lemon, butter" in every single recipe. It is long and repetitive.
- With a library: You create a new ingredient called "secret sauce." Now you only write "secret sauce" in the recipes. You save space, and the recipes become clearer.
The computer does this with music. It finds recurring chord patterns (such as a "V-I" resolution or a "ii-V-I" progression) and gives them a name. It then "refactors" the songs by replacing long lists of chords with these new, named patterns.
4. How They Tested It
They tested this on three famous jazz standards: Red Clay, Valse Hot, and Sunny.
- The Result: The computer successfully compressed the songs. It took long, messy lists of chords and transformed them into short, clean instructions using its new "library" of patterns.
- The Efficiency: By sharing these patterns across the three songs, the computer required much less "memory" to describe the music than if it had tried to explain every song from scratch.
5. What the Computer "Learned"
The system did not just find random patterns; it found things that sound like what human music theorists look for.
- It found standard jazz moves, such as a "Dominant to Tonic" (a tension-and-release pattern).
- It found more complex structures, such as a "Backdoor Dominant" (a specific type of surprise chord).
- A Surprising Twist: In one song (Red Clay), the computer developed a unique interpretation of the opening chords that differed from the standard human analysis. It argued that this strange interpretation was actually the most "efficient" way to explain the music using its library. This suggests that the mathematically most efficient explanation might sometimes sound strange to the human ear or could reveal a new way of hearing the music.
The Big Picture
The article argues that learning music is not just about memorizing notes. It is about building a mental library of reusable blocks. When we listen to jazz, our brains essentially perform "Library Learning": we recognize that a certain group of chords is just a "familiar move" we have heard before, which helps us understand the song faster and with less effort.
This computer model proves that we can teach a machine to do the same: take a raw stream of data, find the hidden, reusable building blocks, and use them to explain the big picture efficiently.
Drowning in papers in your field?
Get daily digests of the most novel papers matching your research keywords — with technical summaries, in your language.