KAIST's MamTra Cuts Text-to-Speech VRAM by 34% Without Losing Voice Quality
KAIST researchers swap half of a text-to-speech Transformer's attention layers for Mamba blocks, cutting VRAM 34% while keeping fidelity intact.
ProTakeaways
- MamTra interleaves Mamba blocks into a pretrained Transformer TTS model, cutting inference VRAM by up to 34%.
- Transfers Q, K, V projection weights directly into Mamba's C, B, x parameters via a linearization identity.
- Multi-level distillation (cross-entropy, skew KL logits, embedding MSE) recovers teacher quality on 2% of training data.
- Built on CosyVoice 2; matches teacher perceptual metrics with only 0.25% absolute WER increase at 1:1 ratio.
- BlockBeginning placement wins at moderate ratios; WER-based importance selection dominates at aggressive 1:5 and 1:11 ratios.
- Inference code for MamTra 1:1 released on the project page; training code coming after review.
Text-to-speech has ridden the same wave as text LLMs: bigger autoregressive Transformers, better prosody, more natural voices. But that quality comes with the usual tax. MamTra, a new hybrid backbone from KAIST and Chung-Ang University, argues you can rip out half of the attention layers in a modern TTS model, replace them with Mamba blocks, and still sound like the teacher, as long as you initialize and distill carefully.
The project page is blunt about the payoff: finetuned on only 2% of the teacher's data, MamTra reduces VRAM by 34% without compromising speech quality.
Why attention hurts more in speech
Speech tokens are long. A podcast or audiobook segment can push context into thousands of tokens, and the quadratic time and memory cost of self-attention leads to high latency and a large key-value cache, making deployment impractical on edge devices. The usual fixes such as grouped-query attention, KV cache compression, and speculative decoding are optimizations on top of an $O(L^2)$ core, not replacements for it.
Mamba and other state space models flip that: linear-time inference, constant memory during decoding. The catch is expressivity. Pure SSMs still underperform Transformers at scale, particularly in in-context learning and long-context reasoning. For zero-shot voice cloning, where the model must attend to a reference speaker embedding scattered across the prompt, that global reasoning matters.
The hybrid recipe
MamTra starts from CosyVoice 2, a 0.5B-parameter, 24-layer Transformer TTS model, and asks a simple question: which layers can I convert to Mamba, and how do I initialize them without retraining from scratch?
The team tested three families of replacement strategies:
- Interleaved (BlockBeginning, BlockEnd): keep a Transformer layer at fixed periodic positions.
- Contiguous (Front, Middle, Back, Sandwich): group Mamba layers into a single spatial region.
- Data-driven (Importance): pick layers to replace based on cosine similarity or their measured contribution to word error rate.
They swept Transformer-to-Mamba ratios from 1:1 all the way to 1:11 (one attention layer for every eleven Mamba blocks). BlockBeginning wins at the moderate 1:1 and 1:3 ratios, while the WER-based importance strategy dominates when the substitution gets aggressive at 1:5 and 1:11, consistent with what structured pruning research has shown for text LLMs.
Turning Q, K, V into C, B, x
The clever part is the initialization. Rather than training the new Mamba blocks from scratch, the authors linearize the attention operation and read off a direct correspondence with Mamba's selective SSM update. The key-value product corresponds to the SSM's input update, the key maps to the input-dependent parameter B, the value maps to the projected input x, and the query aligns with the output projection C.
That means the pretrained Transformer's Q, K, and V projection weights can be dropped straight into the newly inserted Mamba layers as initial values for C, B, and x. Reusing pretrained Transformer weights for both attention and Mamba blocks leads to much faster convergence and a lower final training loss compared to standard Xavier or Kaiming initialization.
Multi-level distillation on 2% of the data
Structural initialization alone loses the softmax nonlinearity, so the model needs to relearn some behavior. MamTra combines three losses:
L_CE: standard cross-entropy against ground-truth tokens.L_logits: skew KL divergence between teacher and student output distributions, recovering nuanced generation behavior.L_emb: mean-squared error on token embeddings, aligning the internal representation space.
Ablations show L_CE is the most critical for intelligibility, while L_logits is what actually rescues the teacher's expressiveness. Training runs on LibriTTS with roughly 500 hours of speech, versus the 170,000 hours behind CosyVoice 2.
The numbers
On Seed-TTS-eval test-en and LibriTTS test-clean, MamTra hits the trade-off the paper is selling:
| Config | TFLOPs/token | WER (Seed-TTS) | SSIM | UTMOS |
|---|---|---|---|---|
| CosyVoice 2 (teacher) | 1.78 | 2.03 | 0.66 | 4.15 |
| Zonos-v0.1 (prior hybrid) | 7.32 | 3.42 | 0.67 | 3.63 |
| MamTra 1:1 | 1.64 | 2.28 | 0.72 | 4.16 |
| MamTra 1:5 (WER) | 1.54 | 2.53 | 0.72 | 4.13 |
| MamTra 1:11 (WER) | 1.52 | 3.99 | 0.72 | 4.15 |
The 1:1 configuration matches the teacher's perceptual metrics with only a 0.25% absolute WER increase, and MamTra's hybrid design achieves sub-quadratic computation and sub-linear cache growth because complexity is dominated by the remaining Transformer layers. In FLOPs terms, that translates to a saving of $1.4 \times 10^{11}$ per token at a 2048 context length.
Where it breaks, and where it fits
The 1:11 ratio is the cliff. At that point intelligibility drops below the Zonos-v0.1 baseline, meaning there is a real floor on how far you can strip attention out of a TTS model before it starts mangling words. The 1:5 configuration with WER-based placement is the sweet spot for long inputs: on the length-stressed LibriTTS test (1 to 62 words), it holds a 2.28% WER and beats the more conservative 1:3 variant, suggesting placement quality matters more than raw attention count.
The broader signal beyond the headline is methodological. This is the first systematic study of where to put Mamba layers in a speech model, and the Q/K/V-to-C/B/x transfer trick generalizes any pretrained Transformer TTS system into a hybrid without a full pretraining run. Practical uses land squarely in memory-constrained long-form generation: on-device audiobook narration, streaming dialogue agents, and podcast synthesis where KV cache blowup is the real bottleneck.
Inference code for the MamTra 1:1 configuration is available on the project page, with other configurations and training code promised after the review period. If you already run CosyVoice 2 in production, this is a drop-in-adjacent path to shaving roughly a third of your inference VRAM.