UDream 1.0 Base: a compact 4.2B parameter MoE model built from scratch
3 min readupdated
UDream 1.0 Base is a pretrained language model built from scratch by author Oleksandr Dormidontov, utilizing a sparse MoE (Mixture-of-Experts — an architecture where only a subset of the model is activated for each token) architecture. With a total of 4.20B parameters and only 1.50B active per token, it delivers fast generation with low memory usage. The model focuses primarily on Ukrainian, while its metadata also lists Russian, English, Polish, Czech, and Belarusian. It is well-suited for researchers and developers looking for a lightweight base model to fine-tune on local texts, dialogues, and long contexts up to 32,768 tokens.
Key features
- Efficient MoE architecture: 26 layers (4 dense and 22 MoE layers with 32 experts using a top-6 routing mechanism, plus 1 shared active expert).
- 5:1 Hybrid attention: alternating local sliding windows (w=512) and 4 global NoPE layers maintain a context of up to 32k tokens while consuming only 278 MB of KV cache in bf16.
- Dense text compression: the custom
udream-64ktokenizer achieves a compression rate of 7.40–7.81 bytes per token for Ukrainian (32–52% denser than Gemma-4 and Qwen3.5). - Trained on local hardware: the model was trained on 63.73B tokens plus a context-extension phase on a single workstation equipped with two NVIDIA RTX 5090 GPUs.
What you can do
- Fine-tune for your tasks: use the checkpoint as a base model for SFT or DPO fine-tuning (a chat version with 8D conditioning is being prepared by the author for a separate release).
- Process long documents: apply the model to long-text fact retrieval tasks—on the Ukrainian NIAH test, it achieved 100% extraction accuracy across distances from 4k to 28.7k tokens.
- Generate and continue text: run locally via
transformersto autocomplete articles, news, and journalistic writing using theorlanguage prefix.
Example
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer
repo_id = "UDream/UDream-1.0-Base"
tok = AutoTokenizer.from_pretrained(repo_id, trust_remote_code=True)
model = AutoModelForCausalLM.from_pretrained(repo_id, trust_remote_code=True, dtype=torch.bfloat16, device_map="cuda").eval()
prompt = "Київ — столиця України, розташована на річці Дніпро."
ids = tok(prompt, return_tensors="pt", add_special_tokens=False).to(model.device)
out = model.generate(**ids, max_new_tokens=64, do_sample=True, temperature=0.7, top_p=0.9)
Read more
DetailsBenchmarks: News BPB — 0.4057 (surpassing Gemma-4-E2B Base and Qwen3.5-4B Base), Meme Facts — 60.2%, Catch BPB — 0.7841.
Context: 32,768 tokens, with the bf16 KV cache occupying 278 MB.
Execution: requires
trust_remote_code=True and the prefix without the token.Limitations: this is a base checkpoint (not a chat model) and is not intended for academic exams (ZNO, MMLU), STEM tasks, or code generation.










Comments