Linear RNNs for autoregressive generation of long music samples

Konrad Szewczyk, Daniel Gallo Fernández, James Townsend · DOI

Introduction

Generating raw audio waveforms remains a significant challenge in sequence modeling due to the extreme length of the data. At a standard sampling rate of 16 kHz, just one minute of audio corresponds to nearly a million tokens. Traditional architectures like Transformers face quadratic complexity ($O(T^2)$) that makes such lengths computationally prohibitive, while standard RNNs suffer from slow, non-parallelizable training. HarmonicRNN addresses these challenges by leveraging efficient linear RNNs combined with temporal pooling and context-parallelism to generate high-quality audio up to one minute in length.

Architecture and Methodology

The core of HarmonicRNN is the Complex Gated Linear Recurrent Unit (CG-LRU). Unlike standard RNNs, the linear recurrence allows for parallel processing during training via associative scans, providing the training efficiency of Transformers with the constant-time inference of RNNs.

The HarmonicRNN architecture features a U-Net structure with hierarchical temporal pooling and a core Complex Gated Linear Recurrent Unit (CG-LRU).

To capture multi-scale musical structures, the model employs a U-Net-inspired hierarchical structure. It uses "down-pooling" to reduce resolution for processing at higher semantic levels and "up-pooling" to reconstruct the original audio resolution. Key technical refinements include:

  • Grouped Convolutions: Using strided convolutions with multiple groups (specifically 4) for pooling was found to be critical for training stability compared to dense layers.
  • Sinusoidal Embeddings: Fixed sinusoidal embeddings were used instead of learned embeddings for the 8-bit audio values, leading to faster convergence and better final performance.
  • Context Parallelism: To handle million-token sequences, the model utilizes multi-host context parallelism across TPU devices to overcome memory constraints.

Experimental Results

The model was evaluated on the SC09 (speech digits), Beethoven (piano sonatas), and YouTubeMix (solo piano) datasets. HarmonicRNN achieved state-of-the-art results in perceptual quality, particularly on the SC09 benchmark.

Comparison of HarmonicRNN against baselines on the SC09 dataset, showing superior perceptual metrics (FID and IS).

As shown in the results table, HarmonicRNN achieved a Frechét Inception Distance (FID) of 0.46, significantly outperforming previous models like SaShiMi (1.99) and Mamba (0.94). In terms of likelihood, it reached a test negative log-likelihood (NLL) of 0.915 on the Beethoven dataset. Furthermore, the pooling architecture improved inference throughput to 103 ktok/s, more than doubling the speed of non-pooling variants.

Discussion and Conclusion

The success of HarmonicRNN reinforces the potential of linear recurrences (State Space Models) for ultra-long sequence modeling. A key insight from the study is that while models without pooling can achieve competitive NLL, the hierarchical structure is essential for capturing the long-term coherence necessary for musical "soul." Perceptual metrics plummeted when pooling was removed, proving its necessity for maintaining structural integrity over time.

Future work includes scaling the architecture beyond the current 7.3M parameters and testing its performance on more complex, multi-instrumental audio and higher fidelity sampling rates. While SaShiMi maintained a slight edge in NLL on the YouTubeMix dataset, HarmonicRNN's ability to model continuous one-minute sequences marks a significant step forward in autoregressive audio generation.

Summary updated

BibTeX
@inproceedings{szewczyk2025linear,
  author = {Konrad Szewczyk and Daniel Gallo Fernández and James Townsend},
  title = {{Linear RNNs for autoregressive generation of long music samples}},
  booktitle = {AI4Music @ NeurIPS},
  year = {2025},
  url = {https://openreview.net/forum?id=G1Y6QSvHyn},
}
Figure