bfuzzy1 commited on
Commit
a4c1304
·
verified ·
1 Parent(s): dacab08

Upload folder using huggingface_hub

Browse files
Files changed (6) hide show
  1. README.md +128 -0
  2. chat_datamix.png +0 -0
  3. chat_eval.png +0 -0
  4. config.json +32 -0
  5. model.safetensors +3 -0
  6. tokenizer.json +0 -0
README.md ADDED
@@ -0,0 +1,128 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: apache-2.0
3
+ language:
4
+ - en
5
+ library_name: mlx
6
+ pipeline_tag: text-generation
7
+ tags:
8
+ - rodan
9
+ - tiny-language-model
10
+ - mlx
11
+ - chat
12
+ - chatml
13
+ base_model: bfuzzy1/Rodan-Base
14
+ ---
15
+
16
+ # Rodan-10M-Chat
17
+
18
+ A 10.41M-parameter chat model trained on one Apple M2 with MLX. It starts from the leaner Rodan-10M v9 base
19
+ (PLE-free) and folds conversational data into a short continued-pretrain stage, which adds chat ability
20
+ without throwing away what the base already knew.
21
+
22
+ > Part of the Rodan-10M series. The base model (`Rodan-10M-Base`, v6) lives in its own repo; this is the
23
+ > chat stage built on the v9 checkpoint.
24
+
25
+ ## What it is
26
+
27
+ A ~10M chat model. With the right decoding settings it answers simple instructions coherently and stays on
28
+ topic, which is more than I expected from something this small. It is not a production assistant. Its world
29
+ knowledge is thin, its arithmetic is shaky, and it will make things up. Treat it as a demo of how much chat
30
+ ability you can fit in 10M params, not as something to rely on.
31
+
32
+ ```
33
+ USER: What is the capital of France?
34
+ RODAN: The capital of France is Paris. It's a city known as the country, which has its own unique
35
+ and cultural significance in Europe.
36
+
37
+ USER: Give me a tip for staying healthy.
38
+ RODAN: You can use a regular exercise routine to manage your body and improve overall well-being.
39
+ It's important ... maintaining healthy weight management by burning calories.
40
+
41
+ USER: Why do we sleep?
42
+ RODAN: Sleep can be used to improve cognitive function and memory.
43
+ ```
44
+
45
+ ## How it was built
46
+
47
+ At 10M params, ordinary supervised finetuning costs you base capability. We saw it in earlier Rodan
48
+ experiments: a masked-SFT stage dropped board avg from about 34 to 32, the SFT tax. So instead of a separate
49
+ masked-SFT stage, Rodan-Chat folds the instruction data into
50
+ a continued-pretrain run mixed with 45% replay of the base's own domains (the approach Falcon used). The
51
+ replay is what keeps the model from forgetting. Chat ability gets added while commonsense, science, and
52
+ arithmetic stay roughly where they were.
53
+
54
+ - Warm-start: Rodan-10M v9 (PLE-free, 10.41M). The tied embedding grows 8192→8194 for 2 ChatML tokens.
55
+ - Data (73M tokens): 40M smol-smoltalk conversations in ChatML, plus 33M curated replay, full-sequence LM loss.
56
+ - Optimizer: Muon on the 2D weights, AdamW elsewhere, low LR (1.2e-3, Muon 7e-3, below the base run), cosine, 6000 steps.
57
+ - Result: perplexity dropped 24.9 → 14.6, and the base board avg held at 35.04.
58
+
59
+ | Source | Share | Role |
60
+ |---|---|---|
61
+ | smol-smoltalk (ChatML) | 55% | instruction / multi-turn chat |
62
+ | Cosmopedia (replay) | 9% | commonsense anchor |
63
+ | dolmino pes2o + StackExchange (replay) | 9% | knowledge anchor |
64
+ | synthetic arithmetic (replay) | 9% | computation anchor |
65
+ | FineMath (replay) | 9% | math anchor |
66
+ | science-QA (replay) | 9% | science-MC anchor |
67
+
68
+ ![Chat fold loss & data mix](chat_datamix.png)
69
+
70
+ ## Architecture
71
+
72
+ Same as the base: decoder-only, dim 320, 8 layers, 8 heads, MQA with 1 KV head, SwiGLU 768, RMSNorm, RoPE
73
+ base 200k, QK-norm, tied embeddings, value-residual, LRM. No PLE, since the probe on the base showed it was
74
+ dead. Vocab is 8194 (the 8k byte-BPE set plus `<|im_start|>` and `<|im_end|>`).
75
+
76
+ ## Evaluation
77
+
78
+ The base capability held; there was no SFT-tax collapse. Zero-shot lm-eval, limit 1000, ChatML-wrapped:
79
+
80
+ | Task | Metric | Rodan-Chat | v9 base | Δ |
81
+ |---|---|---|---|---|
82
+ | HellaSwag | acc_norm | 31.7 | 30.1 | +1.6 |
83
+ | ARC-Easy | acc_norm | 35.3 | 35.4 | ≈ |
84
+ | ARC-Challenge | acc_norm | 22.4 | 22.2 | ≈ |
85
+ | PIQA | acc | 53.8 | 55.5 | −1.7 |
86
+ | ArithMark-2 | acc | 25.8 | 28.4 | −2.6 |
87
+ | **Board avg (÷4)** | | **35.04** | 35.70 | −0.66 |
88
+
89
+ The 0.66 dip is partly just the ChatML wrapper hurting multiple-choice loglikelihood, and it's nowhere near
90
+ the 34→32 drop a naive finetune would have caused. The replay did its job.
91
+
92
+ For instruction following itself, IFEval is close to useless at 10M: it grades strict constraint compliance,
93
+ which really needs a model two or three orders of magnitude larger. So we measured the thing we actually care
94
+ about instead. On 24 instruction prompts, an LLM judge compared Rodan-Chat against the v9 base, both decoded
95
+ with the same repetition penalty. Chat won 14, tied 9, and lost 1, for a 93% win-rate excluding ties. The
96
+ base tended to lose by sliding into code or rambling, while Chat gave coherent on-topic answers, several of
97
+ them correct (Paris, photosynthesis producing glucose, the opposite of hot being cold, sleep helping memory).
98
+
99
+ ![Chat eval: board held + win-rate](chat_eval.png)
100
+
101
+ We skipped a full IFEval score on purpose. It grades strict format compliance, which a 10M model fails
102
+ near-uniformly, so the number carries no signal and isn't worth the long generative eval. The win-rate above
103
+ is the instruction-following metric we trust at this scale.
104
+
105
+ ## Usage
106
+
107
+ Wrap prompts in ChatML and decode with a repetition penalty. Tiny models loop badly under pure greedy
108
+ decoding, and the penalty is the difference between gibberish and readable answers.
109
+
110
+ ```python
111
+ ctx = f"<|im_start|>user\n{question}<|im_end|>\n<|im_start|>assistant\n"
112
+ # greedy + repetition_penalty 1.3 + no-repeat-3gram ; stop on <|im_end|> (8193) or <|endoftext|> (0)
113
+ ```
114
+
115
+ The settings I'd recommend: greedy, `repetition_penalty=1.3`, `no_repeat_ngram=3`, `max_new≈70`, low or zero
116
+ temperature.
117
+
118
+ ## Limitations
119
+
120
+ - ~10M params, English only, for research and teaching. Don't use it in production, for factual queries, or for advice.
121
+ - Thin world knowledge, weak arithmetic, prone to making things up, near chance on abstract reasoning.
122
+ - It needs a repetition penalty to stay coherent; pure greedy decoding loops.
123
+ - No safety alignment. It imitates the shape of a chat reply without being a reliable assistant.
124
+
125
+ ## License
126
+
127
+ Weights are open. Data falls under the respective dataset licenses (smol-smoltalk, Cosmopedia, dolmino-mix
128
+ ODC-By, AllenAI QA sets, FineMath).
chat_datamix.png ADDED
chat_eval.png ADDED
config.json ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "model_type": "rodan-modern",
3
+ "architecture": "ModernLM",
4
+ "framework": "mlx",
5
+ "stage": "chat",
6
+ "base_model": "Rodan-10M (v9, PLE-free)",
7
+ "params": 10410000,
8
+ "vocab_size": 8194,
9
+ "dim": 320,
10
+ "n_layers": 8,
11
+ "n_heads": 8,
12
+ "n_kv_heads": 1,
13
+ "head_dim": 40,
14
+ "ffn_hidden": 768,
15
+ "max_len": 512,
16
+ "rope_base": 200000.0,
17
+ "norm": "rmsnorm",
18
+ "norm_eps": 1e-5,
19
+ "activation": "swiglu",
20
+ "qk_norm": true,
21
+ "tied_embeddings": true,
22
+ "value_residual": true,
23
+ "ple_rank": 0,
24
+ "lrm": true,
25
+ "attention": "mqa",
26
+ "chat_template": "chatml",
27
+ "chat_tokens": {"im_start": 8192, "im_end": 8193},
28
+ "eot_id": 0,
29
+ "tokenizer": "byte-level BPE (8k) + 2 ChatML specials = 8194",
30
+ "recommended_decode": "greedy + repetition_penalty 1.3 + no-repeat-3gram (tiny models loop under pure greedy)",
31
+ "notes": "Warm-started from Rodan-10M v9 (PLE-free). Instruction fold: smol-smoltalk ChatML + 45% curated replay (continued-pretrain, not masked SFT). Load with model_opt.ModernLM(ModernConfig(**fields)) + load_weights('model.safetensors'). Wrap prompts in ChatML: <|im_start|>user\\n{q}<|im_end|>\\n<|im_start|>assistant\\n"
32
+ }
model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:20f4871ecf678cffb24eefc085278f9125ecf720cd535fd0e84fcfc631f37ac3
3
+ size 41664529
tokenizer.json ADDED
The diff for this file is too large to render. See raw diff