A music generator you can play, not just press start on. It emits an unbroken stream of audio in real time and bends to your text and audio prompts mid-performance — the first open-weights model that turns "music as a noun" into "music as a verb."
Open a text-to-music model. Type "lo-fi jazz with a rainy night feel." Hit generate. Wait. Thirty seconds later a 30-second clip drops into your lap. Want it warmer? Want a sax to come in? You change the prompt and start over. You are a customer placing an order, not a musician.
The paper calls this the gap between music as a noun (a finished recording you receive) and music as a verb (a live thing you shape in real time). Almost every modern music AI — Jukebox, MusicGen, Stable Audio — lives firmly on the "noun" side: offline, turn-based generation.
You might think the fix is obvious: make the offline model fast. If it can generate T seconds of audio in less than T seconds of compute, isn't that "real time"?
Not quite. The paper is precise about what "live" demands. A model is a live music model only if it has all three of these properties:
| Property | What it means | Why offline models fail it |
|---|---|---|
| 1. Real-time throughput (RTF ≥ 1×) | Generates audio at least as fast as it plays. RTF = T/L (output seconds ÷ latency seconds). | Many are fast enough, but... |
| 2. Causal streaming | New audio is generated continuously, conditioned on both your controls AND the audio already played. | Offline models generate a whole clip in one shot — there is no "already playing" audio to continue from. |
| 3. Responsive control (low delay D) | The gap between you changing a control and that change reaching the audio is small. | Restarting generation throws away the current performance; D is effectively the whole clip length. |
The paper distinguishes two quantities that beginners constantly conflate:
An offline model with RTF = 5× sounds great until you realize that to change the music you must stop and re-run it — so its effective D is the entire clip. A live model keeps the audio flowing and only lets your change "leak in" after D. That is the difference between a vending machine and an instrument.
How do you generate infinite audio in real time with a Transformer, when Transformers were trained on fixed-length clips and slow down as context grows? Magenta RT's answer is three ideas stacked together — each one removing a different blocker.
Three trained components, chained, looping every 2 seconds:
| Component | Role | From / by |
|---|---|---|
| SpectroStream | Audio codec: turns waveform ↔ discrete tokens (RVQ). | Li et al. 2025 |
| MusicCoCa | Joint audio-text embedder: turns prompts into a style vector. | this paper (builds on MuLan + CoCa) |
| Encoder–Decoder LM | Predicts the next chunk's audio tokens from history + style. | T5-style Transformer |
We will build each one, in the order the data flows: tokens (Ch 2–3), then the streaming trick (Ch 4), then the style control (Ch 5), then the LM that ties them together (Ch 6).
A Transformer predicts discrete tokens. But audio is a continuous waveform — at 48 kHz, that's 48,000 floating-point samples per second per channel. You cannot ask a language model to predict raw samples. So step one of any "codec language model" is to turn audio into something token-shaped.
That job belongs to a neural audio codec: a learned encoder/decoder pair. The encoder squeezes the waveform into a short sequence of integers; the decoder reconstructs the waveform from those integers with minimal perceptible loss. Think of it as a learned, lossy "JPEG for sound" — but the compressed form is a grid of codebook indices, which is exactly what an LM can model.
Formally, the encoder maps a stereo waveform a ∈ R(T·fs) × 2 into a token tensor of shape Vc(T·fk) × dc. Decode each symbol:
2 × 25 = 50 frames, each frame 64 integers → a 50 × 64 grid = 3,200 tokens. The decoder Dec ≈ Enc-1 turns that grid back into a stereo waveform. The codec is frozen — the LM never changes it; it just learns to predict the integers the codec defines.SpectroStream operates in the spectral domain (hence the name) and is built on residual vector quantization (RVQ) — the next chapter's whole topic. Full SpectroStream runs at 16 kbps (fk=25, dc=64, |Vc|=1024). Sanity-check that number: each token carries log2(1024) = 10 bits. Tokens per second = 25 frames × 64 depth = 1600. So 1600 × 10 = 16,000 bits/s = 16 kbps. The math closes.
That's beautiful fidelity but far too many tokens for real time. The fix, previewed: keep only the first 16 of the 64 RVQ levels → 25 × 16 = 400 tokens/sec → 4 kbps. That "live throughput target of 400 tokens per second" is the number the whole system is engineered around.
Drag the frame rate. Low fk → few frames → the reconstruction can't track the wiggles (audible smearing). High fk → faithful, but more tokens to predict. SpectroStream sits at 25 Hz — a deliberate quality/throughput trade.
We keep saying "the first 4 of 16 levels" as if dropping levels were free. To understand why coarse tokens are good enough for the history but not for the output, you have to understand what an RVQ level actually is.
Vector quantization replaces a continuous vector with the nearest entry in a learned codebook of, say, 1024 prototypes. The problem: 1024 prototypes is a coarse grid — the error (the leftover residual) can be large. You could grow the codebook to a billion entries, but the LM's vocabulary would explode.
Residual vector quantization is the elegant fix. Quantize the vector with codebook 1; you get a coarse approximation and a leftover residual. Quantize that residual with codebook 2. Quantize its residual with codebook 3. Each level is one integer; each level shrinks the error. This is exactly the move behind SoundStream and Encodec.
where ek is the k-th codebook and ik is the chosen index at level k. The first few levels carry the loudest, most salient structure (the gist of the sound); later levels add fine texture and air.
The model conditions on H = 5 chunks (10 s) of history. Compare the two choices for representing that history:
| History representation | Tokens (10 s = 250 frames) | Verdict |
|---|---|---|
| Full depth 16 | 250 × 16 = 4000 | Too many — blows the budget |
| Coarse depth 4 (chosen) | 250 × 4 = 1000 | 4× smaller, keeps the gist |
Add the 12 style tokens (next chapter) and the encoder input is exactly 1000 + 12 = 1012 tokens — the number the paper states. Every design choice is in service of that token count.
The green curve is the target signal; the orange curve is the RVQ reconstruction using only the chosen number of levels. Notice how the shape is mostly captured by level 4, and later levels only refine fine wiggles. That is precisely why 4 levels suffice for the memory but not the output.
Now the centerpiece. We have tokens (Ch 2) and a cheap way to represent history (Ch 3). The remaining problem: a Transformer trained on fixed clips behaves unpredictably when you ask it to extrapolate to sequences longer than it ever saw. Generating a 10-minute song token-by-token from position 0 means the model is soon operating far outside its training distribution.
Operate on chunks of length C = 2 s. Under a Markov assumption, predict chunk i from only the last H = 5 chunks (10 s of history) and the current style vector. Slide the window forward 2 s, predict the next chunk, repeat — forever.
The formal modeling objective the paper writes is:
Reading it: predict the full-depth tokens of chunk i, given the coarse (4-level) tokens of the previous H chunks and the style vector ci. Two distinct token resolutions in one equation — that is the whole trick on a single line.
This is the intuition the sim below makes physical:
Magenta RT's C=2 s, H=5 is the sweet spot the team found through play-testing with musicians: responsive enough to feel like an instrument, long enough to keep the music coherent.
Watch the orange playhead advance one chunk at a time. The shaded green band is the context window the model "sees" to predict the next chunk. Hit Change prompt now mid-stream: the new style takes effect only at the next chunk boundary — that delay is D. Shrink C and the change lands sooner; grow H and the band stretches further back (more memory, more tokens).
We've been calling ci "the style vector." Where does it come from, and why is a single 768-dim vector enough to mean "techno flute, but moodier"?
The control signal is produced by MusicCoCa — a joint audio–text embedding model. It has two towers that map into the same 768-dim space: an audio tower (a 12-layer Vision Transformer over log-mel spectrograms) and a text tower (a 12-layer Transformer over tokenized text). It's built on MuLan and CoCa (a "contrastive captioner").
The continuous 768-dim embedding is then quantized into 12 discrete tokens (codebook size |Vm| = 1024) so it can sit in the LM encoder's input alongside the audio tokens. That's the "12 style tokens" we kept adding to the 1000 audio tokens to reach 1012.
Symbol decode for ci in the objective:
where MA is the MusicCoCa audio tower and the subscript picks the most-recent 10-s MusicCoCa embedding for chunk i. At training time the style comes from the target audio itself (the model sees what it should produce); at inference the user supplies it via text/audio prompts.
The dot is the resulting style vector c, a weighted average of two prompt embeddings. Slide the weight and watch c travel along the line between "techno" and "flute" — that geometry is exactly what the model conditions on.
Everything funnels into one Transformer. Magenta RT uses a T5-style encoder–decoder language model (released at T5 Base = 220M and Large = 770M). Let's trace exactly what enters each half.
The bidirectional encoder reads the concatenation:
That's the 1000 coarse audio tokens (4 levels × 25 fps × 2 s × 5 chunks = 1000) plus 12 style tokens = 1012 tokens. Crucially the vocabulary is unified: V = {<S>, <P>} ∪ Vc ∪ Vm — special tokens, codec tokens, and quantized style tokens all share one embedding table.
Here is where naive approaches die. The output chunk is 50 frames × 16 levels = 800 tokens. A vanilla autoregressive decoder would predict 800 tokens one at a time — far too slow. MusicLM's answer was a hierarchical cascade of multiple LMs; MusicGen's was a delay pattern. Neither hits RTF ≥ 1× at full bandwidth.
Magenta RT instead uses a two-module decoder (following the "between-frame / within-frame" method, like Moshi/UniAudio):
The core insight, runnable. This is the inference loop — the exact thing the showcase sim animates:
Read the two load-bearing lines: c = style_vector(user_prompts()) is re-evaluated every loop, which is why the music is live; history = history[1:] + [new_chunk] is the sliding Markov window, which is why it's infinite and stateless.
Live control isn't just "pick a style." It's moving between styles smoothly while the music keeps playing. Two mechanisms enable this: weighted prompt mixing (the algebra) and conditioning interpolation (the time dimension).
With N prompts (text or audio), the target conditioning vector is:
Each wi is a slider on prompt i's influence; M is the relevant MusicCoCa tower. Set "techno"=0.8, "flute"=0.2 and you get techno that's faintly flute-tinted. This is the embedding arithmetic from Ch 5, now with a normalization so weights act like proportions.
To cross-fade from prompt A to prompt B, linearly interpolate between their embeddings across the performance — the paper does it over 60 s in 6 steps (10 s each). At each chunk the style vector is a little more B and a little less A, so the music morphs continuously.
The dashed line is the conditioning we command (a clean A→B ramp). The solid orange line is the audio's measured similarity to B. Raise "context inertia" (the pull of the 10-s history) and watch the response lag and dip mid-transition — exactly the smooth, slightly-behind blending the paper observes.
Text and style vectors steer the mood. But what if you want to feed the model live sound — hum a melody, tap a rhythm, play a chord on a real instrument — and have the AI react to it? That's audio injection, and it's almost free given the architecture we've built.
At each generation step: mix the user's input audio into the model's most recent output, tokenize the mixture, and feed it as the context for the next chunk. That's it. No new training, no new module — it rides on the existing "condition on the last 10 s of audio" loop.
Normally history = [past model chunks]. With injection, the most recent slot becomes tokenize(mix(model_out, user_audio)). If the user audio is silent, the mix is just the model's own output → identical to vanilla generation. If the user audio dominates the mix, the model leans hard on it and may echo it. The mix ratio is the dial between "ignore me" and "follow me."
Blue = your injected audio (a steady melody). Teal = the model's continuation. At mix 0 the model does its own thing; raise the mix and the teal output starts tracking the blue melody's contour — because that contour now lives in the context it's continuing from.
Does this live model actually sound good — or did real-time come at the cost of quality? The headline result: Magenta RT beats bigger offline open models on standard metrics, while being the only one that's live.
| Model | Live? | Params | FDopenl3 ↓ | KLpasst ↓ | CLAP ↑ |
|---|---|---|---|---|---|
| Magenta RealTime | ✓ | 760M | 72.1 | 0.47 | 0.35 |
| Stable Audio Open | ✗ | 1.1B | 96.5 | 0.55 | 0.41 |
| MusicGen-stereo-large | ✗ | 3.3B | 190.5 | 0.52 | 0.31 |
Read the columns: FDopenl3 (Fréchet distance, lower = output distribution matches real music) and KLpasst (lower = semantically closer to reference) — Magenta RT wins both, with 38% fewer params than Stable Audio Open and 77% fewer than MusicGen Large. CLAP (higher = text adherence) — it lands in the middle; the paper notes Stable Audio Open trains on CLAP embeddings, an apples-to-oranges advantage, while Magenta RT trains on MusicCoCa.
Generation uses classifier-free guidance (CFG) with temperature 1.3, top-K 40, CFG weight 5.0. CFG pushes the sample toward the prompt by extrapolating away from the unconditional prediction:
where s is the CFG weight. At s=1 you get plain conditional sampling; s=5 strongly amplifies the prompt's influence (sharper adherence, but too high can over-saturate and hurt diversity). Temperature 1.3 and top-K 40 keep the samples varied without going incoherent.
Each dot is a sampled output around the prompt (the cross). Raise CFG and the cloud is yanked toward the prompt (tighter adherence). Raise temperature and the cloud spreads (more diversity). The paper's chosen point — s=5, T=1.3 — is the balance that felt best in play-testing.
Magenta RT sits at the intersection of three lineages: neural audio codecs (SoundStream → Encodec → SpectroStream), codec language models for audio (AudioLM → MusicLM → MusicGen), and joint audio-text embeddings (MuLan → CoCa → MusicCoCa). Its novelty is the live reframing: chunked autoregression + coarse context + streaming decoder.
| Model | What it gave | What Magenta RT changed |
|---|---|---|
| AudioLM / MusicLM | Codec LM over audio tokens, joint embedding conditioning | Replaced the multi-LM hierarchical cascade with one LM |
| MusicGen | Single-stage with a "delay pattern" for RVQ tokens | Two-module (temporal/depth) decoder hits RTF≥1×; MusicGen can't live-stream |
| Moshi / UniAudio | Between-frame / within-frame decoding for speech | Adapted the same factorization to full-band music |
| Symbol | Meaning | Magenta RT value |
|---|---|---|
| C | chunk length | 2 s |
| H | history window (chunks) | 5 (= 10 s) |
| fk | codec frame rate | 25 Hz |
| dc (out / history) | RVQ depth generated / remembered | 16 / 4 |
| |Vc|, |Vm| | codec / style codebook size | 1024 / 1024 |
| encoder input | coarse history + style tokens | 1000 + 12 = 1012 |
| style dim | MusicCoCa embedding → tokens | 768-dim → 12 tokens |
| RTF | real-time factor (T/L) | 1.8 (H100, T5-Large) |
| s, T, K | CFG weight, temperature, top-K | 5.0, 1.3, 40 |