mav23 commited on
Commit
63c0ca8
·
verified ·
1 Parent(s): 986aa47

Upload folder using huggingface_hub

Browse files
Files changed (3) hide show
  1. .gitattributes +1 -0
  2. README.md +216 -0
  3. llama-3.2-3b-overthinker.Q4_0.gguf +3 -0
.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
+ llama-3.2-3b-overthinker.Q4_0.gguf filter=lfs diff=lfs merge=lfs -text
README.md ADDED
@@ -0,0 +1,216 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ language:
3
+ - en
4
+ license: apache-2.0
5
+ tags:
6
+ - text-generation-inference
7
+ - transformers
8
+ - unsloth
9
+ - llama
10
+ - trl
11
+ - sft
12
+ base_model: unsloth/llama-3.2-3b-instruct-bnb-4bit
13
+ datasets:
14
+ - Lyte/Reasoning-Paused
15
+ pipeline_tag: text-generation
16
+ model-index:
17
+ - name: Llama-3.2-3B-Overthinker
18
+ results:
19
+ - task:
20
+ type: text-generation
21
+ name: Text Generation
22
+ dataset:
23
+ name: IFEval (0-Shot)
24
+ type: HuggingFaceH4/ifeval
25
+ args:
26
+ num_few_shot: 0
27
+ metrics:
28
+ - type: inst_level_strict_acc and prompt_level_strict_acc
29
+ value: 64.08
30
+ name: strict accuracy
31
+ source:
32
+ url: https://huggingface.co/spaces/open-llm-leaderboard/open_llm_leaderboard?query=Lyte/Llama-3.2-3B-Overthinker
33
+ name: Open LLM Leaderboard
34
+ - task:
35
+ type: text-generation
36
+ name: Text Generation
37
+ dataset:
38
+ name: BBH (3-Shot)
39
+ type: BBH
40
+ args:
41
+ num_few_shot: 3
42
+ metrics:
43
+ - type: acc_norm
44
+ value: 20.1
45
+ name: normalized accuracy
46
+ source:
47
+ url: https://huggingface.co/spaces/open-llm-leaderboard/open_llm_leaderboard?query=Lyte/Llama-3.2-3B-Overthinker
48
+ name: Open LLM Leaderboard
49
+ - task:
50
+ type: text-generation
51
+ name: Text Generation
52
+ dataset:
53
+ name: MATH Lvl 5 (4-Shot)
54
+ type: hendrycks/competition_math
55
+ args:
56
+ num_few_shot: 4
57
+ metrics:
58
+ - type: exact_match
59
+ value: 2.64
60
+ name: exact match
61
+ source:
62
+ url: https://huggingface.co/spaces/open-llm-leaderboard/open_llm_leaderboard?query=Lyte/Llama-3.2-3B-Overthinker
63
+ name: Open LLM Leaderboard
64
+ - task:
65
+ type: text-generation
66
+ name: Text Generation
67
+ dataset:
68
+ name: GPQA (0-shot)
69
+ type: Idavidrein/gpqa
70
+ args:
71
+ num_few_shot: 0
72
+ metrics:
73
+ - type: acc_norm
74
+ value: 1.23
75
+ name: acc_norm
76
+ source:
77
+ url: https://huggingface.co/spaces/open-llm-leaderboard/open_llm_leaderboard?query=Lyte/Llama-3.2-3B-Overthinker
78
+ name: Open LLM Leaderboard
79
+ - task:
80
+ type: text-generation
81
+ name: Text Generation
82
+ dataset:
83
+ name: MuSR (0-shot)
84
+ type: TAUR-Lab/MuSR
85
+ args:
86
+ num_few_shot: 0
87
+ metrics:
88
+ - type: acc_norm
89
+ value: 3.9
90
+ name: acc_norm
91
+ source:
92
+ url: https://huggingface.co/spaces/open-llm-leaderboard/open_llm_leaderboard?query=Lyte/Llama-3.2-3B-Overthinker
93
+ name: Open LLM Leaderboard
94
+ - task:
95
+ type: text-generation
96
+ name: Text Generation
97
+ dataset:
98
+ name: MMLU-PRO (5-shot)
99
+ type: TIGER-Lab/MMLU-Pro
100
+ config: main
101
+ split: test
102
+ args:
103
+ num_few_shot: 5
104
+ metrics:
105
+ - type: acc
106
+ value: 22.06
107
+ name: accuracy
108
+ source:
109
+ url: https://huggingface.co/spaces/open-llm-leaderboard/open_llm_leaderboard?query=Lyte/Llama-3.2-3B-Overthinker
110
+ name: Open LLM Leaderboard
111
+ ---
112
+
113
+
114
+ # Model Overview:
115
+
116
+ - **Training Data**: This model was trained on a dataset with columns for initial reasoning, step-by-step thinking, verifications after each step, and final answers based on full context. Is it better than the original base model? Hard to say without proper evaluations, and I don’t have the resources to run them manually.
117
+
118
+ - **Context Handling**: The model benefits from larger contexts (minimum 4k up to 16k tokens, though it was trained on 32k tokens). It tends to "overthink," so providing a longer context helps it perform better.
119
+
120
+ - **Performance**: Based on my very few manual tests, the model seems to excel in conversational settings—especially for mental health, creative tasks and explaining stuff. However, I encourage you to try it out yourself using this [Colab Notebook](https://colab.research.google.com/drive/1dcBbHAwYJuQJKqdPU570Hddv_F9wzjPO?usp=sharing).
121
+
122
+ - **Dataset Note**: The publicly available dataset is only a partial version. The full dataset was originally designed for a custom Mixture of Experts (MoE) architecture, but I couldn't afford to run the full experiment.
123
+
124
+ - **Acknowledgment**: Special thanks to KingNish for reigniting my passion to revisit this project. I almost abandoned it after my first attempt a month ago. Enjoy this experimental model!
125
+
126
+ # Inference Code:
127
+
128
+ - Feel free to make the steps and verifications collapsable and the initial reasoning too, you can show only the final answer to get an o1 feel(i don't know)
129
+ - **Note:** A feature we have here is the ability to control how many steps and verifications you want.
130
+
131
+ ```python
132
+ from transformers import AutoModelForCausalLM, AutoTokenizer
133
+
134
+ model_name = "Lyte/Llama-3.2-3B-Overthinker"
135
+ tokenizer = AutoTokenizer.from_pretrained(model_name)
136
+ model = AutoModelForCausalLM.from_pretrained(model_name, torch_dtype="auto", device_map="auto")
137
+
138
+ def generate_response(prompt, max_tokens=16384, temperature=0.8, top_p=0.95, repeat_penalty=1.1, num_steps=3):
139
+ messages = [{"role": "user", "content": prompt}]
140
+
141
+ # Generate reasoning
142
+ reasoning_template = tokenizer.apply_chat_template(messages, tokenize=False, add_reasoning_prompt=True)
143
+ reasoning_inputs = tokenizer(reasoning_template, return_tensors="pt").to(model.device)
144
+
145
+ reasoning_ids = model.generate(
146
+ **reasoning_inputs,
147
+ max_new_tokens=max_tokens // 3,
148
+ temperature=temperature,
149
+ top_p=top_p,
150
+ repetition_penalty=repeat_penalty
151
+ )
152
+ reasoning_output = tokenizer.decode(reasoning_ids[0, reasoning_inputs.input_ids.shape[1]:], skip_special_tokens=True)
153
+
154
+ # Generate thinking (step-by-step and verifications)
155
+ messages.append({"role": "reasoning", "content": reasoning_output})
156
+ thinking_template = tokenizer.apply_chat_template(messages, tokenize=False, add_thinking_prompt=True, num_steps=num_steps)
157
+ thinking_inputs = tokenizer(thinking_template, return_tensors="pt").to(model.device)
158
+
159
+ thinking_ids = model.generate(
160
+ **thinking_inputs,
161
+ max_new_tokens=max_tokens // 3,
162
+ temperature=temperature,
163
+ top_p=top_p,
164
+ repetition_penalty=repeat_penalty
165
+ )
166
+ thinking_output = tokenizer.decode(thinking_ids[0, thinking_inputs.input_ids.shape[1]:], skip_special_tokens=True)
167
+
168
+ # Generate final answer
169
+ messages.append({"role": "thinking", "content": thinking_output})
170
+ answer_template = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
171
+ answer_inputs = tokenizer(answer_template, return_tensors="pt").to(model.device)
172
+
173
+ answer_ids = model.generate(
174
+ **answer_inputs,
175
+ max_new_tokens=max_tokens // 3,
176
+ temperature=temperature,
177
+ top_p=top_p,
178
+ repetition_penalty=repeat_penalty
179
+ )
180
+ answer_output = tokenizer.decode(answer_ids[0, answer_inputs.input_ids.shape[1]:], skip_special_tokens=True)
181
+ return reasoning_output, thinking_output, answer_output
182
+
183
+ # Example usage:
184
+ prompt = "Explain the process of photosynthesis."
185
+ response = generate_response(prompt, num_steps=5)
186
+
187
+ print("Response:", response)
188
+ ```
189
+
190
+ # Uploaded model
191
+
192
+ - **Developed by:** Lyte
193
+ - **License:** apache-2.0
194
+ - **Finetuned from model :** unsloth/llama-3.2-3b-instruct-bnb-4bit
195
+
196
+ This llama model was trained 2x faster with [Unsloth](https://github.com/unslothai/unsloth) and Huggingface's TRL library.
197
+
198
+ [<img src="https://raw.githubusercontent.com/unslothai/unsloth/main/images/unsloth%20made%20with%20love.png" width="200"/>](https://github.com/unslothai/unsloth)
199
+
200
+ # Notice:
201
+
202
+ - **The problem with runnning evals is that they won't make use of the correct template and it won't be a true eval then would it? so these barely test the model.**
203
+
204
+ # [Open LLM Leaderboard Evaluation Results](https://huggingface.co/spaces/open-llm-leaderboard/open_llm_leaderboard)
205
+ Detailed results can be found [here](https://huggingface.co/datasets/open-llm-leaderboard/details_Lyte__Llama-3.2-3B-Overthinker)
206
+
207
+ | Metric |Value|
208
+ |-------------------|----:|
209
+ |Avg. |19.00|
210
+ |IFEval (0-Shot) |64.08|
211
+ |BBH (3-Shot) |20.10|
212
+ |MATH Lvl 5 (4-Shot)| 2.64|
213
+ |GPQA (0-shot) | 1.23|
214
+ |MuSR (0-shot) | 3.90|
215
+ |MMLU-PRO (5-shot) |22.06|
216
+
llama-3.2-3b-overthinker.Q4_0.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:b0568f9e8a820c6411dcab2b95158241b5b2518c88acc6c240865949905d5b0d
3
+ size 1917187616