Momentum-121M
Momentum is a hybrid language-model architecture: recurrent (Gated DeltaNet) layers carry state forward, compressed-attention (MLA) layers handle exact recall, and a sparse mixture-of-experts feed-forward adds capacity.
This checkpoint is 121M parameters (65M active per token), trained from scratch, then given a second pass that teaches it a small chat format and a single tool: web_search(query). It reads numbered search results that a harness pastes in and answers with [n] citations. It is a small research model, not a general assistant. The pass-1 base model (before this second pass) is kept under the git tag pass1-base.
Architecture
| Layers | 12 (9 Gated DeltaNet : 3 MLA, i.e. every 4th layer from index 3 is attention) |
| Hidden size | 448 |
| Feed-forward | first 2 and last 1 layer(s) dense SwiGLU (width 896); the other 9 layers MoE |
| MoE | 48 routed experts (width 104) + 1 shared, top-3, sigmoid scores, 6 groups / 1 kept, bias-based load balancing (no aux loss), dropless |
| Gated DeltaNet | 7 heads, key dim 32, value dim 64, short causal conv (k=4), fp32 state |
| MLA | 14 heads, q-LoRA 56, kv-LoRA 32, nope/rope/v = 32/16/32, sigmoid output gate |
| Multi-token prediction | 1 extra layer (t+2), loss weight 0.1 |
| Vocab / tokenizer | 50257 (GPT-2 BPE), untied embeddings, no biases |
Layer map: 0:GDN+dense 1:GDN+dense 2:GDN+MoE 3:MLA+MoE 4:GDN+MoE 5:GDN+MoE 6:GDN+MoE 7:MLA+MoE 8:GDN+MoE 9:GDN+MoE 10:GDN+MoE 11:MLA+dense
Built from published components: Gated Delta Networks (arXiv:2412.06464), Multi-head Latent Attention (DeepSeek-V2, arXiv:2405.04434), and sigmoid group-limited routing, aux-loss-free balancing and MTP (DeepSeek-V3, arXiv:2412.19437).
Training
- Pass 1 (pretraining): 1000M tokens of FineWeb-Edu (
sample-10BT), context 512, 30517 steps of 64 sequences, AdamW (lr 6e-4, cosine to 10%). Held-out loss 3.598. - Pass 2, stage A (long-context warm-up): 100M tokens at context 1024: FineWeb-Edu 70% / Cosmopedia v2 30%, with code and math documents filtered out. Held-out FineWeb-Edu loss 3.666.
- Pass 2, stage B (SFT): 40M tokens: MS MARCO questions converted to a
web_searchcall, numbered passages and a short cited answer (60%, about 12% with unrelated passages and the answer "the results don't say"); smol-smoltalk chat (30%); pretraining-text replay (10%). Loss only on assistant text. Held-out loss on this mix 1.757.
Prompt format
Plain text, GPT-2 tokenizer, <|endoftext|> ends every assistant turn:
### System
You can call web_search(query). To call it, write <tool_call>{"name":"web_search","arguments":{"query":"..."}}</tool_call>. Sources come back numbered [1], [2]. Answer from the sources and cite them as [n].
### User
<question>
### Assistant
<tool_call>{"name":"web_search","arguments":{"query":"..."}}</tool_call><eos>
### Tool
[1] <passage>
[2] <passage>
### Assistant
<short answer with [1][2] citations><eos>
The harness runs the search, builds the ### Tool block, and maps [n] back to URLs; the model never writes URLs.
Example (held-out MS MARCO question, real passages pasted by the notebook)
- Question: albany mn population
- Model call:
<tool_call>{"name":"web_search","arguments":{"query":"albany mn population"}}</tool_call> - Model answer: The population of St. Paul, Minnesota is 2,827 [4].
- Reference answer: The population of Albany, Minnesota is 2,662.
No downstream benchmarks were run. Expect short, mostly extractive answers.
Usage
import json, torch
from safetensors.torch import load_file
from transformers import AutoTokenizer
from momentum import Cfg, MomentumLM
cfg = Cfg(**json.load(open("config.json")))
model = MomentumLM(cfg); model.load_state_dict(load_file("model.safetensors")); model.eval()
tok = AutoTokenizer.from_pretrained("gpt2")
The Gated DeltaNet falls back to a slow per-token loop unless flash-linear-attention and a CUDA GPU are available. Generation recomputes the full sequence (no KV/state cache).
Limitations
Small, lightly trained model (1100M pretraining tokens): it can misread or over-copy sources, miscite, and write wrong facts when sources are missing. English only, no safety tuning, and it was trained with context up to 1024 tokens.
Licenses
Code is Apache-2.0. Training data: FineWeb-Edu (ODC-By 1.0), smol-smoltalk (Apache-2.0), Cosmopedia v2 (see the smollm-corpus card), and MS MARCO. The Hugging Face card for MS MARCO states no license, and Microsoft's MS MARCO terms are, as far as the author knows, restricted to non-commercial research, so these weights are marked license: other and should be treated as research-only until that is cleared.
- Downloads last month
- 32