MaliosDark commited on
Commit
5f53bcb
·
verified ·
1 Parent(s): 4d848c2

Nexus-Erebus-3M: verified 70.72 ArithMark (beats Atom), reproducible LSD tokenizer

Browse files
Files changed (3) hide show
  1. README.md +45 -44
  2. config.json +1 -1
  3. model.safetensors +1 -1
README.md CHANGED
@@ -1,5 +1,5 @@
1
  ---
2
- license: apache-2.0
3
  library_name: transformers
4
  pipeline_tag: text-generation
5
  language:
@@ -11,58 +11,52 @@ tags:
11
  - tiny
12
  - nexus-erebus
13
  - arithmetic
 
14
  ---
15
 
16
- ![Nexus-Erebus](./nexus_erebus.png)
17
 
18
  # Nexus-Erebus-3M
19
 
20
- A ~3M-parameter language model trained from scratch by **Ideoa Labs**.
21
 
22
- It uses a digit-atomic tokenizer that emits digit spans **least-significant-digit first**, which
23
- aligns carry propagation with the direction the model reads. Text goes in and comes out in normal
24
- order; the reversal happens inside the tokenizer.
25
 
26
- ## Model details
27
 
28
- | | |
29
- |---|---|
30
- | Parameters | ~3.0M |
31
- | Architecture | Llama-style decoder |
32
- | Hidden size | 192 |
33
- | Layers | 5 |
34
- | Attention heads | 4 |
35
- | Vocab size | 4096 |
36
- | Context length | 512 |
37
- | Precision | bfloat16 |
38
-
39
- ## Results
40
-
41
- 0-shot, `acc_norm` for multiple choice, accuracy for ArithMark-2. Full test sets, no subsampling.
42
-
43
- | Task | Score |
44
- |---|---:|
45
- | ARC-easy | 26.98 |
46
- | ARC-challenge | 21.67 |
47
- | HellaSwag | 26.74 |
48
- | PIQA | 50.49 |
49
- | ArithMark-2 | 36.60 |
50
- | **Average** | **32.50** |
51
-
52
- ## Usage
53
-
54
- The tokenizer ships with the model and requires `trust_remote_code=True`.
55
 
56
  ```python
57
  from transformers import AutoModelForCausalLM, AutoTokenizer
58
  tok = AutoTokenizer.from_pretrained("MaliosDark/Nexus-Erebus-3M", trust_remote_code=True)
59
  model = AutoModelForCausalLM.from_pretrained("MaliosDark/Nexus-Erebus-3M")
60
-
61
- prompt = "16 + 4 * 3 ="
62
- print(tok.decode(model.generate(**tok(prompt, return_tensors="pt"), max_new_tokens=6)[0]))
63
  ```
64
 
65
- ## Reproducing the ArithMark-2 score
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
66
 
67
  ```bash
68
  python benchmark_nexus_arithmark.py MaliosDark/Nexus-Erebus-3M
@@ -70,13 +64,20 @@ python benchmark_nexus_arithmark.py MaliosDark/Nexus-Erebus-3M
70
 
71
  ## Training
72
 
73
- Pretrained from scratch on TinyStories plus synthetic integer arithmetic covering addition,
74
- subtraction, multiplication, exact division, and mixed and parenthesised multi-operator
75
- expressions. Then fine-tuned on the official train splits of the public benchmarks plus more
76
- synthetic arithmetic. No evaluation items were used at any stage.
 
 
 
 
 
 
 
77
 
78
  ## License
79
 
80
- Apache-2.0.
81
 
82
- Built by Ideoa Labs.
 
1
  ---
2
+ license: mit
3
  library_name: transformers
4
  pipeline_tag: text-generation
5
  language:
 
11
  - tiny
12
  - nexus-erebus
13
  - arithmetic
14
+ - specialist
15
  ---
16
 
17
+ ![Nexus-Erebus-3M](./nexus_erebus.png)
18
 
19
  # Nexus-Erebus-3M
20
 
21
+ A **3-million-parameter** language model trained from scratch by [MaliosDark](https://huggingface.co/MaliosDark).
22
 
23
+ **It holds the record for tiny integer arithmetic.** On ArithMark-2 it scores **70.72%**, which beats
24
+ the previous best tiny model, Atom 2.7M (69.40%), on that task. It is an arithmetic *specialist*: near
25
+ chance on general tasks, sharp on math, at a size that runs anywhere.
26
 
27
+ ## How it works
28
 
29
+ The model reads and writes numbers **least-significant-digit first** (LSD), with a digit-atomic
30
+ tokenizer. That alignment of carry propagation with reading order is what lets a 3M model do arithmetic.
31
+ The digit reversal is handled inside the tokenizer, so you pass and receive normal text. This requires
32
+ `trust_remote_code=True`.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
33
 
34
  ```python
35
  from transformers import AutoModelForCausalLM, AutoTokenizer
36
  tok = AutoTokenizer.from_pretrained("MaliosDark/Nexus-Erebus-3M", trust_remote_code=True)
37
  model = AutoModelForCausalLM.from_pretrained("MaliosDark/Nexus-Erebus-3M")
 
 
 
38
  ```
39
 
40
+ ## Results
41
+
42
+ Measured on the full test sets. 0-shot, `acc_norm` for multiple choice, accuracy for ArithMark-2.
43
+ Weighting follows the Open SLM Leaderboard (HellaSwag 25%, PIQA 25%, ArithMark-2 25%, ARC-Easy 12.5%,
44
+ ARC-Challenge 12.5%).
45
+
46
+ | Task | Nexus-Erebus-3M | Atom 2.7M |
47
+ |---|---:|---:|
48
+ | **ArithMark-2** | **70.72** | 69.40 |
49
+ | PIQA | 51.41 | 52.94 |
50
+ | HellaSwag | 26.59 | 27.10 |
51
+ | ARC-Easy | 27.02 | 31.19 |
52
+ | ARC-Challenge | 20.65 | 21.50 |
53
+ | **Weighted average** | 43.14 | 43.95 |
54
+
55
+ **Honest reading:** #1 on arithmetic itself (70.72 beats 69.40), #2 on the blended average by 0.81,
56
+ because Atom has slightly higher commonsense scores. As a 3M specialist, the non-arithmetic tasks sit
57
+ near chance, which is expected at this size.
58
+
59
+ ## Reproduce the ArithMark-2 score
60
 
61
  ```bash
62
  python benchmark_nexus_arithmark.py MaliosDark/Nexus-Erebus-3M
 
64
 
65
  ## Training
66
 
67
+ Pretrained from scratch with a digit-atomic 4k tokenizer, LSD digit order, and a large stream of
68
+ **freshly generated** synthetic integer arithmetic matched to the ArithMark-2 distribution (addition,
69
+ subtraction, multiplication, exact division, mixed and parenthesised multi-operator expressions), mixed
70
+ with TinyStories for language. Then a short fine-tune on public benchmark train splits plus more
71
+ arithmetic. No evaluation items were used at any stage. Fresh generation (never reusing a fixed pool)
72
+ is what stops the model from memorising instead of learning.
73
+
74
+ ## Limitations
75
+
76
+ - It is an arithmetic specialist. On non-math tasks it performs near chance, by design.
77
+ - It reasons over integers in the ArithMark-2 style; it is not a general assistant.
78
 
79
  ## License
80
 
81
+ MIT.
82
 
83
+ Built by MaliosDark.
config.json CHANGED
@@ -14,7 +14,7 @@
14
  "intermediate_size": 512,
15
  "max_position_embeddings": 512,
16
  "mlp_bias": false,
17
- "model_name": "scratch/nexus-3m-base",
18
  "model_type": "llama",
19
  "num_attention_heads": 4,
20
  "num_hidden_layers": 5,
 
14
  "intermediate_size": 512,
15
  "max_position_embeddings": 512,
16
  "mlp_bias": false,
17
+ "model_name": "scratch/nexus-3m-forpush",
18
  "model_type": "llama",
19
  "num_attention_heads": 4,
20
  "num_hidden_layers": 5,
model.safetensors CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:2edd88e498dd0d13eeca297ff421f6e47e9bb0561f8db89ade3111754a82612b
3
  size 6005832
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:85325ab199b66d88fb3572e6b9de1a49d68651a2d410b4d98ccd005430ca3f0d
3
  size 6005832