Learn how diffusion models corrupt training examples with noise, learn to reverse that corruption, and generate music by gradually refining a noisy waveform, spectrogram, or latent representation.
About 13 minutes
Guiding question
How does random noise become structured audio?
By the end, you’ll be able to
Describe the forward noising process and reverse denoising process.
Explain how a noise schedule controls the amount of corruption at each diffusion step.
Distinguish diffusion in waveform, spectrogram, and latent spaces.
Explain why latent diffusion can reduce sequence size and computational cost.
Compare diffusion generation with autoregressive token generation.
Describe how DiffWave, AudioLDM, Noise2Music, Moûsai, and Stable Audio apply diffusion to audio or music.
The previous sections described models that generate a sequence by choosing one token after another. Diffusion models take a different route.
They begin with a noisy representation and repeatedly revise it. At first, the representation contains almost no recognisable music. After several denoising steps, broad shapes begin to appear. Later steps refine rhythm, timbre, texture, and local detail.
The model does not remove real microphone noise from an existing recording. It reverses an artificial corruption process created for training.
The two sides of diffusion
Swipe sideways to view the full comparison
Process
Direction
What happens
When it is used
Forward process
Clean data toward noise
Known amounts of noise are added to a training example
Preparing training inputs
Reverse process
Noise toward structured data
A trained model repeatedly estimates a cleaner representation
Generating new audio
Teaching the model with artificial corruption
Begin with a clean training representation called x0. This could be a waveform, spectrogram, or compressed latent.
The forward process adds a controlled amount of Gaussian noise:
x0 → x1 → x2 → ... → xT
Early versions remain close to the original. Later versions are increasingly corrupted. At a sufficiently noisy endpoint, xT resembles random noise much more than music.
Because the training system added the noise itself, it knows how much corruption was applied.
The schedule controls the difficulty
The model must learn from examples containing many levels of corruption. A nearly clean example requires small corrections. A heavily corrupted example requires the model to infer broad structure from weak evidence.
The noise schedule determines which corruption levels exist and how they are distributed across timesteps. A poor schedule can make useful learning or efficient sampling harder.
Later diffusion research introduced alternative schedules and samplers that reduce the number of model evaluations needed for generation.
What the model learns
Training does not always require running through the full corruption chain one step at a time.
Add the amount of noise associated with that timestep.
Give the noisy representation and timestep to the model.
Ask the model to predict the added noise or another equivalent denoising target.
Compare the prediction with the known target.
The model repeats this task across many recordings and noise levels.
One diffusion training step
1
Load a clean representation
Use a waveform, spectrogram, or latent representation from the training dataset.
2
Choose a timestep
Select how strongly the example will be corrupted.
3
Sample random noise
Generate a known noise tensor with the same shape as the representation.
4
Create the noisy input
Combine the clean representation and noise according to the schedule.
5
Predict the denoising target
Give the model the noisy input, timestep, and any conditions.
6
Calculate the loss
Compare the prediction with the known noise or equivalent training target.
Generating from noise
Once training is complete, the model no longer needs a clean example.
Generation begins with random noise called xT. The model receives that noisy state, the current timestep, and any condition such as a text prompt. It predicts how the representation should change.
The sampler uses that prediction to create a slightly cleaner state. The process repeats:
xT → x(T-1) → ... → x1 → x0
The final x0 is decoded or played as the generated audio.
The diffusion generation loop
1
Sample the initial noise
Create a random tensor in the waveform, spectrogram, or latent space.
2
Read the current timestep
Tell the model how noisy the current representation is expected to be.
3
Apply conditioning
Provide text, timing, melody, or another control signal when the model supports it.
4
Predict a denoising direction
Estimate the noise or another target needed by the sampler.
5
Update the representation
Move to a slightly cleaner state according to the sampler.
6
Repeat and decode
Continue until the final representation can be converted into audio.
More steps are not automatically better
Early diffusion systems often used long sampling chains. Later samplers showed that useful outputs could be produced with fewer evaluations.
Reducing the step count can make generation faster, but an aggressive reduction may weaken detail, stability, or prompt adherence. The best setting depends on the trained model, sampler, representation, and task.
A model trained with one noise process can also support more than one sampling procedure.
In practice
Real-world technique: DDIM sampling
Denoising Diffusion Implicit Models showed that models trained with the standard diffusion objective could be sampled through a different, non-Markovian process. This made it possible to reduce the number of sampling steps while preserving the same training procedure.
Diffusion and autoregression
Swipe sideways to view the full comparison
Question
Autoregressive model
Diffusion model
Starting point
A prompt, prefix, or start token
A random or partially corrupted representation
Main operation
Choose the next token
Refine the current representation
Commitment
Earlier selected tokens become fixed context
Many positions can change across several denoising steps
Generation order
Usually left to right or according to a token ordering
Repeated updates across the representation
Main cost
One model evaluation for each generated token or token group
Repeated model evaluations for denoising steps
Typical representation
Discrete event or codec tokens
Continuous waveform, spectrogram, or latent values
Where can diffusion happen?
Diffusion is a method for modelling a distribution. It does not require one specific music representation.
An audio model can diffuse:
Raw waveform values
Spectrogram values
Compressed continuous latents
An intermediate representation inside a cascade
The choice changes the size of the problem, what information is represented directly, and which decoder is needed afterward.
Choosing the diffusion space
Swipe sideways to view the full comparison
Space
Main advantage
Main challenge
Example
Waveform
Models playable audio directly
Very large representation with many samples
DiffWave
Spectrogram
Makes frequency structure explicit
Requires phase recovery or a vocoder
Spectrogram-based audio systems
Compressed latent
Reduces the size of the denoising problem
Quality depends on the encoder and decoder
AudioLDM, Moûsai, Stable Audio
Intermediate cascade representation
Separates generation from final audio refinement
Errors can pass from one stage into the next
Noise2Music
Why generate in a latent space?
A waveform sampled at 44.1 kHz contains 44,100 sample values per channel for every second of audio. A compressed latent can represent the same duration with far fewer positions.
Diffusion in that latent space reduces the size of each model input and denoising update. The model can spend more capacity on musically useful variation instead of reconstructing every waveform sample directly.
The trade-off is that the autoencoder becomes part of the final quality limit. If the latent representation loses a transient, stereo cue, or high-frequency texture, the diffusion model cannot fully recover it later.
In practice
Real-world example: DiffWave
DiffWave applies diffusion directly to waveforms. It can generate audio unconditionally or work as a neural vocoder conditioned on a mel-spectrogram. The model converts white noise into a structured waveform over a fixed series of denoising steps.
Real-world example: AudioLDM
AudioLDM performs diffusion in a compressed audio representation rather than directly in waveform space.
Its autoencoder represents mel-spectrogram information in a latent space. The diffusion model generates that latent, after which the latent is decoded to a mel-spectrogram and converted into a waveform.
AudioLDM also uses CLAP, a shared audio-language embedding model. During training, audio embeddings can provide the condition. During text-to-audio sampling, aligned text embeddings guide generation.
In practice
Why the AudioLDM setup matters
AudioLDM showed that a latent diffusion system trained with audio conditions could use aligned text embeddings during sampling. This reduced its dependence on paired text descriptions for every training recording while still allowing text-guided generation.
Real-world example: Noise2Music
Noise2Music uses a cascade of diffusion models for text-conditioned music generation.
A generator first creates an intermediate audio representation from the text condition. A cascader then generates higher-fidelity audio while conditioning on that intermediate result and, depending on the configuration, the text.
The system was designed to generate 30-second music clips. It demonstrates that diffusion can be combined with the hierarchical design discussed in Section 3.
In practice
Real-world example: Moûsai
Moûsai uses a two-stage latent diffusion design. A diffusion autoencoder compresses audio, and a text-conditioned latent diffusion model generates inside that compressed space. The paper reports stereo music generation at 48 kHz over multi-minute durations.
Real-world example: Stable Audio
The Stable Audio research system uses a diffusion Transformer operating on a highly downsampled continuous audio latent.
Its conditioning includes text and timing information. Timing lets the model receive a requested duration and position within the training audio, rather than treating every clip as an unstructured fixed-length segment.
The paper reports generation of music lasting up to 4 minutes and 45 seconds using a latent rate of 21.5 positions per second.
Guiding the denoising path
Without a condition, the model learns to generate examples from its overall data distribution. With a condition, the model learns how the denoising direction changes for a prompt, class, melody, timing signal, or another input.
A prompt such as slow ambient strings with distant choir should make some denoising paths more likely than others. The condition does not select one finished recording. It influences the repeated updates that shape the result.
Common diffusion misconceptions
Swipe sideways to view the full comparison
Misconception
More accurate explanation
The model cleans an existing noisy recording
Standard generation starts from newly sampled noise and constructs an original representation
The song is already hidden inside the noise
The generated path is created by the trained model, sampler, conditions, and random seed
Every denoising step adds one musical event
Each step can revise values across the complete current representation
Latent noise should sound like hiss
A latent may not correspond directly to audible sound until decoded
More denoising steps always improve the result
Useful step counts depend on the sampler and model
Diffusion is fully parallel
Positions can be updated together, but denoising iterations remain sequential
Strengths and limitations of diffusion
Swipe sideways to view the full comparison
Area
Strength
Limitation
Global revision
Many positions can change during each denoising step
Several full model evaluations are still required
Conditioning
Text and other signals can guide every refinement stage
Guidance can reduce diversity or create artifacts
Latent modelling
Compression makes long audio more manageable
The autoencoder can remove useful detail
Editing
Partial corruption can support inpainting and transformation
Preserving untouched content precisely can be difficult
Variation
Different seeds can produce different results from one prompt
Results can be difficult to reproduce without recording all settings
Long-form music
Low-rate latents can cover long durations
Long duration does not automatically guarantee coherent musical form
Interactive lesson
Scrub Through Diffusion Steps
Try it: Start with the latent-space example and inspect the visual clean estimate at several steps. Compare the same deterministic seed with different prompts, guidance scales, and step counts. Then switch to waveform and spectrogram modes to see how the chosen representation changes the process.
A diffusion model begins with random values in a waveform, spectrogram, or latent space. It repeatedly predicts how the representation should change toward cleaner data. Conditions such as text guide each denoising update, and a decoder converts the final latent or spectrogram into playable audio.
Directing the result
Diffusion explains how a noisy representation becomes music, but it does not yet explain how a user controls that process.
The next section, Conditioning and Control, follows text prompts, melody inputs, timing signals, audio references, and guidance scales through the model. It also examines what happens when several conditions point in different directions.
Check your understanding
Ready for a quick check?
Test whether you can explain forward corruption, reverse denoising, latent diffusion, sampling, and real music-diffusion systems.
Ready to continue?
Save this section to your account and continue from any device.