Learning to Groove with Inverse Sequence Transformations

Jon Gillick, Adam Roberts, Jesse Engel, Douglas Eck, David Bamman

Researchers from Google AI and UC Berkeley have developed a novel approach to make digital music sound "human" by training neural networks to invert deterministic sequence transformations. By releasing the Groove MIDI Dataset (GMD)—the largest dataset of its kind—they demonstrate that machine learning models can successfully learn to add professional-grade micro-timing and dynamics to robotic musical scores, even outperforming real amateur recordings in some listener evaluations.

The Challenge of "Humanization"

In the world of digital music production, "humanization" is a persistent challenge. Standard software often sounds robotic because notes are perfectly aligned to a grid (quantized) and played at uniform volumes. While professional toolkits try to fix this by adding random "jitter" (Gaussian noise) to timing and velocity, research shows this has little effect on listener preference.

The core difficulty in applying deep learning to this problem has been a lack of paired data. To train a model to "perform" a score, you typically need a massive library of musical scores paired with high-quality, expressive performances of those exact scores. Manually aligning these is incredibly labor-intensive. This paper bypasses that bottleneck using a clever "inverse transformation" trick.

Methods: GrooVAE and Inverse Transformations

The authors introduce GrooVAE, a framework that treats musical performance as a translation task. Instead of searching for paired data, they create it by taking expressive performances and applying deterministic, lossy transformations to "simplify" them into scores. They then train models to invert these transformations.

Diagram illustrating the three inverse sequence transformation tasks: Humanization, Infilling, and Tap2Drum.

The Core Tasks

  1. Humanization: Mapping a quantized 16th-note score (no timing/velocity info) to a full, expressive performance.
  2. Infilling: Taking a performance where one instrument (e.g., the hi-hat) is missing and generating a stylistically consistent part for it.
  3. Tap2Drum: Taking a single-track rhythmic "tap" (precise timing but no instrument info) and expanding it into a full multi-instrument drum performance.

The Architecture

The primary model is a Seq2Seq architecture using a bidirectional LSTM encoder and a 2-layer LSTM decoder.

  • Representations: The model predicts three things per timestep: Hits (which drums are struck), Offsets (how many milliseconds a hit deviates from the 16th-note grid), and Velocities (how hard the drum is hit).
  • Variational Information Bottleneck (VIB): By adding a VIB term, the authors allow the model to trade off between following the input score exactly and producing a "realistic" output that fits the distribution of professional drumming.
  • Groove Transfer: A variation that allows the model to "borrow" the feel of one performance and apply it to the notes of another.

The Groove MIDI Dataset (GMD)

To support this work, the authors released the Groove MIDI Dataset (GMD). It features 13.6 hours of recordings, 1,150 MIDI files, and over 22,000 measures of music. The data was recorded by 10 drummers (mostly professionals) on Roland TD-11 electronic kits, capturing fine-grained velocity and timing. Because the drummers played to a metronome, the "ground truth" scores could be perfectly extracted via quantization.

Key Insights and Ideas

  • Inversion as a Proxy for Creativity: By training a model to "undo" quantization, the model implicitly learns the complex, non-random patterns of human "groove."
  • The "Late" Beat: The data revealed that on-beat notes (eighth notes) are statistically more likely to be played slightly late, while off-beat notes are often played early. This is a nuance random jitter can never capture.
Histogram showing timing offsets for on-beat notes, which tend to be played slightly late.
  • Corrective Infilling: One of the most surprising findings was that the model could act as a "corrective" tool. When the model was asked to infill parts of an amateur performance, listeners often preferred the model’s version over the original human's, as the model "resampled" the part from a distribution of professional-grade playing.
  • Continuous vs. Discrete: The authors found that modeling timing offsets and velocity as single Gaussian distributions (continuous values) produced much more realistic results than trying to categorize them into discrete "bins."

Key Results

In head-to-head "Turing tests" on Amazon Mechanical Turk, the Seq2Seq + VIB model significantly outperformed K-Nearest Neighbor (KNN) baselines. For the Humanization and Tap2Drum tasks, listeners found the model-generated performances to be statistically indistinguishable from real human performances. Quantitatively, the Seq2Seq + VIB model achieved a Mean Absolute Error (MAE) of 18.47ms for timing—well within the threshold of what the human ear perceives as "natural" in a musical context.

Limitations and Future Work

While highly successful, the approach has limitations. The current preprocessing maps everything to a 16th-note resolution, meaning the model cannot currently represent or generate fast drum rolls or "drags" that occur at higher resolutions (32nd or 64th notes). Furthermore, because the dataset was recorded with a metronome, the models don't learn "rubato" (the natural slowing down or speeding up of a song's overall tempo).

Looking forward, the authors suggest applying these inverse transformations to other domains, such as text or video, where "compressed" representations (like a summary or a sketch) need to be expanded into rich, expressive realizations.

Summary updated

BibTeX
@inproceedings{gillick2019learning,
  author = {Jon Gillick and Adam Roberts and Jesse Engel and Douglas Eck and David Bamman},
  title = {{Learning to Groove with Inverse Sequence Transformations}},
  booktitle = {International Conference on Machine Learning},
  year = {2019},
  url = {https://openreview.net/forum?id=r1bWN3-_WH},
}
Figure