Lunar Boom Learning

3.3 · Hierarchical Generation

Section 3.3 of 3.6

Hierarchical Generation

Separating long-range structure from acoustic detail

Learn how multi-stage music systems generate compressed structural tokens first, then add coarse and fine acoustic information until the final waveform can be reconstructed.

About 13 minutes

Guiding question

Why model music at more than one level?

By the end, you’ll be able to
  • Explain why one music-generation system may use several representations or model stages.
  • Distinguish semantic tokens, coarse acoustic tokens, fine acoustic tokens, and decoded waveforms.
  • Describe how different levels operate at different sequence lengths and time scales.
  • Explain how AudioLM, MusicLM, and Jukebox use hierarchical generation.
  • Identify the benefits and limitations of multi-stage generation.

The previous section showed why generating every token in one long autoregressive stream can be difficult. A model may need to remember the shape of a song while also predicting tiny details in the sound.

Hierarchical generation divides those jobs across several levels.

A high-level stage can work with a short, compressed sequence that preserves broad content or structure. Later stages can use that sequence as a guide while adding timing, timbre, texture, and waveform detail.

Instead of asking one model to solve everything at once, the system moves from a rough musical representation toward a finished recording.

Why use more than one level?

A second of raw audio can contain tens of thousands of waveform samples. Even compressed codec representations may contain many token streams per second.

Long-range musical structure changes much more slowly. A phrase, motif, chord movement, or vocal line can extend across seconds or minutes.

A hierarchy lets the early stage work with fewer tokens. The model can focus on relationships across a longer span without also deciding every fine acoustic detail. Later stages receive the earlier result and fill in information at a higher resolution.

Different levels answer different questions

Swipe sideways to view the full comparison

LevelMain questionTypical informationSequence consequence
Semantic or high-levelWhat broad content should continue?Long-term content, phrasing, musical progression, or high-level identityShorter sequence with less acoustic detail
Coarse acousticWhat should the audio roughly sound like?Recognisable timbre, rhythm, voice, and acoustic formLonger sequence with enough information for a rough reconstruction
Fine acousticWhich details make the reconstruction convincing?Texture, high-frequency detail, codec refinement, and local acoustic cuesMore tokens and more local computation
Waveform decoderHow are the tokens turned into playable sound?Continuous audio samplesNeural decoding rather than another musical planning stage

AudioLM: semantic, coarse, and fine stages

AudioLM uses three generation stages:

  1. A semantic model generates tokens intended to preserve long-term structure.
  2. A coarse acoustic model generates the first codec levels while following the semantic sequence.
  3. A fine acoustic model predicts the remaining codec levels and improves local sound quality.

The complete acoustic token set is then passed through the SoundStream decoder to reconstruct the waveform.

The AudioLM hierarchy

  1. Generate semantic tokens

    Model the long-term continuation using a relatively compact token sequence.

  2. Generate coarse acoustic tokens

    Condition on the semantic sequence and predict the most important codec levels.

  3. Generate fine acoustic tokens

    Condition on the coarse tokens and add the remaining codec information.

  4. Decode the waveform

    Use the SoundStream decoder to reconstruct playable audio from all acoustic tokens.

In practice

Real-world example: piano continuation

AudioLM demonstrated piano continuations from short audio prompts without using text or symbolic notation. Its official examples mark the supplied prompt and the generated continuation, making it possible to hear how the model preserves broad piano style while producing new acoustic detail.

Why can the fine stage work locally?

AudioLM assumes that fine acoustic details depend mainly on the coarse acoustic representation nearby. Once the broad content and rough sound are known, the fine stage does not need to solve the full long-range musical problem again.

The paper therefore processes fine acoustic tokens in short, non-overlapping chunks. This reduces the sequence length handled by the fine model and lets acoustic refinement scale separately from the total duration.

MusicLM adds text conditioning

MusicLM extends the hierarchical audio-language approach to text-to-music generation.

A text description is mapped into a shared music-language embedding space. The semantic stage then generates semantic audio tokens under that condition. Coarse and fine acoustic stages turn the semantic sequence into SoundStream tokens, which are decoded into 24 kHz audio.

The hierarchy separates two forms of control: the text guides what the music should be like, while the later acoustic stages determine how the generated result is rendered in sound.

In practice

Real-world example: text and melody conditioning

MusicLM generated music from detailed descriptions and could combine a text description with a hummed or whistled melody. The high-level conditions guide the semantic sequence, while the acoustic hierarchy produces the final recording.

Jukebox: several audio resolutions

Jukebox also uses a hierarchy, but its levels are not the same as AudioLM's semantic and acoustic split.

Jukebox trains audio autoencoders at several compression rates. The top-level codes are highly compressed and cover a longer span with fewer tokens. Middle and bottom levels carry progressively more detail.

An autoregressive prior generates the top-level codes. Upsampling models then generate the middle and bottom codes while conditioning on the coarser levels. A decoder reconstructs the final waveform.

The Jukebox hierarchy

  1. Generate top-level codes

    A prior models the most compressed audio representation over a relatively long span.

  2. Upsample to the middle level

    A second model predicts a denser code sequence conditioned on the top-level codes.

  3. Upsample to the bottom level

    Another model adds the highest-resolution discrete audio codes.

  4. Decode to audio

    The decoder reconstructs the raw waveform from the bottom-level representation.

AudioLM and Jukebox use different hierarchies

Swipe sideways to view the full comparison

QuestionAudioLM and MusicLMJukebox
Highest levelSemantic tokens from a self-supervised audio representationHighly compressed audio codes
Acoustic hierarchyCoarse and fine levels from a residual neural codecTop, middle, and bottom representations at different compression rates
Main purposeSeparate long-term content from local acoustic reconstructionMake long raw-audio generation manageable across several resolutions
Final outputSoundStream decoder reconstructs the waveformVQ-VAE decoder reconstructs the waveform
Example controlsAudio prompt, text, or melody depending on the systemArtist, genre, and unaligned lyrics
Why hierarchy can help

Swipe sideways to view the full comparison

BenefitHow the hierarchy helpsRemaining trade-off
Long-range coherenceA compressed sequence lets the high-level model cover more time with fewer tokensCompression may remove useful detail or structure
Acoustic qualityLater levels refine timbre and codec reconstructionEvery extra stage adds computation and another possible failure point
SpecialisationEach model focuses on a narrower prediction problemThe stages must remain compatible
ScalabilityFine detail can sometimes be generated in shorter local chunksThe complete pipeline can still be slow
ControlText or melody can guide the high-level stage before acoustic renderingLater stages may weaken or distort the intended condition

Early-stage errors become inherited constraints

A later stage cannot freely replace the plan it receives. Its job is normally to add information while remaining compatible with the earlier sequence.

If the semantic stage loses the intended melody, the acoustic stages may render the wrong melody convincingly. If the top-level Jukebox prior creates an awkward structure, the upsamplers can add detail but may not repair the structure.

Hierarchy therefore changes the form of error accumulation discussed in Section 2. Instead of one token affecting later tokens in the same stream, an entire generated level can constrain every model below it.

The high-level representation is a bottleneck

A compressed level cannot preserve everything. This is intentional. The system needs a shorter sequence that keeps information useful for later stages.

The risk is that the bottleneck removes something the final task needs. A semantic representation may preserve broad content but weaken precise timbre. A highly compressed audio code may retain style and rhythm while losing small production details.

Choosing the representation is therefore part of the model design, not merely a storage decision.

Does every level need to be autoregressive?

No. A hierarchy describes how representations depend on one another. It does not require every stage to use the same generation method.

AudioLM generates its semantic, coarse acoustic, and fine acoustic tokens autoregressively. SoundStorm keeps the semantic conditioning stage but replaces AudioLM's two autoregressive acoustic stages with confidence-based parallel decoding.

This produced the same reported audio quality as the AudioLM acoustic generator while greatly reducing generation time in the paper's experiments.

In practice

Real-world example: SoundStorm

SoundStorm receives semantic tokens and predicts neural codec tokens through iterative parallel decoding rather than one acoustic token at a time. It shows that a system can preserve the semantic-to-acoustic hierarchy while changing the method used inside the acoustic stage.

Hierarchy and decoding method are separate choices

Swipe sideways to view the full comparison

SystemHierarchyHow acoustic tokens are generated
AudioLMSemantic, coarse acoustic, fine acousticAutoregressively across stages
MusicLMText condition, semantic, coarse acoustic, fine acousticHierarchical autoregressive token modelling
JukeboxTop, middle, and bottom audio codesAutoregressive prior and autoregressive upsamplers
SoundStormSemantic condition followed by acoustic codec tokensIterative parallel acoustic decoding

In practice

A production analogy

A producer may first decide the section order and chord movement, then record a rough arrangement, and finally refine performances, sound design, and mixing. A neural hierarchy is not following those exact human steps, but the analogy captures the move from broad constraints toward detailed sound.

Interactive lesson

Inspect a Hierarchical Generator

Try it: Begin with the text and melody condition. Inspect the semantic sequence, then compare the visual coarse reconstruction before adding fine acoustic tokens. Change one high-level token and compare how every lower stage changes. Finally, compare the AudioLM-style hierarchy with the Jukebox-style resolution hierarchy.

A hierarchical generator first creates a compressed high-level sequence, then predicts coarse acoustic information, adds fine acoustic tokens, and decodes the result into a waveform. Changing an early level affects all later levels.

From predicting tokens to refining noise

AudioLM, MusicLM, and Jukebox organise generation as a cascade of discrete-token predictions. Another family of models starts from noise or a corrupted representation and repeatedly refines it toward music.

The next section, Diffusion Models, explains this denoising process and why it can generate many parts of a representation in parallel rather than committing to one left-to-right token path.

Check your understanding

Ready for a quick check?

Test whether you can distinguish hierarchical levels, compare real systems, and explain the benefits and risks of coarse-to-fine generation.

Ready to continue?

Save this section to your account and continue from any device.

Checking your account…
Sources for this lesson (7)
  1. AudioLM: A Language Modeling Approach to Audio Generation — Zalan Borsos et al. (2022)
  2. AudioLM Examples — Google Research (2022)
  3. MusicLM: Generating Music From Text — Andrea Agostinelli et al. (2023)
  4. Jukebox: A Generative Model for Music — Prafulla Dhariwal et al. (2020)
  5. SoundStream: An End-to-End Neural Audio Codec — Neil Zeghidour et al. (2021)
  6. Neural Discrete Representation Learning — Aaron van den Oord, Oriol Vinyals, and Koray Kavukcuoglu (2017)
  7. SoundStorm: Efficient Parallel Audio Generation — Zalan Borsos et al. (2023)
Browse all contextual sources →