MiniSeek-D0.1-base
MiniSeek Dense · 预训练基座(非对话 / 非 SFT)
🇨🇳 中文
超小开源 Decoder-only 语言模型(约 28.45M 参数),作为对齐 DeepSeek-V4.1-Flash 结构路线的 Dense 基线。本仓库仅含预训练基座;对话版见 MiniSeek-D0.1。
模型概览
| Model ID | wyf-yfw/MiniSeek-D0.1-base |
| 系列 | MiniSeek-D(Dense);后续 MoE 线为 MiniSeek-M |
| 版本 | 0.1-base(仅预训练) |
| 参数量 | 28,451,328(~28.45M;Embedding 与 LM Head 共享) |
| 权重文件 | model.safetensors |
| 结构 | Dense Decoder-only Transformer |
| 训练上下文 | 512 tokens |
| 分词器 | MiniMind(vocab_size=6400) |
| 精度 | BF16 训练 / FP32 model.safetensors |
| 协议 | MIT |
命名约定(一仓一权重):
MiniSeek-D{x.y}-base— Dense 预训练基座MiniSeek-D{x.y}— 后训练(SFT / chat)MiniSeek-M{x.y}-*— MoE 线
结构

flowchart TB
E[Token Embedding<br/>V=6400 × d=512]
B[×8 Transformer Block<br/>RMSNorm → Causal Attn RoPE → RMSNorm → Dense FFN]
H[LM Head · tied with Embedding]
E --> B --> H
超参
| 组件 | 取值 |
|---|---|
d_model | 512 |
n_layers | 8 |
n_heads | 8 |
head_dim | 64 |
Dense FFN intermediate_size | 2048 (=4d) |
| 激活 / 归一化 | GELU-style FFN + RMSNorm |
| 位置编码 | RoPE(θ=1e6) |
| Embedding tie | 是 |
vocab_size | 6400(MiniMind 实测) |
| 特殊 token | `pad/unk=< |
按 V≈32k 估算的 ~58M 不适用于本发布;本权重使用 MiniMind 6400 词表 → ~28.45M。
训练数据
Stage-0 / Dense 基线锁定数据(后续改结构时仍用同一套,便于公平对比):
| 项 | 说明 |
|---|---|
| 数据集 | jingyaogong/minimind_dataset |
| 训练集 | pretrain_t2t_mini.jsonl(约 1.27M 行) |
| 验证集 | 固定 valid.jsonl(0.5% 划分,seed 锁死) |
| 目标 | 因果语言模型 / next-token |
| EOS | 续训时样本末尾追加 `< |
| 语言 | 以中文为主,含部分英文 |
本仓库不含 SFT / chat;对话权重在 MiniSeek-D0.1。
本检查点训练配置
| 项 | 值 |
|---|---|
| 硬件 | NVIDIA RTX 3090 |
| 优化器 | AdamW |
| 峰值 LR → 最小 LR | 1e-4 → 3e-5(warmup + cosine) |
| Autocast | CUDA 上 BF16 |
| 发布权重来源 | checkpoints/stage0/best.pt |
| Train step | 158035 |
| Train loss(best) | ≈ 0.77 |
代码与配方:github.com/wyf-yfw/miniseek
适用场景
- 超小 LM 训练研究 / 学习
- MiniSeek-M(MoE)及后续 SWA / CSA2 / CED 之前的 Dense 基线
- 仓库内 Web UI 本地推理演示
不是生产级聊天机器人;在困难考试题上接近随机,需 SFT 与更大数据。
使用方法
方式 A — 训练仓库(推荐)
git clone https://github.com/wyf-yfw/miniseek
cd miniseek
python generate.py --ckpt checkpoints/stage0/best.pt --prompt "你好,你是谁" --max-new-tokens 128
方式 B — 从 Hub 加载 DenseLM
import json
from pathlib import Path
import torch
from huggingface_hub import snapshot_download
from safetensors.torch import load_file
from model.config import ModelConfig
from model.dense import DenseLM
from model.tokenizer import load_tokenizer
repo = snapshot_download("wyf-yfw/MiniSeek-D0.1-base")
cfg = ModelConfig.from_dict(json.loads(Path(repo, "config.json").read_text()))
model = DenseLM(cfg)
state = load_file(Path(repo) / "model.safetensors")
model.load_state_dict(state, strict=False) # lm_head tied → tok_emb
tok = load_tokenizer(str(Path(repo) / "tokenizer"))
ids = tok.encode("你好,你是谁", add_special_tokens=True)
out = model.generate(
torch.tensor([ids]),
max_new_tokens=64,
temperature=0.8,
top_k=50,
eos_token_id=tok.eos_token_id,
)
print(tok.decode(out[0].tolist(), skip_special_tokens=True))
自定义
DenseLM,尚不支持AutoModelForCausalLM即插即用。
评测
Eval-Core(后续 MiniSeek-D / M 共用):Valid PPL · Gen-Smoke(20 prompt,seed=42)· C-Eval valid · CMMLU · 效率(显存 / tokens/s)。
分数写入 GitHub eval/reports/。参考锚点:MiniMind-3(~64M)C-Eval≈24.9 / CMMLU≈25.4。
局限
- 容量极小,事实错误与重复常见
- 本发布无指令 SFT / RLHF
- 未遇到 EOS 时可能打满
max_new_tokens;停止符为<|im_end|> - 参考实现逐步重算全上下文(尚无 KV cache)
引用
@misc{miniseek-d01-base,
title = {MiniSeek-D0.1-base},
author = {Wang Yifan},
year = {2026},
howpublished = {\url{https://huggingface.co/wyf-yfw/MiniSeek-D0.1-base}},
note = {Ultra-small dense Decoder-only pretrained base}
}
致谢
- 分词与数据配方参考 MiniMind /
jingyaogong/minimind_dataset - 结构路线对齐 DeepSeek-V4.1-Flash 风格组件(Dense → MoE → …)
🇬🇧 English
Ultra-small open decoder-only LM (~28.45M params), the Dense baseline on a DeepSeek-V4.1-Flash-aligned roadmap. This repo is the pretrained base only; chat/SFT lives at MiniSeek-D0.1.
Model summary
| Model ID | wyf-yfw/MiniSeek-D0.1-base |
| Family | MiniSeek-D (Dense) · MoE line will be MiniSeek-M |
| Version | 0.1-base (pretrained only) |
| Parameters | 28,451,328 (~28.45M; embedding tied with LM head) |
| Weight file | model.safetensors |
| Architecture | Dense decoder-only Transformer |
| Context (train) | 512 tokens |
| Tokenizer | MiniMind (vocab_size=6400) |
| Precision | BF16 train / FP32 model.safetensors |
| License | MIT |
Naming (one Hub repo per checkpoint):
MiniSeek-D{x.y}-base— dense pretrained baseMiniSeek-D{x.y}— after post-training (SFT / chat)MiniSeek-M{x.y}-*— MoE line
Architecture

flowchart TB
E[Token Embedding<br/>V=6400 × d=512]
B[×8 Transformer Block<br/>RMSNorm → Causal Attn RoPE → RMSNorm → Dense FFN]
H[LM Head · tied with Embedding]
E --> B --> H
Hyperparameters
| Component | Value |
|---|---|
d_model | 512 |
n_layers | 8 |
n_heads | 8 |
head_dim | 64 |
Dense FFN intermediate_size | 2048 (=4d) |
| Activation / Norm | GELU-style FFN + RMSNorm |
| Position | RoPE (θ=1e6) |
| Embedding tie | Yes |
vocab_size | 6400 (MiniMind measured) |
| Special tokens | `pad/unk=< |
Paper-style ~58M estimates that assume V≈32k do not apply; this checkpoint uses MiniMind’s 6400 vocab → ~28.45M.
Training data
Locked Stage-0 / Dense-baseline recipe (same corpus for later architecture A/B):
| Item | Detail |
|---|---|
| Dataset | jingyaogong/minimind_dataset |
| Train file | pretrain_t2t_mini.jsonl (~1.27M lines) |
| Valid | fixed valid.jsonl (0.5% split, seed locked) |
| Objective | Causal LM / next-token prediction |
| EOS | `< |
| Language mix | predominantly Chinese + some English |
No SFT/chat in this repo — see MiniSeek-D0.1.
Training setup (this checkpoint)
| Item | Value |
|---|---|
| Hardware | NVIDIA RTX 3090 |
| Optimizer | AdamW |
| Peak LR → min LR | 1e-4 → 3e-5 (warmup + cosine) |
| Autocast | BF16 on CUDA |
| Release weights | checkpoints/stage0/best.pt |
| Train step | 158035 |
| Train loss (best) | ≈ 0.77 |
Code: github.com/wyf-yfw/miniseek
Intended use
- Research / learning ultra-small LM training
- Baseline before MiniSeek-M (MoE) and later SWA / CSA2 / CED stages
- Local demos via the GitHub Web UI
Not a production chatbot; near-random on hard exams until SFT + larger data.
How to use
Option A — training repo (recommended)
git clone https://github.com/wyf-yfw/miniseek
cd miniseek
python generate.py --ckpt checkpoints/stage0/best.pt --prompt "你好,你是谁" --max-new-tokens 128
Option B — load Hub weights with DenseLM
import json
from pathlib import Path
import torch
from huggingface_hub import snapshot_download
from safetensors.torch import load_file
from model.config import ModelConfig
from model.dense import DenseLM
from model.tokenizer import load_tokenizer
repo = snapshot_download("wyf-yfw/MiniSeek-D0.1-base")
cfg = ModelConfig.from_dict(json.loads(Path(repo, "config.json").read_text()))
model = DenseLM(cfg)
state = load_file(Path(repo) / "model.safetensors")
model.load_state_dict(state, strict=False) # lm_head tied → tok_emb
tok = load_tokenizer(str(Path(repo) / "tokenizer"))
ids = tok.encode("你好,你是谁", add_special_tokens=True)
out = model.generate(
torch.tensor([ids]),
max_new_tokens=64,
temperature=0.8,
top_k=50,
eos_token_id=tok.eos_token_id,
)
print(tok.decode(out[0].tolist(), skip_special_tokens=True))
Custom
DenseLM— not drop-inAutoModelForCausalLMyet.
Evaluation
Eval-Core (shared later): Valid PPL · Gen-Smoke (20 prompts, seed=42) · C-Eval valid · CMMLU · efficiency (VRAM / tokens/s).
Scores go into GitHub eval/reports/. Anchor: MiniMind-3 (~64M) C-Eval≈24.9 / CMMLU≈25.4.
Limitations
- Very small capacity — factual errors and repetition are expected
- No instruction SFT / RLHF in this release
- Generation without EOS may hit
max_new_tokens; stop token is<|im_end|> - Reference inference recomputes full context each step (no KV cache yet)
Citation
@misc{miniseek-d01-base,
title = {MiniSeek-D0.1-base},
author = {Wang Yifan},
year = {2026},
howpublished = {\url{https://huggingface.co/wyf-yfw/MiniSeek-D0.1-base}},
note = {Ultra-small dense Decoder-only pretrained base}
}
Acknowledgements
- Tokenizer & dataset recipe inspired by MiniMind /
jingyaogong/minimind_dataset - Architecture roadmap toward DeepSeek-V4.1-Flash-style components (dense → MoE → …)