﻿# MAGNeT generation controls: masking spans and per-codebook steps define the policy

Inspect MAGNeT span arrangement, per-codebook decoding steps, and guidance schedule rather than treating its generation budget as one autoregressive token limit.

Author: Retrivium editorial team
Updated: 2026-11-04
Canonical URL: https://retrivium.ai/journal/fg2-magnet-span-arrangement-codebook-decoding-budget/
Language: en

## Select the direct text-conditioned model

The [MAGNeT paper](https://arxiv.org/abs/2401.04577) describes masked generation across audio-token streams with a non-autoregressive transformer. The [AudioCraft guide](https://raw.githubusercontent.com/facebookresearch/audiocraft/main/docs/MAGNET.md) distinguishes this direct text-to-audio approach from systems requiring upstream semantic tokens. This article focuses on its concrete decoding controls rather than treating every masked audio generator as the same pipeline or transferring the causal generation parameters of MusicGen without checking their supported meaning.

## Read the per-codebook budget

The [public model interface](https://raw.githubusercontent.com/facebookresearch/audiocraft/main/audiocraft/models/magnet.py) accepts `decoding_steps` as a list giving iterative steps for each residual codebook. That differs from a single maximum count of appended text tokens. A shorter list entry changes refinement at its assigned level, so recording only a summed number hides the allocation policy. Keep the ordered list and the compatible checkpoint configuration together when comparing quality, runtime, or a proposed preset migration.

## Inspect span arrangement

The same interface exposes `span_arrangement` with `nonoverlap` and `stride1` choices for non-overlapping and overlapping masking spans. The [language-model implementation](https://raw.githubusercontent.com/facebookresearch/audiocraft/main/audiocraft/models/lm_magnet.py) supplies the associated masked generation path. This makes adjacency part of the decoding policy rather than a mere batching convenience. Replacing span-based decisions with independent position choices changes the algorithm, even if the final token tensor has the same dimensions and all positions eventually receive valid codec symbols.

## Compare policies under controlled conditions

Imagine an update that retains weights but redistributes steps among codebooks and changes span arrangement. A benchmark should preserve the prompt set, random-state policy, duration configuration, and waveform decoding while reporting the changed controls explicitly. Inspect artifacts such as repeated transients or unstable textures alongside text alignment. Equal total passes do not prove equal conditioning opportunities, and a single pleasing music clip cannot establish that the new span policy is equivalent or universally better.

## Keep guidance and refinement distinct

Record the per-level steps, span mode, sampling settings, and guidance schedule limits. Guides to [masked objectives](/journal/masked-causal-language-objectives/) and [audio representations](/journal/audio-codec-token-generation/) support the mechanism. Guidance alters conditional prediction, while refinement decides how token positions are progressively established. Reporting both makes the operating choice reproducible and avoids reducing a structured audio-generation policy to a misleading one-dimensional step count or an unsupported analogy with a causal language model's output limit.
