SongCraft: Unified Song Generation and Editing with Reconstructive Learning

Haohe Liu, Varun Nagaraja, Gael Le Lan, Xinhao Mei, Zhaoheng Ni, Vikas Chandra, Abdelrahman Mohamed, Yangyang ShiarXiv 2026

TL;DR

SongCraft unifies song generation and fine-grained editing into a single latent flow matching model via reconstructive pretraining. By treating generation and editing as sparse versus dense points on a single conditioning spectrum, a single model can either create diverse new songs from text or precisely modify attributes like melody, lyrics, and singer identity without requiring paired training data or finicky noise tuning.

What Problem Does This Paper Address?

AI-driven music creation has advanced rapidly, but song generation (creating music from scratch) and song editing (modifying an existing track) have traditionally been treated as entirely separate problems.

Existing song editing methods suffer from major drawbacks:

  • Inversion-based methods inject noise and regenerate audio, but they require delicate hyperparameter tuning; too much noise destroys the original song, while too little prevents meaningful edits.
  • Inpainting-based methods mask specific time regions to replace them, but they require manual boundary selection and cannot handle global changes like voice conversion.
  • Paired-data finetuning relies on scarce, hard-to-curate "before and after" training pairs, limiting edits to simple operations like adding or removing an instrument.
Comparison of song editing paradigms.

SongCraft addresses these challenges by introducing a unified framework that handles both generation and precise, deterministic editing within a single architecture.

Methods

The core intuition behind SongCraft is that generation and editing exist on the same conditioning spectrum. Generation uses sparse conditions (e.g., text descriptions and lyrics), leaving the model free to fill in the musical blanks. Editing uses dense conditions (e.g., precise word timestamps, vocal MIDI, chords, and speaker embeddings) to tightly constrain the output to a target song.

The conditioning spectrum mapping sparse generation to dense editing.

Reconstructive Pretraining

During training, the model randomly alternates between a generation mode (conditioned only on sparse inputs) and a reconstruction mode (conditioned on dense inputs extracted from the source audio). This multitask approach allows editing to emerge naturally: to edit a song, a user extracts its dense attributes, modifies one (e.g., changes the vocal MIDI sequence), and keeps the rest fixed during reconstruction.

Model Architecture

SongCraft is built on Latent Flow Matching, utilizing a Diffusion Transformer (DiT) backbone operating on a Variational Autoencoder (VAE) latent space.

System overview of SongCraft's training and inference modes.

Key technical innovations include:

  1. Word-Level Phoneme Alignment: Instead of concatenating text and phonemes blindly, SongCraft fuses text and phoneme embeddings at the word level before passing them to the DiT via cross-attention. This provides an explicit inductive bias for pronunciation without requiring external forced-alignment tools.
  2. Beat Conditioning: The model incorporates explicit frame-aligned embeddings for beats and downbeats, significantly improving rhythmic structure.
  3. VAE Representation Alignment (REPA): The authors extend REPA to the VAE latent space, aligning it with a pretrained music understanding model (MusicFM). This ensures the latent space inherits semantically meaningful musical structures, accelerating downstream DiT training.
  4. Residual Audio Encoder: To capture unquantifiable acoustic details (like reverb or background textures), a separate encoder compresses the source audio into a small number of tokens ($M$).

Datasets

The model was trained on an internal dataset of songs spanning diverse genres. To ensure high audio quality, the dataset was filtered using AudioBox Aesthetics (A4) scores, retaining only tracks with high production complexity, quality, and enjoyment metrics. The final training set consisted of English vocal tracks longer than 30 seconds, evaluated against a verified held-out test set of 945 tracks. Text descriptions were sourced from LP-MusicCaps.

Key Insights and Ideas

  • The Bottleneck Trade-off ($M$): The number of tokens ($M$) allocated to the residual encoder governs a strict trade-off between reconstruction fidelity and editability. If $M$ is too small, the model lacks acoustic detail. If $M$ is too large, a fascinating "condition-bypass" effect occurs: the residual encoder smuggles all the original song's information past the explicit control knobs, destroying the model's ability to edit and paradoxically degrading reconstruction quality due to overfitting. The authors found $M=15$ to be the optimal Pareto-frontier sweet spot.
  • Cascading REPA Alignment: Aligning both the VAE latent space and the intermediate DiT layers with MusicFM features creates a cascading effect. Pre-aligning the VAE makes the flow-matching task significantly easier, leading to faster convergence and lower final loss.
  • The Intelligibility vs. Musicality Trade-off: Ablation studies revealed an inverse relationship between lyrics intelligibility (Word Error Rate) and musical quality. Removing beat conditioning actually improved the Word Error Rate but severely degraded musicality and coherence, proving that rhythmic constraints compete with linguistic optimization.

Key Results

SongCraft outperforms recent open-source song generation baselines (including YuE, DiffRhythm, and LeVo) across both objective and subjective metrics:

  • Vocal Intelligibility: SongCraft achieved a Word Error Rate (WERs) of 0.133, representing a 31% relative improvement over the next-best baseline (LeVo at 0.193).
  • Subjective Evaluation: In Mean Opinion Score (MOS) listening tests conducted with music professionals, SongCraft scored highest in 5 out of 6 dimensions, including Overall Quality (4.075 vs. LeVo's 3.150) and Text Adherence.
  • Deterministic Editing: The model successfully demonstrated precise, independent control over lyrics, vocal melody, beats, and singer identity without requiring paired data or stochastic noise tuning.

Limitations and Future Work

  • Speaker Leakage: The residual encoder occasionally captures speaker-specific characteristics alongside background textures. When performing voice conversion (swapping speaker embeddings), these residual cues can conflict with the target identity, causing artifacts—especially in cross-gender conversions.
  • Upstream Dependencies: Editing performance is bounded by the accuracy of the upstream tools used to extract chords, pitch (F0), and timestamps.
  • Lack of Preference Optimization: SongCraft was trained purely on flow-matching objectives. Applying post-training techniques like Direct Preference Optimization (DPO)—which baselines like LeVo use—could further enhance its perceptual audio quality.

Summary updated

BibTeX
@misc{liu2026songcraft,
  author = {Haohe Liu and Varun Nagaraja and Gael Le Lan and Xinhao Mei and Zhaoheng Ni and Vikas Chandra and Abdelrahman Mohamed and Yangyang Shi},
  title = {{SongCraft: Unified Song Generation and Editing with Reconstructive Learning}},
  year = {2026},
  eprint = {2609.16315},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2609.16315},
}
Figure