Skip to content

SAME: generation difficulty as an autoencoder training loss

Stability AI's SAME autoencoder, the latent space Stable Audio 3 generates in, makes generation difficulty part of the autoencoder's training loss.

Line diagram: a waveform passes through the encoder to a small latent and back out of the decoder, with a diffusion loss L_diff on the latent feeding back into the encoder

SAME (Semantically-Aligned Music autoEncoder) is Stability AI's autoencoder for 44.1 kHz stereo music and general audio, and the frozen latent space Stable Audio 3 generates in. SAME-L and the CPU-targeted SAME-S are open weights.

SAME's latent

  • 10.8 Hzlatent frame rate, 4096x temporal downsampling
  • 256channels per frame, four times the usual 64
  • 2,760floats per second (about), the scalar rate of a 1024x, 64-channel VAE
  • 3,900latent frames, about, for a 6-minute track

The hard part is a latent a flow-matching generator can learn, so a small diffusion transformer trains with the autoencoder and its loss reaches the encoder. Without it, SAME's bottleneck is worse than the VAE it replaces.

A 4x shorter, 4x wider latent at the same scalar rate

Same budget, reshaped: a shorter sequence is cheaper for the generator, because sequence length is what a generator pays for.

The rate arithmetic, and why wide latents were avoided

Raising temporal downsampling shortens the sequence a downstream generator must model; at fixed latent dimension it also raises compression difficulty, so SAME widens the latent to compensate. The budget is unchanged, reshaped into a 4x shorter, 4x wider sequence, in compute and context.

SAME compresses the waveform 4096x along the time axis into 256-dimensional latent frames at roughly 10.8 Hz, about twice the temporal compression of recent audio VAEs at four times their usual 64 channels. The design problem at this operating point is producing a latent distribution that a flow-matching generator can learn, not reconstruction. In the paper's controlled ablation the auxiliary losses are load-bearing: the deterministic bottleneck they accompany is, alone, worse than the VAE it replaces, and with them it is better.

At 10.8 Hz and 256 channels the latent carries about 2,760 floats per second, exactly the scalar rate of a conventional 1024x, 64-channel audio VAE. A 6-minute track is about 3,900 latent frames. Early latent-diffusion practice kept latent dimension small on the belief that wide latents are hard to generate in; SAME instead cites the representation-autoencoder (RAE) results from images, where large dimensions are tractable when the latent is semantically structured.

Patching and transformer resampling replace strided convolution

SAME's pipeline after the paper's Figure 1: stereo waveform, patch (256x, a reshape), encoder TRB (16x, attention), soft-norm bottleneck (256-dim latent, 10.8 Hz) where L_diff, L_sem and L_con act, decoder TRB, unpatch; reconstruction and adversarial losses compare the decoded waveform with the input
No learned convolutions on the signal path; the auxiliary losses act on the latent itself. Redrawn from the SAME paper, Figure 1, p. 2.
View full size: SAME's pipeline after the paper's Figure 1: stereo waveform, patch (256x, a reshape), encoder TRB (16x, attention), soft-norm bottleneck (256-dim latent, 10.8 Hz) where L_diff, L_sem and L_con act, decoder TRB, unpatch; reconstruction and adversarial losses compare the decoded waveform with the input
The paper's Figure 1
SAME architecture: patching, encoder TRB, soft-normalization bottleneck, decoder TRB, unpatching, with reconstruction, adversarial, and auxiliary loss families.
SAME paper, Figure 1, p. 2, as published. Source: SAME paper, Figure 1, p. 2.What to see

Patching and transformer resampling replace strided convolution. The auxiliary losses attach at the bottleneck, on the latent itself; the reconstruction and adversarial losses act on the decoded waveform.

View full size: SAME architecture: patching, encoder TRB, soft-normalization bottleneck, decoder TRB, unpatching, with reconstruction, adversarial, and auxiliary loss families.

Where the 4096x comes from

  1. Patch, 256xa parameter-free reshape of stereo waveform, P=256
  2. Encoder TRB, 16xattention into one learned token per 16-embedding segment
  3. Bottlenecksoft-normalization of the 256-dim latent
  4. Decoder TRBeach latent paired with 16 learnable outputs
  5. Unpatchthe reshape reversed back to stereo waveform
The patching and resampling mechanics

A parameter-free patching pretransform reshapes stereo waveform (B, 2, T) into (B, 2P, T/P) with P=256, so each embedding concatenates 256 left-channel and 256 right-channel samples: 256x downsampling as a pure reshape. The remaining 16x comes from a Transformer Resampling Block (TRB): the patch sequence is partitioned into non-overlapping 16-embedding segments, one learnable output embedding is appended to each, a transformer stack processes the interleaved sequence, and only the output embeddings are kept. The decoder TRB reverses the roles, pairing each latent with 16 learnable outputs.

TRB encoder-mode interleaving: each segment of input embeddings gets one learnable query token; after the transformer stack, only the query tokens survive.
Downsampling is attention into one learned token per segment. Source: SAME paper, Figure 2, p. 3.What to see

The figure is shown with stride 2 for clarity; the released models use stride 16. Downsampling happens through attention into one learned token per segment, not through pooling or strided convolution.

SAME-L (852M parameters, sliding-window attention) and the CPU-targeted SAME-S (108M, chunked attention) share the design.

The two variants, attention, activations and speed

Two variants, one design

SAME-L

  • 852M parameters
  • sliding-window attention
  • about 2x the real-time factor of smaller convolutional VAEs

SAME-S

  • 108M parameters, CPU-targeted
  • chunked attention, grid shifted midway

In SAME-L the transformer layers use differential attention with RoPE and per-head QK-normalization, and the last 8 decoder layers swap their feed-forward activations for sin(pi x), a periodic basis for waveform detail; SAME-S drops both for CPU throughput. Both variants replace LayerNorm with Dynamic Tanh, a learnable tanh activation, avoiding normalization statistics that near-silent audio segments corrupt. Because training segments are a few seconds but inference must handle arbitrary lengths, full attention is unsuitable: SAME-L uses sliding-window attention, and SAME-S uses chunked attention whose chunk grid shifts by half a chunk midway through the stack, so first-half chunk boundaries fall in second-half chunk interiors and stop producing audible boundary artifacts; CPU inference libraries such as LiteRT do not support sliding windows. The all-transformer design buys speed: SAME-L runs at about twice the real-time factor (audio duration over encode-plus-decode wall clock) of smaller convolutional VAE baselines despite its 852M parameters, which the paper attributes to well-optimized transformer primitives plus the high compression ratio.

Soft-normalization: a deterministic bottleneck that pins statistics

Where most continuous audio codecs put a VAE, SAME puts a deterministic normalization with no sampled posterior.

The bottleneck at a glance

  • No posteriordeterministic bottleneck, nothing is sampled
  • 5e-2latent noise scale during training
  • 1e-3latent noise scale kept at inference

What the bottleneck does to the encoder output

  1. Affinea learnable per-channel affine transform
  2. Scaledivide by a running standard deviation (EMA)
  3. PenaltyGaussian KL form, per channel and per timestep
  4. NoiseGaussian noise scaled by the running standard deviation
The bottleneck in full

The encoder output passes through a learnable per-channel affine transform, then is divided by a running standard deviation tracked by exponential moving average. A penalty of Gaussian KL form pushes means and variances toward zero and one along two axes independently, per channel over time and per timestep across channels, so neither individual channels nor individual frames drift to extreme statistics. Gaussian noise scaled by the running standard deviation is added to the latent (5e-2 during training, 1e-3 at inference), smoothing the latent manifold so the decoder tolerates the imperfect latents a downstream generator will hand it.

L_diff: a jointly trained diffusion model shapes the encoder

L_diff, an auxiliary diffusion model, trains jointly with the autoencoder and backpropagates into the encoder. It is one of three auxiliary losses that act on the latent itself:

Diagram: the encoder produces a 256-channel, 10.8 Hz latent; three auxiliary losses act on it: L_diff, a small diffusion transformer fitting the latents; L_sem, linear chroma and stereo regressors; L_con, a critic matching latent, wavelets and text
All three losses reach the encoder through the latent, not through the decoded audio.

L_diff trains with the standard straight-path flow-matching objective, warming up on detached latents before its gradients reach the encoder.

L_diff rises when the current latent distribution is hard for a flow-matching model to fit, so minimizing it with respect to the encoder pushes the latent toward geometries that are easier to generate in.

The three losses in words, the discrete-tokenizer precedent, and how closely the probe matches Stable Audio 3

Three auxiliary losses on the latent

L_diff

A 4-layer, 768-dim diffusion transformer fits the latents with flow matching; its loss reaches the encoder.

L_sem

Linear 1x1-convolution regressors predict chromagrams and interaural level difference from the latent.

L_con

A critic scores whether the latent, a wavelet decomposition and a T5Gemma text embedding come from one input.

When building discrete tokenizers it is common to jointly train a small autoregressive prior whose loss backpropagates into the encoder, keeping the token distribution easy for that prior to model; for continuous latents under diffusion the paper calls the equivalent move rarer, citing a single recent precedent.

SAME's L_diff is a 4-layer, 768-dimensional diffusion transformer trained on the latents with the standard straight-path flow-matching objective, noising z_t = (1-t)z + t*eps and regressing the velocity eps - z, with timesteps drawn from a truncated logistic-normal distribution. The auxiliary model warms up on detached latents; after warmup, its gradients flow into the encoder.

The auxiliary model is unconditional and exists only as a training signal. An unconditional model this small is a coarse proxy for the text-conditioned generator that will actually use the latent; Stable Audio 3 pre-trains on the same frozen latents with the same straight-path velocity parameterization (its full objective adds minibatch optimal-transport coupling and an inpainting mask), so the encoder is shaped during its own training by a scaled-down version of the downstream generator.

L_sem and L_con: chroma and stereo regressors plus a text critic

Speech tokenizers usually align to a teacher such as WavLM. SAME has none:

Two signals from the audio and its caption, no teacher

L_sem: linear regressors

  • 1x1 convolutions on the latent
  • predict three octave-banded chromagrams
  • and the interaural level difference (stereo)

L_con: a contrastive critic

  • latent, wavelets and T5Gemma text
  • scores whether all three match
  • negatives: audio re-paired with other captions

The pressure is mild, unlike VibeVoice's hard transcript objective, which degraded reconstruction.

How L_sem and L_con are computed, and why the pressure is mild

Speech tokenizers usually buy semantic structure by aligning the latent to a self-supervised teacher such as WavLM. SAME aligns to no pretrained teacher; its semantic regression loss, L_sem, supervises with quantities computed from the signal itself, and a separate contrastive loss, L_con, scores the latent against the paired text.

Single 1x1-convolution regressors predict three octave-banded chromagrams (per-frame energy by pitch class) and an interaural level difference (the per-band left/right log-magnitude gap that encodes the stereo image) directly from the latent; because the regressors are linear, pitch-class and spatial structure are pressured to stay linearly decodable rather than nonlinearly entangled. A separate contrastive loss, L_con, trains a critic to score whether a latent sequence, a wavelet decomposition of the audio, and a T5Gemma embedding of the paired text description come from the same input, with negatives formed by re-pairing audio and text within the batch and heavy masking of latent and feature positions to block shortcut cues. Like the auxiliary diffusion model, the critic warms up on detached latents before its gradients reach the encoder.

The pressure is mild: linear regressors and a warmed-up critic on a 256-dimensional latent. VibeVoice found that the opposite setting, a hard transcript-decoding objective pushed through a 7.5 Hz, 64-dimensional speech latent, degraded reconstruction and collapsed speaker similarity.

The bottleneck ablation: reconstruction pinned, generation decoupled

Everything is fixed except the latent space, and both budgets are short: the ablation measures how readily a 1.4B DiT fits each latent at fixed compute.

SAME ablation, configs A to E (Table 2; A to D are 4096x/256)

MELlog1p, reconstruction (lower is better)

A · VAE
0.108
B · soft-norm
0.108
C · + L_diff
0.103
D · + L_sem/L_con
0.109
E · 1024x/64 VAE
0.098

Bars start at 0.09, not 0, so small differences show.

FAD-CLAP, generation (lower is better)

A · VAE
0.651
B · soft-norm
1.061
C · + L_diff
0.593
D · + L_sem/L_con
0.576
E · 1024x/64 VAE
0.724

Bars start at 0.5, not 0, so small differences show.

MuQEval, generation (higher is better)

A · VAE
3.252
B · soft-norm
2.783
C · + L_diff
3.340
D · + L_sem/L_con
3.870
E · 1024x/64 VAE
3.194

Bars start at 2.5, not 0, so small differences show.

Reconstruction barely moves across A to E; generation spreads widely.

Configs A and B reconstruct identically and generate very differently; L_diff (C) beats the VAE on all three metrics, and the semantic losses (D) take the best generation scores.

Table 2 in full, the setup and metric definitions, what each config shows, and what the ablation cannot separate

The ablation holds everything fixed except the latent space: 50k autoencoder steps with the SAME-L backbone and no adversarial losses (removing GAN dynamics as a confounder), then a roughly 1.4B-parameter diffusion transformer (DiT) trained with flow matching on each latent space for 50k steps. VAE variants use a single, unswept KL weight (1e-4). Both budgets are short, so the comparison measures how readily a DiT fits each latent space at fixed compute, not converged quality.

Config Compression / width Bottleneck MELlog1p (recon) FAD-CLAP (gen) MuQEval (gen)
A 4096x / 256 VAE 0.108 0.651 3.252
B 4096x / 256 soft-norm 0.108 1.061 2.783
C 4096x / 256 soft-norm + L_diff 0.103 0.593 3.340
D 4096x / 256 soft-norm + L_diff + L_sem/L_con 0.109 0.576 3.870
E 1024x / 64 VAE 0.098 0.724 3.194

SAME paper, Table 2, p. 8. MELlog1p is a multi-resolution log-mel reconstruction error (lower is better); FAD-CLAP is Fréchet audio distance in the embedding space of CLAP, a contrastive audio-text model, computed on the DiT's caption-conditioned outputs (lower is better); MuQEval is a model-based, reference-less musical quality score (higher is better).

Configs A and B reconstruct identically on the table's metric and generate very differently: FAD-CLAP 0.651 against 1.061. The statistics soft-normalization pins (means, variances, magnitudes) survived the swap, so whatever the DiT needed lives in distributional structure beyond those statistics, which a reconstruction metric cannot see.

Adding the auxiliary diffusion model (config C) more than repays the simplification, beating the VAE baseline on all three metrics at no reconstruction cost. Adding the semantic losses (config D) trades a little reconstruction for the best generation scores, with a MuQEval jump the paper reads as musical structure becoming easier to model.

Config E is the conventional 1024x/64 shape: the table's best reconstruction, and worse generation than A, C, and D. All generation evidence in the paper is this internal ablation; no generator is trained on a competitor's latent space.

The table cannot say whether config C's gain is diffusion-specific shaping or a more generic smoothing pressure, and the untested VAE-plus-L_diff cell is what would separate the bottleneck's contribution from the auxiliary model's. L_sem and L_con are added together, so their individual contributions are unknown.

The conventional 1024x/64 VAE (E) reconstructs best and generates worse, the decoupling also measured across speech and audio systems.

Full-scale reconstruction: best mel error and listening score

The released models train in three stages on about 19,500 hours of licensed production audio (a 66/25/9 percent music, sound-effects, instrument-stems mix):

Three training stages

  1. End to endall losses, encoder and decoder together
  2. Decoder stage 1decoder only, encoder frozen
  3. Decoder stage 2transformer discriminator ensemble, frequency sweeps against aliasing

SAME paper, Table 1: music reconstruction from a 4x shorter sequence

MELlog1p (lower is better)

eps-ar-VAE
0.070
ACE-Step 1.5
0.069
SAO VAE
0.079
CoDiCodec
0.096
SAME-S
0.071
SAME-L
0.057

Bars start at 0.05, not 0, so small differences show.

MUSHRA listening score, 0-100 (higher is better)

Hidden reference
97.6
eps-ar-VAE
77.6
ACE-Step 1.5
76.5
SAO VAE
73.3
SAME-S
66.1
SAME-L
82.2

eps-ar-VAE stays marginally ahead on SI-SDR, STFTlog1p and CCPC; the full table is below. CoDiCodec was excluded from the listening test.

Speed, real-time factor (higher is faster)

  • 2069SAME-S, the CPU-targeted variant
  • 561SAME-L
  • 284 to 325eps-ar-VAE, ACE-Step 1.5 and SAO VAE

Listening-score intervals overlap, and every number is music: non-music quality is never evaluated.

Table 1 in full, how it was measured, and how SAME-L and SAME-S share one latent space
Metric eps-ar-VAE ACE-Step 1.5 SAO VAE CoDiCodec SAME-S SAME-L
Compression 1024x 1920x 2048x 4096x 4096x 4096x
Latent dim 64 64 64 64 256 256
RTF 325 284 300 47 2069 561
SI-SDR 12.0 7.0 6.2 -0.3 9.6 11.9
STFTlog1p 0.080 0.084 0.092 0.096 0.088 0.081
MELlog1p 0.070 0.069 0.079 0.096 0.071 0.057
CCPC 97.2 93.2 92.2 81.7 95.5 96.6
MUSHRA 77.6 76.5 73.3 n/a 66.1 82.2

SAME paper, Table 1, p. 8; baselines are recent open-weights continuous audio autoencoders. Objective metrics use 446 captioned music tracks from the Song Describer Dataset: SI-SDR is scale-invariant signal-to-distortion ratio in dB (higher is better), STFTlog1p a log-magnitude STFT distance (lower is better), CCPC cross-channel phase coherence for stereo-image fidelity (higher is better). RTF is averaged over 50 two-minute tracks, FP16 on one H100. MUSHRA is a 0-100 listening test on excerpts, here 36 valid trials from 12 participants after filtering, with the hidden reference (the clean original, rated blind) at 97.6; CoDiCodec was excluded from it.

SAME-L takes the best mel error and the best mean listening score (82.2 against 77.6 for the strongest baseline, with overlapping confidence intervals), while eps-ar-VAE, the conventional 1024x/64 shape, stays marginally ahead on SI-SDR, the magnitude-STFT distance, and stereo phase coherence. Every number here is music reconstruction; despite the sound-effects share in training, non-music quality is never evaluated in the paper.

SAME-S, the 108M CPU variant, matches the Stable Audio Open VAE on objective reconstruction at 6-7x the speed; its listening score is lower (66.1 to SAO's 73.3). It is distilled to share SAME-L's latent space.

Its distillation aligns student latents to the frozen SAME-L teacher's with an L1 loss and applies reconstruction and adversarial losses to cross-decoded outputs, student decoder on teacher latents and the reverse, so the two models share one latent space with interchangeable latents. That is what lets Stable Audio 3 train its small model on SAME-S and its larger models on SAME-L.

Sources

What each source supports