/ Модель

Характеристики

Лицензия
Apache 2.0
Архитектура
smoldlm · dense
Опубликована
10 мар 2026

smoldlm-144m

Генерация текстаТекст → текст3 профессии

Экспериментальная базовая модель блочной диффузии на 144 млн параметров для генерации английского текста и исследований диффузионных языковых моделей.

491скачиваний за 30 дней2лайкавеса обновлены10 мар 2026

Бенчмарки

Как модель справилась с задачами пользователей ailist и что о ней публикуют открытые лидерборды

Публичные оценки

Из открытых лидербордов. Сравнивайте результаты одного теста при одинаковых условиях — отсутствие оценки не значит, что модель хуже.

В подключённых источниках результатов для этой модели пока нет.

Что умеет модель

Описание составлено по карточке модели и метаданным Hugging Face

SmolDLM-144M — базовая языковая модель с 144,47 млн параметров, разработанная в рамках открытого проекта SmolDLM. Это плотная модель блочной диффузии: она уточняет замаскированные блоки по 32 токена итеративно, вместо того чтобы предсказывать текст строго по одному токену слева направо. В архитектуре используются staircase attention masks, Gated Query Attention и QK-нормализация.

Модель предназначена для экспериментальной генерации английского текста и изучения диффузионных языковых моделей. Это ранний исследовательский чекпойнт, обученный 25 500 шагов на смеси FinePDFs, DCLM и FineWeb-Edu; он видел около 26 млрд токенов из запланированных 100 млрд. Параллельное уточнение токенов внутри блока позволяет модели пересматривать предсказания по мере появления контекста.

Качество генерации ограничено: связный многофразовый текст требует дальнейшего обучения, возможны повторы, а жадное декодирование при температуре 0 приводит к вырождению. Модель обучалась на английских веб-текстах, не настроена на инструкции и не имеет обучения безопасности; она может выдавать вредный, предвзятый или фактически неверный текст. Для работы нужна предоставленная реализация SmolDLM: архитектура несовместима с AutoModel из Transformers. Лицензия — Apache-2.0.

Сценарии применения

  • эксперименты с генерацией текста методом блочной диффузии
  • изучение итеративного уточнения токенов в языковых моделях
  • сравнение параллельного и авторегрессионного декодирования
  • исследование механизмов внимания в компактных языковых моделях

Ограничения

Это ранний чекпойнт с ограниченным качеством генерации: возможны повторы, а для связного многофразового текста требуется дальнейшее обучение; жадное декодирование при температуре 0 вырождается. Модель не настроена на инструкции и не обучена обеспечивать безопасность, требует пользовательской реализации SmolDLM и несовместима с Transformers AutoModel.

Для каких профессий подходит3

Разделы каталога профессий, в задачах которых используется эта модель

Все профессии

Карточка модели

README от автора на Hugging Face, как он его опубликовал

Открыть на Hugging Face

SmolDLM-144M

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

Architecture

Parameters144.47M (tied embeddings)
Layers30
Hidden dim576
Query heads9
KV heads3 (GQA 3:1)
Head dim64
MLP hidden1,536
Context length2,048 tokens
Block size32 tokens
Vocab size49,152
ActivationSwiGLU
NormalizationRMSNorm (eps=1e-5)
Position encodingRoPE (theta=10,000)
AttentionGated Query Attention + QK-norm
  • Block Diffusion — Text is generated in blocks of 32 tokens using BD3-LMs staircase attention masks. Each block is denoised over multiple steps, allowing the model to self-correct within a block.
  • Gated Query Attention (arXiv:2505.06708) — A sigmoid gate on attention output that eliminates attention sinks, zero-initialized for stable training.
  • QK-norm — Per-head RMSNorm on queries and keys for training stability.
  • MuonClip Optimizer — Newton-Schulz momentum for 2D weights + AdamW for embeddings, with QK-Clip (tau=100) for attention logit scaling.
  • Linear Noise Schedule — mask_prob = t, ELBO weight = 1/t. Mathematically simpler than cosine schedules and proven at scale by LLaDA-8B.
  • Document Packing — No right-padding; multiple documents packed per sequence with doc-boundary-aware attention and per-document RoPE reset.

Quickstart

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"
ParameterDefaultDescription
steps10Denoising steps per block. More steps = higher quality, slower generation.
temperature0.7Sampling temperature. 0 = greedy (not recommended for dLLMs), higher = more random.
max_new_tokens256Maximum tokens to generate.

Tips:

  • Use temperature >= 0.5 — greedy decoding causes mode collapse in diffusion LMs (known artifact).
  • More steps improves coherence, especially for longer generations. Try 15-20 for best quality.
  • The model generates in blocks of 32 tokens, so generation is naturally "bursty."

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"
)

How Diffusion LMs Work

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
  1. Start with noise — Fill a block of 32 positions with <|mask|> tokens
  2. Predict all positions — The model predicts what token belongs at every masked position simultaneously
  3. Unmask the most confident — Reveal positions where the model is most certain
  4. Iterate — Re-predict remaining positions with newly revealed context
  5. Next block — Cache the completed block and move to the next 32 positions

This parallel-within-block generation enables:

  • Self-correction — The model can revise earlier predictions within a block as context builds
  • Parallel decoding — Multiple tokens generated per forward pass
  • Non-autoregressive flexibility — No strict left-to-right constraint within blocks

Training

Datasetfinepdfs_50BT + dclm_30BT + fineweb_edu_20BT (100B tokens)
Steps25,500
Tokens seen~26B
HardwareH100-80GB GPUs
Precisionbfloat16 (AMP)
OptimizerMuonClip (lr=0.02) + AdamW (lr=3e-3)
ScheduleWSD (warmup 7%, stable, linear decay at 80%)
Gradient clipping1.0
Noise scheduleLinear (t ~ U[0.1, 1.0], ELBO weight = 1/t)
FrameworkPyTorch + DDP

Training Curves

Training Curves

Loss, gradient norm, and throughput tracked via Trackio.

  • FlexAttention — Compiled block-sparse staircase masks (PyTorch 2.5+)
  • Liger Kernels — Fused RMSNorm + SwiGLU
  • FP8 Training — Optional tensorwise dynamic scaling on H100+ (--fp8)
  • torch.compile — Per-block compilation with Inductor
  • Document Packing — No padding waste, attention masked at document boundaries
  • Selective Activation Checkpointing — Save matmul/attention outputs, recompute cheap ops

Tokenizer

SmolDLM uses a hybrid BPE tokenizer:

  • Merges from SmolLM2 cosmo2-tokenizer (49,138 tokens)
  • Pre-tokenizer from Qwen3 (NFC normalization + GPT-4 regex + ByteLevel)
  • 14 special tokens at IDs 0-13:
IDTokenPurpose
0<|mask|>Diffusion noise token
1<|endoftext|>Document boundary / EOS
2<|padding|>Right-padding (unused with doc packing)
3-7Chat markers<|im_start|>, <|im_end|>, <|system|>, <|user|>, <|assistant|>
8-13Reasoning & tools<think>, </think>, <tool_call>, </tool_call>, <tool_response>, </tool_response>

Limitations

  • Early checkpoint — Trained on ~26B of 100B available tokens (26%). The model has learned language structure but generation quality is limited. Coherent multi-sentence output requires further training.
  • Repetition — Like other early-stage diffusion LMs, the model can produce repetitive patterns, especially at low temperatures.
  • Greedy decoding degenerates — Temperature=0 causes mode collapse (known dLLM artifact). Always use temperature >= 0.5.
  • English only — Trained on English web text.
  • Not instruction-tuned — Base model, no chat or instruction-following capability.
  • Custom architecture — Not compatible with HuggingFace transformers AutoModel. Use the provided modeling_smoldlm.py.
  • No safety training — May generate harmful, biased, or factually incorrect content.

Related Work

SmolDLM builds on ideas from:

  • LLaDA (GSAI-ML) — Large-scale diffusion LM proving the paradigm works at 8B
  • BD3-LMs (Arriaga et al.) — Block diffusion with staircase attention
  • MDLM (Sahoo et al.) — Masked diffusion framework
  • SmolLM2 (HuggingFace) — Architecture and tokenizer foundation
  • Fast-dLLM (NVIDIA) — Inference acceleration techniques
  • Gated Query Attention — Attention sink elimination

License

Apache 2.0

Citation

@misc{smoldlm2026,
  title   = {SmolDLM: A Small Block Diffusion Language Model},
  author  = {Hoang Ha},
  year    = {2026},
  url     = {https://huggingface.co/HoangHa/smoldlm-144m}
}

Как запустить

На своей GPU в ailist. Цена — по текущим предложениям провайдеров

GPU в ailist

Универсальный рантайм

Нельзя запустить

Архитектура smoldlm неизвестна transformers в образе рантайма.

Ревизия весов
64f1177

0 моделей