34 / 34 · Audio Generation
Audio generation: text-to-speech and music
The course's models applied to sound: mel spectrograms and vocoders, Glow-TTS as a flow with a text-conditioned prior, neural codecs that turn a waveform into a few token streams, and MusicGen.
Autoregressive transformers: ImageGPT, VQGAN, DALL·E and Parti · Flow architectures · VAE variants: β-VAE and VQ-VAE · Latent diffusion and Stable Diffusion
On this page 9
One second of mono audio sampled at 22,050 Hz contains 22,050 sample values. Under standard ancestral sampling, a model that generates it one number at a time, as WaveNet does, runs its network 22,050 times for that second; a three-minute song at 32 kHz is almost six million numbers.
How do we make sound short enough for the models of the course? Speech systems keep a continuous summary, the mel spectrogram, and Glow-TTS generates it with a normalizing flow whose prior is set by the text. Music systems compress the waveform into a few streams of discrete codes, as VQGAN compressed images in the previous note, and MusicGen generates the codes with one transformer.
Sound as a signal#
A microphone converts pressure variations into an electrical signal. Sampling it times per second gives a waveform; normalized digital audio commonly represents its samples in . By the Nyquist–Shannon sampling theorem, a signal with no frequency at or above is determined by its complete infinite grid of exact samples; finite clips and quantized values introduce further limits. Higher frequencies fold onto lower ones, as the StyleGAN3 section derives. LJ Speech, the single-speaker corpus used in the cited TTS experiments, has about 24 hours of 16-bit audio at 22,050 Hz (Ito and Johnson, 2017).
The spectrogram says which frequencies are present when. The short-time Fourier transform cuts the waveform into overlapping windows and takes the Fourier transform of each; the magnitudes form a time–frequency image. With a window of 1024 samples (46.4 ms) and a hop of 256 samples (11.6 ms), the frame rate is per second. A finite clip has an integer number of windows: with no padding, 22,050 samples give windows. Padding changes this count.
The mel spectrogram compresses the frequency axis the way hearing does. Our pitch resolution is fine at low frequencies and coarse at high ones, and the mel scale follows it:
which maps 1000 Hz to approximately 1000 mel and the Nyquist frequency of 11,025 Hz to 3176 mel. A bank of triangular filters, equally spaced in mel, aggregates spectral magnitudes or powers into bands, depending on the preprocessing convention; a floor precedes the logarithm. With bands, the long-run rate is values per second, about 3.2 times fewer than waveform samples. This counts values, not compressed bits, and is specific to this configuration.
The price is the phase. Magnitudes say how much of each frequency is present and nothing about how the waves line up, so a mel spectrogram does not determine its waveform, and a vocoder must invent a plausible one. The classical Griffin–Lim algorithm estimates STFT phase iteratively and can introduce audible artifacts; neural vocoders learn the inversion from data.
The text-to-speech pipeline#
A text-to-speech (TTS) system works in stages. Text normalization writes out numbers and symbols (“£5” becomes “five pounds”), and grapheme-to-phoneme conversion maps letters to phonemes. An acoustic model maps the phonemes to a mel spectrogram, and a vocoder maps that to a waveform.
The acoustic model faces the central difficulty of TTS, alignment: tens of phonemes go in, hundreds of frames come out, and the data does not say how many frames each phoneme lasts. Tacotron 2 decodes frames one at a time with attention that selects the input text token (Shen et al., 2018); when the attention slips, it skips or repeats words (Kim et al., 2020). FastSpeech generates all frames in parallel, but takes its durations from an autoregressive teacher’s attention (Ren et al., 2019).
Vocoders cover the families of the course. WaveNet is autoregressive over samples. WaveGlow is a normalizing flow from noise to the waveform, conditioned on the mel spectrogram (Prenger, Valle and Catanzaro, 2019). HiFi-GAN groups the waveform into phase columns for each ; convolutions within each column inspect samples separated by that period, while retaining all sample positions (Kong, Kim and Bae, 2020). DiffWave is the DDPM of the course on the waveform, its noise predictor conditioned on the upsampled mel spectrogram (Kong et al., 2021).
The pipeline can also be one model: VITS is a conditional VAE with a phoneme-conditioned flow prior and a GAN decoder that outputs the waveform (Kim, Kong and Son, 2021). A speaker is one more condition, an embedding per speaker ID or one computed from a recording; YourTTS, built on VITS, clones an unseen voice from a short clip (Casanova et al., 2022).
Glow-TTS: a flow with a text-conditioned prior#
Glow-TTS (Kim et al., 2020) is a parallel acoustic model that finds its own alignment, joining a normalizing flow with a dynamic-programming search.
The likelihood#
The decoder is an invertible flow from a latent sequence to the mel spectrogram , both with frames of numbers. The decoder never sees the text. The text enters through the prior: an encoder reads the phonemes and outputs a mean and standard deviations for each phoneme .
An alignment says which phoneme each latent frame belongs to. Glow-TTS imposes a monotonic, non-skipping reading model: is monotonic (never goes back) and surjective (every phoneme gets a frame). This is a modeling constraint, not a statement about every real utterance. Given , the prior is a product of Gaussians, and the change of variables gives the likelihood:
Training alternates two steps. Given the parameters , find the best alignment ; given , take a gradient step on . The latent and the log-determinant do not depend on , so the first step only maximizes the prior term. The objective is the likelihood under the single best alignment, (Viterbi training).
Monotonic alignment search#
There are many alignments. Choosing one means choosing, among the boundaries between consecutive frames, the boundaries at which a new phoneme starts, so there are of them: for 50 phonemes and 430 frames, five seconds of speech.
Monotonic alignment search (MAS) finds the best one by dynamic programming. Let be the largest log-likelihood of the first frames, aligned to the first phonemes with frame on phoneme . Monotonicity and surjectivity leave frame two options, phoneme or phoneme , so
with and impossible states set to . This requires . The table has cells. The alignment is read backwards from , at each earlier frame moving to the predecessor with the larger .
Worked example. Take three phonemes with one-dimensional means and , the value the paper fixes in training, and six frames . With , . Summing over the first frames gives , where is the summed squared distance. Every alignment of frames has the same constant, so maximizing means minimizing , which follows the same recursion:
| phoneme 1, | 0.04 | 0.13 | 5.89 | 6.70 | 20.39 | 37.20 |
| phoneme 2, | — | 2.93 | 0.29 | 1.50 | 4.39 | 8.80 |
| phoneme 3, | — | — | 5.49 | 9.90 | 1.59 | 1.60 |
Backtracking from the corner picks the bold cells: , cost 1.60, prior log-likelihood . Frame is nearer than , and nearest-mean assignment, , costs only 1.20, but it returns from phoneme 2 to phoneme 1, which violates the chosen alignment constraint. The means and six frames are locally specified scalar teaching inputs, not speech measurements or the paper’s experiment.
Durations and sampling#
At inference there is no spectrogram to align, so the alignment is predicted. MAS supplies the targets: the duration of phoneme is the number of frames aligned to it, , in the example. A small convolutional duration predictor on the encoder output is trained with a squared error on log durations,
where the stop-gradient keeps this loss from changing the encoder, which the likelihood trains.
Synthesis is then one parallel pass. Exponentiating the predicted log durations and rounding up gives positive integer durations. These durations repeat each phoneme’s mean for as many frames as it lasts; the latent is with , which is with the paper’s fixed , and . The temperature is the standard deviation used at sampling. New noise gives a new intonation, and scaling all durations changes the speaking rate.
The decoder is a Glow stack of ActNorm, invertible convolutions and affine couplings (flow architectures). On LJ Speech, with WaveGlow as the vocoder and , listeners gave Glow-TTS a mean opinion score of 4.01 against 3.88 for Tacotron 2 (how such scores are collected).
Neural audio codecs: sound as tokens#
Music needs the whole bandwidth, and a transformer wants discrete tokens. The image answer carries over: train an autoencoder with a discrete bottleneck on the waveform, then model its codes.
EnCodec#
EnCodec (Défossez et al., 2023) follows SoundStream (Zeghidour et al., 2022). Its encoder is a one-dimensional convolutional network with strides 2, 4, 5 and 8 followed by an LSTM. The total stride is , so 24 kHz audio gives 75 latent frames per second. The decoder mirrors it with transposed convolutions, and between them a residual vector quantizer turns each frame into codes.
The losses are VQGAN’s, adapted to sound: an distance on the waveform and distances between mel spectrograms at several resolutions, adversarial and feature-matching losses, and a commitment loss. A loss balancer rescales each loss’s gradient by its running norm, to target specified relative gradient norms at the waveform output. Moving averages and interactions between gradient directions mean this is not an exact fixed share of the final parameter update; the commitment loss is outside this balancer.
Residual vector quantization#
A VQ-VAE replaces each encoder vector by the nearest entry of one codebook. Residual vector quantization (RVQ) then quantizes what that leaves, again and again, with codebooks of entries each. For a frame ,
for . The decoder receives the sum of the chosen vectors, and the sum telescopes:
The quantization error is exactly the last residual. The code of the frame is its list of indices, and stage describes only what the earlier stages missed. With the bottleneck has one VQ codebook. EnCodec uses a straight-through gradient for the encoder, exponential-moving-average codebook updates and a commitment penalty; this does not make every neural-codec training procedure identical to VQ-VAE.
Residual quantization: three codebooks of four vectors
Worked example. The figure follows one vector of a toy cloud through three codebooks of four entries, each fitted by k-means to the residuals of the previous stages:
| Stage | Input | Chosen entry | Squared residual |
|---|---|---|---|
| 1 | entry 2, | 1.66 | |
| 2 | entry 1, | 0.51 | |
| 3 | entry 4, | 0.11 |
The squared norm falls from 8.01 to 0.11, the code is , six bits, and .
Why not one large codebook? Specify a separate fictional codec with 60 frames per second and five codebooks of 16 entries. It uses bits per frame, or 1200 bits per second. One unconstrained codebook for all 20-bit indices would contain vectors; the five residual books store . The possible RVQ sums form at most distinct vectors. Searching all those sums jointly cannot be worse on a given point than the greedy RVQ choice; a globally optimized unconstrained book is at least as expressive. Finite k-means training and unseen test data do not inherit a universal ordering. On a toy cloud, fitted on 2000 points and tested on 2000 others with variance 1.589 per coordinate:
| Bits per point | RVQ: stages × entries | Test error | One codebook: entries | Test error |
|---|---|---|---|---|
| 2 | 1 × 4 | 0.464 | 4 | 0.463 |
| 4 | 2 × 4 | 0.166 | 16 | 0.143 |
| 6 | 3 × 4 | 0.067 | 64 | 0.042 |
In this constructed run, RVQ has higher test error at the same bit count. For fixed entries per stage, its stored codebook size grows linearly with the number of stages rather than exponentially. These are newly executed local synthetic-data calculations, not measured audio quality. Its codes also go from coarse to fine, so with quantizer dropout, a random number of stages kept per training example, one model serves many bitrates.
How many bits#
With fixed-length indices, a power of two, codebooks and frames per second, the nominal code payload rate is
| Codec | Frames per second | Bitrate | ||
|---|---|---|---|---|
| SoundStream, 24 kHz | 75 | 8 | 1024 | 6 kbps |
| EnCodec, 24 kHz | 75 | 2 to 32 | 1024 | 1.5 to 24 kbps |
| EnCodec in MusicGen, 32 kHz, stride 640 | 50 | 4 | 2048 | 2.2 kbps |
Headers, framing and side information add overhead; entropy coding can reduce the average rate. These numbers do not by themselves measure perceptual fidelity.
For MusicGen’s codec bits per second, 233 times less than the of 16-bit samples at 32 kHz (Copet et al., 2023). One second becomes 200 codes, or 50 frames of four codes each.
MusicGen: one transformer over parallel streams#
MusicGen (Copet et al., 2023) generates the four code streams of that codec with one transformer decoder, conditioned on a text and optionally a melody. How can one model predict parallel streams?
Interleaving the codebooks#
Write for the code of codebook at frame . The exact answer is to flatten the codes into one sequence, frame by frame and codebook by codebook within a frame: . The chain rule then factorizes the joint distribution exactly, but the sequence has steps, 6000 for 30 seconds.
The cheap answer predicts several codes in one step from the same past. Predicting all codes of frame together models
which is exact only if the codes of a frame are independent given the past. RVQ generally introduces dependence because stage encodes the previous residual; it does not establish conditional independence of these codes.
The paper calls each layout a pattern: sets partitioning the cells , where step predicts all cells of at once from those of earlier sets. Flattening has ; the parallel pattern, a whole frame per step, ; coarse first, all of codebook 1 and then the rest frame by frame, for . The delay pattern shifts codebook by steps,
where the second condition keeps the frame index inside the clip. The first cell, , is in and the last, , in , so .
For a separately specified five-frame, three-codebook fixture, let . The four step counts are 15, 5, 10 and 7. The figure executes the delay schedule and shows the actual integer codes; it is not a reproduction of a paper figure or an audio-model output.
Reading a delayed schedule
In the delay pattern the code is predicted at step , after the coarser codes of its own frame at steps : the dependency RVQ creates, at almost the cost of the parallel pattern.
The trade-off is measured by the Fréchet audio distance (FAD), the FID of audio on embeddings of the VGGish classifier (Kilgour et al., 2018). On 30-second excerpts (Table 4), flattening scores 0.86 with 6000 steps, delay 0.96 with 1500 and parallel 2.58 with 1500; the reported mean overall-quality scores were close (79.69 and 79.71), while text-relevance means favored flattening. These are the authors’ benchmark results, not our run. The table reports 1500 steps; explicitly counting all boundary positions in the finite schedule defined here instead gives 1503 for . MusicGen uses delay.
The transformer and its objective#
To predict , the shifted input contains the codes of , summed over the codebook embedding tables; missing codebooks contribute a special empty token. Set to start the sequence. During teacher forcing these are the known previous codes, never the current target codes. For text-only conditioning, each layer has causal self-attention, cross-attention to the conditioning , and a feed-forward block. linear heads, one per codebook, each give logits. Training minimizes the cross-entropy of every code given the steps before it:
where collects the codes of earlier sets. A locally chosen description such as “quiet marimba over a slow pulse” becomes through a frozen T5 text encoder (Raffel et al., 2020; MusicGen implementation documentation), one vector per token.
Classifier-free guidance on logits#
As in latent diffusion, the condition is dropped in training, here with probability 0.2, so one network learns both and . At sampling, for every code, the two sets of logits are extrapolated with a guidance scale :
What distribution does this sample? Logits are log-probabilities up to a constant per distribution: and . Substituting and collecting terms,
since the softmax removes the constant. If the conditional and unconditional probabilities come from a compatible joint distribution, Bayes’ rule, , turns this into : the unconditional distribution reweighted by an implicit classifier raised to the power . Separately learned conditional and empty-condition predictions need not be Bayes-consistent; the probability-ratio formula above remains the algebraic identity.
The tilt holds for each code given the codes before it. Over a sequence each step is normalized on its own, by a sum that depends on the prefix, and in general the result differs from tilting the whole sequence.
Derivation: per-step tilts against the tilted sequence
Write the codes in sampling order. Step samples from :
Here . By the chain rule, is the tilt of the whole sequence, . The sampled distribution is proportional to that tilt only when is the same for every sequence, which in general it is not.
MusicGen uses , then samples from the 250 most likely codes (top-).
Worked example. Take three codes with and , and :
| Code | ||
|---|---|---|
| 1 | 0.009 | |
| 2 | 0.087 | |
| 3 | 0.904 |
In this chosen three-code example, the largest conditional-to-unconditional ratio receives most mass and entropy falls from 1.49 bits to 0.50. Neither decreasing entropy for every pair of distributions nor improved semantic text matching follows from the formula alone. Each step costs two forward passes, run as one batch.
Melody and continuation#
Text gives a style, and a melody can come from a reference recording through its chromagram, the energy in each of the 12 pitch classes over time. With drums and bass removed, only the strongest pitch class per frame is kept: with the full chromagram the model learned to copy the reference instead of composing. The result is a prefix of the decoder input.
A recording can be a prefix too: its first seconds are encoded, laid out by the delay pattern and continued, as ImageGPT completes images, within the 30-second training crops (1500 frames).
Where it breaks#
The parallel pattern fails in a way we can compute by hand. Take two codebooks of two entries and a frame whose codes, given the past, are or with probability 0.5 each: stage 2 corrects in the direction that stage 1 chose. Each marginal is . Predicting both codes in one step samples from the product of the marginals, which puts 0.25 on each of the four pairs, so half of the frames get a combination the codec never produced.
The loss of the factorization has a name. In the following calculation, logarithms are base 2 and the preceding context is held fixed. The expected cross-entropy of the product of marginals on data from the joint splits into one term per codebook, each depending only on its own code, whose distribution is :
The best model of the joint pays its entropy, and the difference is
in the toy, the total correlation of the codes. No amount of training removes it, because the factorized model cannot represent the dependence. The delay pattern predicts each code after the coarser codes of its own frame, which removes this within-frame term in the constructed example. Codes predicted at one step, such as and , are still treated as independent given the past, so other dependencies can still be lost. There is no general theorem that their gap is smaller for every data distribution. The reported FAD difference, 0.96 against 0.86, is an empirical comparison, not a measurement of that KL/entropy gap.
The other failures come from stages the generator does not control. WaveGlow resynthesizing the true mel spectrograms of the Glow-TTS test scored 4.19 against 4.54 for the recordings, an empirical reference for what the vocoder alone loses, not a proven cap. MusicGen’s 2.2 kbps codec plays the same role.
What you should remember#
- With the stated 80-band configuration, a mel spectrogram gives about 6900 numbers per second; a vocoder supplies a plausible waveform and phase, not a unique inverse.
- Glow-TTS: a flow to a Gaussian prior set by the text; MAS finds the best monotonic alignment in .
- RVQ: each stage quantizes the residual; the error is the last residual; .
- The delay pattern predicts code at step : steps, coarse codes of a frame seen first.
- Guidance on logits samples each code from .
Notebook#
Run python3 scripts/notes/generative-practice.py audio-generation. The standalone script synthesizes 0.25 seconds at 8,192 samples per second from two sinusoids at 227 and 463 Hz with amplitudes 0.53 and 0.19. It uses no recordings, speech corpus, pretrained voice or music weights.
- Quantize each sample with four fixed coarse values. Quantize the remaining residual with four smaller values and add the two reconstructions. The saved mean squared error decreases from 0.020684 to 0.001261. This illustrates residual refinement with scalar codebooks; it is not a learned neural audio codec or a perceptual-quality test.
- Separately construct five frames of three integer codebook tokens. With zero-based codebook index , delay codebook by steps (equivalently, by with the body’s one-based indexing). The schedule takes 7 steps, and undoing the offsets recovers all five frames exactly. Empty schedule positions carry no token; counting them as complete audio frames would overstate duration.
- Inspect the generated schedule and compare the two quantization errors. These calculations exercise signal representation and delayed token layout. They do not generate speech or music and do not validate a text-conditioned audio model.
The example, script and observations were newly authored for this course with Codex assistance; the numerical results are from the linked run.
Code#
The worked examples: alignment search, RVQ against one codebook, the codec bitrate, guidance on one code, and two dependent codes predicted in parallel. NumPy only; the k-means errors can differ slightly across platforms.
import numpy as np
# 1. Monotonic alignment search on the worked example (sigma = 1, so costs are squared distances)
mu = np.array([0.0, 2.0, 4.0])
z = np.array([-0.2, 0.3, 2.4, 0.9, 3.7, 4.1])
I, J = len(mu), len(z)
C = np.full((I, J), np.inf)
C[0, 0] = (z[0] - mu[0]) ** 2
for j in range(1, J):
for i in range(min(j + 1, I)):
prev = C[i, j - 1] if i == 0 else min(C[i - 1, j - 1], C[i, j - 1])
C[i, j] = prev + (z[j] - mu[i]) ** 2
A, i = [], I - 1 # backtrack from the last phoneme at the last frame
for j in range(J - 1, -1, -1):
A.append(i + 1)
if j > 0 and i > 0 and C[i - 1, j - 1] <= C[i, j - 1]:
i -= 1
A = A[::-1]
print(np.round(C, 2))
print(A, round(C[-1, -1], 2), round(-J / 2 * np.log(2 * np.pi) - C[-1, -1] / 2, 2))
nearest = np.abs(z[:, None] - mu).argmin(1) + 1
print(nearest, round(((z - mu[nearest - 1]) ** 2).sum(), 2))
# [[ 0.04 0.13 5.89 6.7 20.39 37.2 ]
# [ inf 2.93 0.29 1.5 4.39 8.8 ]
# [ inf inf 5.49 9.9 1.59 1.6 ]]
# [1, 1, 2, 2, 3, 3] 1.6 -6.31
# [1 1 2 1 3 3] 1.2
# 2. Residual VQ against one codebook with the same number of bits (toy 2-D cloud)
rng = np.random.default_rng(0)
def cloud(n):
u, v = 1.6 * rng.standard_normal(n), 0.8 * rng.standard_normal(n)
return np.stack([0.8 * u - 0.6 * v, 0.6 * u + 0.8 * v], 1)
train, test = cloud(2000), cloud(2000)
def kmeans(X, m, iters=200, restarts=5):
best = None
for r in range(restarts):
cb = X[rng.choice(len(X), m, replace=False)]
for _ in range(iters):
a = ((X[:, None] - cb) ** 2).sum(-1).argmin(1)
cb = np.array([X[a == k].mean(0) if (a == k).any() else cb[k] for k in range(m)])
a = ((X[:, None] - cb) ** 2).sum(-1).argmin(1)
err = ((X - cb[a]) ** 2).sum()
if best is None or err < best[0]: best = (err, cb)
return best[1]
quant = lambda X, cb: cb[((X[:, None] - cb) ** 2).sum(-1).argmin(1)]
mse = lambda X: (X ** 2).mean() # mean squared error per coordinate
print('test variance per coordinate', round(test.var(0).mean(), 3))
r_tr, r_te = train.copy(), test.copy()
for stages in (1, 2, 3): # 4 entries per stage: 2 bits each
cb = kmeans(r_tr, 4)
r_tr, r_te = r_tr - quant(r_tr, cb), r_te - quant(r_te, cb)
one = kmeans(train, 4 ** stages)
print(2 * stages, 'bits: RVQ', round(mse(r_te), 3), ' one codebook', round(mse(test - quant(test, one)), 3))
# test variance per coordinate 1.589
# 2 bits: RVQ 0.464 one codebook 0.463
# 4 bits: RVQ 0.166 one codebook 0.143
# 6 bits: RVQ 0.067 one codebook 0.042
# 3. Bitrate of MusicGen's codec
K, M, fr = 4, 2048, 50
R = K * np.log2(M) * fr
print(R, round(32000 * 16 / R)) # 2200.0 233
# 4. Classifier-free guidance on one code
p0, pc, s = np.array([0.5, 0.3, 0.2]), np.array([0.2, 0.3, 0.5]), 3.0
w = p0 ** (1 - s) * pc ** s
pt = w / w.sum()
H = lambda p: -(p * np.log2(p)).sum()
print(np.round(w, 3), np.round(pt, 3), round(H(pc), 2), round(H(pt), 2))
# [0.032 0.3 3.125] [0.009 0.087 0.904] 1.49 0.5
# 5. Parallel prediction of two dependent codes: the joint against the product of its marginals
joint = np.array([[0.5, 0.0], [0.0, 0.5]]) # rows: code of codebook 1, columns: codebook 2
prod = np.outer(joint.sum(1), joint.sum(0))
Hj = -(joint[joint > 0] * np.log2(joint[joint > 0])).sum()
print(prod, round(prod[joint == 0].sum(), 2), round(H(joint.sum(1)) + H(joint.sum(0)) - Hj, 2))
# [[0.25 0.25]
# [0.25 0.25]] 0.5 1.0
The course in one paragraph#
Every model of the course answers one question: how to fit and sample from it when is known only through examples. The Foundations turn that into maximum likelihood, a KL divergence to minimize, and the six families differ in what part of the likelihood they can compute and what they pay for it:
| Family | What it computes | What it pays |
|---|---|---|
| VAE | a lower bound, through an encoder | an inference gap; sample fidelity depends on the observation model and capacity |
| GAN | no likelihood, a discriminator instead | a minimax optimization problem and possible coverage failures |
| Normalizing flow | the exact likelihood | invertible layers of fixed width |
| Energy-based model | the density up to its normalizing constant | often approximate normalization and iterative sampling |
| Diffusion | a bound with a fixed encoder, a regression on noise or score | usually many network evaluations, with faster approximate or distilled variants |
| Autoregressive | the exact likelihood, a product of conditionals | sequential conditional draws in standard ancestral sampling |
Evaluation comes before the GANs, because a model without a likelihood is judged by its samples: FID, precision and recall, human judgement.
The families then meet. Under the appropriate score and regularity assumptions, diffusion in continuous time has a probability-flow ODE with matching marginals. The largest systems stack two models: an autoencoder compresses the image or the sound into a short code, and diffusion or an autoregressive transformer generates the code. The audio models above follow that recipe.
References#
- J. Kim, S. Kim, J. Kong, S. Yoon. Glow-TTS: A Generative Flow for Text-to-Speech via Monotonic Alignment Search. NeurIPS, 2020. Monotonic alignment search in §3.2; the prior’s σ fixed to 1 in §4; results in §5. Inference exp/ceil convention: official models.py, lines 263–265.
- J. Copet, F. Kreuk, I. Gat, T. Remez, D. Kant, G. Synnaeve, Y. Adi, A. Défossez. Simple and Controllable Music Generation. NeurIPS, 2023. MusicGen; codebook patterns in §2.2, setup in §3.1, the pattern ablation in Table 4.
- A. Défossez, J. Copet, G. Synnaeve, Y. Adi. High Fidelity Neural Audio Compression. Transactions on Machine Learning Research, 2023. EnCodec; architecture and the loss balancer in §3.
- N. Zeghidour, A. Luebs, A. Omran, J. Skoglund, M. Tagliasacchi. SoundStream: An End-to-End Neural Audio Codec. IEEE/ACM Transactions on Audio, Speech, and Language Processing, 30, 2022. Residual vector quantization and quantizer dropout in §III-C.
- A. van den Oord, S. Dieleman, H. Zen, K. Simonyan, O. Vinyals, A. Graves, N. Kalchbrenner, A. Senior, K. Kavukcuoglu. WaveNet: A Generative Model for Raw Audio. arXiv, 2016.
- Z. Kong, W. Ping, J. Huang, K. Zhao, B. Catanzaro. DiffWave: A Versatile Diffusion Model for Audio Synthesis. ICLR, 2021. Architecture in §3.
- J. Kong, J. Kim, J. Bae. HiFi-GAN: Generative Adversarial Networks for Efficient and High Fidelity Speech Synthesis. NeurIPS, 2020. The multi-period discriminator in §2.3.
- R. Prenger, R. Valle, B. Catanzaro. WaveGlow: A Flow-based Generative Network for Speech Synthesis. ICASSP, 2019.
- J. Shen et al. Natural TTS Synthesis by Conditioning WaveNet on Mel Spectrogram Predictions. ICASSP, 2018. Tacotron 2.
- Y. Ren, Y. Ruan, X. Tan, T. Qin, S. Zhao, Z. Zhao, T.-Y. Liu. FastSpeech: Fast, Robust and Controllable Text to Speech. NeurIPS, 2019.
- J. Kim, J. Kong, J. Son. Conditional Variational Autoencoder with Adversarial Learning for End-to-End Text-to-Speech. ICML, 2021. VITS.
- E. Casanova, J. Weber, C. Shulby, A. Candido Junior, E. Gölge, M. A. Ponti. YourTTS: Towards Zero-Shot Multi-Speaker TTS and Zero-Shot Voice Conversion for everyone. ICML, 2022.
- K. Ito, L. Johnson. The LJ Speech Dataset. 2017.
- C. Raffel, N. Shazeer, A. Roberts, K. Lee, S. Narang, M. Matena, Y. Zhou, W. Li, P. J. Liu. Exploring the Limits of Transfer Learning with a Unified Text-to-Text Transformer. JMLR, 21(140), 2020. T5.
- K. Kilgour, M. Zuluaga, D. Roblek, M. Sharifi. Fréchet Audio Distance: A Metric for Evaluating Music Enhancement Algorithms. arXiv, 2018.
- A. Ryzhikov, S. Ali, A. Akhmatova, T. Ramazyan, K. Aithadzhaev, A. Khizhik. GenAI: music and sound generation. Lecture 12 of Deep Generative Models, HSE, spring 2025. Mel spectrograms, WaveNet, Tacotron, Jukebox, MusicGen, latent diffusion for audio.