MiniSeek-M0.1-base

MiniSeek MoE · 预训练基座(非对话 / 非 SFT)

中文 | English

GitHub License


🇨🇳 中文

超小开源 Decoder-only MoE 语言模型(架构参数 150,217,216 ≈ 150.22M,Embedding 与 LM Head 共享),作为对齐 DeepSeek 结构路线中的 MoE 预训练基座。本仓库仅含预训练基座;对话版见 MiniSeek-M0.1。

目标是对齐 DeepSeek(Dense → MoE,base → chat),不是宣称已对标。

模型概览

Model ID wyf-yfw/MiniSeek-M0.1-base
系列 MiniSeek-M(MoE);Dense 线为 MiniSeek-D
版本 0.1-base(仅预训练)
参数量 150,217,216(~150.22M;Embedding 与 LM Head 共享)
权重文件 model.safetensors(不含重复的 lm_head,加载时 strict=False)
结构 MoE Decoder-only Transformer(每层 1 shared + 32 routed,top-2)
训练上下文 1024 tokens
分词器 MiniMind(vocab_size=6400)+ ChatML chat_template
精度 BF16 训练 / FP32 model.safetensors
协议 MIT

命名约定(一仓一权重):

  • MiniSeek-D{x.y}-base / MiniSeek-D{x.y} — Dense 预训练 / SFT
  • MiniSeek-M{x.y}-base — MoE 预训练基座(本仓库)
  • MiniSeek-M{x.y} — MoE 后训练(SFT / chat)

结构

flowchart TB
  E[Token Embedding<br/>V=6400 × d=512]
  B[×8 Transformer Block<br/>RMSNorm → Causal Attn RoPE → RMSNorm → MoE FFN]
  H[LM Head · tied with Embedding]
  E --> B --> H
  B --- M[每层 MoE<br/>1 shared + 32 routed · top-2 · h=512]

超参

组件 取值
d_model 512
n_layers 8
n_heads / head_dim 8 / 64
MoE 1 shared + 32 routed,num_experts_per_tok=2
moe_intermediate_size 512
激活 / 归一化 GELU-style expert MLP + RMSNorm
位置编码 RoPE(θ=1e6)
Embedding tie 是
vocab_size 6400(MiniMind)
特殊 token pad/unk=<|endoftext|>(0), bos=<|im_start|>(1), eos=<|im_end|>(2)

训练数据与本检查点

项 说明
目标 因果语言模型 / next-token + MoE load-balance aux(aux_coef=0.01)
发布权重来源 task 20261028-000054-56bd(moe-pretrain-3)checkpoints/last.pt
Train step 106586
Train loss(last) ≈ 2.67
max_seq_len 1024
优化器 AdamW · LR 1e-5
硬件 NVIDIA GPU(训练机)

代码与配方:github.com/wyf-yfw/miniseek

适用场景

  • 超小 MoE 预训练研究 / 学习
  • MiniSeek-M 对话 SFT 的初始化基座
  • 仓库内 Web UI 本地推理演示

不是生产级聊天机器人;本发布无指令 SFT。

从 Hub 加载 MoELM

import json
from pathlib import Path
import torch
from huggingface_hub import snapshot_download
from safetensors.torch import load_file
# clone https://github.com/wyf-yfw/miniseek ,把 algo/ 加入 PYTHONPATH:
from model.config import ModelConfig
from model.moe import MoELM
from transformers import AutoTokenizer

repo = snapshot_download("wyf-yfw/MiniSeek-M0.1-base")
cfg = ModelConfig.from_dict(json.loads(Path(repo, "config.json").read_text()))
model = MoELM(cfg).eval()
state = load_file(Path(repo) / "model.safetensors")
model.load_state_dict(state, strict=False)  # lm_head tied → tok_emb
tokenizer = AutoTokenizer.from_pretrained(Path(repo) / "tokenizer", trust_remote_code=True)

ids = tokenizer.encode("你好,你是谁", add_special_tokens=True)
out = model.generate(
    torch.tensor([ids]),
    max_new_tokens=64,
    temperature=0.8,
    top_k=50,
    eos_token_id=tokenizer.eos_token_id,
)
print(tokenizer.decode(out[0].tolist(), skip_special_tokens=True))

自定义 MoELM,尚不支持 AutoModelForCausalLM 即插即用。本包附带 moe.py / dense.py 参考源码。

局限

  • ~150M MoE 容量仍小,事实错误与重复常见
  • 本发布无指令 SFT / RLHF
  • 停止符为 <|im_end|>
  • 参考实现逐步重算全上下文(尚无 KV cache)

引用

@misc{miniseek-m01-base,
  title        = {MiniSeek-M0.1-base},
  author       = {wyf-yfw},
  year         = {2026},
  howpublished = {\url{https://huggingface.co/wyf-yfw/MiniSeek-M0.1-base}},
  note         = {Ultra-small MoE Decoder-only pretrained base}
}

致谢

  • 分词参考 MiniMind
  • Dense 前序:wyf-yfw/MiniSeek-D0.1-base
  • 结构路线目标对齐 DeepSeek 风格组件(Dense → MoE → …)

🇬🇧 English

Ultra-small open decoder-only MoE LM (150,217,216 ≈ 150.22M params with tied embedding/LM head), the MoE pretrained base on a DeepSeek-aligned roadmap. This repo is the pretrained base only; chat/SFT lives at MiniSeek-M0.1.

Goal: align toward DeepSeek (Dense → MoE, base → chat). Not a claim of parity.

Model summary

Model ID wyf-yfw/MiniSeek-M0.1-base
Family MiniSeek-M (MoE) · Dense line is MiniSeek-D
Version 0.1-base (pretrained only)
Parameters 150,217,216 (~150.22M; embedding tied with LM head)
Weight file model.safetensors (no duplicate lm_head; load with strict=False)
Architecture MoE decoder-only Transformer (1 shared + 32 routed, top-2 per layer)
Context (train) 1024 tokens
Tokenizer MiniMind (vocab_size=6400) + ChatML chat_template
Precision BF16 train / FP32 model.safetensors
License MIT

Naming (one Hub repo per checkpoint):

  • MiniSeek-D{x.y}-* — Dense
  • MiniSeek-M{x.y}-base — MoE pretrained (this repo)
  • MiniSeek-M{x.y} — MoE SFT / chat

Architecture

flowchart TB
  E[Token Embedding<br/>V=6400 × d=512]
  B[×8 Transformer Block<br/>RMSNorm → Causal Attn RoPE → RMSNorm → MoE FFN]
  H[LM Head · tied with Embedding]
  E --> B --> H
  B --- M[Per-layer MoE<br/>1 shared + 32 routed · top-2 · h=512]

Hyperparameters

Component Value
d_model 512
n_layers 8
n_heads / head_dim 8 / 64
MoE 1 shared + 32 routed, num_experts_per_tok=2
moe_intermediate_size 512
Activation / Norm GELU-style expert MLP + RMSNorm
Position RoPE (θ=1e6)
Embedding tie Yes
vocab_size 6400

Training setup (this checkpoint)

Item Detail
Objective Causal LM + MoE load-balance aux (aux_coef=0.01)
Release weights task 20261028-000054-56bd (moe-pretrain-3) checkpoints/last.pt
Train step 106586
Train loss (last) ≈ 2.67
max_seq_len 1024
Optimizer AdamW · LR 1e-5

Code: github.com/wyf-yfw/miniseek

How to load

See the Chinese section for the Python snippet (MoELM + strict=False). Custom model — not drop-in AutoModelForCausalLM yet.

Limitations

  • Small MoE capacity — factual errors and repetition expected
  • No instruction SFT / RLHF in this release
  • Stop token <|im_end|>; no KV cache in reference generate

Citation

@misc{miniseek-m01-base,
  title        = {MiniSeek-M0.1-base},
  author       = {wyf-yfw},
  year         = {2026},
  howpublished = {\url{https://huggingface.co/wyf-yfw/MiniSeek-M0.1-base}},
  note         = {Ultra-small MoE Decoder-only pretrained base}
}
Downloads last month
46
Safetensors
Model size
0.2B params
Tensor type
F32
·
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for wyf-yfw/MiniSeek-M0.1-base

Finetunes
1 model

Collection including wyf-yfw/MiniSeek-M0.1-base