OzTianlu commited on
Commit
d13d109
·
verified ·
1 Parent(s): a4a375a

Upload 12 files

Browse files
.gitattributes CHANGED
@@ -33,3 +33,4 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
 
 
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
36
+ ADS.png filter=lfs diff=lfs merge=lfs -text
ADS.png ADDED

Git LFS Details

  • SHA256: 592e7505712f54639d39fecf5a13ee0b354ade0bb0bece53df67e1ca05175f84
  • Pointer size: 131 Bytes
  • Size of remote file: 680 kB
README.md CHANGED
@@ -1,3 +1,150 @@
1
- ---
2
- license: apache-2.0
3
- ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ library_name: transformers
3
+ license: apache-2.0
4
+ tags:
5
+ - math
6
+ - reasoning
7
+ - text-generation
8
+ language:
9
+ - en
10
+ pipeline_tag: text-generation
11
+ model-index:
12
+ - name: OpenKai-0.35B-Instruct
13
+ results:
14
+ - task:
15
+ type: multiple-choice
16
+ name: ARC-Challenge
17
+ dataset:
18
+ name: ARC-Challenge
19
+ type: allenai/ai2_arc
20
+ config: ARC-Challenge
21
+ split: test
22
+ metrics:
23
+ - type: acc_norm
24
+ value: 37.80
25
+ name: Accuracy (normalized)
26
+ - task:
27
+ type: multiple-choice
28
+ name: HellaSwag
29
+ dataset:
30
+ name: HellaSwag
31
+ type: Rowan/hellaswag
32
+ split: validation
33
+ metrics:
34
+ - type: acc_norm
35
+ value: 55.88
36
+ name: Accuracy (normalized)
37
+ - task:
38
+ type: multiple-choice
39
+ name: PIQA
40
+ dataset:
41
+ name: PIQA
42
+ type: piqa
43
+ split: validation
44
+ metrics:
45
+ - type: acc_norm
46
+ value: 71.82
47
+ name: Accuracy (normalized)
48
+ - task:
49
+ type: text-generation
50
+ name: MBPP
51
+ dataset:
52
+ name: MBPP
53
+ type: google-research-datasets/mbpp
54
+ split: test
55
+ metrics:
56
+ - type: pass_at_1
57
+ value: 22.20
58
+ name: pass@1
59
+ ---
60
+
61
+ # OpenKai-0.35B-Instruct
62
+
63
+ A compact 0.35B-parameter instruction-tuned language model optimized for reasoning, math, and code generation tasks.
64
+
65
+ ## Model Details
66
+
67
+ | | |
68
+ |---|---|
69
+ | **Model** | OpenKai-0.35B-Instruct |
70
+ | **Architecture** | LlamaForCausalLM |
71
+ | **Parameters** | 360M |
72
+ | **Hidden size** | 960 |
73
+ | **Layers** | 32 |
74
+ | **Attention heads** | 15 (5 KV heads, GQA) |
75
+ | **Context length** | 8192 |
76
+ | **Precision** | bfloat16 |
77
+ | **Vocab size** | 49,152 |
78
+
79
+ ## Benchmark Results (5-shot, log-likelihood)
80
+
81
+ | Benchmark | OpenKai-0.35B-Instruct | Mamba (370M) | TinyLlama (1.1B) | Llama-3.2 (1B) |
82
+ |---|:---:|:---:|:---:|:---:|
83
+ | **ARC-Challenge** (science reasoning) | **37.80%** | ~29.1% | ~30.1% | ~44.5% |
84
+ | **HellaSwag** (sentence completion) | 55.88% | ~53.8% | ~59.2% | ~61.1% |
85
+ | **PIQA** (physical commonsense) | **71.82%** | ~69.6% | ~73.0% | ~74.5% |
86
+
87
+ ### Code Generation — MBPP (3-shot, pass@1)
88
+
89
+ | Model | Params | MBPP pass@1 |
90
+ |---|:---:|:---:|
91
+ | Mamba / Mamba-2 | 370M | <10.0% |
92
+ | TinyLlama | 1.1B | ~19.91% |
93
+ | **OpenKai-0.35B-Instruct** | **360M** | **22.20%** |
94
+ | Llama-3.2-1B (Base) | 1.0B | ~25-30% |
95
+ | Llama-3.2-1B-Instruct | 1.0B | ~49.0% |
96
+
97
+ ### Key Observations
98
+
99
+ 1. **ARC-Challenge**: OpenKai-0.35B scores **37.80%** (5-shot), significantly outperforming both Mamba-370M (+8.7pp) and TinyLlama-1.1B (+7.7pp) — a model 3x its size.
100
+
101
+ 2. **PIQA**: At **71.82%**, OpenKai-0.35B nearly matches TinyLlama-1.1B (73.0%) with only 1/3 the parameters, and trails the 1B-class Llama-3.2 by less than 3pp.
102
+
103
+ 3. **MBPP**: At **22.20%** pass@1, OpenKai-0.35B surpasses TinyLlama-1.1B (~19.91%) in code generation despite being 3x smaller.
104
+
105
+ ## Usage
106
+
107
+ ```python
108
+ from transformers import AutoModelForCausalLM, AutoTokenizer
109
+ import torch
110
+
111
+ model = AutoModelForCausalLM.from_pretrained(
112
+ "NoesisLab/OpenKai-0.35B-Instruct",
113
+ torch_dtype=torch.bfloat16,
114
+ )
115
+ tokenizer = AutoTokenizer.from_pretrained("NoesisLab/OpenKai-0.35B-Instruct")
116
+
117
+ messages = [{"role": "user", "content": "What is 25 * 4?"}]
118
+ input_ids = tokenizer.apply_chat_template(messages, return_tensors="pt")
119
+ output = model.generate(input_ids, max_new_tokens=256)
120
+ print(tokenizer.decode(output[0], skip_special_tokens=True))
121
+ ```
122
+
123
+ ## Evaluation
124
+
125
+ Benchmarks were run using [lm-evaluation-harness](https://github.com/EleutherAI/lm-evaluation-harness):
126
+
127
+ ```bash
128
+ lm_eval --model hf \
129
+ --model_args pretrained=NoesisLab/OpenKai-0.35B-Instruct,dtype=bfloat16 \
130
+ --tasks arc_challenge,hellaswag,piqa \
131
+ --num_fewshot 5 \
132
+ --batch_size auto \
133
+ --output_path ./lmeval_results \
134
+ --log_samples
135
+ ```
136
+
137
+ ## Citation
138
+
139
+ ```bibtex
140
+ @misc{noesislab2026openkai,
141
+ title={OpenKai-0.35B-Instruct},
142
+ author={NoesisLab},
143
+ year={2026},
144
+ url={https://huggingface.co/NoesisLab/OpenKai-0.35B-Instruct}
145
+ }
146
+ ```
147
+
148
+ ## License
149
+
150
+ Apache 2.0
chat_template.jinja ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
 
1
+ {% for message in messages %}{% if loop.first and messages[0]['role'] != 'system' %}{{ '<|im_start|>system
2
+ You are a helpful AI assistant named SmolLM, trained by Hugging Face<|im_end|>
3
+ ' }}{% endif %}{{'<|im_start|>' + message['role'] + '
4
+ ' + message['content'] + '<|im_end|>' + '
5
+ '}}{% endfor %}{% if add_generation_prompt %}{{ '<|im_start|>assistant
6
+ ' }}{% endif %}
config.json ADDED
@@ -0,0 +1,38 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "architectures": [
3
+ "LlamaForCausalLM"
4
+ ],
5
+ "attention_bias": false,
6
+ "attention_dropout": 0.0,
7
+ "bos_token_id": 1,
8
+ "dtype": "bfloat16",
9
+ "eos_token_id": 2,
10
+ "head_dim": 64,
11
+ "hidden_act": "silu",
12
+ "hidden_size": 960,
13
+ "initializer_range": 0.02,
14
+ "intermediate_size": 2560,
15
+ "is_llama_config": true,
16
+ "max_position_embeddings": 8192,
17
+ "mlp_bias": false,
18
+ "model_type": "llama",
19
+ "num_attention_heads": 15,
20
+ "num_hidden_layers": 32,
21
+ "num_key_value_heads": 5,
22
+ "pad_token_id": 2,
23
+ "pretraining_tp": 1,
24
+ "rms_norm_eps": 1e-05,
25
+ "rope_interleaved": false,
26
+ "rope_scaling": null,
27
+ "rope_theta": 100000,
28
+ "tie_word_embeddings": true,
29
+ "transformers.js_config": {
30
+ "kv_cache_dtype": {
31
+ "fp16": "float16",
32
+ "q4f16": "float16"
33
+ }
34
+ },
35
+ "transformers_version": "4.57.6",
36
+ "use_cache": true,
37
+ "vocab_size": 49152
38
+ }
generation_config.json ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "_from_model_config": true,
3
+ "bos_token_id": 1,
4
+ "eos_token_id": [
5
+ 2
6
+ ],
7
+ "pad_token_id": 2,
8
+ "transformers_version": "4.57.6"
9
+ }
merges.txt ADDED
The diff for this file is too large to render. See raw diff
 
model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:37c5a5d9a81067cc40ec0ccfeec12b4878c4152c8f5c5b2490db882c68f3a7dc
3
+ size 723674912
special_tokens_map.json ADDED
@@ -0,0 +1,34 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "additional_special_tokens": [
3
+ "<|im_start|>",
4
+ "<|im_end|>"
5
+ ],
6
+ "bos_token": {
7
+ "content": "<|im_start|>",
8
+ "lstrip": false,
9
+ "normalized": false,
10
+ "rstrip": false,
11
+ "single_word": false
12
+ },
13
+ "eos_token": {
14
+ "content": "<|im_end|>",
15
+ "lstrip": false,
16
+ "normalized": false,
17
+ "rstrip": false,
18
+ "single_word": false
19
+ },
20
+ "pad_token": {
21
+ "content": "<|im_end|>",
22
+ "lstrip": false,
23
+ "normalized": false,
24
+ "rstrip": false,
25
+ "single_word": false
26
+ },
27
+ "unk_token": {
28
+ "content": "<|endoftext|>",
29
+ "lstrip": false,
30
+ "normalized": false,
31
+ "rstrip": false,
32
+ "single_word": false
33
+ }
34
+ }
tokenizer.json ADDED
The diff for this file is too large to render. See raw diff
 
tokenizer_config.json ADDED
@@ -0,0 +1,154 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "add_prefix_space": false,
3
+ "added_tokens_decoder": {
4
+ "0": {
5
+ "content": "<|endoftext|>",
6
+ "lstrip": false,
7
+ "normalized": false,
8
+ "rstrip": false,
9
+ "single_word": false,
10
+ "special": true
11
+ },
12
+ "1": {
13
+ "content": "<|im_start|>",
14
+ "lstrip": false,
15
+ "normalized": false,
16
+ "rstrip": false,
17
+ "single_word": false,
18
+ "special": true
19
+ },
20
+ "2": {
21
+ "content": "<|im_end|>",
22
+ "lstrip": false,
23
+ "normalized": false,
24
+ "rstrip": false,
25
+ "single_word": false,
26
+ "special": true
27
+ },
28
+ "3": {
29
+ "content": "<repo_name>",
30
+ "lstrip": false,
31
+ "normalized": false,
32
+ "rstrip": false,
33
+ "single_word": false,
34
+ "special": true
35
+ },
36
+ "4": {
37
+ "content": "<reponame>",
38
+ "lstrip": false,
39
+ "normalized": false,
40
+ "rstrip": false,
41
+ "single_word": false,
42
+ "special": true
43
+ },
44
+ "5": {
45
+ "content": "<file_sep>",
46
+ "lstrip": false,
47
+ "normalized": false,
48
+ "rstrip": false,
49
+ "single_word": false,
50
+ "special": true
51
+ },
52
+ "6": {
53
+ "content": "<filename>",
54
+ "lstrip": false,
55
+ "normalized": false,
56
+ "rstrip": false,
57
+ "single_word": false,
58
+ "special": true
59
+ },
60
+ "7": {
61
+ "content": "<gh_stars>",
62
+ "lstrip": false,
63
+ "normalized": false,
64
+ "rstrip": false,
65
+ "single_word": false,
66
+ "special": true
67
+ },
68
+ "8": {
69
+ "content": "<issue_start>",
70
+ "lstrip": false,
71
+ "normalized": false,
72
+ "rstrip": false,
73
+ "single_word": false,
74
+ "special": true
75
+ },
76
+ "9": {
77
+ "content": "<issue_comment>",
78
+ "lstrip": false,
79
+ "normalized": false,
80
+ "rstrip": false,
81
+ "single_word": false,
82
+ "special": true
83
+ },
84
+ "10": {
85
+ "content": "<issue_closed>",
86
+ "lstrip": false,
87
+ "normalized": false,
88
+ "rstrip": false,
89
+ "single_word": false,
90
+ "special": true
91
+ },
92
+ "11": {
93
+ "content": "<jupyter_start>",
94
+ "lstrip": false,
95
+ "normalized": false,
96
+ "rstrip": false,
97
+ "single_word": false,
98
+ "special": true
99
+ },
100
+ "12": {
101
+ "content": "<jupyter_text>",
102
+ "lstrip": false,
103
+ "normalized": false,
104
+ "rstrip": false,
105
+ "single_word": false,
106
+ "special": true
107
+ },
108
+ "13": {
109
+ "content": "<jupyter_code>",
110
+ "lstrip": false,
111
+ "normalized": false,
112
+ "rstrip": false,
113
+ "single_word": false,
114
+ "special": true
115
+ },
116
+ "14": {
117
+ "content": "<jupyter_output>",
118
+ "lstrip": false,
119
+ "normalized": false,
120
+ "rstrip": false,
121
+ "single_word": false,
122
+ "special": true
123
+ },
124
+ "15": {
125
+ "content": "<jupyter_script>",
126
+ "lstrip": false,
127
+ "normalized": false,
128
+ "rstrip": false,
129
+ "single_word": false,
130
+ "special": true
131
+ },
132
+ "16": {
133
+ "content": "<empty_output>",
134
+ "lstrip": false,
135
+ "normalized": false,
136
+ "rstrip": false,
137
+ "single_word": false,
138
+ "special": true
139
+ }
140
+ },
141
+ "additional_special_tokens": [
142
+ "<|im_start|>",
143
+ "<|im_end|>"
144
+ ],
145
+ "bos_token": "<|im_start|>",
146
+ "clean_up_tokenization_spaces": false,
147
+ "eos_token": "<|im_end|>",
148
+ "extra_special_tokens": {},
149
+ "model_max_length": 8192,
150
+ "pad_token": "<|im_end|>",
151
+ "tokenizer_class": "GPT2Tokenizer",
152
+ "unk_token": "<|endoftext|>",
153
+ "vocab_size": 49152
154
+ }
training_args.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:e5a347fe5928208bf359ae00394cf60372744e2b098bb0203a90c04c8818235a
3
+ size 6289
vocab.json ADDED
The diff for this file is too large to render. See raw diff