RichardErkhov commited on
Commit
afacef7
1 Parent(s): 17daff9

uploaded readme

Browse files
Files changed (1) hide show
  1. README.md +320 -0
README.md ADDED
@@ -0,0 +1,320 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Quantization made by Richard Erkhov.
2
+
3
+ [Github](https://github.com/RichardErkhov)
4
+
5
+ [Discord](https://discord.gg/pvy7H8DZMG)
6
+
7
+ [Request more models](https://github.com/RichardErkhov/quant_request)
8
+
9
+
10
+ granite-3.0-3b-a800m-base - bnb 4bits
11
+ - Model creator: https://huggingface.co/ibm-granite/
12
+ - Original model: https://huggingface.co/ibm-granite/granite-3.0-3b-a800m-base/
13
+
14
+
15
+
16
+
17
+ Original model description:
18
+ ---
19
+ pipeline_tag: text-generation
20
+ inference: false
21
+ license: apache-2.0
22
+ library_name: transformers
23
+ tags:
24
+ - language
25
+ - granite-3.0
26
+ model-index:
27
+ - name: granite-3.0-3b-a800m-base
28
+ results:
29
+ - task:
30
+ type: text-generation
31
+ dataset:
32
+ type: human-exams
33
+ name: MMLU
34
+ metrics:
35
+ - name: pass@1
36
+ type: pass@1
37
+ value: 48.64
38
+ veriefied: false
39
+ - task:
40
+ type: text-generation
41
+ dataset:
42
+ type: human-exams
43
+ name: MMLU-Pro
44
+ metrics:
45
+ - name: pass@1
46
+ type: pass@1
47
+ value: 18.84
48
+ veriefied: false
49
+ - task:
50
+ type: text-generation
51
+ dataset:
52
+ type: human-exams
53
+ name: AGI-Eval
54
+ metrics:
55
+ - name: pass@1
56
+ type: pass@1
57
+ value: 23.81
58
+ veriefied: false
59
+ - task:
60
+ type: text-generation
61
+ dataset:
62
+ type: commonsense
63
+ name: WinoGrande
64
+ metrics:
65
+ - name: pass@1
66
+ type: pass@1
67
+ value: 65.67
68
+ veriefied: false
69
+ - task:
70
+ type: text-generation
71
+ dataset:
72
+ type: commonsense
73
+ name: OBQA
74
+ metrics:
75
+ - name: pass@1
76
+ type: pass@1
77
+ value: 42.20
78
+ veriefied: false
79
+ - task:
80
+ type: text-generation
81
+ dataset:
82
+ type: commonsense
83
+ name: SIQA
84
+ metrics:
85
+ - name: pass@1
86
+ type: pass@1
87
+ value: 47.39
88
+ veriefied: false
89
+ - task:
90
+ type: text-generation
91
+ dataset:
92
+ type: commonsense
93
+ name: PIQA
94
+ metrics:
95
+ - name: pass@1
96
+ type: pass@1
97
+ value: 78.29
98
+ veriefied: false
99
+ - task:
100
+ type: text-generation
101
+ dataset:
102
+ type: commonsense
103
+ name: Hellaswag
104
+ metrics:
105
+ - name: pass@1
106
+ type: pass@1
107
+ value: 72.79
108
+ veriefied: false
109
+ - task:
110
+ type: text-generation
111
+ dataset:
112
+ type: commonsense
113
+ name: TruthfulQA
114
+ metrics:
115
+ - name: pass@1
116
+ type: pass@1
117
+ value: 41.34
118
+ veriefied: false
119
+ - task:
120
+ type: text-generation
121
+ dataset:
122
+ type: reading-comprehension
123
+ name: BoolQ
124
+ metrics:
125
+ - name: pass@1
126
+ type: pass@1
127
+ value: 75.75
128
+ veriefied: false
129
+ - task:
130
+ type: text-generation
131
+ dataset:
132
+ type: reading-comprehension
133
+ name: SQuAD 2.0
134
+ metrics:
135
+ - name: pass@1
136
+ type: pass@1
137
+ value: 20.96
138
+ veriefied: false
139
+ - task:
140
+ type: text-generation
141
+ dataset:
142
+ type: reasoning
143
+ name: ARC-C
144
+ metrics:
145
+ - name: pass@1
146
+ type: pass@1
147
+ value: 46.84
148
+ veriefied: false
149
+ - task:
150
+ type: text-generation
151
+ dataset:
152
+ type: reasoning
153
+ name: GPQA
154
+ metrics:
155
+ - name: pass@1
156
+ type: pass@1
157
+ value: 24.83
158
+ veriefied: false
159
+ - task:
160
+ type: text-generation
161
+ dataset:
162
+ type: reasoning
163
+ name: BBH
164
+ metrics:
165
+ - name: pass@1
166
+ type: pass@1
167
+ value: 38.93
168
+ veriefied: false
169
+ - task:
170
+ type: text-generation
171
+ dataset:
172
+ type: reasoning
173
+ name: MUSR
174
+ metrics:
175
+ - name: pass@1
176
+ type: pass@1
177
+ value: 35.05
178
+ veriefied: false
179
+ - task:
180
+ type: text-generation
181
+ dataset:
182
+ type: code
183
+ name: HumanEval
184
+ metrics:
185
+ - name: pass@1
186
+ type: pass@1
187
+ value: 26.83
188
+ veriefied: false
189
+ - task:
190
+ type: text-generation
191
+ dataset:
192
+ type: code
193
+ name: MBPP
194
+ metrics:
195
+ - name: pass@1
196
+ type: pass@1
197
+ value: 34.60
198
+ veriefied: false
199
+ - task:
200
+ type: text-generation
201
+ dataset:
202
+ type: math
203
+ name: GSM8K
204
+ metrics:
205
+ - name: pass@1
206
+ type: pass@1
207
+ value: 35.86
208
+ veriefied: false
209
+ - task:
210
+ type: text-generation
211
+ dataset:
212
+ type: math
213
+ name: MATH
214
+ metrics:
215
+ - name: pass@1
216
+ type: pass@1
217
+ value: 17.40
218
+ veriefied: false
219
+ ---
220
+
221
+ <!-- ![image/png](https://cdn-uploads.huggingface.co/production/uploads/62cd5057674cdb524450093d/1hzxoPwqkBJXshKVVe6_9.png) -->
222
+ <!-- ![image/png](granite-3_0-language-models_Group_1.png) -->
223
+
224
+ # Granite-3.0-3B-A800M-Base
225
+
226
+ **Model Summary:**
227
+ Granite-3.0-3B-A800M-Base is a decoder-only language model to support a variety of text-to-text generation tasks. It is trained from scratch following a two-stage training strategy. In the first stage, it is trained on 8 trillion tokens sourced from diverse domains. During the second stage, it is further trained on 2 trillion tokens using a carefully curated mix of high-quality data, aiming to enhance its performance on specific tasks.
228
+
229
+ - **Developers:** Granite Team, IBM
230
+ - **GitHub Repository:** [ibm-granite/granite-3.0-language-models](https://github.com/ibm-granite/granite-3.0-language-models)
231
+ - **Website**: [Granite Docs](https://www.ibm.com/granite/docs/)
232
+ - **Paper:** [Granite 3.0 Language Models](https://github.com/ibm-granite/granite-3.0-language-models/blob/main/paper.pdf)
233
+ - **Release Date**: October 21st, 2024
234
+ - **License:** [Apache 2.0](https://www.apache.org/licenses/LICENSE-2.0)
235
+
236
+ **Supported Languages:**
237
+ English, German, Spanish, French, Japanese, Portuguese, Arabic, Czech, Italian, Korean, Dutch, and Chinese. Users may finetune Granite 3.0 models for languages beyond these 12 languages.
238
+
239
+ **Intended use:**
240
+ Prominent use cases of LLMs in text-to-text generation include summarization, text classification, extraction, question-answering, and more. All Granite Base models are able to handle these tasks as they were trained on a large amount of data from various domains. Moreover, they can serve as baseline to create specialized models for specific application scenarios.
241
+
242
+ **Generation:**
243
+ This is a simple example of how to use Granite-3.0-3B-A800M-Base model.
244
+
245
+ Install the following libraries:
246
+
247
+ ```shell
248
+ pip install torch torchvision torchaudio
249
+ pip install accelerate
250
+ pip install transformers
251
+ ```
252
+ Then, copy the code snippet below to run the example.
253
+
254
+ ```python
255
+ from transformers import AutoModelForCausalLM, AutoTokenizer
256
+ device = "auto"
257
+ model_path = "ibm-granite/granite-3.0-3b-a800m-base"
258
+ tokenizer = AutoTokenizer.from_pretrained(model_path)
259
+ # drop device_map if running on CPU
260
+ model = AutoModelForCausalLM.from_pretrained(model_path, device_map=device)
261
+ model.eval()
262
+ # change input text as desired
263
+ input_text = "Where is the Thomas J. Watson Research Center located?"
264
+ # tokenize the text
265
+ input_tokens = tokenizer(input_text, return_tensors="pt").to(device)
266
+ # generate output tokens
267
+ output = model.generate(**input_tokens,
268
+ max_length=4000)
269
+ # decode output tokens into text
270
+ output = tokenizer.batch_decode(output)
271
+ # print output
272
+ print(output)
273
+ ```
274
+
275
+ **Model Architecture:**
276
+ Granite-3.0-3B-A800M-Base is based on a decoder-only sparse Mixture of Experts (MoE) transformer architecture. Core components of this architecture are: Fine-grained Experts, Dropless Token Routing, and Load Balancing Loss.
277
+
278
+ | Model | 2B Dense | 8B Dense | 1B MoE | 3B MoE |
279
+ | :-------- | :--------| :--------| :--------| :-------- |
280
+ | Embedding size | 2048 | 4096 | 1024 | **1536** |
281
+ | Number of layers | 40 | 40 | 24 | **32** |
282
+ | Attention head size | 64 | 128 | 64 | **64** |
283
+ | Number of attention heads | 32 | 32 | 16 | **24** |
284
+ | Number of KV heads | 8 | 8 | 8 | **8** |
285
+ | MLP hidden size | 8192 | 12800 | 512 | **512** |
286
+ | MLP activation | SwiGLU | SwiGLU | SwiGLU | **SwiGLU** |
287
+ | Number of Experts | — | — | 32 | **40** |
288
+ | MoE TopK | — | — | 8 | **8** |
289
+ | Initialization std | 0.1 | 0.1 | 0.1 | **0.1** |
290
+ | Sequence Length | 4096 | 4096 | 4096 | **4096** |
291
+ | Position Embedding | RoPE | RoPE | RoPE | **RoPE** |
292
+ | # Parameters | 2.5B | 8.1B | 1.3B | **3.3B** |
293
+ | # Active Parameters | 2.5B | 8.1B | 400M | **800M** |
294
+ | # Training tokens | 12T | 12T | 10T | **10T** |
295
+
296
+ **Training Data:**
297
+ This model is trained on a mix of open source and proprietary data following a two-stage training strategy.
298
+ * Stage 1 data: The data for stage 1 is sourced from diverse domains, such as: web, code, academic sources, books, and math data.
299
+ * Stage 2 data: The data for stage 2 comprises a curated mix of high-quality data from the same domains, plus multilingual and instruction data. The goal of this second training phase is to enhance the model’s performance on specific tasks.
300
+
301
+ A detailed attribution of datasets can be found in the [Granite Technical Report](https://github.com/ibm-granite/granite-3.0-language-models/blob/main/paper.pdf) and [Accompanying Author List](https://github.com/ibm-granite/granite-3.0-language-models/blob/main/author-ack.pdf).
302
+
303
+ **Infrastructure:**
304
+ We train Granite 3.0 Language Models using IBM's super computing cluster, Blue Vela, which is outfitted with NVIDIA H100 GPUs. This cluster provides a scalable and efficient infrastructure for training our models over thousands of GPUs while minimizing environmental impact by utilizing 100% renewable energy sources.
305
+
306
+ **Ethical Considerations and Limitations:**
307
+ The use of Large Language Models involves risks and ethical considerations people must be aware of, including but not limited to: bias and fairness, misinformation, and autonomous decision-making. Granite-3.0-3B-A800M-Base model is not the exception in this regard. Even though this model is suited for multiple generative AI tasks, it has not undergone any safety alignment, there it may produce problematic outputs. Additionally, it remains uncertain whether smaller models might exhibit increased susceptibility to hallucination in generation scenarios by copying text verbatim from the training dataset due to their reduced sizes and memorization capacities. This aspect is currently an active area of research, and we anticipate more rigorous exploration, comprehension, and mitigations in this domain. Regarding ethics, a latent risk associated with all Large Language Models is their malicious utilization. We urge the community to use Granite-3.0-3B-A800M-Base model with ethical intentions and in a responsible way.
308
+
309
+ <!-- ## Citation
310
+ ```
311
+ @misc{granite-models,
312
+ author = {author 1, author2, ...},
313
+ title = {},
314
+ journal = {},
315
+ volume = {},
316
+ year = {2024},
317
+ url = {https://arxiv.org/abs/0000.00000},
318
+ }
319
+ ``` -->
320
+