All models

MOHAWK

A Mamba-based language model distilled from Phi-1.5 with the three-stage MOHAWK method.

Language · 2,476 operations Structure only

Structure-only capture: TorchLens recorded this graph without running real numbers through the model, so shapes and data types on the diagram are hypotheses, not measurements.

100%

Showing the top corner; full diagram not loaded yetShowing a small copy; full diagram not loaded yetLarge diagram, not loaded yet

Open SVG

This diagram has 2,476 operations (7 KB) and is drawn when you ask.

Open in a new tab

Click or tap a spot to read it up close. Scroll or drag inside the diagram to move through it. Zoom with + and − or Ctrl and scroll. Press 0 for the whole graph. Swipe inside the diagram to move through it. Use + and − to zoom.

At a glance

Parameters
1.5B
Operations
2,476
Framework
PyTorch
Recurrent
No
Published
NeurIPS (arXiv 2024)
Cited by
7 (as of 4 November 2026)
Authors
Aviv Bick, Kevin Y. Li, Eric P. Xing and others
Checked
Structure only: shapes and data types are hypotheses, not measurements.

Files

The diagram is a drawing of a TorchLens trace of the source code. It contains no code or weights.

Details
Stable ID
m18184
Graph hash
01172eeeff249085c7f6444c6d3818e70a102403165b19d30371a48de9aa4a07
Skeleton hash
b90eb81f383ab9af6e5521de9cc53a5d993bdfd4c3f9b8114ebd3c44e7dabd28
Architecture hash
94cff818f5c8037d294c34428f4def88219c226546a26aba4f551e7754f03e70
Diagram SHA-256
6300d18ca335f46a53df97f8b99d96ae59567c44c2ac2607ee2bdbff2b60865c
TorchLens version
2.36.0
Renderer
graphviz 2.43.0+pyvips 3.2.0+libvips 8.18.7+render-opts@06c1f0d3

What it is

Phi-Mamba is a language model built by converting a Transformer into a state space model: it keeps the layout of Phi-1.5 but replaces each self-attention layer with a Mamba-2-style matrix mixer. The motivation is that subquadratic models such as Mamba have been pretrained with far less compute than the strongest Transformers.

The method that makes it, MOHAWK, treats attention and SSMs alike as mixing matrices applied over the token sequence, which lets a pretrained Transformer teach an SSM student directly. Distillation runs in three stages of growing scope: first matching the mixing matrices themselves, then the hidden units at each block, and finally the end-to-end predictions. The paper reports distilling Phi-Mamba with only 3B tokens, and a hybrid version that keeps some attention layers with 5B tokens.

The mixer here is a discrete variant of Mamba-2's: it uses a multi-head structure rather than Mamba-2's multi-value structure, and drops the non-linear activation and layer normalization. This model is the non-hybrid Phi-Mamba, whose released weights were trained on C4 with MOHAWK.

Key idea. MOHAWK distills a pretrained Transformer into a state space model by matching mixing matrices, then block hidden states, then end-to-end predictions.

  • Phi-Mamba
  • MOHAWK
  • Mamba
  • state space model
  • SSM
  • distillation
  • Phi-1.5
  • language model
  • subquadratic

AI-written summary, based on the paper and checked automatically against it; not reviewed by a person. Corrections welcome.

Cite the paper

@misc{bick2025transformersssmsdistillingquadratic,
      title={Transformers to SSMs: Distilling Quadratic Knowledge to Subquadratic Models}, 
      author={Aviv Bick and Kevin Y. Li and Eric P. Xing and J. Zico Kolter and Albert Gu},
      year={2025},
      eprint={2408.10189},
      archivePrefix={arXiv},
      primaryClass={cs.LG},
      url={https://arxiv.org/abs/2408.10189}, 
}