TL;DR
Audio Prompt Adapter (AP-Adapter) is a lightweight, 22-million-parameter module that equips pre-trained text-to-music diffusion models (specifically AudioLDM2) with zero-shot audio editing capabilities. By injecting acoustic features from AudioMAE through decoupled cross-attention layers, it allows users to perform tasks like timbre transfer, genre alteration, and accompaniment generation using simple text prompts while preserving the core musical structure.
What Problem Does This Paper Address?
While modern text-to-music models can synthesize realistic audio from scratch, editing an existing musical recording remains difficult. Effective music editing requires balancing two competing goals:
- Transferability: Faithfully executing the text instruction (e.g., swapping a violin for a flute or shifting styles to jazz).
- Fidelity: Preserving the input's unedited structural elements (e.g., pitch, rhythm, tempo, and dynamics).
Prior approaches either lack fine-grained acoustic control, require extensive supervised datasets of paired triplets (source audio, text instruction, target audio), or rely on complex multi-stage pipelines and caption-matching LLMs. Furthermore, fine-tuning large 1B+ parameter models from scratch is computationally prohibitive for most researchers.
Methods
Inspired by Image Prompt Adapter (IP-Adapter) from computer vision, the authors freeze the 1.5B-parameter AudioLDM2 backbone and introduce decoupled cross-attention adapters totaling just 22M parameters:
Input Audio x ──> AudioMAE ──> Pool(rate=ω) ──> Audio Cross-Attention (zaudio) ──┐
├──> zfusion = ztext + α * zaudio ──> U-Net
Input Text y ──> Text Encoder (Flan-T5/CLAP) ──> Text Cross-Attention (ztext) ──┘
- Feature Extraction & Pooling: The input audio is encoded using AudioMAE into "Language of Audio" (LOA) features. Because raw LOA leads to near-verbatim reconstruction, the authors apply combined mean- and max-pooling with a tunable pooling rate ($\omega$). Varying $\omega \in \{1, 2, 4, 8\}$ during training allows users to dynamically trade off fidelity and transferability at inference.
- Decoupled Cross-Attention: The frozen U-Net’s original text cross-attention layers handle prompt transferability. An added parallel cross-attention layer consumes the pooled audio features. Its output is scaled by an audio prompt weight $\alpha$ and added to the text representation: $$\mathbf{z}_{\text{fusion}} = \mathbf{z}_{\text{text}} + \alpha \mathbf{z}_{\text{audio}}$$
- Weight Initialization: Because AudioLDM2 aligns text features with AudioMAE representations during pre-training, initializing the adapter weights directly from the pre-trained text projection matrices significantly accelerates convergence.
- Inference with Negative Prompts: The diffusion sampling process incorporates negative text prompts (e.g., penalizing the original instrument's timbre or generic "low quality music") within classifier-free guidance (CFG).
Datasets
- Training: ~200,000 10-second audio clips with text tags sampled from AudioSet (~500 hours, roughly 10% of the dataset).
- Evaluation:
- In-domain: 40 monophonic 10-second clips from YouTube across 8 common Western instruments (piano, violin, cello, flute, marimba, organ, harp, acoustic guitar).
- Out-of-domain: 35 monophonic clips featuring 7 traditional ethnic instruments (2 Chinese instruments and 5 Korean instruments from AIHub) unseen during training.
Key Insights and Ideas
- Decoupled attention prevents catastrophic interference: Instead of forcing audio and text into a concatenated joint embedding, separate cross-attention branches allow the network to balance text instructions and audio structure independently via the hyperparameter $\alpha$.
- Feature pooling acts as an information bottleneck: Full-resolution LOA features encode too much timbral detail for tasks like instrument transfer. Downsampling acoustic tokens via pooling acts as an abstraction knob: low pooling rates keep fine details, while higher rates retain only high-level melody and rhythm.
- Zero-shot out-of-domain generalization: Even though the adapter is trained only on standard AudioSet audio, it successfully adapts traditional Chinese and Korean instruments because the underlying AudioMAE features capture universal melodic and rhythmic contours.
Key Results
The authors evaluated AP-Adapter across three tasks: timbre transfer, genre transfer, and accompaniment generation, comparing against AudioLDM2 (via SDEdit) and MusicGen-Melody:
- Objective Metrics (averaged across in-domain tasks):
- Fidelity (Chroma Cosine Similarity): AP-Adapter achieved 0.777, edging out MusicGen (0.771) and substantially outperforming AudioLDM2-SDEdit (0.643).
- Transferability (CLAP score): AP-Adapter scored 0.314 (higher than AudioLDM2’s 0.284; MusicGen scored 0.339, but did so by discarding all non-melodic acoustic details).
- Audio Quality (FAD $\downarrow$): AP-Adapter scored 5.986, vastly outperforming MusicGen (8.443) and remaining close to native AudioLDM2 (5.389).
- Subjective Listening Tests: In user studies (30 participants evaluating transferability, fidelity, and overall preference on a 5-point Likert scale), AP-Adapter outperformed both baselines in 16 out of 18 comparisons, demonstrating particularly large gains in fidelity on both in-domain and out-of-domain instruments.
- Efficiency: Training required only 35k steps on a single consumer GPU (NVIDIA RTX 3090, 24GB).
Limitations and Future Work
- Evaluation Metric Blind Spots: Standard objective metrics like Chroma similarity capture harmonic pitch content but overlook percussive patterns, phrasing, and dynamics. Furthermore, CLAP and FAD cannot reliably evaluate non-Western, out-of-domain instruments.
- Input Constraints: Current experiments focus primarily on short (10-second) monophonic melodic lines rather than complex, full-length polyphonic mixes.
- Future Directions: Extending the decoupled adapter strategy to autoregressive music architectures (e.g., MusicGen), supporting localized region-based inpainting edits, and testing more diverse, open-ended editing commands.
Summary updated