Upload melon-18m weights and model card
Browse filesFiles changed (6)
- README.mdAdded+55
- config.jsonAdded+35
- model.safetensorsAdded+3
- tokenizer.jsonAdded
- train.tomlAdded+268
- training-state.jsonAdded+3
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455---language:- enpipeline_tag: text-generationtags:- melon- rust- candle- from-scratch---
# melon-18m
Tiny 18M model (8,192-entry BPE), 20,000 steps of 16k tokens (~0.33B tokens).
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.
Training tokens: ~0.33B. The exact run config is in `train.toml`; the step count is in `training-state.json`.
## 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** | .270 | .271 | .216 | .516 | .062 | – || Melon 18M SFT | .275 | .297 | .219 | .552 | .107 | – || 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:d7a8f6fe4d3990a66d316a76bd0bd2f3dee75921b35a2426192bd2286b9fee9dsize 72878672123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268out = "checkpoints/text-18m"device = "cuda"cache_dir = "data/prepared"
[model]context_length = 2048attention_chunk = 512attention_bf16 = trued_model = 384n_layers = 8n_heads = 6d_ff = 1088tokenizer = "bpe"vocab_size = 8192bitnet = falseactivation_bits = 8
[training]mode = "pretrain"steps = 20000batch = 16seq = 1024lr = 0.0003weight_decay = 0.1val_every = 200val_batches = 8val_seed = 42checkpoint_every = 500log_every = 10grad_accum_steps = 1grad_clip = 0.0schedule = "cosine"warmdown_ratio = 0.65final_lr_frac = 0.05compute_dtype = "f32"loss_chunk = 256pack = "random"doc_masking = falsetokenizer_train_bytes = 2000000000optimizer = "adamw"muon_lr = 0.02muon_momentum = 0.95muon_weight_decay = 0.0adam_beta1 = 0.9adam_beta2 = 0.999adam_eps = 0.00000001muon_ns_dtype = "f32"muon_orthogonalizer = "newton-schulz"tf32 = truefused_kernels = truekeep_snapshots = 0best_weights_only = falseddp_bucket_mb = 256ddp_bf16_grads = falsemuon_shard_ns = false
[[datasets]]hf_repo = "Salesforce/wikitext"hf_file = "wikitext-103-raw-v1/train-*.parquet"split = "train"bytes = 30000000seed = 42
[[datasets]]hf_repo = "HuggingFaceFW/fineweb-edu"hf_file = "sample/10BT/003_00000.parquet"text_column = "text"split = "val"bytes = 1500000seed = 11
[[datasets]]hf_repo = "wikimedia/wikipedia"hf_file = "20231101.en/train-00000-of-00041.parquet"text_column = "text"split = "val"bytes = 1500000seed = 11
[[datasets]]hf_repo = "allenai/c4"hf_file = "realnewslike/c4-train.0000?-of-00512.json.gz"split = "train"bytes = 25000000seed = 42
[[datasets]]hf_repo = "allenai/c4"hf_file = "en.noblocklist/c4-train.00000-of-01024.json.gz"split = "train"bytes = 20000000seed = 42
[[datasets]]hf_repo = "PleIAs/common_corpus"hf_file = "common_corpus_1/subset_100_?.parquet"text_column = "text"split = "train"bytes = 60000000seed = 42
[datasets.filter]language = "English"
[[datasets]]hf_repo = "PleIAs/common_corpus"hf_file = "common_corpus_1/subset_100_?.parquet"text_column = "text"split = "train"bytes = 25000000seed = 42
[datasets.filter]language = "French"
[[datasets]]hf_repo = "PleIAs/common_corpus"hf_file = "common_corpus_1/subset_100_?.parquet"text_column = "text"split = "train"bytes = 20000000seed = 42
[datasets.filter]language = "German"
[[datasets]]hf_repo = "PleIAs/common_corpus"hf_file = "common_corpus_1/subset_100_?.parquet"text_column = "text"split = "train"bytes = 12000000seed = 42
[datasets.filter]language = "Spanish"
[[datasets]]hf_repo = "PleIAs/common_corpus"hf_file = "common_corpus_1/subset_100_?.parquet"text_column = "text"split = "train"bytes = 8000000seed = 42
[datasets.filter]language = "Italian"
[[datasets]]hf_repo = "PleIAs/common_corpus"hf_file = "common_corpus_1/subset_100_?.parquet"text_column = "text"split = "train"bytes = 12000000seed = 42
[datasets.filter]language = "Chinese"
[[datasets]]hf_repo = "PleIAs/common_corpus"hf_file = "common_corpus_1/subset_100_?.parquet"text_column = "text"split = "train"bytes = 8000000seed = 42
[datasets.filter]language = "Japanese"
[[datasets]]hf_repo = "stanfordnlp/imdb"hf_file = "plain_text/unsupervised-*.parquet"text_column = "text"split = "train"bytes = 20000000seed = 42
[[datasets]]hf_repo = "stanfordnlp/imdb"hf_file = "plain_text/t*-*.parquet"template = """Review: {text}Sentiment: {label}"""labels = [ "negative", "positive",]split = "train"bytes = 20000000seed = 42
[[datasets]]hf_repo = "openai/gsm8k"hf_file = "main/train-*.parquet"template = """Question: {question}Answer: {answer}"""split = "train"bytes = 5000000seed = 42
[[datasets]]hf_repo = "google/boolq"hf_file = "data/train-*.parquet"template = """{passage}Question: {question}?Answer: {answer}"""split = "train"bytes = 6000000seed = 42
[[datasets]]hf_repo = "google-research-datasets/paws"hf_file = "labeled_final/train-*.parquet"template = """Sentence 1: {sentence1}Sentence 2: {sentence2}Paraphrase: {label}"""labels = [ "no", "yes",]split = "train"bytes = 12000000seed = 42
[[datasets]]hf_repo = "nvidia/OpenMathInstruct-2"hf_file = "data/train-00000-of-00032.parquet"template = """Problem: {problem}Solution: {generated_solution}Answer: {expected_answer}"""split = "train"bytes = 20000000seed = 42
[[datasets]]hf_repo = "openbmb/UltraData-SFT-Agent-2609"hf_file = "data/Tool_Use/Tool_Use_part-4-of-9.jsonl"kind = "jsonl"conversation_column = "messages"split = "train"bytes = 15000000seed = 42
[[datasets]]hf_repo = "allenai/c4"hf_file = "multilingual/c4-it.tfrecord-00000-of-01024.json.gz"split = "train"bytes = 10000000seed = 42
[[datasets]]hf_repo = "allenai/c4"hf_file = "multilingual/c4-ru.tfrecord-00000-of-04096.json.gz"split = "train"bytes = 10000000seed = 42
[[datasets]]hf_repo = "allenai/c4"hf_file = "multilingual/c4-zh.tfrecord-00000-of-01024.json.gz"split = "train"bytes = 10000000seed = 42123{ "step": 20000}README.mdAdded+55
config.jsonAdded+35
model.safetensorsAdded+3
tokenizer.jsonAdded
train.tomlAdded+268
training-state.jsonAdded+3