LoopGen: Training-Free Loopable Music Generation

Davide Marincione, Giorgio Strano, Donato Crisostomi, Roberto Ribuoli, Emanuele Rodolà

Abstract

LoopGen is a training-free framework designed to enable non-autoregressive (NAR) music models to generate seamless, perfectly repeatable audio loops. By implementing a "circular padding" strategy during inference, the model aligns the end of a track with its beginning. This approach results in a 55% improvement in transition consistency and a 70% boost in human-rated loop quality without requiring specialized datasets or expensive retraining.

1. Introduction

In modern music production—particularly in electronic, hip-hop, and dance genres—loops serve as fundamental building blocks. A "perfect loop" must transition from its final millisecond back to its first without audible clicks, rhythmic jumps, or harmonic clashes.

Existing state-of-the-art generative models like MusicGen or MAGNeT typically generate music linearly. Because they lack an inherent understanding of the looping constraint, the "seam" (the junction where the end meets the start) is often jarring. Previous solutions required retraining on specialized datasets or slow post-processing. LoopGen addresses this problem at the source during the generation process itself.

2. Methodology

LoopGen leverages the architecture of Non-Autoregressive (NAR) Transformers, such as MAGNeT. Unlike autoregressive models that predict tokens sequentially from left to right, NAR models predict multiple tokens simultaneously and refine them over several iterations. This bidirectional attention allows tokens at the end of a loop to "see" the beginning.

2.1 Circular Padding (Audio Tiling)

The core innovation is a circular padding strategy. The model defines a central "main tile" representing the actual loop, which is flanked by "left padding" and "right padding."

Illustration of the circular padding (audio tiling) mechanism where the main tile is flanked by periodic extensions to ensure continuity.

Before each refinement step, the algorithm copies the beginning of the main tile into the right padding and the end of the main tile into the left padding. Because the model uses non-causal attention, the tokens at the end of the loop are forced to generate content that naturally flows back into the start.

2.2 Hybrid Variants and Beat Alignment

To further enhance quality, the paper introduces a Hybrid Variant that uses MusicGen to create a high-quality initial "prompt" for the first half of the loop. Additionally, a Beat-Alignment Algorithm ensures the loop length matches musical bars (e.g., exactly 4 or 8 bars), preventing rhythmic hiccups.

3. Evaluation and Metrics

Since LoopGen is an inference-only method, evaluation was conducted using 100 textual prompts and the FMA-Pop dataset for Fréchet Audio Distance (FAD) calculations.

A critical contribution of this work is the introduction of Seam Perplexity. This metric measures the "surprise" (entropy) of a model at the transition point. If the transition from the end back to the start is highly predictable, the loop is considered seamless.

4. Key Results

LoopGen achieved a 55% improvement in Seam Perplexity compared to naive baselines. As shown in the distribution of perplexity scores, the tiling approach significantly shifts the model's performance toward lower (better) entropy at the seam.

Distribution of Seam Perplexity across models; lower values indicate more seamless transitions at the loop point.

In blind listening tests, human users rated the "imperceptibility of the seam" on a 1-5 scale. LoopGen's mean rating was 70% higher than the baseline, moving from "evident cut" toward "imperceptible." Furthermore, the Hybrid version achieved the best FAD scores, indicating that the method improves looping without sacrificing overall audio fidelity.

5. Conclusion

LoopGen demonstrates that creative inference-time modifications can solve complex generative constraints without the need for additional training data or increased GPU resources. While the quality remains dependent on the base NAR model, the circular logic applied here offers a blueprint for other iterative generative tasks, such as tileable textures or periodic time-series data.

Summary updated

BibTeX
@inproceedings{marincione2025loopgen,
  author = {Davide Marincione and Giorgio Strano and Donato Crisostomi and Roberto Ribuoli and Emanuele Rodolà},
  title = {{LoopGen: Training-Free Loopable Music Generation}},
  booktitle = {ISMIR},
  year = {2025},
  doi = {10.5281/zenodo.17706509},
}
Figure