All models

doge

Small language models with Dynamic Mask Attention, blending self-attention and state-space ideas.

Language · 2,980 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,980 operations (70 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
403.1M
Operations
2,980
Framework
PyTorch
Recurrent
No
Published
2025
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
m4362
Graph hash
51ea44316e65843b2a47f10948702e7abf5e76cc3617d02b4b86073f60c5a041
Skeleton hash
1f02e78f42ed9c3df2b056e5309fa0bb67b046ffd06c8b15e4665e4e1180c517
Architecture hash
5cba0a40c98d1263f61347cf5bfe400d2f038143094446c00ee5061eca156871
Diagram SHA-256
05447999d8c68307fa5137ebdee5a256b96567f7be47523013217edf1e68aec4
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.AutoModelForCausalLM.from_config()

What it is

Doge is a series of small language models whose architecture aims to combine the advantages of state-space and self-attention algorithms. The sequence-mixing part is called Dynamic Mask Attention: it can be understood as self-attention tied to value states during training and as state-space without past state decay at inference, so that the model does not get lost in long text.

The state-transformation part uses a Cross Domain Mixture of Experts, made of dense linear layers and sparse embedding layers, which can add sparse parameters to continue training from dense checkpoints without retraining the entire model. Doge also uses RMSNorm and residual connections with learnable parameters to adapt the gradient range of deep models. The released checkpoints were pre-trained on the smollm-corpus with the wsd_scheduler.

Key idea. Dynamic Mask Attention, which acts like self-attention during training and like state-space without past state decay at inference, so small language models stop getting lost in long text.

  • doge
  • small doge
  • smalldoge
  • doge-20m
  • small language model
  • dynamic mask attention
  • cross domain mixture of experts
  • text generation

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