STAGE: Stemmed Accompaniment Generation Through Prefix-Based Conditioning

Giorgio Strano, Chiara Ballanti, Donato Crisostomi, Michele Mancusi, Luca Cosmo, Emanuele Rodolà

Introduction

Recent advancements in generative music models, such as MusicGen and MusicLM, have demonstrated a remarkable ability to synthesize high-quality audio from text prompts. However, these models are primarily designed for "from-scratch" generation, which often diverges from the iterative workflow of human musicians. In professional composition, artists typically build tracks layer by layer—recording a melody and then seeking a rhythmically synchronized bassline or drum track.

Existing solutions for accompaniment generation frequently struggle with rhythmic precision and architectural complexity. Standard cross-attention mechanisms often fail to maintain the strict timing required for musical coherence, while other models require massive datasets and heavy auxiliary encoders. This paper introduces STAGE (STemmed Accompaniment GEneration), a parameter-efficient approach that utilizes prefix-based conditioning to generate single-instrument stems that are perfectly synchronized with existing audio tracks.

Methodology

Prefix-Based Conditioning

The core innovation of STAGE is the move away from separate conditioning encoders in favor of a "prefix-based" approach. The researchers fine-tuned the MusicGen-Small architecture (~400M parameters) by treating the background context audio as a prompt directly within the transformer's input sequence.

  1. Tokenization: The context audio (the background track) is tokenized using the EnCodec neural audio codec.
  2. Sequence Construction: These context tokens are prepended to the beginning of the transformer's input. To distinguish between the "prompt" and the "generation," the authors introduced a unique context token into the model's embedding matrix. This token acts as a separator, signaling the transition from the background context to the target accompaniment.
  3. Self-Attention Dynamics: By placing both the context and the generated tokens within the same self-attention stream, the model learns a direct, token-to-token correspondence. This allows the transformer to attend to specific rhythmic events in the context with high temporal resolution, a significant improvement over the "blurred" dependencies often found in cross-attention models.

Tempo and Rhythmic Control

To address the need for strict tempo adherence, STAGE can be conditioned on a metronome-like click track. During training, the model learns to treat these clicks as a rhythmic grid, allowing it to generate accompaniments that remain "on the beat" even when the musical context is sparse or complex.

Experimental Setup

Datasets

The model was trained and evaluated using two primary datasets:

  • MoisesDB: A multi-stem dataset of 240 songs. Training pairs were created by mixing random subsets of stems to serve as the context, with the missing instrument (e.g., drums or bass) serving as the target.
  • MusDB: Utilized for evaluation to test the model's performance against real-world beat structures and musical mixtures.

Metrics

Performance was measured using two primary metrics:

  • COCOLA Score: Assessing the musical coherence and quality of the generated audio.
  • F1 Score: Measuring the accuracy of rhythmic alignment between the generated stem and the context beats.

Results

STAGE was compared against state-of-the-art baselines, including Instruct-MusicGen and SA-ControlNet. Despite its smaller parameter count, STAGE demonstrated superior performance in both musicality and alignment.

  • Musical Coherence: In drum generation tasks, STAGE achieved a COCOLA score of 61.02, outperforming Instruct-MusicGen (48.24) and SA-ControlNet (57.46).
  • Rhythmic Precision: STAGE-drums reached a rhythmic alignment F1 score of 66.88 on MusDB. When provided with a dedicated metronome click track as context, this score improved to 71.57, highlighting the model's sensitivity to rhythmic prompts.
  • Efficiency: The model's lightweight design allows for rapid training; the authors successfully trained the system in less than 24 hours on a single NVIDIA RTX 3090 GPU.

Discussion and Future Work

STAGE demonstrates that parameter-efficient fine-tuning can outperform much larger models when the conditioning mechanism is properly aligned with the task's requirements. The use of self-attention for prefix-based conditioning proves particularly effective for tasks requiring high temporal precision.

However, limitations remain. The current study focused on drums and bass, which have relatively consistent roles in a mix. Instruments with higher variability, such as guitars or synthesizers, will likely require larger and more diverse datasets than the 240 songs currently available in MoisesDB. Future research will explore expanding the instrument vocabulary and introducing more granular control parameters, such as velocity and swing, directly through the prefix conditioning interface.

Summary updated

BibTeX
@inproceedings{strano2025stage,
  author = {Giorgio Strano and Chiara Ballanti and Donato Crisostomi and Michele Mancusi and Luca Cosmo and Emanuele Rodolà},
  title = {{STAGE: Stemmed Accompaniment Generation Through Prefix-Based Conditioning}},
  booktitle = {ISMIR},
  year = {2025},
  doi = {10.5281/zenodo.17706555},
}
Figure