← Latest papers
⚡ electrical engineering

MIDI-RAE-JEPA: Hierarchical Representation Learning and Generation for Symbolic Music

This paper introduces MIDI-RAE-JEPA, a self-supervised framework that combines a Swin Transformer V2 encoder with pitch- and time-shift equivariance objectives to learn hierarchical, semantically rich representations of symbolic music that excel in downstream tasks like emotion classification and enable high-quality generative modeling.

Original authors: Scott H. Hawley

Published 2026-07-17
📖 6 min read🧠 Deep dive

Original authors: Scott H. Hawley

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 trying to teach a robot to understand music, not just by listening to the sound waves, but by reading the sheet music itself. In the world of artificial intelligence, this is like teaching a computer to read a map of musical notes. Usually, AI learns by looking at millions of photos of cats or dogs, learning that a "cat" is a cat whether it's zoomed in or zoomed out. But music is different. If you zoom in on a piece of sheet music, you don't just see a bigger note; you see a different rhythm or a different pitch entirely. The rules that work for photos break down for music.

To solve this, scientists use a clever trick called "self-supervised learning." Instead of hiring a human teacher to label every single note, they let the AI play a game of "fill in the blanks." They hide parts of the music and ask the AI to guess what's missing. If the AI can guess correctly, it means it has learned the hidden rules of how music is built. The big question this paper tackles is: Can we teach an AI to understand the structure of music—how a small melody fits into a big song—without ever showing it a single labeled example? And if we do, can that AI then write its own music that sounds good?


Meet MIDI-RAE-JEPA, a new AI system designed to learn the secret language of symbolic music (music written as digital instructions, like a piano roll). Think of a piano roll as a giant, binary grid: 128 squares wide for every possible piano key, and 128 squares tall for time. A black square means a note is playing; a white square means silence. The goal of this project was to teach an AI to look at these grids and understand the deep, hierarchical relationships of music—how a single note builds a phrase, how phrases build a section, and how sections build a whole song.

The researchers built a system that acts like a musical detective. They used a special type of AI architecture called a Swin Transformer V2, which is like a set of magnifying glasses that look at the music at different levels of detail, from tiny single notes up to the whole song structure. But the real magic is in how they taught it. Instead of just guessing missing notes, they taught the AI a game of "musical translation."

Imagine you have a melody. If you shift that melody up by a few notes (pitch shift) or move it forward in time (time shift), the structure of the music stays the same, even though the notes are different. The AI was trained to recognize that these shifted versions are related. If you shift a song up by one note, the AI's internal "fingerprint" for that song should move just a little bit. If you shift it up by an entire octave, the fingerprint should move a lot further away. This is called equivariance. It's like teaching a child that a red ball is still a red ball whether it's on the floor or on the table; the AI learns that a musical idea is still the same idea, even if it's in a different key or at a different time.

To make sure the AI didn't just memorize the answers or get confused, the researchers added a few safety nets. They used a "masked embedding predictor," which is like covering up parts of the sheet music and asking the AI to predict what's underneath based on the rest of the song. They also added a special rule called SIGReg to stop the AI from getting lazy and giving the same answer for every song (a problem known as "collapse").

The results were surprisingly successful. When they froze the AI's brain (stopped it from learning anything new) and attached a simple decoder to it, the system could reconstruct the original piano roll with incredible accuracy, scoring an F1 of 0.995. That's almost perfect. It means the AI had truly captured the essence of the music in its internal memory.

But the real test was generation. The researchers took these internal "fingerprint" representations and fed them into a generative model (a type of AI that creates new things). When they gave the model a specific musical excerpt to "condition" on, the AI generated new music that matched the pitch register (how high or low the notes are) and the rhythmic density (how busy or sparse the notes are) of the original. If they gave it a mismatched condition, the AI still made music that sounded plausible, but it was unrelated to the prompt. This suggests the AI isn't just copying; it's understanding the style and structure of the input.

The paper also tested if these learned representations could help with other tasks. They tried using the AI's internal fingerprints to guess the emotion of a song (like "happy" or "sad"). The results suggest that this method works better than older, simpler techniques (like a Haar scattering transform), proving that the AI learned something musically meaningful without needing to be explicitly taught emotions.

However, the authors are careful not to claim they have solved everything. They note that while the "finer" levels of their AI (which look at small details) are very good at capturing specific notes and rhythms, the "coarser" levels (which look at the big picture) haven't quite learned to capture obvious, interpretable musical abstractions yet. The system is a strong proof-of-concept, showing that combining equivariance (understanding shifts) with hierarchical learning (understanding scales of detail) is a viable path forward. It suggests that we can build AI assistants that listen to a musical idea and understand its structure well enough to help refine a composition, but we are still working on getting the AI to fully grasp the grand, abstract architecture of a symphony.

In short, this paper shows that by teaching an AI to respect the rules of musical shifts and scales, we can create a system that understands music deeply enough to reconstruct it perfectly and generate new, plausible music based on specific musical moods. It's a step toward an AI that doesn't just mimic music, but truly understands its grammar.

Drowning in papers in your field?

Get daily digests of the most novel papers matching your research keywords — with technical summaries, in your language.

Try Digest →