Upload melon-18m-sft weights and model card
Browse filesFiles changed (6)
- README.mdAdded+61
- config.jsonAdded+35
- model.safetensorsAdded+3
- tokenizer.jsonAdded
- train.tomlAdded+101
- training-state.jsonAdded+3
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061---language:- enpipeline_tag: text-generationtags:- melon- rust- candle- from-scratch---
# melon-18m-sft
melon-18m after chat SFT.
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
- 18M parameters in total (fp32 safetensors), including the input embedding, an untied output head; the name is the run's internal size label- 8 layers, d_model 384, 6 heads, context 2048, vocab 8192- RoPE, RMSNorm, swiglu MLP
## Training
Pretrained on a web/Wikipedia text mix.
Supervised fine-tuning on 158k SmolTalk conversations (about 1,000 steps, loss on assistant tokens only).
Training tokens: ~0.33B + 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.
## 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 reference rows come from lm-evaluation-harness, so treat them as approximately comparable.
| Model | HellaSwag | ARC-Easy | ARC-Challenge | PIQA | LAMBADA | WinoGrande ||---|---|---|---|---|---|---|| **Melon 18M SFT** | .275 | .297 | .219 | .552 | .107 | – || Melon 18M | .270 | .271 | .216 | .516 | .062 | – || Hubble-1B (500B tokens, reference) | – | .694 | .369 | .759 | – | .625 || GPT-2 124M (reference) | .311 | .438 | .227 | .625 | .326 | – |
## 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": 8192, "context_length": 2048, "d_model": 384, "n_layers": 8, "n_heads": 6, "d_ff": 1088, "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": false, "logit_softcap": 0.0, "untied_head": false, "embed_norm": false, "zero_init_projections": false, "residual_scalars": false, "value_embeddings": false, "value_embedding_tables": 0, "gated_attention": false, "head_mixing": "none", "head_mixing_window": 4, "mlp": "swiglu", "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:96988a41907c504af1892298837187cabe8ab3030301ba6455f69b02c564a5b2size 72878672123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101out = "checkpoints/text-18m-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-18m"epochs = 2.0steps = 1000batch = 32seq = 2048lr = 0.001warmup_steps = 20weight_decay = 0.0val_every = 100val_batches = 16val_seed = 42checkpoint_every = 200log_every = 10grad_accum_steps = 4grad_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": 1052}README.mdAdded+61
config.jsonAdded+35
model.safetensorsAdded+3
tokenizer.jsonAdded
train.tomlAdded+101
training-state.jsonAdded+3