All models

Jamba-tiny-random (ai21labs)

A language model that interleaves Transformer attention layers with Mamba layers and mixture-of-experts MLPs.

Language · 2,685 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

This diagram has 2,685 operations (33 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
119.3M
Operations
2,685
Framework
PyTorch
Recurrent
No
Published
2024
Cited by
605 (as of 12 November 2026)
Authors
Opher Lieber, Barak Lenz, Hofit Bata and others
Name in source
ai21labs:Jamba-tiny-random
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
m3482
Graph hash
069616d547eca07d379b9331e10816319b91148fe9bab4fad20de11d099b154e
Skeleton hash
bf1c093940a41e442e9363e0415432f365e1fa3ec7e48014f92bedc061f207fc
Architecture hash
72c7105a65cf49d5ce9e559663daa65e2c62fdb392ba4cf3b0e4cbd1472e2668
Diagram SHA-256
0a5c187252658fc601fed3cf6f62579da5fd200d87edc0be9739a7f65cc01b9d
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.JambaModel()

What it is

This model is a tiny version of Jamba meant for debugging and experimentation; its model card gives 128M parameters and says it is initialized with random weights and did not undergo any training.

Jamba is a large language model that mixes two kinds of sequence layer, Transformer attention layers and Mamba layers (a recent state-space model), and adds mixture-of-experts (MoE) modules. The reason is memory and speed on long inputs: trading attention layers for Mamba layers reduces the cache of attention keys and values, the KV cache, which becomes a limiting factor when Transformers are scaled to long contexts.

The repeating unit is a Jamba block, a stack of layers that each contain either an attention or a Mamba module followed by an MLP. The released configuration has a sequence of 4 blocks of 8 layers each, with one attention layer for every seven Mamba layers. MoE replaces the MLP at every other layer, with 16 experts and the top 2 used at each token. The model uses no explicit positional information, because the authors found positional embeddings unnecessary once Mamba layers are present.

The paper reports that Jamba performs comparably to Mixtral-8x7B and Llama-2 70B on its benchmarks and has 3x the throughput of Mixtral-8x7B for long contexts. Its ablations found that pure Mamba struggles to develop in-context learning, while the attention-Mamba hybrid behaves like a vanilla Transformer in that respect. The released model is a pretrained base model that did not go through alignment or instruction tuning.

Key idea. The paper presents a language model that interleaves blocks of Transformer and Mamba layers and adds mixture-of-experts to some layers, raising capacity while keeping active parameter usage manageable.

  • Jamba
  • Joint Attention and Mamba
  • hybrid SSM-Transformer
  • Transformer-Mamba
  • mixture of experts
  • state space model
  • large language model
  • long context
  • text generation

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

Cite the paper

@misc{lieber2024jambahybridtransformermambalanguage,
      title={Jamba: A Hybrid Transformer-Mamba Language Model}, 
      author={Opher Lieber and Barak Lenz and Hofit Bata and Gal Cohen and Jhonathan Osin and Itay Dalmedigos and Erez Safahi and Shaked Meirom and Yonatan Belinkov and Shai Shalev-Shwartz and Omri Abend and Raz Alon and Tomer Asida and Amir Bergman and Roman Glozman and Michael Gokhman and Avashalom Manevich and Nir Ratner and Noam Rozen and Erez Shwartz and Mor Zusman and Yoav Shoham},
      year={2024},
      eprint={2403.19887},
      archivePrefix={arXiv},
      primaryClass={cs.CL},
      url={https://arxiv.org/abs/2403.19887}, 
}