Small language models
verified
10 models · 1 tool
Small language models · Ten small language models from 2023 to 2026, from TinyLlama to LFM3: dense layers in TinyLlama, OLMo and Qwen3, sliding-window attention in Gemma 2 and 3, experts in Granite, a state-space model in Mamba-2, and hybrids in Granite 4, RecurrentGemma and LFM3. And a new Diagram you open block by block.
New tool
Diagram
Most model diagrams are black boxes too. This one opens: every box is a block of the program, so you can open it level by level, click it to find its lines, or put your cursor on a line to see its box.
Language models
- recurrentgemma-2b.byhand2.7BGriffin: two recurrent layers for each local-attention layer, so its memory stays the same however long the text.
- gemma-2-2b.byhand2.6BLocal and global attention taking turns, 13 pairs of them, with both the scores and the logits soft-capped by tanh.
- lfm3-1.7b.byhand1.7BLiquid AI's hybrid: short convolutions in 13 of its 24 layers, sliding and global attention in the other 11.
- qwen3-1.7b.byhand1.7B28 layers, each head's queries and keys normalised before their rotary positions (QK-norm).
- granite-moe-1b.byhand1.3B1.33B parameters, about 400 million at work per token: 8 of 32 experts chosen in each of 24 layers.
- olmo-1b.byhand1.2BOpen down to its training data, with a LayerNorm that learns nothing: no scale, no shift, in all 16 layers.
- tinyllama-1.1b.byhand1.1BLlama 2's design at 1.1B parameters: 22 layers, 32 query heads sharing 4 key and value heads.
- gemma-3-1b.byhand1BFive sliding-window layers for every global one, each kind with its own rotary base: 10,000 near, 1,000,000 far.
- granite4-350m.byhand352MIBM's small dense model, its embedding, residuals, attention and logits each scaled by a multiplier of its own.
- mamba2-130m.byhand129MNo attention at all: 24 layers of Mamba-2's state-space scan, each token updating a fixed-size state.