Downloads · 30 days
125
2% of all-time downloads
HoangHa/smoldlm-144m
smoldlm-144m is a text generation model from HoangHa. Use it when you need the model to write or continue text. The card lists the license as apache-2.0.
SmolDLM is a 144M parameter block diffusion language model — a new paradigm where text is generated by iteratively denoising masked token blocks, rather than predicting one token at a time like autoregressive models.
Downloads · 30 days
125
2% of all-time downloads
All-time downloads
6.7K
Public
Parameters
144M
58.9 GB on disk
Likes
2
Public
Click a slice to open those files.
.safetensors59.5 GB · 100%
From the Hugging Face model README
SmolDLM is a 144M parameter block diffusion language model — a new paradigm where text is generated by iteratively denoising masked token blocks, rather than predicting one token at a time like autoregressive models.
This is an early research checkpoint from the SmolDLM project — an open-source effort building diffusion language models from first principles, progressing from character-level toys to modern architectures.
[!NOTE] This is a base model trained for 25K steps (~26B tokens of 100B available). See Limitations.
Try the model here: Gooogle Colab
| Parameters | 144.47M (tied embeddings) |
| Layers | 30 |
| Hidden dim | 576 |
| Query heads | 9 |
| KV heads | 3 (GQA 3:1) |
| Head dim | 64 |
| MLP hidden | 1,536 |
| Context length | 2,048 tokens |
| Block size | 32 tokens |
| Vocab size | 49,152 |
| Activation | SwiGLU |
| Normalization | RMSNorm (eps=1e-5) |
| Position encoding | RoPE (theta=10,000) |
| Attention | Gated Query Attention + QK-norm |
pip install torch safetensors tokenizers huggingface-hub
wget https://huggingface.co/HoangHa/smoldlm-144m/resolve/main/modeling_smoldlm.py
from modeling_smoldlm import SmolDLM, generate
model = SmolDLM.from_pretrained("HoangHa/smoldlm-144m")
text = generate(model, prompt="The meaning of life is")
print(text)
Or use the CLI script directly:
wget https://huggingface.co/HoangHa/smoldlm-144m/resolve/main/generate.py
python generate.py "The meaning of life is"
python generate.py --steps 20 --temperature 0.5 "Once upon a time"
<details>
<summary><b>Generation parameters</b></summary>
| Parameter | Default | Description |
|---|---|---|
steps | 10 | Denoising steps per block. More steps = higher quality, slower generation. |
temperature | 0.7 | Sampling temperature. 0 = greedy (not recommended for dLLMs), higher = more random. |
max_new_tokens | 256 | Maximum tokens to generate. |
Tips:
temperature >= 0.5 — greedy decoding causes mode collapse in diffusion LMs (known artifact).steps improves coherence, especially for longer generations. Try 15-20 for best quality.102 checkpoints are available at 250-step intervals from step 250 to step 25,500:
model = SmolDLM.from_pretrained(
"HoangHa/smoldlm-144m",
checkpoint="checkpoints/model_step_025000.safetensors"
)
</details>
Traditional language models (GPT, LLaMA) generate text one token at a time, left to right. Diffusion language models take a fundamentally different approach:
Step 0: [MASK] [MASK] [MASK] [MASK] [MASK] [MASK] [MASK] [MASK]
Step 1: [MASK] [MASK] The [MASK] [MASK] [MASK] was [MASK]
Step 2: [MASK] In The [MASK] year [MASK] was great
Step 3: And In The first year 2024 was great
<|mask|> tokensThis parallel-within-block generation enables:
| Dataset | finepdfs_50BT + dclm_30BT + fineweb_edu_20BT (100B tokens) |
| Steps | 25,500 |
| Tokens seen | ~26B |
| Hardware | H100-80GB GPUs |
| Precision | bfloat16 (AMP) |
| Optimizer | MuonClip (lr=0.02) + AdamW (lr=3e-3) |
| Schedule | WSD (warmup 7%, stable, linear decay at 80%) |
| Gradient clipping | 1.0 |
| Noise schedule | Linear (t ~ U[0.1, 1.0], ELBO weight = 1/t) |
| Framework | PyTorch + DDP |

Loss, gradient norm, and throughput tracked via Trackio.
<details> <summary><b>Training features</b></summary>--fp8)SmolDLM uses a hybrid BPE tokenizer:
| ID | Token | Purpose |
|---|---|---|
| 0 | <|mask|> | Diffusion noise token |
| 1 | <|endoftext|> | Document boundary / EOS |
| 2 | <|padding|> | Right-padding (unused with doc packing) |
| 3-7 | Chat markers | <|im_start|>, <|im_end|>, <|system|>, <|user|>, <|assistant|> |
| 8-13 | Reasoning & tools | <think>, </think>, <tool_call>, </tool_call>, <tool_response>, </tool_response> |
transformers AutoModel. Use the provided modeling_smoldlm.py.SmolDLM builds on ideas from:
Apache 2.0
@misc{smoldlm2026,
title = {SmolDLM: A Small Block Diffusion Language Model},
author = {Hoang Ha},
year = {2026},
url = {https://huggingface.co/HoangHa/smoldlm-144m}
}