Nirca Mini, checkpoint 1217308k (step 62,895), as latest
Browse files- README.md +57 -0
- checkpoints/1217308k/config.json +41 -0
- checkpoints/1217308k/model.safetensors +3 -0
- latest.json +18 -0
- latest/config.json +41 -0
- latest/model.safetensors +3 -0
README.md
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
language:
|
| 3 |
+
- en
|
| 4 |
+
tags:
|
| 5 |
+
- ternary
|
| 6 |
+
- mixture-of-experts
|
| 7 |
+
- byte-level
|
| 8 |
+
- chatml
|
| 9 |
+
- webgpu
|
| 10 |
+
datasets:
|
| 11 |
+
- HuggingFaceTB/smoltalk
|
| 12 |
+
- open-thoughts/OpenThoughts-114k
|
| 13 |
+
---
|
| 14 |
+
|
| 15 |
+
# Nirca Mini
|
| 16 |
+
|
| 17 |
+
Nirca Mini is a small chat model trained from scratch in a natively ternary format. Its
|
| 18 |
+
linear layers' weights are -1, 0 or +1, with a scale and a bias for each block of 128
|
| 19 |
+
weights. The norms and a few small layers stay in floating point. It was trained
|
| 20 |
+
with quantization-aware training from its first step, so it was never quantized after
|
| 21 |
+
training.
|
| 22 |
+
|
| 23 |
+
## Files
|
| 24 |
+
|
| 25 |
+
- `latest/`: the newest published checkpoint. It is replaced as new ones are published.
|
| 26 |
+
- `checkpoints/<tokens>k/`: each published checkpoint, kept. The folder is named by the
|
| 27 |
+
number of training tokens it has seen, in thousands.
|
| 28 |
+
|
| 29 |
+
Each folder holds two files:
|
| 30 |
+
- `model.safetensors`: the packed ternary weights in MLX's 2-bit affine layout, group 128.
|
| 31 |
+
- `config.json`: the model's shape, and `step`, which changes with each checkpoint.
|
| 32 |
+
|
| 33 |
+
A WebGPU page loads a folder by its URL:
|
| 34 |
+
`https://huggingface.co/nirca/nirca-mini/resolve/main/latest/`.
|
| 35 |
+
|
| 36 |
+
## Architecture
|
| 37 |
+
|
| 38 |
+
- Byte-level: 256 byte values plus special tokens, 265 in all. It needs no tokenizer file.
|
| 39 |
+
- Width 512, with 8 attention heads and rotary position embeddings.
|
| 40 |
+
- A mixture-of-experts layer with 32 experts, 8 active per token.
|
| 41 |
+
- A recurrent block that repeats with learned halting, up to 24 times, after 2 plain layers.
|
| 42 |
+
- About 109 million parameters.
|
| 43 |
+
- A context of 2,048 bytes.
|
| 44 |
+
- The ChatML chat format (`<|im_start|>` / `<|im_end|>`), with loss on assistant turns only.
|
| 45 |
+
|
| 46 |
+
## Training data
|
| 47 |
+
|
| 48 |
+
- [mini-AGI's corpus](https://github.com/volotat/mini-AGI): pretraining text.
|
| 49 |
+
- [SmolTalk](https://huggingface.co/datasets/HuggingFaceTB/smoltalk): chat conversations,
|
| 50 |
+
including a subset of those that fit within 2,048 bytes.
|
| 51 |
+
- [OpenThoughts-114k](https://huggingface.co/datasets/open-thoughts/OpenThoughts-114k),
|
| 52 |
+
reformatted as ChatML.
|
| 53 |
+
- Generated chats: synthetic conversations written to give the model its character.
|
| 54 |
+
|
| 55 |
+
## Limits
|
| 56 |
+
|
| 57 |
+
It is a small research model and is often wrong or incoherent. Don't rely on what it says.
|
checkpoints/1217308k/config.json
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"name": "nirca-mini",
|
| 3 |
+
"step": 62895,
|
| 4 |
+
"quant": "ternary",
|
| 5 |
+
"quant_scope": "all",
|
| 6 |
+
"n_experts": 32,
|
| 7 |
+
"chat_format": "chatml",
|
| 8 |
+
"cfg": {
|
| 9 |
+
"vocab_size": 265,
|
| 10 |
+
"d_model": 512,
|
| 11 |
+
"n_head": 8,
|
| 12 |
+
"d_ff": 1408,
|
| 13 |
+
"block": 2048,
|
| 14 |
+
"rope_theta": 10000.0,
|
| 15 |
+
"tie_embeddings": true,
|
| 16 |
+
"n_prelude": 2,
|
| 17 |
+
"n_recur": 1,
|
| 18 |
+
"n_coda": 0,
|
| 19 |
+
"max_steps": 24,
|
| 20 |
+
"pool_experts": 32,
|
| 21 |
+
"pool_d_ff": 2048,
|
| 22 |
+
"pool_top_k": 8,
|
| 23 |
+
"pool_resident": 32,
|
| 24 |
+
"pool_capacity_factor": 2.25,
|
| 25 |
+
"pool_aux": 0.01,
|
| 26 |
+
"pool_balance": 0.001,
|
| 27 |
+
"min_steps": 1,
|
| 28 |
+
"train_steps_mean": 8.0,
|
| 29 |
+
"train_depth": "halt:8/2/1",
|
| 30 |
+
"bptt_window": 24,
|
| 31 |
+
"ponder_beta": 0.01,
|
| 32 |
+
"halt_prior": 0.072,
|
| 33 |
+
"halt_thresh": 0.9,
|
| 34 |
+
"halt_freeze": true,
|
| 35 |
+
"adam_moments": "bf16",
|
| 36 |
+
"adam_beta2": 0.95,
|
| 37 |
+
"use_pool": true,
|
| 38 |
+
"pool_depth": 1,
|
| 39 |
+
"pool_max": 32
|
| 40 |
+
}
|
| 41 |
+
}
|
checkpoints/1217308k/model.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:c1e10118a19500e4574589b8b534a05333d0fcdbc573445ee50e3cbc36f36b88
|
| 3 |
+
size 32638048
|
latest.json
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"name": "nirca-mini",
|
| 3 |
+
"step": 62895,
|
| 4 |
+
"tokens": 1217308397,
|
| 5 |
+
"checkpoint": "checkpoints/1217308k/",
|
| 6 |
+
"files": {
|
| 7 |
+
"config.json": {
|
| 8 |
+
"url": "https://huggingface.co/nirca/nirca-mini/resolve/main/checkpoints/1217308k/config.json",
|
| 9 |
+
"sha256": "def7980ea0549de5ec9b85239e5238de44821cda935ad738e1fb61ed7af2c003",
|
| 10 |
+
"bytes": 804
|
| 11 |
+
},
|
| 12 |
+
"model.safetensors": {
|
| 13 |
+
"url": "https://huggingface.co/nirca/nirca-mini/resolve/main/checkpoints/1217308k/model.safetensors",
|
| 14 |
+
"sha256": "c1e10118a19500e4574589b8b534a05333d0fcdbc573445ee50e3cbc36f36b88",
|
| 15 |
+
"bytes": 32638048
|
| 16 |
+
}
|
| 17 |
+
}
|
| 18 |
+
}
|
latest/config.json
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"name": "nirca-mini",
|
| 3 |
+
"step": 62895,
|
| 4 |
+
"quant": "ternary",
|
| 5 |
+
"quant_scope": "all",
|
| 6 |
+
"n_experts": 32,
|
| 7 |
+
"chat_format": "chatml",
|
| 8 |
+
"cfg": {
|
| 9 |
+
"vocab_size": 265,
|
| 10 |
+
"d_model": 512,
|
| 11 |
+
"n_head": 8,
|
| 12 |
+
"d_ff": 1408,
|
| 13 |
+
"block": 2048,
|
| 14 |
+
"rope_theta": 10000.0,
|
| 15 |
+
"tie_embeddings": true,
|
| 16 |
+
"n_prelude": 2,
|
| 17 |
+
"n_recur": 1,
|
| 18 |
+
"n_coda": 0,
|
| 19 |
+
"max_steps": 24,
|
| 20 |
+
"pool_experts": 32,
|
| 21 |
+
"pool_d_ff": 2048,
|
| 22 |
+
"pool_top_k": 8,
|
| 23 |
+
"pool_resident": 32,
|
| 24 |
+
"pool_capacity_factor": 2.25,
|
| 25 |
+
"pool_aux": 0.01,
|
| 26 |
+
"pool_balance": 0.001,
|
| 27 |
+
"min_steps": 1,
|
| 28 |
+
"train_steps_mean": 8.0,
|
| 29 |
+
"train_depth": "halt:8/2/1",
|
| 30 |
+
"bptt_window": 24,
|
| 31 |
+
"ponder_beta": 0.01,
|
| 32 |
+
"halt_prior": 0.072,
|
| 33 |
+
"halt_thresh": 0.9,
|
| 34 |
+
"halt_freeze": true,
|
| 35 |
+
"adam_moments": "bf16",
|
| 36 |
+
"adam_beta2": 0.95,
|
| 37 |
+
"use_pool": true,
|
| 38 |
+
"pool_depth": 1,
|
| 39 |
+
"pool_max": 32
|
| 40 |
+
}
|
| 41 |
+
}
|
latest/model.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:c1e10118a19500e4574589b8b534a05333d0fcdbc573445ee50e3cbc36f36b88
|
| 3 |
+
size 32638048
|