AppleProblem & solution
Attention to Mamba: A Recipe for Cross-Architecture Distillation
Summary
State Space Models like Mamba offer lower memory and higher throughput than Transformers, but naive cross-architecture distillation from Transformers to Mamba fails to preserve teacher performance. The authors propose a principled two-stage distillation recipe: first distill a Transformer into a linearized Attention model via a kernel trick, then distill that into a Mamba model without any Attention blocks. The distilled Mamba model reaches a perplexity of 14.01, close to the teacher Pythia-1B Transformer’s 13.86. This performance largely carries over to downstream tasks, though gaps appear on tasks relying on in-context recall. The recipe is validated through ablations at 1B scale with 10B tokens, scaling analysis on model sizes and total distillation tokens, and sensitivity analysis on token allocation between stages.
Context
State Space Models like Mamba offer lower memory and higher generation throughput than Transformers, but naive cross-architecture distillation from Transformers to Mamba fails to preserve teacher performance, often requiring hybrid Attention-SSM solutions.
Approach / What changed
A two-stage distillation: first distill a Transformer into a linearized Attention model via a kernel trick, then distill that linearized model into a Mamba model that uses no Attention blocks, with a principled initialization for Mamba.
Takeaways
Naive cross-architecture distillation from Transformers to Mamba fails to preserve teacher performance, often requiring hybrid Attention-SSM solutions.
A principled two-stage distillation—first to a linearized Attention model via a kernel trick, then to Mamba—recovers most of the teacher’s performance.
The distilled Mamba model achieves a perplexity of 14.01 versus the teacher’s 13.86, but gaps remain on tasks that depend on in-context recall.
FAQ
What is the two-stage distillation recipe?
The two-stage approach first distills a Transformer into a linearized Attention model using a kernel trick, then distills that into a Mamba model without any Attention blocks, with a principled initialization for Mamba.
How does the distilled Mamba compare to the teacher?
The distilled Mamba model achieved a perplexity of 14.01, close to the teacher Pythia-1B Transformer's 13.86, and largely carried over to downstream tasks, though gaps appeared on tasks relying on in-context recall.
Source and freshness
- Source
- machinelearning.apple.com
- Published
- Added to Yomu
Summaries are generated from the original by a language model. Check the original before relying on it.
Keep reading
Related reading
The Good Stuff
Paid picks we use ourselves. Links carry a referral code — a subscription through one earns us a commission at no extra cost to you.
The best engineering reads, once a week
One useful email. Unsubscribe anytime.