---
title: "Attention to Mamba: A Recipe for Cross-Architecture Distillation"
description: "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."
---

# Attention to Mamba: A Recipe for Cross-Architecture Distillation

[Apple](https://yomu.fyi/company/apple) · Nov 3, 2026

**Type:** Problem & solution

## 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.

**Tags:** [Distillation](https://yomu.fyi/topic/distillation), [Mamba](https://yomu.fyi/topic/mamba), [State Space Models](https://yomu.fyi/topic/state-space-models), [Transformers](https://yomu.fyi/topic/transformers)

- Source: [Apple](https://machinelearning.apple.com/research/attention-mamba-distillation)
- Source URL: https://machinelearning.apple.com/research/attention-mamba-distillation
- Ingested by Yomu: 2026-11-10T21:00:11.105Z

[Read original post](https://machinelearning.apple.com/research/attention-mamba-distillation)
