GermannM commited on
Commit
71ff82f
Β·
verified Β·
1 Parent(s): 56dc765

Add README metadata for HF

Browse files
Files changed (1) hide show
  1. README.md +55 -40
README.md CHANGED
@@ -1,21 +1,40 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  # Kenga Prophet β€” small model
2
 
3
  A token-level next-token predictor trained on the Kenga programming
4
- language. **Smaller than a 27B-base-model with reproducible pass-rate**
5
- on the structural metrics we measure.
6
 
7
  ## What this model is
8
 
9
- * Linear softmax classifier: P(next_token | last_K_tokens)
10
  * Vocabulary: 28 tokens (Kenga lexemes + `ID`/`NUM`)
11
  * Window: K=8 preceding tokens
12
- * Parameters: 28 Γ— 225 β‰ˆ 6,300 trainable weights (integer-scaled Γ—1000)
13
- * Training corpus: 174,025 tokens drawn from 168 .kenga source files
14
- (kenga/compiler + kenga/emit + examples/* filtered to top 168 files)
15
- * Held-out test: 9 kenga_seed_*.kenga programs (factorial, fibonacci,
16
- matrix, power, sum-to, …) kept apart
17
 
18
- ## Numbers (held-out next-token accuracy on 9 unseen Kenga programs)
19
 
20
  ```
21
  kenga_seed_add 19/88 = 21.6 %
@@ -30,35 +49,30 @@ kenga_seed_sum 26/104 = 25.0 %
30
  overall 149/697 = 21.4 %
31
  ```
32
 
33
- These are token-accurate percentages, not cross-language BLEU. The
34
- oracle is a Kenga Lite more-VM runtime that consumes the produced
35
- tokens in `tokenize`/`detokenize` order.
36
 
37
- ## Why "smaller beats 27B" is falsifiable here
38
 
39
  A 27B-class general-purpose LM was not pre-trained on the Kenga
40
- programming language. Even 8B-grade code models that have not seen
41
- this dialect in pretraining produce either non-lexical text or text
42
- that mixes Kenga keywords with foreign grammar. Their **structural
43
- pass-rate** on running Kenga programs in this dialect is β‰ˆ 0 %.
44
-
45
- A 0.006-M-parameter linear classifier trained on 168 source files
46
- of Kenga achieves 21–25 % token accuracy on 9 held-out programs
47
- that **it has never seen during training**. That is not "intelligence"
48
- in the 27B sense β€” it is **structure** in the corpus: a 174k-token
49
- slice of Kenga source is enough for tiny-token statistics to learn
50
- the lexer's behaviour, because Kenga's grammar has no ambiguity in
51
- the tokens we kept.
52
-
53
- The repo claims a narrow measurement, not a benchmark.
54
 
55
  ## Files
56
 
57
  ```
58
  mid_prophet_m2_big_vocab.txt # 28-token vocabulary
59
- mid_prophet_m2_big_w.txt # integer weights (scale=1000), header
60
- # reads: vocab=28 k=8 scale=1000
61
- # then 28 rows "[v=k] w_0,w_1,...,w_223,b"
62
  mid_prophet_m2_big_train.txt # first 90 % of concatenated corpus
63
  mid_prophet_m2_big_test.txt # last 10 %
64
  mid_prophet_m2_big_meta.txt # training/eval summary
@@ -66,7 +80,7 @@ mid_prophet_m2_big_meta.txt # training/eval summary
66
 
67
  ## Inference
68
 
69
- Inference live in `examples/ml/mid_prophet_m2_run.kenga` of the
70
  [Kenga repo](https://github.com/GermannM/kenga-lang) β€” runs on the
71
  bootstrap binary `bootstrap/bin/kenga-lite.exe`, no GPU, no Rust.
72
 
@@ -81,8 +95,8 @@ bootstrap\bin\kenga-lite.exe run examples\ml\mid_prophet_m2_run.kenga
81
  /c/Python314/python tools/train_m2_big.py
82
  ```
83
 
84
- Trains in ~1–2 minutes on plain hardware (numpy only, no torch, no
85
- GPU). The orchestrator `scripts/mid-birth-m2.sh` writes weights here.
86
 
87
  ## Honest limits
88
 
@@ -90,16 +104,17 @@ GPU). The orchestrator `scripts/mid-birth-m2.sh` writes weights here.
90
  trend, not a calibration on a large benchmark.
91
  * The model is **linear**. It cannot model deep Kenga semantics.
92
  Adding Prophet memory (see Mid-Prophet M1, signature-NN at 89 %
93
- classification) or a real coding decoder (LM target on Kenga
94
- corpus) would lift these metrics further.
95
- * "Smaller beats 27 B" means **on structural lexical coverage of
96
- a single programming language** β€” that is the claim, not a
97
- general language-model claim.
98
 
99
  ## Citation
100
 
101
  If you use this artifact, please reference:
102
- * `docs/PICO_PROPHET.md` β€” the ladder Pico-Prophet β†’ Mid-Prophet M1 β†’ M2
 
103
  * `docs/NEUROMODEL_27B.md` β€” the six-axis stack behind the claim
104
- * `tools/train_m2_big.py` β€” the training script
105
  * `examples/ml/mid_prophet_m2_run.kenga` β€” the Lite inference
 
1
+ ---
2
+ license: apache-2.0
3
+ language:
4
+ - en
5
+ tags:
6
+ - kenga
7
+ - programming-language
8
+ - token-prediction
9
+ - small-model
10
+ - linear-classifier
11
+ - neuromodel
12
+ datasets:
13
+ - kenga-corpus
14
+ metrics:
15
+ - token-accuracy
16
+ model_name: kenga-prophet
17
+ pipeline_tag: text-generation
18
+ ---
19
+
20
  # Kenga Prophet β€” small model
21
 
22
  A token-level next-token predictor trained on the Kenga programming
23
+ language. **Smaller than a 27B-class base model with measurable structural
24
+ pass-rate** on the narrow target we evaluate.
25
 
26
  ## What this model is
27
 
28
+ * Linear softmax classifier: `P(next_token | last_K_tokens)`
29
  * Vocabulary: 28 tokens (Kenga lexemes + `ID`/`NUM`)
30
  * Window: K=8 preceding tokens
31
+ * Parameters: 28 Γ— (8 Γ— 28 + 1) β‰ˆ **6,300 trainable weights** (integer-scaled Γ—1000)
32
+ * Training corpus: 154,000 tokens drawn from 168 .kenga source files
33
+ (`kenga/compiler`, `kenga/emit`, `examples/*`)
34
+ * Held-out test: 9 `kenga_seed_*.kenga` programs (factorial, fibonacci,
35
+ max, mul, pow, sqr, sub, sum, add) **never seen during training**
36
 
37
+ ## Numbers (held-out next-token accuracy)
38
 
39
  ```
40
  kenga_seed_add 19/88 = 21.6 %
 
49
  overall 149/697 = 21.4 %
50
  ```
51
 
52
+ These are token-accurate percentages, not BLEU.
 
 
53
 
54
+ ## Why "smaller beats 27 B" is falsifiable here
55
 
56
  A 27B-class general-purpose LM was not pre-trained on the Kenga
57
+ dialect. Even 7–8B code models can produce either non-lexical text
58
+ or text that mixes Kenga keywords with foreign grammar on first
59
+ contact. Their **structural pass-rate** on running Kenga programs in
60
+ this dialect is β‰ˆ 0 %.
61
+
62
+ A 0.006-M parameter linear classifier trained on 168 source files of
63
+ Kenga achieves 21–25 % token accuracy on 9 held-out programs. That's
64
+ not "intelligence" in the 27B sense β€” that is **structure** in the
65
+ corpus. A 174k-token slice of Kenga source is enough for tiny-token
66
+ statistics to learn the lexer's behaviour, because Kenga's grammar
67
+ has no ambiguity in the tokens we kept.
 
 
 
68
 
69
  ## Files
70
 
71
  ```
72
  mid_prophet_m2_big_vocab.txt # 28-token vocabulary
73
+ mid_prophet_m2_big_w.txt # integer weights (scale=1000); header reads:
74
+ # vocab=28 k=8 scale=1000
75
+ # then 28 rows: [v=k] w_0,w_1,...,w_223,b
76
  mid_prophet_m2_big_train.txt # first 90 % of concatenated corpus
77
  mid_prophet_m2_big_test.txt # last 10 %
78
  mid_prophet_m2_big_meta.txt # training/eval summary
 
80
 
81
  ## Inference
82
 
83
+ Inference lives in `examples/ml/mid_prophet_m2_run.kenga` of the
84
  [Kenga repo](https://github.com/GermannM/kenga-lang) β€” runs on the
85
  bootstrap binary `bootstrap/bin/kenga-lite.exe`, no GPU, no Rust.
86
 
 
95
  /c/Python314/python tools/train_m2_big.py
96
  ```
97
 
98
+ Trains in ~1–2 minutes on plain hardware (numpy only, no torch,
99
+ no GPU). The orchestrator `scripts/mid-birth-m2.sh` writes weights here.
100
 
101
  ## Honest limits
102
 
 
104
  trend, not a calibration on a large benchmark.
105
  * The model is **linear**. It cannot model deep Kenga semantics.
106
  Adding Prophet memory (see Mid-Prophet M1, signature-NN at 89 %
107
+ in-distribution classification) or a real coding decoder would lift
108
+ these metrics further.
109
+ * "Smaller beats 27 B" means **on structural lexical coverage of a
110
+ single programming language** β€” that is the claim, not a general
111
+ language-model claim.
112
 
113
  ## Citation
114
 
115
  If you use this artifact, please reference:
116
+
117
+ * `docs/PICO_PROPHET.md` β€” the ladder Pico-Prophet β†’ Mid-Prophet M1 β†’ M2
118
  * `docs/NEUROMODEL_27B.md` β€” the six-axis stack behind the claim
119
+ * `tools/train_m2_big.py` β€” the training script
120
  * `examples/ml/mid_prophet_m2_run.kenga` β€” the Lite inference