Skip to page content
SAVRN
Search Plan a project

Open-weight model · Text generation

minimind-math-v3

by Jiwubu jiwubu/minimind-math-v3

minimind-math-v3 is an open-weight model for text generation from Jiwubu, released under Apache License 2.0. It has 64M parameters and a 32,768-token context. At 16-bit it needs about 0.2 GB of GPU memory, which fits on 1x MI300X from $1.85 an hour, at the lowest prices in the SAVRN Index.

minimind-math-v3 是一个基于 MiniMind 项目从零训练的小型中文数学语言模型,权重已转换为 Qwen3 兼容格式,可直接使用 HuggingFace transformers 加载推理。 - 架构:Dense Transformer(Decoder-only),未使用 MoE - 数据:以数学/推理语料为主的预训练数据(pretraint2tmini.jsonl),并经过数学 SFT 训练 - Tokenizer:基于 MiniMind 自训 tokenizer 修改的 patched…

Parameters64M
Context32,768
Weights127.8 MB
Licenseapache-2.0
AccessOpen weights
Monthly Downloads—

Runs On

What it takes to serve minimind-math-v3 (64M parameters): the memory its weights need at each precision, and the cheapest way to rent enough data-center GPUs to hold them.

PrecisionWeightsMemory neededCheapest setupPer hourAlso fits
16-bit 0.1 GB 0.2 GB 1x MI300X (192 GB)
Vultr
$1.85 1x H100 $1.99 · 1x MI325X $2.00
8-bit 0.1 GB 0.1 GB 1x MI300X (192 GB)
Vultr
$1.85 1x H100 $1.99 · 1x MI325X $2.00
4-bit 0.0 GB 0.0 GB 1x MI300X (192 GB)
Vultr
$1.85 1x H100 $1.99 · 1x MI325X $2.00

Memory is the weights at that precision plus 20% for the runtime and a short context; a long context needs more. Prices are the lowest on-demand hourly rates in the SAVRN Index, read Oct 18, 2026.

minimind-math-v3 on every accelerator the SAVRN Index prices, at every precision

Model Card

By Jiwubu, published under apache-2.0, revision dcacacf43fcf.

minimind-math-v3 是一个基于 MiniMind 项目从零训练的小型中文数学语言模型,权重已转换为 Qwen3 兼容格式,可直接使用 HuggingFace transformers 加载推理。 - 架构:Dense Transformer(Decoder-only),未使用 MoE - 数据:以数学/推理语料为主的预训练数据(pretraint2tmini.jsonl),并经过数学 SFT 训练 - Tokenizer:基于 MiniMind 自训 tokenizer 修改的 patched tokenizer,详见下方说明 本模型的预训练与 SFT 均基于 jiwubu/minimind 代码仓库完成。相对上游 jingyaogong/minimind 的主要修改是新增 math/ 目录,用于生成数学 SFT 用的加减乘除算术数据(genmathdataaddsub.py、genmathdatamuldiv.py 等),并提供配套评测脚本(evalmath.py)。 最简单的方式是用仓库自带的交互式验证脚本(chat template + 贪心解码 + 流式输出): 或直接用 transformers: - 预训练 2 个 epoch,batch size 32,最大序列长度 340 - 优化器 AdamW,初始学习率 5e-4(带 warmup + 余弦衰减) - 混合精度:bfloat16 本模型使用基于 MiniMind 原版 tokenizer 修改的 patched tokenizer(Sequence[Digits, ByteLevel]):…

Read Jiwubu's full model card

minimind-math-v3 是一个基于 MiniMind 项目从零训练的小型中文数学语言模型,权重已转换为 Qwen3 兼容格式,可直接使用 HuggingFace transformers 加载推理。

模型描述

  • 训练方式:从零预训练(随机初始化,无任何基座权重)
  • 架构:Dense Transformer(Decoder-only),未使用 MoE
  • 数据:以数学/推理语料为主的预训练数据(pretrain_t2t_mini.jsonl),并经过数学 SFT 训练
  • Tokenizer:基于 MiniMind 自训 tokenizer 修改的 patched tokenizer,详见下方说明

代码仓库

本模型的预训练与 SFT 均基于 jiwubu/minimind 代码仓库完成。相对上游 jingyaogong/minimind 的主要修改是新增 math/ 目录,用于生成数学 SFT 用的加减乘除算术数据(gen_math_data_addsub.py、gen_math_data_muldiv.py 等),并提供配套评测脚本(eval_math.py)。

模型规格

参数 值
参数量 ~64M
hidden_size 768
num_hidden_layers 8
num_attention_heads 8
num_key_value_heads (GQA) 4
head_dim 96
intermediate_size 2432
激活函数 SiLU (SwiGLU)
位置编码 RoPE (theta = 1e6)
最大上下文长度 32768
词表大小 6400
tie_word_embeddings true
精度 float16

快速开始

最简单的方式是用仓库自带的交互式验证脚本(chat template + 贪心解码 + 流式输出):

python verify_model.py
# 输入> 竖式计算 1245 + 111
#: 竖式计算 1245 + 111
#...逐位演算过程...
# 答案(3位): 1356

或直接用 transformers:

from transformers import AutoModelForCausalLM, AutoTokenizer

model = AutoModelForCausalLM.from_pretrained(
    "jiwubu/minimind-math-v3",
    torch_dtype="float16",
    device_map="auto",
)
tokenizer = AutoTokenizer.from_pretrained("jiwubu/minimind-math-v3")

messages = [{"role": "user", "content": "竖式计算 1245 + 111"}]
prompt = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
outputs = model.generate(
    **inputs,
    max_new_tokens=512,
    do_sample=False,   # 贪心解码,结果可复现
)
print(tokenizer.decode(outputs[0, inputs["input_ids"].shape[1]:], skip_special_tokens=True))

注意:本模型经过预训练与数学 SFT 训练,推理时必须套 chat template——裸文本输入(不套模板)是分布外输入,会产生无意义的重复输出。数学能力范围见下方评测一节。

训练细节

  • 预训练 2 个 epoch,batch size 32,最大序列长度 340
  • 优化器 AdamW,初始学习率 5e-4(带 warmup + 余弦衰减)
  • 混合精度:bfloat16

Tokenizer 修改

本模型使用基于 MiniMind 原版 tokenizer 修改的 patched tokenizer(Sequence[Digits, ByteLevel]):

  • 数字全局一位一 token:每个数字字符(0-9)单独切分为一个 token,使模型能更稳定地处理算术运算中的数字对齐
  • ID 兼容:修改后的 tokenizer 与原版 token id 完全兼容,不影响已有 token 序列
  • 词表冻结:词表大小保持 6400 不变,embedding 层未重训

数学能力评测

评测使用 math/eval_math.py(--max_digits 8 --n 25,贪心解码,按整数值判定对错),训练范围内总体准确率 98.6%(3975 题)。

加减法(8 位以内,各分档准确率 %)

档位 准确率 档位 准确率
等长± 100 负数 98.9
不等长± 100 负数·等长接近 95.4
短在前 99.3 前导零 88.0
紧凑写法 100 长串答案 99.3
紧凑不等长 99.3 全同数字 99.7
负数共后缀 99.4 长零串 100

乘除法(≤4 位,各分档准确率 %)

档位 准确率 档位 准确率
乘法(通用) 100 整除 97.0
乘一位乘数 100 带余 89.0
乘末尾零 99.0 商含 0 98.0
乘内嵌 0 100 商零串 98.0
乘整十幂 100 小除以大 96.0
乘全同数字 100 除数 1 位 100
乘 9 串 100 除数 2 位 88.9
乘相等 100 —

已知限制

  • 近等值比较判定(负数·等长接近 95.4%、前导零 88.0%)为 64M / 单 epoch SFT 的能力边界
  • 带余除法 89.0% 为残余难点
  • 乘除 ≥5 位未训练,属于外推场景(实测 0~12%)
  • 固定输出格式:模型始终输出完整竖式演算过程

局限性

  • 模型规模很小(~64M),数学推理能力有限,仅用于学习与研究
  • 经过数学 SFT 但规模有限,可能生成不准确或无意义的内容
  • 上下文以短序列训练(340 tokens),长文本能力未经充分训练

引用

如果你使用了本模型,欢迎引用 MiniMind 项目:

@misc{minimind,
  author = {jingyaogong},
  title  = {MiniMind: Training a small LLM from scratch},
  url    = {https://github.com/jingyaogong/minimind},
  year   = {2024}
}

许可证

Apache License 2.0

Configuration

Architecture
Qwen3ForCausalLM
Context length (tokens)
32,768
Layers
8
Hidden size
768
Feed-forward size
2,432
Attention heads
8
Key/value heads
4
Head dimension
96
Vocabulary size
6,400
RoPE base
1e+06
Model type
qwen3

Identity and Version

Repository
jiwubu/minimind-math-v3
Publisher
Jiwubu
Task
Text generation
Modality
Text
Library
transformers
Parameters
64M parameters
Languages
zh, en
Revision
dcacacf43fcf41ac5ffb0b11504277c9c42f2d19
First published
2026-09-25
Last updated
2026-09-25

Files and Weights

10 files, 128.3 MB in total. The weights are 1 file totalling 127.8 MB in safetensors.

Weights1 file · 127.8 MB
Configuration4 files · 3.9 KB
Tokenizer2 files · 458.9 KB
Documentation1 file · 5.5 KB
Other1 file · 3.9 KB
Repository1 file · 1.5 KB
Every file
FileTypeSizeSHA-256
model.safetensorsWeights127.8 MB 160a0040a007
config.jsonConfiguration863 B —
generation_config.jsonConfiguration69 B —
special_tokens_map.jsonConfiguration1.1 KB —
verify_model.pyConfiguration1.9 KB —
README.mdDocumentation5.5 KB —
chat_template.jinjaOther3.9 KB —
.gitattributesRepository1.5 KB —
tokenizer.jsonTokenizer451.3 KB —
tokenizer_config.jsonTokenizer7.5 KB —

License and Download

License
apache-2.0
Access
Open weights, no gate
Download size
127.8 MB
Download from Jiwubu

Released by Jiwubu through its official repository on Hugging Face. Read the license.

Memory Requirements

PrecisionWeights in memory
As published127.8 MB
16-bit0.1 GB
8-bit0.1 GB
4-bit0.0 GB

Weights only, from the published parameter count; the key-value cache and runtime add to this.

Questions About minimind-math-v3

How much GPU memory does minimind-math-v3 need?

About 0.2 GB at 16-bit and 0 GB at 4-bit: the weights (64M parameters) plus a working margin. A long context needs more.

What is the cheapest GPU to run minimind-math-v3 on?

At 16-bit, 1x MI300X from $1.85 an hour; at 4-bit, 1x MI300X from $1.85 an hour, at the lowest on-demand prices the SAVRN Index lists.

Can I use minimind-math-v3 commercially?

Yes. minimind-math-v3 is released under Apache License 2.0. The Apache License 2.0 is a permissive open-source license. It permits commercial use, modification and redistribution. It requires keeping the license and copyright notices and any NOTICE file, stating significant changes, and it includes an express patent grant from contributors.

What is minimind-math-v3's context length?

32,768 tokens, from the maximum position embeddings in its published configuration.

Similar Models

Model · Text generation

lightning-60m

AobanZ

Lightning is a small, autoregressive transformer which utilizes FlashAttention and MHA. This model is trained on a variety of books from a dataset(300 MB). This is the expanded version of Lightning-30m. Lightning utilizes FlashAttention and AdamW for performance and capability. Lightning is designed to provide quick, coherent outputs, improved with a larger size and weight. Lightning is intended to be used for research, analysis and fine-tuning, stories and other. It is not intended to be used for professional advice, real writing or any kind of heavy work as generated outputs may be incorrect. Lightning can be used directly for text generation, experimentation, and conversational…

Open weights mit 65M parameters transformers

Model · Text generation

TeenyTinyStories-33M

YF

GPT-Neo storyteller (nominal 33M; actual 68,514,048 parameters including the 50,257-token embedding) trained on TeenyTinyStories (ableian/TeenyTinyStories) batch 1280 x 512, constant LR 5e-4, weight decay 0.1, betas (0.9, 0.95), clip 1.0. - TS-valid capped to stories of at most 400 tokens (20,711 stories): 1.539 / ppl 4.66 Research on small-scale synthetic pretraining data. Generates simple children's stories; sample at temperature 0.8-1.0. See the TeenyTinyStories paper for the corpus recipe and judge evaluations. Apache-2.0.

Open weights apache-2.0 69M parameters 2,048 tokens transformers

Model · Text generation

DiscoverLM-70M

Convergent Intelligence

A 69M parameter causal language model built on the Mixture-of-Attentions (MoA) architecture — distance-based metric attention that respects the triangle inequality by construction, not approximation. Every attention head operates in a proper metric space. The geometry is enforced, not hoped for. Standard transformers compute attention as a dot product: Q·Kᵀ. This has no geometric meaning — it's a bilinear form, not a distance. Two tokens can be "close" by dot product while violating basic metric properties. MoA replaces this with negative squared distance under a learned diagonal Mahalanobis metric, then enforces the triangle inequality through a regularizer over random triples sampled…

Open weights cc 69M parameters 1,024 tokens transformers

Model · Text generation

Discovery

Convergent Intelligence

A 70M parameter causal language model built on the Mixture-of-Attentions (MoA) architecture — distance-based metric attention that respects the triangle inequality by construction, not approximation. Every attention head operates in a proper metric space. The geometry is enforced, not hoped for. Standard transformers compute attention as a dot product: Q·Kᵀ. This has no geometric meaning — it's a bilinear form, not a distance. Two tokens can be "close" by dot product while violating basic metric properties. MoA replaces this with negative squared distance under a learned diagonal Mahalanobis metric, then enforces the triangle inequality through a regularizer over random triples sampled…

Open weights cc 71M parameters 2,048 tokens transformers

Model · Text generation

SAGI

Convergent Intelligence

SAGI is a novel causal language model that integrates swarm intelligence dynamics with transformer architecture. The model treats cognition as a dynamic, adaptive system where multiple internal "agents" collaborate through differentiable routing, trust mechanisms, and shared memory. - Episodic + Semantic Memory: Dual memory system with trainable retrieval utility The swarm processes observations derived from token embeddings, updating its internal state S. This state conditions the transformer's attention patterns and feed-forward activations via learned projections, creating bidirectional information flow between symbolic (tokens) and subsymbolic (swarm dynamics) processing. - Educational…

Open weights apache-2.0 53M parameters 2,048 tokens transformers

Model · Text generation

cRia-LM-75M

Shreyan Mohanty

cRia-LM-75M is a 75.7M-parameter base language model built as a Relaxed Recursive Transformer (RRT). It uses a shared 11-layer recurrent block evaluated twice, with pass-specific LoRA parameters on the second traversal. Training was carried out in three stages. Stage 1 established the 2K base model over 10B tokens. Stage 2 continued training with a 2B-token budget and a capability-focused data curriculum; the released Stage 2 checkpoint is step 10,000, corresponding to about 1.31B continuation tokens. Stage 3 extended the context window from 2,048 to 4,096 tokens with a 50M-token run on codelion/sutra-1B. The released checkpoint continues from that long-context stage with 35 learned…

Open weights apache-2.0 76M parameters 4,096 tokens transformers