TL;DR
HarmonicRNN pushes the limits of autoregressive raw audio modeling by combining linear recurrent layers (specifically, Complex Gated LRUs) with hierarchical temporal pooling and context parallelism. By training on full one-minute raw audio waveforms (roughly 1M tokens at 16 kHz), the architecture achieves state-of-the-art sample quality and perceptual scores over previous models like SaShiMi and Mamba.
What Problem Does This Paper Address?
Generating raw audio autoregressively is notoriously difficult because high sample rates create massive sequence lengths (e.g., 16,000 samples for a single second) with dependencies spanning multiple temporal scales—from micro-level acoustic vibrations to macro-level musical phrasing.
Standard architectures struggle here:
- Transformers suffer from $O(T^2)$ compute and memory scaling, making generation of sequences near a million steps impractical.
- Traditional RNNs cannot parallelize over time during training and fail on extremely long contexts.
- Causal convolutions (like WaveNet) require very deep networks to expand their receptive fields.
While recent structured state-space models (linear RNNs) like SaShiMi established viable linear-time alternatives, training directly on raw minute-long sequences and achieving stable, high-fidelity long-term generation remains a challenging frontier.
Methods
HarmonicRNN builds upon the multi-scale pooling approach of SaShiMi with several crucial architectural and systems improvements:
- CG-LRU Recurrent Core: Rather than using the Structured State Space (S4) layer, the model utilizes the Complex Gated Linear Recurrent Unit (CG-LRU). Its hidden state recurrence, $h_t = a(u_t) \odot h_{t-1} + b(u_t)$, enables associative parallel prefix scans during training and fast $O(1)$ constant-time recurrent state updates during autoregressive generation.
- Grouped Pooling Convolutions: Instead of dense linear reshaping layers, down-pooling uses strided 1D convolutions and up-pooling uses transposed strided convolutions. Splitting channels into feature groups (e.g., 4 or 128 groups) was essential to stabilize training.
- Hierarchical Temporal Architecture: Employs a 4-level U-Net structure with down-pooling factors $[2, 4, 4, 5]$ (reducing sequence length up to $160\times$ at the bottleneck), totaling 36 temporal blocks.
- Fixed Sinusoidal Embeddings: Quantized 8-bit audio inputs are mapped into high dimensions via non-learned sinusoidal embeddings of varying frequencies, outperforming standard learned embeddings.
- Context Parallelism for 1M Tokens: Leveraged custom CG-LRU TPU kernels to split the sequence dimension across multiple TPU devices, allowing end-to-end training directly on 1-minute waveforms (960,512 tokens). Fast generation was handled using the Scanagram inference library.
Datasets
The authors evaluated on three standard 16 kHz, 8-bit quantized benchmarks:
- SC09: 1-second recordings (16,000 tokens) of spoken digits (0–9), used to measure negative log-likelihood (NLL) and perceptual quality metrics (FID and Inception Score).
- Beethoven: 8-second excerpts (128,000 tokens) from Beethoven piano sonatas (linear PCM encoding).
- YouTubeMix: Continuous 1-minute piano recordings (960,512 tokens, $\mu$-law encoded).
No new benchmarks were created; established splits from prior literature were used for fair comparison.
Key Insights and Ideas
- Perceptual coherence requires pooling, not just log-likelihood: Interestingly, removing temporal pooling slightly improved the token-level negative log-likelihood (1.854 to 1.852 NLL on SC09). However, perceptual quality collapsed: Fréchet Inception Distance (FID) degraded drastically from 0.46 to 2.95, and Inception Score dropped from 6.46 to 3.33. Pooling forces the model to capture high-level musical structure rather than over-focusing on low-level waveform noise.
- Inductive bias in pooling matters: Transitioning from dense pooling to grouped convolutions prevented training instabilities while slightly shrinking parameter count.
- Fixed sinusoidal embeddings speed up convergence: Replacing learned token embeddings with non-learned sinusoidal encodings led to substantially faster training convergence and lower final test loss.
Key Results
- SC09 Benchmark: HarmonicRNN established a new state-of-the-art across both likelihood and perceptual metrics against prior baselines:
- Test NLL: 1.848 (4-group model) vs. 1.852 (Mamba) and 1.873 (SaShiMi).
- FID: 0.46 (lower is better) vs. 0.94 (Mamba) and 1.99 (SaShiMi).
- Inception Score (IS): 6.46 (higher is better) vs. 6.26 (Mamba) and 5.13 (SaShiMi).
- Beethoven Dataset: Outperformed SaShiMi with a test NLL of 0.915 vs. 0.946.
- YouTubeMix: Achieved a competitive test NLL of 1.324 (vs. SaShiMi's 1.294), while being trained directly on full, non-truncated 1-minute clips.
- Throughput: Incorporating hierarchical pooling boosted inference throughput from 46 ktok/s (no pooling) to 103 ktok/s.
Limitations and Future Work
- Dataset Scope: Experiments are limited to small-scale, domain-specific benchmarks (single spoken words and solo piano music).
- NLL Gap on YouTubeMix: While the model generated coherent minute-long music samples, SaShiMi achieved a slightly better raw NLL score on YouTubeMix.
- Future Work: The authors emphasize scaling this linear RNN architecture to larger, multi-instrumental, and more diverse audio datasets.
Summary updated