Upload melon-135m weights and model card
Browse filesFiles changed (6)
- README.mdAdded+54
- config.jsonAdded+35
- model.safetensorsAdded+3
- tokenizer.jsonAdded
- train.tomlAdded+76
- training-state.jsonAdded+3
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354---language:- enpipeline_tag: text-generationtags:- melon- rust- candle- from-scratch---
# melon-135m
Small model trained with the full 1B recipe, with depth head mixing, as a pipeline test before the 1B run.
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
- 275M parameters in total (fp32 safetensors), including the input embedding, an untied output head and 3 value-embedding tables; the name is the run's internal size label- 12 layers, d_model 768, 12 heads, context 2048, vocab 49152- RoPE, RMSNorm, relu2 MLP, QK-norm, logit soft-cap 15, value embeddings, depth head mixing, 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. 5,150 steps of 524k tokens (~2.7B tokens).
Training tokens: ~2.7B. 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 Hubble-1B row comes from lm-evaluation-harness, so treat it as approximately comparable.
| Model | HellaSwag | ARC-Easy | ARC-Challenge | PIQA | LAMBADA | WinoGrande ||---|---|---|---|---|---|---|| **Melon 135M** | .341 | .548 | .271 | .650 | .337 | – || Melon 135M SFT | .344 | .478 | .251 | .622 | .300 | – || 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": 49152, "context_length": 2048, "d_model": 768, "n_layers": 12, "n_heads": 12, "d_ff": 2304, "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": 3, "gated_attention": false, "head_mixing": "depth", "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:6339b595925f1b6b17488cc417fbb702af44c4e218c16922022dfd5dfbb8d178size 109812496012345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576out = "checkpoints/text-135m-v3-depth"device = "cuda"cache_dir = "data/prepared"
[model]context_length = 2048attention_chunk = 512attention_bf16 = trueqk_norm = truelogit_softcap = 15.0untied_head = trueembed_norm = truezero_init_projections = trueresidual_scalars = truevalue_embeddings = truevalue_embedding_tables = 3mlp = "relu2"head_mixing = "depth"d_model = 768n_layers = 12n_heads = 12d_ff = 2304tokenizer = "bpe"vocab_size = 49152bitnet = falseactivation_bits = 8
[training]mode = "pretrain"steps = 5150batch = 32seq = 2048lr = 0.001warmup_steps = 20weight_decay = 0.1val_every = 250val_batches = 16val_seed = 42checkpoint_every = 500log_every = 10grad_accum_steps = 8grad_clip = 0.0schedule = "wsd"warmdown_ratio = 1.0final_lr_frac = 0.0compute_dtype = "bf16"loss_chunk = 256pack = "bos"doc_masking = truetokenizer_train_bytes = 2000000000optimizer = "muon"muon_lr = 0.02muon_momentum = 0.95muon_weight_decay = 0.1embedding_lr = 0.2head_lr = 0.02scalar_lr = 0.03lr_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 = trueseed = 7ddp_bucket_mb = 256ddp_bf16_grads = falsemuon_shard_ns = false
[[datasets]]shards = "data/shards/full-2.7b/manifest.json"split = "train"seed = 42123{ "step": 5150}README.mdAdded+54
config.jsonAdded+35
model.safetensorsAdded+3
tokenizer.jsonAdded
train.tomlAdded+76
training-state.jsonAdded+3