Text Generation
Transformers
Safetensors
Chinese
English
ynet32
custom_code
ymodel
ymodel32
conversational
Instructions to use SnifferCaptain/YModel3.2-fm-1B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use SnifferCaptain/YModel3.2-fm-1B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="SnifferCaptain/YModel3.2-fm-1B", trust_remote_code=True) messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("SnifferCaptain/YModel3.2-fm-1B", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use SnifferCaptain/YModel3.2-fm-1B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "SnifferCaptain/YModel3.2-fm-1B" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "SnifferCaptain/YModel3.2-fm-1B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/SnifferCaptain/YModel3.2-fm-1B
- SGLang
How to use SnifferCaptain/YModel3.2-fm-1B with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "SnifferCaptain/YModel3.2-fm-1B" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "SnifferCaptain/YModel3.2-fm-1B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "SnifferCaptain/YModel3.2-fm-1B" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "SnifferCaptain/YModel3.2-fm-1B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use SnifferCaptain/YModel3.2-fm-1B with Docker Model Runner:
docker model run hf.co/SnifferCaptain/YModel3.2-fm-1B
Update README.md
Browse files
README.md
CHANGED
|
@@ -12,25 +12,17 @@ tags:
|
|
| 12 |
- ymodel32
|
| 13 |
---
|
| 14 |
|
|
|
|
|
|
|
| 15 |
## 模型描述
|
| 16 |
|
| 17 |
`YModel3.2-fm-1B` 是 YModel3.2 家族的 1B 参数**基础权重模型**(foundation weights)。
|
| 18 |
|
| 19 |
-
该模型在内部项目 `ymodel4-1`(架构内部名 `ymodel4`)中完成训练。由于 group attn 设计的实际效果不及预期,该架构已从 YModel4 降级并更名到 YModel3.2 家族,本仓库即以 `YModel3.2-fm-1B` 之名发布。
|
| 20 |
-
|
| 21 |
-
## 命名含义
|
| 22 |
-
|
| 23 |
-
- **YModel3.2** — 架构家族名(内部原名为 ymodel4)
|
| 24 |
-
- **fm** — foundation,基础权重模型
|
| 25 |
-
- **1B** — 1,120,343,553 参数(约 1.12B)
|
| 26 |
-
|
| 27 |
-
称其为"基础权重模型"的原因:group attn 的设计注定让它在常规下游任务上表现不佳,它的意义不在于 YModel3.2 架构本身,而在于它能够以很低的成本训练出一套**完整的权重**——包含完整的 attention、FFN、DCP(dynamic compression probe,动态压缩判断)以及 Sengram 嵌入。如果拿这样一套权重作为相同大小模型的初始化,基本就能实现急速收敛。
|
| 28 |
-
|
| 29 |
## 模型细节
|
| 30 |
|
| 31 |
| 项目 | 值 |
|
| 32 |
| --- | --- |
|
| 33 |
-
| 架构 | YModel3.2
|
| 34 |
| Scale level | 1 |
|
| 35 |
| 参数量 | 1,120,343,553(1.12B,含嵌入)|
|
| 36 |
| Hidden size | 1024 |
|
|
@@ -41,7 +33,7 @@ tags:
|
|
| 41 |
| Group size | 8(固定分组)|
|
| 42 |
| FFN | SwiGLU + SEBlock,intermediate 3072 |
|
| 43 |
| DCP | dynamic compression probe(probe hidden 1024);use_dcp=false,分组固定,probe 权重保留 |
|
| 44 |
-
| Sengram | bucket 16384 / topk 12
|
| 45 |
| 词表 | 151,669(Qwen3 tokenizer,tied embeddings)|
|
| 46 |
| 上下文 | 8192 |
|
| 47 |
| 精度 | bfloat16 |
|
|
@@ -54,12 +46,9 @@ YModel3.2-fm 的 group attn 主要借鉴了论文 **Efficient Pre-Training with
|
|
| 54 |
|
| 55 |
训练分四个阶段完成(bf16,AdamW 与 Muon 双优化器):
|
| 56 |
|
| 57 |
-
1. **预训练**:causal LM,1024 上下文,
|
| 58 |
-
2. **SFT**:UltraData SFT + Instant 混合语料,8192 上下文(预训练为 1024,此阶段首次扩展到 8192),Muon 5e-6 / AdamW 5e-7,嵌入与 lm_head 冻结,
|
| 59 |
-
3. **蒸馏**:teacher 为 Qwen3-0.6B(CE=0.5 / KL=0.5,temperature=1.0),固定 group_size=4,DCP probe 冻结,哈希辅助监督加强至 1e-1,Muon 1e-4 / AdamW 1e-5。
|
| 60 |
-
4. **SFT 2B(最终阶段,maskfix)**:2B token 预算、8192 上下文、Muon 1e-5 / AdamW 1e-6、warmup 1000 步、grad clip 1.0、group_size=4 固定、嵌入与 lm_head 冻结、seed 20260925。数据混合(UltraData-SFT-2605):sft_t2t 400M(20%)、sonnet4.6 200M、z1-1m(structured)300M、z1-1m-free 200M、school math 35M、thinking Chinese-general 100M(5%)、其余 UltraData 精选 765M(38%)。
|
| 61 |
-
|
| 62 |
-
本仓库导出的权重为第 4 阶段(SFT 2B maskfix)结束时的 checkpoint(训练项目内文件名 `sft.pt`,2026-09-27 保存)。
|
| 63 |
|
| 64 |
## Usage
|
| 65 |
|
|
@@ -81,8 +70,7 @@ model = AutoModelForCausalLM.from_pretrained(
|
|
| 81 |
## Notes
|
| 82 |
|
| 83 |
- 包含自定义代码:`modeling_ymodel32.py`(自包含:配置类 + 完整架构)、`ymodel32_eval.py`(参考实现),加载需 `trust_remote_code=True`。
|
| 84 |
-
-
|
| 85 |
-
- 权重为单个 `model.safetensors`(bfloat16,约 2.55GB),嵌入与 lm_head 共享(tied)。
|
| 86 |
- 基准分数与示例输出待补充。
|
| 87 |
|
| 88 |
---
|
|
@@ -91,21 +79,11 @@ model = AutoModelForCausalLM.from_pretrained(
|
|
| 91 |
|
| 92 |
`YModel3.2-fm-1B` is the 1B-parameter **foundation-weights model** of the YModel3.2 family.
|
| 93 |
|
| 94 |
-
The model was trained under the internal project `ymodel4-1` (internal architecture name `ymodel4`). Because the group attn design underperformed expectations, the architecture was demoted and renamed into the YModel3.2 family; this repository publishes it as `YModel3.2-fm-1B`.
|
| 95 |
-
|
| 96 |
-
## Naming
|
| 97 |
-
|
| 98 |
-
- **YModel3.2** — architecture family name (internally: ymodel4)
|
| 99 |
-
- **fm** — foundation (base) weights
|
| 100 |
-
- **1B** — 1,120,343,553 parameters (~1.12B)
|
| 101 |
-
|
| 102 |
-
Why "foundation weights": the group attn design is expected to perform poorly on ordinary downstream tasks. The value of this model is not the YModel3.2 architecture itself — it is that a **complete weight set** (full attention, FFN, the DCP dynamic-compression probe, and the Sengram embeddings) can be trained at very low cost. Initializing a model of the same size with these weights should give essentially rapid convergence.
|
| 103 |
-
|
| 104 |
## Model Details
|
| 105 |
|
| 106 |
| Item | Value |
|
| 107 |
| --- | --- |
|
| 108 |
-
| Architecture | YModel3.2
|
| 109 |
| Scale level | 1 |
|
| 110 |
| Parameters | 1,120,343,553 (1.12B, incl. embeddings) |
|
| 111 |
| Hidden size | 1024 |
|
|
@@ -116,7 +94,7 @@ Why "foundation weights": the group attn design is expected to perform poorly on
|
|
| 116 |
| Group size | 8 (fixed grouping) |
|
| 117 |
| FFN | SwiGLU + SEBlock, intermediate 3072 |
|
| 118 |
| DCP | dynamic compression probe (probe hidden 1024); use_dcp=false, fixed grouping, probe weights retained |
|
| 119 |
-
| Sengram | bucket 16384 / topk 12
|
| 120 |
| Vocab | 151,669 (Qwen3 tokenizer, tied embeddings) |
|
| 121 |
| Context | 8192 |
|
| 122 |
| Dtype | bfloat16 |
|
|
@@ -129,12 +107,9 @@ The group attn of YModel3.2-fm is inspired primarily by **Efficient Pre-Training
|
|
| 129 |
|
| 130 |
Training ran in four stages (bf16, AdamW + Muon dual optimizers):
|
| 131 |
|
| 132 |
-
1. **Pre-training**: causal LM, 1024 context,
|
| 133 |
-
2. **SFT**: mixed UltraData SFT + Instant corpus, 8192 context (pre-training used 1024, so 8192 is new context here), Muon 5e-6 / AdamW 5e-7, embeddings and lm_head frozen,
|
| 134 |
-
3. **Distillation**: teacher Qwen3-0.6B (CE=0.5 / KL=0.5, temperature 1.0), fixed group_size=4, DCP probe frozen, hash auxiliary supervision raised to 1e-1, Muon 1e-4 / AdamW 1e-5.
|
| 135 |
-
4. **SFT 2B (final stage, maskfix)**: 2B token budget, 8192 context, Muon 1e-5 / AdamW 1e-6, 1000-step warmup, grad clip 1.0, fixed group_size=4, embeddings and lm_head frozen, seed 20260925. Data mix (UltraData-SFT-2605): sft_t2t 400M (20%), sonnet4.6 200M, z1-1m (structured) 300M, z1-1m-free 200M, school math 35M, thinking Chinese-general 100M (5%), remaining curated UltraData 765M (38%).
|
| 136 |
-
|
| 137 |
-
The exported weights are the checkpoint saved at the end of stage 4 (SFT 2B maskfix) — file name `sft.pt` in the training project, saved 2026-09-27.
|
| 138 |
|
| 139 |
## Usage
|
| 140 |
|
|
@@ -156,6 +131,5 @@ Note: this architecture ships a custom `generate()` implementation without KV ca
|
|
| 156 |
## Notes
|
| 157 |
|
| 158 |
- Custom code included: `modeling_ymodel32.py` (self-contained: config class + full architecture) and `ymodel32_eval.py` (reference implementation); load with `trust_remote_code=True`.
|
| 159 |
-
-
|
| 160 |
-
- Weights: single `model.safetensors` (bfloat16, ~2.55GB); embeddings and lm_head are tied.
|
| 161 |
- Benchmark scores and sample outputs: to be added.
|
|
|
|
| 12 |
- ymodel32
|
| 13 |
---
|
| 14 |
|
| 15 |
+
*this file is generated by Qwen3.8-27B under human supervision*
|
| 16 |
+
|
| 17 |
## 模型描述
|
| 18 |
|
| 19 |
`YModel3.2-fm-1B` 是 YModel3.2 家族的 1B 参数**基础权重模型**(foundation weights)。
|
| 20 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 21 |
## 模型细节
|
| 22 |
|
| 23 |
| 项目 | 值 |
|
| 24 |
| --- | --- |
|
| 25 |
+
| 架构 | YModel3.2 |
|
| 26 |
| Scale level | 1 |
|
| 27 |
| 参数量 | 1,120,343,553(1.12B,含嵌入)|
|
| 28 |
| Hidden size | 1024 |
|
|
|
|
| 33 |
| Group size | 8(固定分组)|
|
| 34 |
| FFN | SwiGLU + SEBlock,intermediate 3072 |
|
| 35 |
| DCP | dynamic compression probe(probe hidden 1024);use_dcp=false,分组固定,probe 权重保留 |
|
| 36 |
+
| Sengram | bucket 16384 / topk 12 |
|
| 37 |
| 词表 | 151,669(Qwen3 tokenizer,tied embeddings)|
|
| 38 |
| 上下文 | 8192 |
|
| 39 |
| 精度 | bfloat16 |
|
|
|
|
| 46 |
|
| 47 |
训练分四个阶段完成(bf16,AdamW 与 Muon 双优化器):
|
| 48 |
|
| 49 |
+
1. **预训练**:causal LM,1024 上下文,**8.52B Tokens**,冻结嵌入与 lm_head。
|
| 50 |
+
2. **SFT**:UltraData SFT + Instant 混合语料,8192 上下文(预训练为 1024,此阶段首次扩展到 8192),Muon 5e-6 / AdamW 5e-7,嵌入与 lm_head 冻结,**4.14B Tokens**。
|
| 51 |
+
3. **蒸馏**:teacher 为 Qwen3-0.6B(CE=0.5 / KL=0.5,temperature=1.0),固定 group_size=4,DCP probe 冻结,哈希辅助监督加强至 1e-1,Muon 1e-4 / AdamW 1e-5,**0.98B Tokens**。
|
|
|
|
|
|
|
|
|
|
| 52 |
|
| 53 |
## Usage
|
| 54 |
|
|
|
|
| 70 |
## Notes
|
| 71 |
|
| 72 |
- 包含自定义代码:`modeling_ymodel32.py`(自包含:配置类 + 完整架构)、`ymodel32_eval.py`(参考实现),加载需 `trust_remote_code=True`。
|
| 73 |
+
- 权重为单个 `model.safetensors`(bfloat16,约 2.55GB)。
|
|
|
|
| 74 |
- 基准分数与示例输出待补充。
|
| 75 |
|
| 76 |
---
|
|
|
|
| 79 |
|
| 80 |
`YModel3.2-fm-1B` is the 1B-parameter **foundation-weights model** of the YModel3.2 family.
|
| 81 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 82 |
## Model Details
|
| 83 |
|
| 84 |
| Item | Value |
|
| 85 |
| --- | --- |
|
| 86 |
+
| Architecture | YModel3.2 |
|
| 87 |
| Scale level | 1 |
|
| 88 |
| Parameters | 1,120,343,553 (1.12B, incl. embeddings) |
|
| 89 |
| Hidden size | 1024 |
|
|
|
|
| 94 |
| Group size | 8 (fixed grouping) |
|
| 95 |
| FFN | SwiGLU + SEBlock, intermediate 3072 |
|
| 96 |
| DCP | dynamic compression probe (probe hidden 1024); use_dcp=false, fixed grouping, probe weights retained |
|
| 97 |
+
| Sengram | bucket 16384 / topk 12 |
|
| 98 |
| Vocab | 151,669 (Qwen3 tokenizer, tied embeddings) |
|
| 99 |
| Context | 8192 |
|
| 100 |
| Dtype | bfloat16 |
|
|
|
|
| 107 |
|
| 108 |
Training ran in four stages (bf16, AdamW + Muon dual optimizers):
|
| 109 |
|
| 110 |
+
1. **Pre-training**: causal LM, 1024 context, **8.52B Tokens**, embeddings and lm_head frozen.
|
| 111 |
+
2. **SFT**: mixed UltraData SFT + Instant corpus, 8192 context (pre-training used 1024, so 8192 is new context here), Muon 5e-6 / AdamW 5e-7, embeddings and lm_head frozen, **4.14B Tokens**.
|
| 112 |
+
3. **Distillation**: teacher Qwen3-0.6B (CE=0.5 / KL=0.5, temperature 1.0), fixed group_size=4, DCP probe frozen, hash auxiliary supervision raised to 1e-1, Muon 1e-4 / AdamW 1e-5, **0.98B Tokens**.
|
|
|
|
|
|
|
|
|
|
| 113 |
|
| 114 |
## Usage
|
| 115 |
|
|
|
|
| 131 |
## Notes
|
| 132 |
|
| 133 |
- Custom code included: `modeling_ymodel32.py` (self-contained: config class + full architecture) and `ymodel32_eval.py` (reference implementation); load with `trust_remote_code=True`.
|
| 134 |
+
- Weights: single `model.safetensors` (bfloat16, ~2.55GB).
|
|
|
|
| 135 |
- Benchmark scores and sample outputs: to be added.
|