Music generation with variational recurrent autoencoder supported by history

Alexey Tikhonov, Ivan P. YamshchikovarXiv 2017

Abstract

Generating music with artificial neural networks often struggles with maintaining long-term structural coherence. This paper introduces VRASH (Variational Recurrent Autoencoder Supported by History), a new neural architecture designed to generate longer, more diverse melodic patterns. By feeding previously generated notes back into the decoder as "historic" context, the model better captures the long-distance dependencies and complex structures found in human-composed music. Results indicate that VRASH outperforms standard language models and VAEs in cross-entropy metrics while producing more musically interesting structures.

Introduction

Generating music with artificial neural networks often hits a "boringness" wall. While standard Recurrent Neural Networks (RNNs) and Variational Autoencoders (VAEs) are effective at capturing local note transitions, they frequently struggle with the macro-structure of a song.

The authors identify a specific statistical hurdle: slow mutual information decline. In human music, a note played now still carries significant information about a note played much later. Most generative models fail to maintain this "thread," leading to sequences that are either statistically similar to the training data but musically nonsensical, or annoyingly repetitive. The challenge is to balance global structure (the "big picture" of a song) with local diversity (interesting note-to-note variations).

Methods

The core contribution is the VRASH architecture. It builds upon the standard VAE framework but adds a crucial twist: History Support. Unlike a standard VAE where the decoder generates sequences based primarily on a latent vector, the VRASH decoder "listens" to the notes it has already composed. These previous outputs are fed back in as additional "historic" inputs, helping the model maintain context over longer durations.

The VRASH architecture featuring an encoder-decoder structure with history support and variational Bayesian noise.

The model utilizes gated Recurrent Highway Networks (RHN) to process these sequences, which are known for handling longer internal dependencies better than standard LSTMs. Additionally, the authors developed a post-generation filtering mechanism using a classifier (Logistic Regression and SVC) trained on human-labeled data. This filter uses features like note entropy and length entropy to automatically discard unpleasing or repetitive tracks.

Datasets and Preprocessing

The researchers used a proprietary dataset of 4GB of MIDI files spanning various epochs and genres. Multi-track files were split into individual tracks, pitches were normalized to the 4th octave, and pauses were normalized based on median values. After filtering out low-entropy tracks to prevent overfitting, the final training set consisted of over 15,000 normalized tracks.

Key Results and Insights

Quantitatively, VRASH demonstrated superior performance in predicting musical sequences. In terms of cross-entropy, VRASH achieved a score of 2.11, outperforming a standard Language Model (2.34) and a baseline untrained network (~11.0).

Comparison of cross-entropy scores across different models, showing VRASH's superior performance.

Key insights from the study include:

  • The "History" Fix: Explicitly providing the history of generated notes to the decoder addresses the "slow mutual information decline" problem, forcing the model to stay "in the zone" of the current composition.
  • Entropy as a Quality Proxy: The paper suggests that "acoustically pleasing" music occupies a specific entropy sweet spot. By calculating the entropy of note changes and lengths, the model can mathematically identify tracks that humans would likely find engaging.
  • Filtering Success: The automated filtering mechanism was highly effective, achieving up to 87% recall on "good" tracks. This allows for a "pseudo-realtime" stream of high-quality music generation where the AI acts as its own critic.

Limitations and Future Work

While VRASH produces tracks with more interesting temporal structures, the authors acknowledge that evaluating art is inherently subjective. The filtering heuristics were largely trained on Bach-stylizations, and a filter optimized for one style might need retraining for another (e.g., Jazz) to avoid filtering out intentional complexity. Finally, the current work focuses on monotonic music; extending this "history support" to polyphonic music (chords and multiple instruments) remains a complex next step.

Summary updated

BibTeX
@misc{tikhonov2017music,
  author = {Alexey Tikhonov and Ivan P. Yamshchikov},
  title = {{Music generation with variational recurrent autoencoder supported by history}},
  year = {2017},
  eprint = {1705.05458},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1705.05458},
}
Figure