All models

zamba_tiny

A language model with a Mamba state-space backbone and a shared attention layer.

Language · 1,288 operations Checked

100%

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

Open SVG

Loading diagram (25 KB)

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
278.6K
Operations
1,288
Framework
PyTorch
Recurrent
No
Published
2024
Cited by
193 (as of 24 November 2026)
Authors
Paolo Glorioso, Quentin Anthony, Yury Tokpanov and others
License
Apache-2.0
Checked
Passed: the trace was replayed operation by operation and matched the model's own output for this input.

Files

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

Details
Stable ID
m11567
Graph hash
4147aa3f844186227f7cee309e3b4ee5bfaa4f48924b6e3d00f8ef70eb479cc2
Skeleton hash
47bfdd091565234a6de6bde7ef92932600ec8ef8b5593350ba1056e0f16d5487
Architecture hash
a8a6aba8a50f5d28386ce6a43ce7ae9b8ca09c3fad560032130869d5729a4290
Diagram SHA-256
52687f6faafbe61584db19817283b79b44a3d50fae8f350d963c51a0d7175e44
TorchLens version
2.36.0
Renderer
graphviz 2.43.0+pyvips 3.2.0+libvips 8.18.7+render-opts@06c1f0d3
Check
Forward pass replayed in PyTorch

How this diagram was made

transformers.ZambaModel()

What it is

This is a tiny Zamba configuration that keeps the same design, a backbone of Mamba layers with a shared attention layer.

Zamba is a language model that mixes two kinds of layer: Mamba, a state-space model, and transformer attention. Most of the network is a Mamba backbone, and a shared transformer layer is applied every 6 blocks. The attention weights are shared to keep the parameter cost of the model low. The authors also concatenate the original model embeddings to the input of the attention block, which they found improves performance.

The paper presents Zamba as a 7B model trained on 1T tokens from openly available datasets. A second phase annealed it on a mixture of 50B high-quality tokens. According to the paper, the architecture makes Zamba faster at inference than comparable transformer models, with less memory needed to generate long sequences. The model card adds that it performs slightly worse than the leading open-weight models at the 7B scale.

The Zamba2 technical report follows with a series of 1.2B, 2.7B and 7.4B parameter models. In Zamba2 the Mamba1 blocks are replaced with Mamba2 blocks. A LoRA projector is added to each shared block so that the shared layer can specialize at each place it is used across depth. Zamba is a pretrained base model, and its card says not to expect good chat performance because it was not fine-tuned for chat.

Key idea. Zamba combines a Mamba backbone with a single shared attention module, obtaining the benefits of attention at minimal parameter cost.

  • zamba
  • zamba2
  • zamba 7b
  • zamba-7b-v1
  • zamba2-1.2b
  • ssm-transformer hybrid
  • state-space model
  • hybrid language model
  • shared attention
  • zyphra

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

Cite the paper

@misc{glorioso2024zambacompact7bssm,
      title={Zamba: A Compact 7B SSM Hybrid Model}, 
      author={Paolo Glorioso and Quentin Anthony and Yury Tokpanov and James Whittington and Jonathan Pilault and Adam Ibrahim and Beren Millidge},
      year={2024},
      eprint={2405.16712},
      archivePrefix={arXiv},
      primaryClass={cs.LG},
      url={https://arxiv.org/abs/2405.16712}, 
}