AudioEditor: A Training-Free Diffusion-Based Audio Editing Framework

Yuhang Jia, Yang Chen, Jinghua Zhao, Shiwan Zhao, Wenjia Zeng, Yong Chen, Yong Qin

TL;DR

AudioEditor is a training-free framework that brings advanced image-editing diffusion techniques to the audio domain. By leveraging Null-text Inversion and End-of-Token (EOT) suppression on top of a pretrained text-to-audio model, it enables precise, flexible audio editing (addition, deletion, and replacement) while preserving unedited regions—all without requiring any fine-tuning or specialized datasets.

What Problem Does This Paper Address?

While text-to-audio (TTA) generation has flourished recently, editing existing audio remains a major challenge. An ideal audio editor needs to balance two conflicting goals: executing precise modifications guided by text (e.g., adding a dog bark or removing background applause) while leaving the rest of the original audio completely untouched.

Existing audio editing approaches typically suffer from two main drawbacks. They either require training specialized models on scarce, expensive triplet datasets (consisting of input audio, text instructions, and edited output audio), or they force users to rely on rigid, inflexible command formats (e.g., "add... at..."). The authors of this paper address these limitations by asking: Can we achieve flexible, high-fidelity audio editing using only a frozen, pretrained text-to-audio diffusion model?

Methods

AudioEditor utilizes Auffusion, a pretrained latent diffusion model (LDM) for text-to-audio generation, as its foundational framework. The complete pipeline consists of five main stages:

  1. Audio to Latent Space: The input audio is converted into a 2D mel-spectrogram and then encoded into a latent representation ($z_0$) using a Variational Auto-Encoder (VAE).
  2. DDIM Inversion & Null-text Optimization: To ensure the model can accurately reconstruct the original audio, the authors use DDIM inversion to map the latent state $z_0$ back to initial noise $z_T$. They introduce Null-text Optimization, which fine-tunes the unconditional (null-text) embeddings at each timestep. This closes the domain gap between real audio data and the generative model's latent space, ensuring high-fidelity reconstruction.
  3. EOT-suppression: Simply changing a text prompt can cause global drift in a diffusion model because the End-of-Token (EOT) embedding carries mixed contextual information. AudioEditor splits prompt tokens into "positive" (to preserve) and "negative" (to edit) types. It applies Singular Value Decomposition (SVD) to the negative and EOT embeddings, regularizing the singular values to either suppress components (for deletion) or enhance them (for addition/replacement).
  4. Attention Loss: Cross-attention maps between the prompt and audio embeddings are optimized at each step to further enforce that unedited regions remain stable while edited regions adapt to the target prompt.
Fig. 1: The overall workflow of AudioEditor. The workflow can be divided into 5 parts: A) audio space processing, B) spectrogram space processing, C) latent space processing, D) performing DDIM Inversion and Null-text Optimization, and E) performing EOT-suppression and Attention Loss updating.

Datasets

The framework was evaluated using the AudioCaps test set. The authors manually selected 300 audio samples well-suited for editing tasks and categorized them into three groups based on specific principles: addition (audio containing a single event), deletion, and replacement (audio with multiple events). They manually crafted target captions for each sample to guide the editing process and have open-sourced this evaluation dataset to facilitate future benchmarking.

Key Insights and Ideas

  • Cross-Modal Portability: Advanced inversion and editing techniques pioneered in text-to-image models (like Null-text Inversion) transfer remarkably well to audio when treating mel-spectrograms as 2D images within a latent diffusion space.
  • The Power of EOT Embeddings: Isolating and regularizing EOT tokens via SVD is the secret sauce for localized editing. Without this, modifying a single word in a prompt causes the entire audio background to morph unexpectedly.
  • Zero-Shot Viability: You do not need paired editing datasets to train an audio editor. Test-time optimization of null-text embeddings and attention maps is sufficient to achieve competitive performance.

Key Results

The authors compared AudioEditor against SDEdit (a popular diffusion-based image/audio editing baseline) and fully regenerated audio across objective and subjective metrics:

  • Editing Accuracy: AudioEditor achieved a CLAP text-audio alignment score of 57.6%, outperforming the SDEdit baseline (56.8%) and closely approaching the score of completely regenerated audio (59.2%).
  • Feature Preservation: In similarity tests with the original audio, AudioEditor achieved a lower Frechet Audio Distance (FAD = 4.95) than SDEdit (5.68), demonstrating its superior ability to preserve unedited context.
  • Subjective Quality: Human evaluators via Mean Opinion Scores (MOS) rated AudioEditor higher in both Relevance to the target text (3.88 vs 3.14) and Faithfulness to the original audio (3.82 vs 3.77) compared to SDEdit.
  • Ablation Verifications: Removing Null-text Optimization caused a significant spike in FAD (from 4.95 to 5.33), proving its necessity for feature retention. Conversely, removing EOT-suppression dropped the CLAP score, proving its vital role in editing precision.

Limitations and Future Work

The paper does not include a dedicated section on limitations, but a few constraints are apparent from the methodology:

  • Inference Latency: Because the framework relies on iterative optimization (10 iterations per diffusion timestep) during the inversion phase, it is computationally slower at inference time than a purely feed-forward trained model.
  • Dependence on the Base Model: As a training-free framework, its ultimate generation quality, audio fidelity, and vocabulary boundaries are strictly limited by the capabilities of the underlying pretrained TTA model (Auffusion).

Summary updated

BibTeX
@misc{jia2024audioeditor,
  author = {Yuhang Jia and Yang Chen and Jinghua Zhao and Shiwan Zhao and Wenjia Zeng and Yong Chen and Yong Qin},
  title = {{AudioEditor: A Training-Free Diffusion-Based Audio Editing Framework}},
  year = {2024},
  eprint = {2409.12466},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2409.12466},
}
Figure