Upload melon-1b-ext2-sft weights and model card
Browse filesFiles changed (6)
- README.mdAdded+86
- config.jsonAdded+35
- model.safetensorsAdded+3
- tokenizer.jsonAdded
- train.tomlAdded+101
- training-state.jsonAdded+3
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586---language:- enpipeline_tag: text-generationtags:- melon- rust- candle- from-scratch---
# melon-1b-ext2-sft
melon-1b-ext2 after chat SFT on SmolTalk.
Part of **Melon**, a language model trainer written from scratch in Rust on [Candle](https://github.com/huggingface/candle),with its own tokenizer, kernels and training pipeline. These weights are a research artifact, not a production model.
> **Not a `transformers` model.** The architecture is Melon's own, so loading it needs the Melon code> (`melon-llm`). `config.json` here is Melon's config, not a Hugging Face one.
## Architecture
- 1,312M parameters in total (fp32 safetensors), including the input embedding, an untied output head and 1 value-embedding table; the name is the run's internal size label- 20 layers, d_model 2048, 32 heads, context 4096, vocab 49156- RoPE, RMSNorm, relu2 MLP, QK-norm, logit soft-cap 15, value embeddings, gated attention, learned residual scalars
## Training
Pretraining mix (`configs/data-1b.toml`): 45% FineWeb-Edu, 30% DCLM-Baseline, 20% GitHub code, 5% FineMath, tokenized with a 49,152-entry BPE trained on the same mix.
Continued from the original run's step-8015 checkpoint (the last step at peak learning rate): 1,140 more steps at peak rate on a refreshed web/code/reasoning mix, then a 2,100-step (~2.2B token) decay to zero on a reasoning-heavy mix: 21% DeepSeek reasoning traces (big-reasoning-traces), 21% MegaMath, 21% OpenThoughts3, 8% OpenCodeReasoning, 14% FineWeb-Edu, 6% GitHub code, 5% DCLM, 3% PIPPA roleplay, 1% WordNet.
Supervised fine-tuning on 158k SmolTalk conversations (922 steps, loss on assistant tokens only).
Training tokens: ~11.8B + SFT. The exact run config is in `train.toml`; the step count is in `training-state.json`.
## Chat
Chat turns use special tokens added to the tokenizer (ids 49152–49155 on the 49k tokenizer); `melon-llm chat` applies the template.
## Chat benchmark
Our 200-question multi-turn chat benchmark (facts, math, riddles, code, and recalling earlier turns), every reply scored 0–10 by Claude Sonnet; same sampling settings for every model. Only the two Melon 1B chat models were run on it.
| Model | Overall | Facts | Math | Riddles | Code | Memory ||---|---|---|---|---|---|---|| Qwen2.5-1.5B-Instruct | 7.08 | 7.85 | 9.22 | 4.75 | 8.53 | 5.08 || Qwen3.5-2B | 6.76 | 5.60 | 9.03 | 5.08 | 7.60 | 6.53 || SmolLM2-1.7B-Instruct | 6.24 | 7.65 | 8.25 | 3.02 | 7.20 | 5.05 || Llama-3.2-1B-Instruct | 6.21 | 6.78 | 8.97 | 2.40 | 6.42 | 6.47 || Gemma-3-1B-it | 6.17 | 7.15 | 7.65 | 4.58 | 7.10 | 4.38 || Qwen3.5-0.8B | 5.32 | 4.20 | 8.38 | 2.52 | 6.08 | 5.42 || MiniCPM-1B-SFT | 5.16 | 6.88 | 6.83 | 2.21 | 6.66 | 3.23 || **melon-1b-ext2-sft-targeted** | **4.70** | 3.31 | 7.03 | 3.75 | 5.14 | 4.28 || Qwen1.5-1.8B-Chat | 3.96 | 4.47 | 5.75 | 1.32 | 4.65 | 3.58 || Phi-1.5-Instruct | 3.68 | 5.10 | 5.20 | 2.52 | 5.15 | 0.42 || melon-1b-ext2-sft | 3.12 | 4.42 | 3.95 | 1.35 | 3.20 | 2.65 || TinyLlama-1.1B-Chat | 2.60 | 5.28 | 0.53 | 1.40 | 3.83 | 1.98 |
Melon's main weaknesses: factual recall, multi-digit or decimal arithmetic, and sometimes denying that the user said something earlier in the conversation.
## Evaluation
Zero-shot, log-likelihood scoring of the answer choices (acc_norm for HellaSwag, ARC-Challenge and PIQA; acc for ARC-Easy, LAMBADA and WinoGrande). Melon numbers come from Melon's own evaluator; the Hubble-1B row comes from lm-evaluation-harness, so treat it as approximately comparable.
| Model | HellaSwag | ARC-Easy | ARC-Challenge | PIQA | LAMBADA | WinoGrande ||---|---|---|---|---|---|---|| **Melon 1B ext2 SFT** | .460 | .598 | .323 | .671 | .413 | – || Melon 1B | .522 | .653 | .337 | .708 | .481 | .563 || Melon 1B SFT | .527 | .616 | .340 | .693 | .452 | – || Melon 1B ext2 | .467 | .633 | .338 | .674 | .391 | .533 || Melon 1B ext2 targeted SFT | .454 | .606 | – | .665 | – | .541 || Hubble-1B (500B tokens, reference) | – | .694 | .369 | .759 | – | .625 |
## Usage
```shmelon-llm chat <path-to-this-repo> --prompt "What is photosynthesis?" # add --cuda on NVIDIA GPUsmelon-llm eval <path-to-this-repo>```
## Limitations
Small model, trained on about 12B tokens or fewer. It makes factual mistakes, is weak at arithmetic,and has no safety tuning. Do not rely on its output.1234567891011121314151617181920212223242526272829303132333435{ "vocab_size": 49156, "context_length": 4096, "d_model": 2048, "n_layers": 20, "n_heads": 32, "d_ff": 512, "rope_theta": 10000.0, "rope_scaling": 1.0, "rope_type": "linear", "attention_chunk": 512, "attention_bf16": true, "attention_log_scale": false, "attention_prefix_tokens": 0, "attention_sink_tokens": 0, "qk_norm": true, "logit_softcap": 15.0, "untied_head": true, "embed_norm": true, "zero_init_projections": true, "residual_scalars": true, "value_embeddings": true, "value_embedding_tables": 1, "gated_attention": true, "head_mixing": "none", "head_mixing_window": 4, "mlp": "relu2", "rms_norm_eps": 0.00001, "image_size": 64, "patch_size": 16, "max_visual_tokens": 64, "bitnet": false, "bitnet_activation_bits": 8, "tokenizer": "bpe"}123version https://git-lfs.github.com/spec/v1oid sha256:f7e2e9a5453bbff3dca053c4fc847596db96f3c2e8d45dfbf7079a0b2340aee5size 5247016016123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101out = "checkpoints/text-1b-ext2-sft"device = "cuda"cache_dir = "data/prepared"
[model]d_model = 192n_layers = 6n_heads = 6d_ff = 512tokenizer = "bpe"vocab_size = 4096bitnet = falseactivation_bits = 8
[training]mode = "sft"init_from = "checkpoints/text-1b-ext2"epochs = 2.0steps = 1000batch = 8seq = 2048lr = 0.001warmup_steps = 20weight_decay = 0.0val_every = 100val_batches = 16val_seed = 42checkpoint_every = 200log_every = 10grad_accum_steps = 2grad_clip = 0.0schedule = "wsd"warmdown_ratio = 1.0final_lr_frac = 0.0compute_dtype = "bf16"loss_chunk = 256pack = "random"doc_masking = truetokenizer_train_bytes = 2000000000optimizer = "muon"muon_lr = 0.003muon_momentum = 0.95muon_weight_decay = 0.0embedding_lr = 0.03head_lr = 0.003scalar_lr = 0.0045lr_width_reference = 768adam_beta1 = 0.9adam_beta2 = 0.95adam_eps = 0.00000001muon_ns_dtype = "bf16"muon_orthogonalizer = "newton-schulz"tf32 = truefused_kernels = truekeep_snapshots = 0best_weights_only = falseseed = 7ddp_bucket_mb = 256ddp_bf16_grads = falsemuon_shard_ns = false
[[datasets]]hf_repo = "HuggingFaceTB/smoltalk"hf_file = "data/smol-magpie-ultra/train-00000-of-00006.parquet"conversation_column = "messages"split = "train"seed = 42
[[datasets]]hf_repo = "HuggingFaceTB/smoltalk"hf_file = "data/{smol-constraints,smol-rewrite,everyday-conversations}/train-*.parquet"conversation_column = "messages"split = "train"seed = 42
[[datasets]]hf_repo = "OpenAssistant/oasst2"hf_file = "data/train-*.parquet"chat_format = "oasst-tree"split = "train"seed = 42
[datasets.filter]lang = "en"
[[datasets]]hf_repo = "HuggingFaceTB/smoltalk"hf_file = "data/{everyday-conversations,smol-constraints}/test-*.parquet"conversation_column = "messages"split = "val"seed = 42
[[datasets]]hf_repo = "OpenAssistant/oasst2"hf_file = "data/validation-*.parquet"chat_format = "oasst-tree"split = "val"seed = 42
[datasets.filter]lang = "en"123{ "step": 922}README.mdAdded+86
config.jsonAdded+35
model.safetensorsAdded+3
tokenizer.jsonAdded
train.tomlAdded+101
training-state.jsonAdded+3