Efficient Fine-Grained Guidance for Diffusion Model Based Symbolic Music Generation

Tingyu Zhu, Haoyu Liu, Ziyu Wang, Zhimin Jiang, Zeyu Zheng

Introduction

While diffusion models have revolutionized image and video generation, applying them to symbolic music (like MIDI) presents unique hurdles. In an image, a slightly "off" pixel is often unnoticeable; in music, a single out-of-key note is a glaring error that can ruin the listener's experience.

This paper introduces Fine-Grained Guidance (FGG), a novel method designed to ensure diffusion models generate symbolic music that is both harmonically precise and highly controllable. By integrating a "hard control" projection step into the denoising process, FGG eliminates jarring out-of-key notes and allows for real-time, interactive music creation that strictly adheres to user-specified keys and rhythms.

The Challenge of Symbolic Music

The authors identify two primary challenges in generating symbolic music with diffusion models:

  1. Imprecise Detail: Diffusion models frequently produce "hallucinated" notes that clash with the established harmonic context.
  2. Limited Controllability: Forcing a model to follow a specific chord progression or rhythmic pattern without retraining it from scratch is notoriously difficult.

Furthermore, high-quality symbolic music data is scarce due to copyright restrictions. The authors theoretically prove that the error rate for "unresolved" out-of-key notes decays very slowly ($O(n^{-1/(LH)})$) as dataset size increases. This means simply scaling up the training data is not a viable solution to the wrong-note problem.

Methodology: Fine-Grained Guidance (FGG)

To overcome these limitations, the researchers developed Fine-Grained Guidance (FGG), which operates in two distinct phases:

1. Conditioning in Training: The model is trained using a multi-channel piano roll representation on the POP909 dataset (a collection of pop song MIDIs, filtered to a 4/4 time signature and 16th-note resolution). It learns to associate music with fine-grained harmonic (chord) and rhythmic (onset) conditions using classifier-free guidance.

2. Hard Control in Sampling: During the denoising process, the model predicts the final clean music ($X_0$) at every step. FGG intercepts this prediction and projects it onto a constrained domain.

Fine-grained guidance mask for chord and rhythm conditioning

As illustrated above, this acts as a "musical filter" that mathematically ensures only notes within the allowed key signature or rhythmic grid are permitted. This adjusted prediction is then used to guide the next step of the diffusion process. The authors provide a theoretical framework using SDE formulations and Girsanov’s Theorem to prove that this hard guidance shapes the generation toward the desired tonal quality without breaking the model's learned internal logic (like melodic flow).

Key Insights

  • The "Hard Control" Advantage: While most models use "soft" conditioning (encouraging the model to follow a chord), FGG uses "hard" control, mathematically forbidding out-of-key notes during sampling.
  • Inherent Generative Flaws: The paper's statistical proof demonstrates why generative models naturally struggle to resolve out-of-key notes, justifying why external, hard guidance is a necessity for high-fidelity music AI.
  • Zero-Shot Flexibility: Because the guidance happens during sampling, users can change the "key" of the generation in real-time without any retraining (e.g., forcing a model trained on Major scales to play in the Dorian mode).

Results and Performance

The FGG approach was evaluated against state-of-the-art baselines, including WholeSongGen and GETMusic.

Quantitative comparison of FGG against baseline models

As shown in the results table, FGG dramatically outperforms existing methods:

  • Zero Dissonance: FGG achieved an unprecedented 0.0% out-of-key notes, compared to the 2.1%–3.5% error rates seen in baseline models.
  • Superior Accuracy: FGG reached a Direct Chord Accuracy of 0.485, significantly higher than WholeSongGen (0.314) and GETMusic (0.153).
  • Human Preference: In subjective evaluations, experienced listeners rated FGG higher across all dimensions, including creativity, harmony, and naturalness.
  • Efficiency: The system is highly optimized, taking only ~0.4 seconds to generate a 4-measure accompaniment on a modern GPU, enabling true real-time interaction.

Limitations and Future Directions

While highly effective, the current model relies on a quantized 16th-note grid. This simplifies the mathematics but prevents the model from capturing the micro-timing nuances of human performance, such as swing, rubato, or expressive delays. Additionally, the "piano roll" format, while practical, does not easily accommodate more abstract musical structures.

Future work will focus on integrating pitch-class-based control with dynamic, high-resolution timing (e.g., 10ms resolution) to capture more expressive performances. The authors also aim to develop better automatic evaluation metrics that align more closely with human musical judgment.

Summary updated

BibTeX
@inproceedings{zhu2025efficient,
  author = {Tingyu Zhu and Haoyu Liu and Ziyu Wang and Zhimin Jiang and Zeyu Zheng},
  title = {{Efficient Fine-Grained Guidance for Diffusion Model Based Symbolic Music Generation}},
  booktitle = {International Conference on Machine Learning},
  year = {2025},
  url = {https://openreview.net/forum?id=oo6ucNx10s},
}
Figure