RichardErkhov commited on
Commit
07c0a79
1 Parent(s): 6cff3e1

uploaded readme

Browse files
Files changed (1) hide show
  1. README.md +319 -0
README.md ADDED
@@ -0,0 +1,319 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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-2b-base - bnb 8bits
11
+ - Model creator: https://huggingface.co/ibm-granite/
12
+ - Original model: https://huggingface.co/ibm-granite/granite-3.0-2b-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-2b-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: 55.00
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: 23.79
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: 22.56
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: 74.90
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: 43.00
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: 59.84
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: 79.27
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: 77.65
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: 39.90
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: 81.35
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: 25.22
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: 54.27
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: 30.58
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: 40.69
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: 34.34
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: 38.41
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: 35.40
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: 47.23
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: 19.46
218
+ veriefied: false
219
+ ---
220
+
221
+ <!-- ![image/png](https://github.com/ibm-granite/granite-3.0-language-models/blob/main/figures/granite-3_0-language-models-3x-v1.png) -->
222
+
223
+ # Granite-3.0-2B-Base
224
+
225
+ **Model Summary:**
226
+ Granite-3.0-2B-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 10 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.
227
+
228
+ - **Developers:** Granite Team, IBM
229
+ - **GitHub Repository:** [ibm-granite/granite-3.0-language-models](https://github.com/ibm-granite/granite-3.0-language-models)
230
+ - **Website**: [Granite Docs](https://www.ibm.com/granite/docs/)
231
+ - **Paper:** [Granite 3.0 Language Models](https://github.com/ibm-granite/granite-3.0-language-models/blob/main/paper.pdf)
232
+ - **Release Date**: October 21st, 2024
233
+ - **License:** [Apache 2.0](https://www.apache.org/licenses/LICENSE-2.0)
234
+
235
+ **Supported Languages:**
236
+ 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.
237
+
238
+ **Intended use:**
239
+ 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.
240
+
241
+ **Generation:**
242
+ This is a simple example of how to use Granite-3.0-2B-Base model.
243
+
244
+ Install the following libraries:
245
+
246
+ ```shell
247
+ pip install torch torchvision torchaudio
248
+ pip install accelerate
249
+ pip install transformers
250
+ ```
251
+ Then, copy the code snippet below to run the example.
252
+
253
+ ```python
254
+ from transformers import AutoModelForCausalLM, AutoTokenizer
255
+ device = "auto"
256
+ model_path = "ibm-granite/granite-3.0-2b-base"
257
+ tokenizer = AutoTokenizer.from_pretrained(model_path)
258
+ # drop device_map if running on CPU
259
+ model = AutoModelForCausalLM.from_pretrained(model_path, device_map=device)
260
+ model.eval()
261
+ # change input text as desired
262
+ input_text = "Where is the Thomas J. Watson Research Center located?"
263
+ # tokenize the text
264
+ input_tokens = tokenizer(input_text, return_tensors="pt").to(device)
265
+ # generate output tokens
266
+ output = model.generate(**input_tokens,
267
+ max_length=4000)
268
+ # decode output tokens into text
269
+ output = tokenizer.batch_decode(output)
270
+ # print output
271
+ print(output)
272
+ ```
273
+
274
+ **Model Architecture:**
275
+ Granite-3.0-2B-Base is based on a decoder-only dense transformer architecture. Core components of this architecture are: GQA and RoPE, MLP with SwiGLU, RMSNorm, and shared input/output embeddings.
276
+
277
+ | Model | 2B Dense | 8B Dense | 1B MoE | 3B MoE |
278
+ | :-------- | :-------- | :--------| :--------| :--------|
279
+ | Embedding size | **2048** | 4096 | 1024 | 1536 |
280
+ | Number of layers | **40** | 40 | 24 | 32 |
281
+ | Attention head size | **64** | 128 | 64 | 64 |
282
+ | Number of attention heads | **32** | 32 | 16 | 24 |
283
+ | Number of KV heads | **8** | 8 | 8 | 8 |
284
+ | MLP hidden size | **8192** | 12800 | 512 | 512 |
285
+ | MLP activation | **SwiGLU** | SwiGLU | SwiGLU | SwiGLU |
286
+ | Number of Experts | **—** | — | 32 | 40 |
287
+ | MoE TopK | **—** | — | 8 | 8 |
288
+ | Initialization std | **0.1** | 0.1 | 0.1 | 0.1 |
289
+ | Sequence Length | **4096** | 4096 | 4096 | 4096 |
290
+ | Position Embedding | **RoPE** | RoPE | RoPE | RoPE |
291
+ | # Parameters | **2.5B** | 8.1B | 1.3B | 3.3B |
292
+ | # Active Parameters | **2.5B** | 8.1B | 400M | 800M |
293
+ | # Training tokens | **12T** | 12T | 10T | 10T |
294
+
295
+ **Training Data:**
296
+ This model is trained on a mix of open source and proprietary data following a two-stage training strategy.
297
+ * Stage 1 data: The data for stage 1 is sourced from diverse domains, such as: web, code, academic sources, books, and math data.
298
+ * 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.
299
+
300
+ 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).
301
+
302
+ **Infrastructure:**
303
+ 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.
304
+
305
+ **Ethical Considerations and Limitations:**
306
+ 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-2B-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-2B-Base model with ethical intentions and in a responsible way.
307
+
308
+ <!-- ## Citation
309
+ ```
310
+ @misc{granite-models,
311
+ author = {author 1, author2, ...},
312
+ title = {},
313
+ journal = {},
314
+ volume = {},
315
+ year = {2024},
316
+ url = {https://arxiv.org/abs/0000.00000},
317
+ }
318
+ ``` -->
319
+