Melodia: Training-Free Music Editing Guided by Attention Probing in Diffusion Models

Authors

  • Yi Yang South China University of Technology
  • Haowen Li South China University of Technology
  • Tianxiang Li South China University of Technology
  • Boyu Cao South China University of Technology
  • Xiaohan Zhang South China University of Technology
  • Liqun Chen South China University of Technology
  • Qi Liu South China University of Technology

DOI:

https://doi.org/10.1609/aaai.v40i3.37204

Abstract

Text-to-music generation technology is progressing rapidly, creating new opportunities for musical composition and editing. However, existing music editing methods often fail to preserve the source music's temporal structure, including melody and rhythm, when altering particular attributes like instrument, genre, and mood. To address this challenge, this paper conducts an in-depth probing analysis on attention maps within AudioLDM 2, a diffusion-based model commonly used as the backbone for existing music editing methods. We reveal a key finding: cross-attention maps encompass details regarding distinct musical characteristics, and interventions on these maps frequently result in ineffective modifications. In contrast, self-attention maps are essential for preserving the temporal structure of the source music during its conversion into the target music. Building upon this understanding, we present Melodia, a training-free technique that selectively manipulates self-attention maps in particular layers during the denoising process and leverages an attention repository to store source music information, achieving accurate modification of musical characteristics while preserving the original structure without requiring textual descriptions of the source music. Additionally, we propose two novel metrics to better evaluate music editing methods. Both objective and subjective experiments demonstrate that our approach achieves superior results in terms of textual adherence and structural integrity across various datasets. This research enhances comprehension of internal mechanisms within music generation models and provides improved control for music creation.

Published

2026-03-14

How to Cite

Yang, Y., Li, H., Li, T., Cao, B., Zhang, X., Chen, L., & Liu, Q. (2026). Melodia: Training-Free Music Editing Guided by Attention Probing in Diffusion Models. Proceedings of the AAAI Conference on Artificial Intelligence, 40(3), 2209–2217. https://doi.org/10.1609/aaai.v40i3.37204

Issue

Section

AAAI Technical Track on Cognitive Modeling & Cognitive Systems