Lauarvik commited on
Commit
4f8407f
·
verified ·
1 Parent(s): 75e712f

Upload README.md with huggingface_hub

Browse files
Files changed (1) hide show
  1. README.md +626 -196
README.md CHANGED
@@ -1,199 +1,629 @@
1
  ---
 
2
  library_name: transformers
3
- tags: []
 
 
 
 
 
 
 
4
  ---
5
-
6
- # Model Card for Model ID
7
-
8
- <!-- Provide a quick summary of what the model is/does. -->
9
-
10
-
11
-
12
- ## Model Details
13
-
14
- ### Model Description
15
-
16
- <!-- Provide a longer summary of what this model is. -->
17
-
18
- This is the model card of a 🤗 transformers model that has been pushed on the Hub. This model card has been automatically generated.
19
-
20
- - **Developed by:** [More Information Needed]
21
- - **Funded by [optional]:** [More Information Needed]
22
- - **Shared by [optional]:** [More Information Needed]
23
- - **Model type:** [More Information Needed]
24
- - **Language(s) (NLP):** [More Information Needed]
25
- - **License:** [More Information Needed]
26
- - **Finetuned from model [optional]:** [More Information Needed]
27
-
28
- ### Model Sources [optional]
29
-
30
- <!-- Provide the basic links for the model. -->
31
-
32
- - **Repository:** [More Information Needed]
33
- - **Paper [optional]:** [More Information Needed]
34
- - **Demo [optional]:** [More Information Needed]
35
-
36
- ## Uses
37
-
38
- <!-- Address questions around how the model is intended to be used, including the foreseeable users of the model and those affected by the model. -->
39
-
40
- ### Direct Use
41
-
42
- <!-- This section is for the model use without fine-tuning or plugging into a larger ecosystem/app. -->
43
-
44
- [More Information Needed]
45
-
46
- ### Downstream Use [optional]
47
-
48
- <!-- This section is for the model use when fine-tuned for a task, or when plugged into a larger ecosystem/app -->
49
-
50
- [More Information Needed]
51
-
52
- ### Out-of-Scope Use
53
-
54
- <!-- This section addresses misuse, malicious use, and uses that the model will not work well for. -->
55
-
56
- [More Information Needed]
57
-
58
- ## Bias, Risks, and Limitations
59
-
60
- <!-- This section is meant to convey both technical and sociotechnical limitations. -->
61
-
62
- [More Information Needed]
63
-
64
- ### Recommendations
65
-
66
- <!-- This section is meant to convey recommendations with respect to the bias, risk, and technical limitations. -->
67
-
68
- Users (both direct and downstream) should be made aware of the risks, biases and limitations of the model. More information needed for further recommendations.
69
-
70
- ## How to Get Started with the Model
71
-
72
- Use the code below to get started with the model.
73
-
74
- [More Information Needed]
75
-
76
- ## Training Details
77
-
78
- ### Training Data
79
-
80
- <!-- This should link to a Dataset Card, perhaps with a short stub of information on what the training data is all about as well as documentation related to data pre-processing or additional filtering. -->
81
-
82
- [More Information Needed]
83
-
84
- ### Training Procedure
85
-
86
- <!-- This relates heavily to the Technical Specifications. Content here should link to that section when it is relevant to the training procedure. -->
87
-
88
- #### Preprocessing [optional]
89
-
90
- [More Information Needed]
91
-
92
-
93
- #### Training Hyperparameters
94
-
95
- - **Training regime:** [More Information Needed] <!--fp32, fp16 mixed precision, bf16 mixed precision, bf16 non-mixed precision, fp16 non-mixed precision, fp8 mixed precision -->
96
-
97
- #### Speeds, Sizes, Times [optional]
98
-
99
- <!-- This section provides information about throughput, start/end time, checkpoint size if relevant, etc. -->
100
-
101
- [More Information Needed]
102
-
103
- ## Evaluation
104
-
105
- <!-- This section describes the evaluation protocols and provides the results. -->
106
-
107
- ### Testing Data, Factors & Metrics
108
-
109
- #### Testing Data
110
-
111
- <!-- This should link to a Dataset Card if possible. -->
112
-
113
- [More Information Needed]
114
-
115
- #### Factors
116
-
117
- <!-- These are the things the evaluation is disaggregating by, e.g., subpopulations or domains. -->
118
-
119
- [More Information Needed]
120
-
121
- #### Metrics
122
-
123
- <!-- These are the evaluation metrics being used, ideally with a description of why. -->
124
-
125
- [More Information Needed]
126
-
127
- ### Results
128
-
129
- [More Information Needed]
130
-
131
- #### Summary
132
-
133
-
134
-
135
- ## Model Examination [optional]
136
-
137
- <!-- Relevant interpretability work for the model goes here -->
138
-
139
- [More Information Needed]
140
-
141
- ## Environmental Impact
142
-
143
- <!-- Total emissions (in grams of CO2eq) and additional considerations, such as electricity usage, go here. Edit the suggested text below accordingly -->
144
-
145
- Carbon emissions can be estimated using the [Machine Learning Impact calculator](https://mlco2.github.io/impact#compute) presented in [Lacoste et al. (2019)](https://arxiv.org/abs/1910.09700).
146
-
147
- - **Hardware Type:** [More Information Needed]
148
- - **Hours used:** [More Information Needed]
149
- - **Cloud Provider:** [More Information Needed]
150
- - **Compute Region:** [More Information Needed]
151
- - **Carbon Emitted:** [More Information Needed]
152
-
153
- ## Technical Specifications [optional]
154
-
155
- ### Model Architecture and Objective
156
-
157
- [More Information Needed]
158
-
159
- ### Compute Infrastructure
160
-
161
- [More Information Needed]
162
-
163
- #### Hardware
164
-
165
- [More Information Needed]
166
-
167
- #### Software
168
-
169
- [More Information Needed]
170
-
171
- ## Citation [optional]
172
-
173
- <!-- If there is a paper or blog post introducing the model, the APA and Bibtex information for that should go in this section. -->
174
-
175
- **BibTeX:**
176
-
177
- [More Information Needed]
178
-
179
- **APA:**
180
-
181
- [More Information Needed]
182
-
183
- ## Glossary [optional]
184
-
185
- <!-- If relevant, include terms and calculations in this section that can help readers understand the model or model card. -->
186
-
187
- [More Information Needed]
188
-
189
- ## More Information [optional]
190
-
191
- [More Information Needed]
192
-
193
- ## Model Card Authors [optional]
194
-
195
- [More Information Needed]
196
-
197
- ## Model Card Contact
198
-
199
- [More Information Needed]
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  ---
2
+ license: apache-2.0
3
  library_name: transformers
4
+ tags:
5
+ - language
6
+ - granite-4.1
7
+ - heretic
8
+ - uncensored
9
+ - decensored
10
+ - abliterated
11
+ - reproducible
12
  ---
13
+ # This is a decensored version of [ibm-granite/granite-4.1-8b](https://huggingface.co/ibm-granite/granite-4.1-8b), made using [Heretic](https://github.com/p-e-w/heretic) v1.2.0
14
+
15
+ > [!TIP]
16
+ > **This model is reproducible!**
17
+ >
18
+ > See the [README](reproduce/README.md) in the `reproduce` directory for more information.
19
+
20
+ ## Abliteration parameters
21
+
22
+ | Parameter | Value |
23
+ | :-------- | :---: |
24
+ | **direction_index** | per layer |
25
+ | **attn.o_proj.max_weight** | 1.34 |
26
+ | **attn.o_proj.max_weight_position** | 33.00 |
27
+ | **attn.o_proj.min_weight** | 0.99 |
28
+ | **attn.o_proj.min_weight_distance** | 12.73 |
29
+ | **mlp.down_proj.max_weight** | 1.15 |
30
+ | **mlp.down_proj.max_weight_position** | 32.88 |
31
+ | **mlp.down_proj.min_weight** | 0.65 |
32
+ | **mlp.down_proj.min_weight_distance** | 14.66 |
33
+
34
+ ## Performance
35
+
36
+ | Metric | This model | Original model ([ibm-granite/granite-4.1-8b](https://huggingface.co/ibm-granite/granite-4.1-8b)) |
37
+ | :----- | :--------: | :---------------------------: |
38
+ | **KL divergence** | 0.0647 | 0 *(by definition)* |
39
+ | **Refusals** | 1/100 | 61/100 |
40
+
41
+ -----
42
+
43
+
44
+ [![mof-class3-qualified](https://mot.isitopen.ai/modules/mof/assets/badge_class3_qualified.png)](https://mot.isitopen.ai/model/1160)
45
+
46
+ # Granite-4.1-8B
47
+
48
+
49
+ **Model Summary:**
50
+ Granite-4.1-8B is a 8B parameter long-context instruct model finetuned from *Granite-4.1-8B-Base* using a combination of open source instruction datasets with permissive license and internally collected synthetic datasets. Granite 4.1 models have gone through an improved post-training pipeline, including supervised finetuning and reinforcement learning alignment, resulting in enhanced tool calling, instruction following, and chat capabilities.
51
+
52
+ - **Developers:** Granite Team, IBM
53
+ - **HF Collection:** [Granite 4.1 Language Models HF Collection](https://huggingface.co/collections/ibm-granite/granite-41-language-models)
54
+ - **Technical Blog:** [Granite-4.1 Blog](https://huggingface.co/blog/ibm-granite/granit-4-1)
55
+ - **GitHub Repository:** [ibm-granite/granite-4.1-language-models](https://github.com/ibm-granite/granite-4.1-language-models)
56
+ - **Website**: [Granite Docs](https://www.ibm.com/granite/docs/)
57
+ - **Release Date**: April 29th, 2026
58
+ - **License:** [Apache 2.0](https://www.apache.org/licenses/LICENSE-2.0)
59
+
60
+ **Supported Languages:**
61
+ English, German, Spanish, French, Japanese, Portuguese, Arabic, Czech, Italian, Korean, Dutch, and Chinese. Users may finetune Granite 4.1 models for languages beyond these languages.
62
+
63
+ **Intended use:**
64
+ The model is designed to follow general instructions and can serve as the foundation for AI assistants across diverse domains, including business applications, as well as for LLM agents equipped with tool-use capabilities.
65
+
66
+ *Capabilities*
67
+ * Summarization
68
+ * Text classification
69
+ * Text extraction
70
+ * Question-answering
71
+ * Retrieval Augmented Generation (RAG)
72
+ * Code related tasks
73
+ * Function-calling tasks
74
+ * Multilingual dialog use cases
75
+ * Fill-In-the-Middle (FIM) code completions
76
+
77
+ <!-- <todo>Need to test the examples. (especially the tool calling and RAG ones)</todo>
78
+ -->
79
+
80
+ **Generation:**
81
+ This is a simple example of how to use Granite-4.1-8B model.
82
+
83
+ Install the following libraries:
84
+
85
+ ```shell
86
+ pip install torch torchvision torchaudio
87
+ pip install accelerate
88
+ pip install transformers
89
+ ```
90
+ Then, copy the snippet from the section that is relevant for your use case.
91
+
92
+ ```python
93
+ import torch
94
+ from transformers import AutoModelForCausalLM, AutoTokenizer
95
+
96
+ device = "cuda"
97
+ model_path = "ibm-granite/granite-4.1-8b"
98
+ tokenizer = AutoTokenizer.from_pretrained(model_path)
99
+ # drop device_map if running on CPU
100
+ model = AutoModelForCausalLM.from_pretrained(model_path, device_map=device)
101
+ model.eval()
102
+ # change input text as desired
103
+ chat = [
104
+ { "role": "user", "content": "Please list one IBM Research laboratory located in the United States. You should only output its name and location." },
105
+ ]
106
+ chat = tokenizer.apply_chat_template(chat, tokenize=False, add_generation_prompt=True)
107
+ # tokenize the text
108
+ input_tokens = tokenizer(chat, return_tensors="pt").to(device)
109
+ # generate output tokens
110
+ output = model.generate(**input_tokens,
111
+ max_new_tokens=100)
112
+ # decode output tokens into text
113
+ output = tokenizer.batch_decode(output)
114
+ # print output
115
+ print(output[0])
116
+ ```
117
+
118
+ Expected output:
119
+ ```shell
120
+ <|start_of_role|>user<|end_of_role|>Please list one IBM Research laboratory located in the United States. You should only output its name and location.<|end_of_text|>
121
+ <|start_of_role|>assistant<|end_of_role|>IBM Almaden Research Laboratory, San Jose, California, United States.<|end_of_text|>
122
+ ```
123
+ <!-- 📣 **Update [2025-10-07]:** Added a *default system prompt* to the chat template to guide the model towards more *professional, accurate, and safe* responses. -->
124
+
125
+ **Tool-calling:**
126
+ Granite-4.1-8B comes with enhanced tool calling capabilities, enabling seamless integration with external functions and APIs. To define a list of tools please follow OpenAI's function [definition schema](https://platform.openai.com/docs/guides/function-calling?api-mode=responses#defining-functions).
127
+
128
+ This is an example of how to use Granite-4.1-8B model tool-calling ability:
129
+
130
+ ```python
131
+ import torch
132
+ from transformers import AutoModelForCausalLM, AutoTokenizer
133
+
134
+ device = "cuda"
135
+ model_path = "ibm-granite/granite-4.1-8b"
136
+ tokenizer = AutoTokenizer.from_pretrained(model_path)
137
+ # drop device_map if running on CPU
138
+ model = AutoModelForCausalLM.from_pretrained(model_path, device_map=device)
139
+ model.eval()
140
+
141
+ tools = [
142
+ {
143
+ "type": "function",
144
+ "function": {
145
+ "name": "get_current_weather",
146
+ "description": "Get the current weather for a specified city.",
147
+ "parameters": {
148
+ "type": "object",
149
+ "properties": {
150
+ "city": {
151
+ "type": "string",
152
+ "description": "Name of the city"
153
+ }
154
+ },
155
+ "required": ["city"]
156
+ }
157
+ }
158
+ }
159
+ ]
160
+
161
+ # change input text as desired
162
+ chat = [
163
+ { "role": "user", "content": "What's the weather like in Boston right now?" },
164
+ ]
165
+ chat = tokenizer.apply_chat_template(chat, \
166
+ tokenize=False, \
167
+ tools=tools, \
168
+ add_generation_prompt=True)
169
+ # tokenize the text
170
+ input_tokens = tokenizer(chat, return_tensors="pt").to(device)
171
+ # generate output tokens
172
+ output = model.generate(**input_tokens,
173
+ max_new_tokens=100)
174
+ # decode output tokens into text
175
+ output = tokenizer.batch_decode(output)
176
+ # print output
177
+ print(output[0])
178
+ ```
179
+
180
+ Expected output:
181
+ ```shell
182
+ <|start_of_role|>system<|end_of_role|>You are a helpful assistant with access to the following tools. You may call one or more tools to assist with the user query.
183
+ You are provided with function signatures within <tools></tools> XML tags:
184
+ <tools>
185
+ {"type": "function", "function": {"name": "get_current_weather", "description": "Get the current weather for a specified city.", "parameters": {"type": "object", "properties": {"city": {"type": "string", "description": "Name of the city"}}, "required": ["city"]}}}
186
+ </tools>
187
+ For each tool call, return a json object with function name and arguments within <tool_call></tool_call> XML tags:
188
+ <tool_call>
189
+ {"name": <function-name>, "arguments": <args-json-object>}
190
+ </tool_call>. If a tool does not exist in the provided list of tools, notify the user that you do not have the ability to fulfill the request.<|end_of_text|>
191
+ <|start_of_role|>user<|end_of_role|>What's the weather like in Boston right now?<|end_of_text|>
192
+ <|start_of_role|>assistant<|end_of_role|><tool_call>
193
+ {"name": "get_current_weather", "arguments": {"city": "Boston"}}
194
+ </tool_call><|end_of_text|>
195
+ ```
196
+
197
+ <!-- **Retrieval Augmented Generation:**
198
+ *Coming soon* -->
199
+
200
+ **Evaluation Results:**
201
+
202
+ <table>
203
+ <!-- <caption><b> All Results</b></caption> -->
204
+ <thead>
205
+ <tr>
206
+ <th style="text-align:left; background-color: #001d6c; color: white;">Benchmarks</th>
207
+ <th style="text-align:left; background-color: #001d6c; color: white;">Metric</th>
208
+ <th style="text-align:center; background-color: #001d6c; color: white;">3B Dense</th>
209
+ <th style="text-align:center; background-color: #001d6c; color: white;">8B Dense</th>
210
+ <th style="text-align:center; background-color: #001d6c; color: white;">30B Dense</th>
211
+ </tr>
212
+ </thead>
213
+ <tbody>
214
+ <tr>
215
+ <td colspan="5" style="text-align:center; background-color: #FFFFFF; color: #2D2D2D; font-style:italic;">
216
+ General Tasks
217
+ </td>
218
+ </tr>
219
+ <tr>
220
+ <td style="text-align:left; background-color: #FFFFFF; color: #2D2D2D;">MMLU</td>
221
+ <td style="text-align:left; background-color: #FFFFFF; color: #2D2D2D;">5-shot</td>
222
+ <td style="text-align:right; background-color: #FFFFFF; color: #2D2D2D;">67.02</td>
223
+ <td style="text-align:right; background-color: #DAE8FF; color: #2D2D2D;">73.84</td>
224
+ <td style="text-align:right; background-color: #FFFFFF; color: #2D2D2D;">80.16</td>
225
+ </tr>
226
+ <tr>
227
+ <td style="text-align:left; background-color: #FFFFFF; color: #2D2D2D;">MMLU-Pro</td>
228
+ <td style="text-align:left; background-color: #FFFFFF; color: #2D2D2D;">5-shot, CoT</td>
229
+ <td style="text-align:right; background-color: #FFFFFF; color: #2D2D2D;">49.83</td>
230
+ <td style="text-align:right; background-color: #DAE8FF; color: #2D2D2D;">55.99</td>
231
+ <td style="text-align:right; background-color: #FFFFFF; color: #2D2D2D;">64.09</td>
232
+ </tr>
233
+ <tr>
234
+ <td style="text-align:left; background-color: #FFFFFF; color: #2D2D2D;">BBH</td>
235
+ <td style="text-align:left; background-color: #FFFFFF; color: #2D2D2D;">3-shot, CoT</td>
236
+ <td style="text-align:right; background-color: #FFFFFF; color: #2D2D2D;">75.83</td>
237
+ <td style="text-align:right; background-color: #DAE8FF; color: #2D2D2D;">80.51</td>
238
+ <td style="text-align:right; background-color: #FFFFFF; color: #2D2D2D;">83.74</td>
239
+ </tr>
240
+ <tr>
241
+ <td style="text-align:left; background-color: #FFFFFF; color: #2D2D2D;">AGI EVAL</td>
242
+ <td style="text-align:left; background-color: #FFFFFF; color: #2D2D2D;">0-shot, CoT</td>
243
+ <td style="text-align:right; background-color:#FFFFFF; color: #2D2D2D;">65.16</td>
244
+ <td style="text-align:right; background-color: #DAE8FF; color: #2D2D2D;">72.43</td>
245
+ <td style="text-align:right; background-color: #FFFFFF; color: #2D2D2D;">77.80</td>
246
+ </tr>
247
+ <tr>
248
+ <td style="text-align:left; background-color: #FFFFFF; color: #2D2D2D;">GPQA</td>
249
+ <td style="text-align:left; background-color: #FFFFFF; color: #2D2D2D;">0-shot, CoT</td>
250
+ <td style="text-align:right; background-color: #FFFFFF; color: #2D2D2D;">31.70</td>
251
+ <td style="text-align:right; background-color: #DAE8FF; color: #2D2D2D;">41.96</td>
252
+ <td style="text-align:right; background-color: #FFFFFF; color: #2D2D2D;">45.76</td>
253
+ </tr>
254
+ <tr>
255
+ <td style="text-align:left; background-color: #FFFFFF; color: #2D2D2D;">SimpleQA</td>
256
+ <td style="text-align:left; background-color: #FFFFFF; color: #2D2D2D;"></td>
257
+ <td style="text-align:right; background-color: #FFFFFF; color: #2D2D2D;">3.68</td>
258
+ <td style="text-align:right; background-color: #DAE8FF; color: #2D2D2D;">4.82</td>
259
+ <td style="text-align:right; background-color: #FFFFFF; color: #2D2D2D;">6.81</td>
260
+ </tr>
261
+ <tr>
262
+ <td colspan="5" style="text-align:center; background-color: #FFFFFF; color: #2D2D2D; font-style:italic;">
263
+ Alignment Tasks
264
+ </td>
265
+ </tr>
266
+ <tr>
267
+ <td style="text-align:left; background-color: #FFFFFF; color: #2D2D2D;">AlpacaEval 2.0</td>
268
+ <td style="text-align:right; background-color: #FFFFFF; color: #2D2D2D;"></td>
269
+ <td style="text-align:right; background-color: #FFFFFF; color: #2D2D2D;">38.57</td>
270
+ <td style="text-align:right; background-color: #DAE8FF; color: #2D2D2D;">50.08</td>
271
+ <td style="text-align:right; background-color: #FFFFFF; color: #2D2D2D;">56.16</td>
272
+ </tr>
273
+ <tr>
274
+ <td style="text-align:left; background-color: #FFFFFF; color: #2D2D2D;">IFEval Avg</td>
275
+ <td style="text-align:left; background-color: #FFFFFF; color: #2D2D2D;"></td>
276
+ <td style="text-align:right; background-color: #FFFFFF; color: #2D2D2D;">82.30</td>
277
+ <td style="text-align:right; background-color: #DAE8FF; color: #2D2D2D;">87.06</td>
278
+ <td style="text-align:right; background-color: #FFFFFF; color: #2D2D2D;">89.65</td>
279
+ </tr>
280
+ <tr>
281
+ <td style="text-align:left; background-color: #FFFFFF; color: #2D2D2D;">ArenaHard</td>
282
+ <td style="text-align:left; background-color: #FFFFFF; color: #2D2D2D;"></td>
283
+ <td style="text-align:right; background-color: #FFFFFF; color: #2D2D2D;">37.80</td>
284
+ <td style="text-align:right; background-color: #DAE8FF; color: #2D2D2D;">68.98</td>
285
+ <td style="text-align:right; background-color: #FFFFFF; color: #2D2D2D;">71.02</td>
286
+ </tr>
287
+ <tr>
288
+ <td style="text-align:left; background-color: #FFFFFF; color: #2D2D2D;">MTBench Avg</td>
289
+ <td style="text-align:left; background-color: #FFFFFF; color: #2D2D2D;"></td>
290
+ <td style="text-align:right; background-color: #FFFFFF; color: #2D2D2D;">7.57</td>
291
+ <td style="text-align:right; background-color: #DAE8FF; color: #2D2D2D;">8.61</td>
292
+ <td style="text-align:right; background-color: #FFFFFF; color: #2D2D2D;">8.61</td>
293
+ </tr>
294
+ <tr>
295
+ <td colspan="5" style="text-align:center; background-color: #FFFFFF; color: #2D2D2D; font-style:italic;">
296
+ Math Tasks
297
+ </td>
298
+ </tr>
299
+ <tr>
300
+ <td style="text-align:left; background-color: #FFFFFF; color: #2D2D2D;">GSM8K</td>
301
+ <td style="text-align:left; background-color: #FFFFFF; color: #2D2D2D;">8-shot</td>
302
+ <td style="text-align:right; background-color: #FFFFFF; color: #2D2D2D;">86.88</td>
303
+ <td style="text-align:right; background-color: #DAE8FF; color: #2D2D2D;">92.49</td>
304
+ <td style="text-align:right; background-color: #FFFFFF; color: #2D2D2D;">94.16</td>
305
+ </tr>
306
+ <tr>
307
+ <td style="text-align:left; background-color: #FFFFFF; color: #2D2D2D;">GSM Symbolic</td>
308
+ <td style="text-align:left; background-color: #FFFFFF; color: #2D2D2D;">8-shot</td>
309
+ <td style="text-align:right; background-color: #FFFFFF; color: #2D2D2D;">81.32</td>
310
+ <td style="text-align:right; background-color: #DAE8FF; color: #2D2D2D;">83.70</td>
311
+ <td style="text-align:right; background-color: #FFFFFF; color: #2D2D2D;">75.70</td>
312
+ </tr>
313
+ <tr>
314
+ <td style="text-align:left; background-color: #FFFFFF; color: #2D2D2D;">Minerva Math</td>
315
+ <td style="text-align:left; background-color: #FFFFFF; color: #2D2D2D;">0-shot, CoT</td>
316
+ <td style="text-align:right; background-color: #FFFFFF; color: #2D2D2D;">67.94</td>
317
+ <td style="text-align:right; background-color: #DAE8FF; color: #2D2D2D;">80.10</td>
318
+ <td style="text-align:right; background-color: #FFFFFF; color: #2D2D2D;">81.32</td>
319
+ </tr>
320
+ <tr>
321
+ <td style="text-align:left; background-color: #FFFFFF; color: #2D2D2D;">DeepMind Math</td>
322
+ <td style="text-align:left; background-color: #FFFFFF; color: #2D2D2D;">0-shot, CoT</td>
323
+ <td style="text-align:right; background-color: #FFFFFF; color: #2D2D2D;">64.64</td>
324
+ <td style="text-align:right; background-color: #DAE8FF; color: #2D2D2D;">80.07</td>
325
+ <td style="text-align:right; background-color: #FFFFFF; color: #2D2D2D;">81.93</td>
326
+ </tr>
327
+ <tr>
328
+ <td colspan="5" style="text-align:center; background-color: #FFFFFF; color: #2D2D2D; font-style:italic;">
329
+ Code Tasks
330
+ </td>
331
+ </tr>
332
+ <tr>
333
+ <td style="text-align:left; background-color: #FFFFFF; color: #2D2D2D;">HumanEval</td>
334
+ <td style="text-align:left; background-color: #FFFFFF; color: #2D2D2D;">pass@1</td>
335
+ <td style="text-align:right; background-color: #FFFFFF; color: #2D2D2D;">81.71</td>
336
+ <td style="text-align:right; background-color: #DAE8FF; color: #2D2D2D;">85.37</td>
337
+ <td style="text-align:right; background-color: #FFFFFF; color: #2D2D2D;">88.41</td>
338
+ </tr>
339
+ <tr>
340
+ <td style="text-align:left; background-color: #FFFFFF; color: #2D2D2D;">HumanEval+</td>
341
+ <td style="text-align:left; background-color: #FFFFFF; color: #2D2D2D;">pass@1</td>
342
+ <td style="text-align:right; background-color: #FFFFFF; color: #2D2D2D;">76.83</td>
343
+ <td style="text-align:right; background-color: #DAE8FF; color: #2D2D2D;">79.88</td>
344
+ <td style="text-align:right; background-color: #FFFFFF; color: #2D2D2D;">85.37</td>
345
+ </tr>
346
+ <tr>
347
+ <td style="text-align:left; background-color: #FFFFFF; color: #2D2D2D;">MBPP</td>
348
+ <td style="text-align:left; background-color: #FFFFFF; color: #2D2D2D;">pass@1</td>
349
+ <td style="text-align:right; background-color: #FFFFFF; color: #2D2D2D;">71.16</td>
350
+ <td style="text-align:right; background-color: #DAE8FF; color: #2D2D2D;">87.30</td>
351
+ <td style="text-align:right; background-color: #FFFFFF; color: #2D2D2D;">85.45</td>
352
+ </tr>
353
+ <tr>
354
+ <td style="text-align:left; background-color: #FFFFFF; color: #2D2D2D;">MBPP+</td>
355
+ <td style="text-align:left; background-color: #FFFFFF; color: #2D2D2D;">pass@1</td>
356
+ <td style="text-align:right; background-color: #FFFFFF; color: #2D2D2D;">62.17</td>
357
+ <td style="text-align:right; background-color: #DAE8FF; color: #2D2D2D;">73.81</td>
358
+ <td style="text-align:right; background-color: #FFFFFF; color: #2D2D2D;">73.54</td>
359
+ </tr>
360
+ <tr>
361
+ <td style="text-align:left; background-color: #FFFFFF; color: #2D2D2D;">CRUXEval-O</td>
362
+ <td style="text-align:left; background-color: #FFFFFF; color: #2D2D2D;">pass@1</td>
363
+ <td style="text-align:right; background-color: #FFFFFF; color: #2D2D2D;">40.75</td>
364
+ <td style="text-align:right; background-color: #DAE8FF; color: #2D2D2D;">47.63</td>
365
+ <td style="text-align:right; background-color: #FFFFFF; color: #2D2D2D;">55.75</td>
366
+ </tr>
367
+ <tr>
368
+ <td style="text-align:left; background-color: #FFFFFF; color: #2D2D2D;">BigCodeBench</td>
369
+ <td style="text-align:left; background-color: #FFFFFF; color: #2D2D2D;">pass@1</td>
370
+ <td style="text-align:right; background-color: #FFFFFF; color: #2D2D2D;">32.19</td>
371
+ <td style="text-align:right; background-color: #DAE8FF; color: #2D2D2D;">35.00</td>
372
+ <td style="text-align:right; background-color: #FFFFFF; color: #2D2D2D;">38.77</td>
373
+ </tr>
374
+ <tr>
375
+ <td style="text-align:left; background-color: #FFFFFF; color: #2D2D2D;">MULTIPLE</td>
376
+ <td style="text-align:left; background-color: #FFFFFF; color: #2D2D2D;">pass@1</td>
377
+ <td style="text-align:right; background-color: #FFFFFF; color: #2D2D2D;">52.54</td>
378
+ <td style="text-align:right; background-color: #DAE8FF; color: #2D2D2D;">60.26</td>
379
+ <td style="text-align:right; background-color: #FFFFFF; color: #2D2D2D;">62.31</td>
380
+ </tr>
381
+ <tr>
382
+ <tr>
383
+ <td style="text-align:left; background-color: #FFFFFF; color: #2D2D2D;">Eval+ Avg</td>
384
+ <td style="text-align:left; background-color: #FFFFFF; color: #2D2D2D;">pass@1</td>
385
+ <td style="text-align:right; background-color: #FFFFFF; color: #2D2D2D;">67.05</td>
386
+ <td style="text-align:right; background-color: #DAE8FF; color: #2D2D2D;">80.21</td>
387
+ <td style="text-align:right; background-color: #FFFFFF; color: #2D2D2D;">82.66</td>
388
+ </tr>
389
+ <tr>
390
+ <td colspan="5" style="text-align:center; background-color: #FFFFFF; color: #2D2D2D; font-style:italic;">
391
+ Tool Calling Tasks
392
+ </td>
393
+ </tr>
394
+ <tr>
395
+ <td style="text-align:left; background-color: #FFFFFF; color: #2D2D2D;">BFCL v3</td>
396
+ <td style="text-align:left; background-color: #FFFFFF; color: #2D2D2D;"></td>
397
+ <td style="text-align:right; background-color: #FFFFFF; color: #2D2D2D;">60.80</td>
398
+ <td style="text-align:right; background-color: #DAE8FF; color: #2D2D2D;">68.27</td>
399
+ <td style="text-align:right; background-color: #FFFFFF; color: #2D2D2D;">73.68</td>
400
+ </tr>
401
+ <tr>
402
+ <td colspan="5" style="text-align:center; background-color: #FFFFFF; color: #2D2D2D; font-style:italic;">
403
+ Multilingual Tasks
404
+ </td>
405
+ </tr>
406
+ <tr>
407
+ <td style="text-align:left; background-color: #FFFFFF; color: #2D2D2D;">MMMLU</td>
408
+ <td style="text-align:left; background-color: #FFFFFF; color: #2D2D2D;">5-shot</td>
409
+ <td style="text-align:right; background-color: #FFFFFF; color: #2D2D2D;">57.61</td>
410
+ <td style="text-align:right; background-color: #DAE8FF; color: #2D2D2D;">64.84</td>
411
+ <td style="text-align:right; background-color: #FFFFFF; color: #2D2D2D;">73.71</td>
412
+ </tr>
413
+ <tr>
414
+ <td style="text-align:left; background-color: #FFFFFF; color: #2D2D2D;">INCLUDE</td>
415
+ <td style="text-align:left; background-color: #FFFFFF; color: #2D2D2D;">5-shot</td>
416
+ <td style="text-align:right; background-color: #FFFFFF; color: #2D2D2D;">52.05</td>
417
+ <td style="text-align:right; background-color: #DAE8FF; color: #2D2D2D;">58.89</td>
418
+ <td style="text-align:right; background-color: #FFFFFF; color: #2D2D2D;">67.26</td>
419
+ </tr>
420
+ <tr>
421
+ <td style="text-align:left; background-color: #FFFFFF; color: #2D2D2D;">MGSM</td>
422
+ <td style="text-align:left; background-color: #FFFFFF; color: #2D2D2D;">8-shot</td>
423
+ <td style="text-align:right; background-color: #FFFFFF; color: #2D2D2D;">70.00</td>
424
+ <td style="text-align:right; background-color: #DAE8FF; color: #2D2D2D;">82.32</td>
425
+ <td style="text-align:right; background-color: #FFFFFF; color: #2D2D2D;">71.12</td>
426
+ </tr>
427
+ <tr>
428
+ <td colspan="6" style="text-align:center; background-color: #FFFFFF; color: #2D2D2D; font-style:italic;">
429
+ Safety
430
+ </td>
431
+ </tr>
432
+ <tr>
433
+ <td style="text-align:left; background-color: #FFFFFF; color: #2D2D2D;">SALAD-Bench</td>
434
+ <td style="text-align:left; background-color: #FFFFFF; color: #2D2D2D;"></td>
435
+ <td style="text-align:right; background-color: #FFFFFF; color: #2D2D2D;">93.95</td>
436
+ <td style="text-align:right; background-color: #DAE8FF; color: #2D2D2D;">95.80</td>
437
+ <td style="text-align:right; background-color: #FFFFFF; color: #2D2D2D;">96.41</td>
438
+ </tr>
439
+ <tr>
440
+ <td style="text-align:left; background-color: #FFFFFF; color: #2D2D2D;">AttaQ</td>
441
+ <td style="text-align:left; background-color: #FFFFFF; color: #2D2D2D;"></td>
442
+ <td style="text-align:right; background-color: #FFFFFF; color: #2D2D2D;">81.88</td>
443
+ <td style="text-align:right; background-color: #DAE8FF; color: #2D2D2D;">81.19</td>
444
+ <td style="text-align:right; background-color: #FFFFFF; color: #2D2D2D;">85.76</td>
445
+ </tr>
446
+ <tr>
447
+ <td style="text-align:left; background-color: #FFFFFF; color: #2D2D2D;">Tulu3 Safety Eval Avg</td>
448
+ <td style="text-align:left; background-color: #FFFFFF; color: #2D2D2D;"></td>
449
+ <td style="text-align:right; background-color: #FFFFFF; color: #2D2D2D;">66.84</td>
450
+ <td style="text-align:right; background-color: #DAE8FF; color: #2D2D2D;">75.57</td>
451
+ <td style="text-align:right; background-color: #FFFFFF; color: #2D2D2D;">78.19</td>
452
+ </tr>
453
+ </tbody></table>
454
+
455
+
456
+ <table>
457
+ <caption><b>Multilingual Benchmarks and the included languages:</b></caption>
458
+ <thead>
459
+ <tr>
460
+ <th style="text-align:left; background-color: #001d6c; color: white;">Benchmarks</th>
461
+ <th style="text-align:left; background-color: #001d6c; color: white;"># Langs</th>
462
+ <th style="text-align:center; background-color: #001d6c; color: white;">Languages</th>
463
+ </tr>
464
+ </thead>
465
+ <tbody>
466
+ <tr>
467
+ <td style="text-align:left; background-color: #FFFFFF; color: #2D2D2D;">MMMLU</td>
468
+ <td style="text-align:center; background-color: #FFFFFF; color: #2D2D2D;">11</td>
469
+ <td style="text-align:left; background-color: #FFFFFF; color: #2D2D2D;">ar, de, en, es, fr, ja, ko, pt, zh, bn, hi</td>
470
+ </tr>
471
+ <tr>
472
+ <td style="text-align:left; background-color: #FFFFFF; color: #2D2D2D;">INCLUDE</td>
473
+ <td style="text-align:center; background-color: #FFFFFF; color: #2D2D2D;">14</td>
474
+ <!-- <td style="text-align:left; background-color: #FFFFFF; color: #2D2D2D;">hindi, bengali, tamil, telugu, arabic, german, spanish, french, italian, japanese, korean, dutch, portuguese, chinese</td> -->
475
+ <td style="text-align:left; background-color: #FFFFFF; color: #2D2D2D;">hi, bn, ta, te, ar, de, es, fr, it, ja, ko, nl, pt, zh</td>
476
+
477
+ </tr>
478
+ <tr>
479
+ <td style="text-align:left; background-color: #FFFFFF; color: #2D2D2D;">MGSM</td>
480
+ <td style="text-align:center; background-color: #FFFFFF; color: #2D2D2D;">5</td>
481
+ <td style="text-align:left; background-color: #FFFFFF; color: #2D2D2D;">en, es, fr, ja, zh</td>
482
+ </tr>
483
+ </tbody>
484
+ </table>
485
+
486
+ **Model Architecture:**
487
+
488
+ Granite-4.1-8B baseline is built on a decoder-only dense transformer architecture. Core components of this architecture are: GQA, RoPE, MLP with SwiGLU, RMSNorm, and shared input/output embeddings.
489
+
490
+ <table>
491
+ <thead>
492
+ <tr>
493
+ <th style="text-align:left; background-color: #001d6c; color: white;">Model</th>
494
+ <th style="text-align:center; background-color: #001d6c; color: white;">3B Dense</th>
495
+ <th style="text-align:center; background-color: #001d6c; color: white;">8B Dense</th>
496
+ <th style="text-align:center; background-color: #001d6c; color: white;">30B Dense</th>
497
+ </tr></thead>
498
+ <tbody>
499
+ <tr>
500
+ <td style="text-align:left; background-color: #FFFFFF; color: black;">Embedding size</td>
501
+ <td style="text-align:center; background-color: #FFFFFF; color: black;">2560</td>
502
+ <td style="text-align:center; background-color: #DAE8FF; color: black;">4096</td>
503
+ <td style="text-align:center; background-color: #FFFFFF; color: black;">4096</td>
504
+ </tr>
505
+ <tr>
506
+ <td style="text-align:left; background-color: #FFFFFF; color: black;">Number of layers</td>
507
+ <td style="text-align:center; background-color: #FFFFFF; color: black;">40</td>
508
+ <td style="text-align:center; background-color: #DAE8FF; color: black;">40</td>
509
+ <td style="text-align:center; background-color: #FFFFFF; color: black;">64</td>
510
+ </tr>
511
+ <tr>
512
+ <td style="text-align:left; background-color: #FFFFFF; color: black;">Attention head size</td>
513
+ <td style="text-align:center; background-color: #FFFFFF; color: black;">64</td>
514
+ <td style="text-align:center; background-color: #DAE8FF; color: black;">128</td>
515
+ <td style="text-align:center; background-color: #FFFFFF; color: black;">128</td>
516
+ </tr>
517
+ <tr>
518
+ <td style="text-align:left; background-color: #FFFFFF; color: black;">Number of attention heads</td>
519
+ <td style="text-align:center; background-color: #FFFFFF; color: black;">40</td>
520
+ <td style="text-align:center; background-color: #DAE8FF; color: black;">32</td>
521
+ <td style="text-align:center; background-color: #FFFFFF; color: black;">32</td>
522
+ </tr>
523
+ <tr>
524
+ <td style="text-align:left; background-color: #FFFFFF; color: black;">Number of KV heads</td>
525
+ <td style="text-align:center; background-color: #FFFFFF; color: black;">8</td>
526
+ <td style="text-align:center; background-color: #DAE8FF; color: black;">8</td>
527
+ <td style="text-align:center; background-color: #FFFFFF; color: black;">8</td>
528
+ </tr>
529
+ <!--<tr>
530
+ <td style="text-align:left; background-color: #FFFFFF; color: black;">Mamba2 state size</td>
531
+ <td style="text-align:center; background-color: #FFFFFF; color: black;">-</td>
532
+ <td style="text-align:center; background-color: #DAE8FF; color: black;"></td>
533
+ <td style="text-align:center; background-color: #FFFFFF; color: black;"></td>
534
+ </tr>
535
+ <tr>
536
+ <td style="text-align:left; background-color: #FFFFFF; color: black;">Number of Mamba2 heads</td>
537
+ <td style="text-align:center; background-color: #FFFFFF; color: black;"></td>
538
+ <td style="text-align:center; background-color: #DAE8FF; color: black;"></td>
539
+ <td style="text-align:center; background-color: #FFFFFF; color: black;"></td>
540
+ </tr>-->
541
+
542
+ <tr>
543
+ <td style="text-align:left; background-color: #FFFFFF; color: black;">MLP / Shared expert hidden size</td>
544
+ <td style="text-align:center; background-color: #FFFFFF; color: black;">8192</td>
545
+ <td style="text-align:center; background-color: #DAE8FF; color: black;">12800</td>
546
+ <td style="text-align:center; background-color: #FFFFFF; color: black;">32768</td>
547
+ </tr>
548
+ <!--<tr>
549
+ <td style="text-align:left; background-color: #FFFFFF; color: black;">Num. Experts</td>
550
+ <td style="text-align:center; background-color: #FFFFFF; color: black;"></td>
551
+ <td style="text-align:center; background-color: #DAE8FF; color: black;"></td>
552
+ <td style="text-align:center; background-color: #FFFFFF; color: black;"></td>
553
+ </tr>
554
+ <tr>
555
+ <td style="text-align:left; background-color: #FFFFFF; color: black;">Num. active Experts</td>
556
+ <td style="text-align:center; background-color: #FFFFFF; color: black;"></td>
557
+ <td style="text-align:center; background-color: #DAE8FF; color: black;"></td>
558
+ <td style="text-align:center; background-color: #FFFFFF; color: black;"></td>
559
+ </tr>
560
+ <tr>
561
+ <td style="text-align:left; background-color: #FFFFFF; color: black;">Expert hidden size</td>
562
+ <td style="text-align:center; background-color: #FFFFFF; color: black;"></td>
563
+ <td style="text-align:center; background-color: #DAE8FF; color: black;"></td>
564
+ <td style="text-align:center; background-color: #FFFFFF; color: black;"></td>
565
+ </tr>-->
566
+
567
+ <tr>
568
+ <td style="text-align:left; background-color: #FFFFFF; color: black;">MLP activation</td>
569
+ <td style="text-align:center; background-color: #FFFFFF; color: black;">SwiGLU</td>
570
+ <td style="text-align:center; background-color: #DAE8FF; color: black;">SwiGLU</td>
571
+ <td style="text-align:center; background-color: #FFFFFF; color: black;">SwiGLU</td>
572
+ </tr>
573
+
574
+ <tr>
575
+ <td style="text-align:left; background-color: #FFFFFF; color: black;">Sequence length</td>
576
+ <td style="text-align:center; background-color: #FFFFFF; color: black;">131072</td>
577
+ <td style="text-align:center; background-color: #DAE8FF; color: black;">131072</td>
578
+ <td style="text-align:center; background-color: #FFFFFF; color: black;">131072</td>
579
+ </tr>
580
+ <tr>
581
+ <td style="text-align:left; background-color: #FFFFFF; color: black;">Position embedding</td>
582
+ <td style="text-align:center; background-color: #FFFFFF; color: black;">RoPE</td>
583
+ <td style="text-align:center; background-color: #DAE8FF; color: black;">RoPE</td>
584
+ <td style="text-align:center; background-color: #FFFFFF; color: black;">RoPE</td>
585
+ </tr>
586
+ <tr>
587
+ <td style="text-align:left; background-color: #FFFFFF; color: black;"># Parameters</td>
588
+ <td style="text-align:center; background-color: #FFFFFF; color: black;">3B</td>
589
+ <td style="text-align:center; background-color: #DAE8FF; color: black;">8B</td>
590
+ <td style="text-align:center; background-color: #FFFFFF; color: black;">30B</td>
591
+ </tr>
592
+ <!-- <tr>
593
+ <td style="text-align:left; background-color: #FFFFFF; color: black;"># Active parameters</td>
594
+ <td style="text-align:center; background-color: #FFFFFF; color: black;"></td>
595
+ <td style="text-align:center; background-color: #DAE8FF; color: black;"></td>
596
+ <td style="text-align:center; background-color: #FFFFFF; color: black;"></td>
597
+ </tr>-->
598
+ </tbody></table>
599
+
600
+
601
+
602
+ **Training Data:**
603
+ Overall, our SFT data is largely comprised of three key sources: (1) publicly available datasets with permissive license, (2) internal synthetic data targeting specific capabilities, and (3) a select set of human-curated data.
604
+
605
+ **Supervised Fine-Tunning and Reinforcement Learning:**
606
+ Instruct model has been fine tuned with significantly improved SFT-pipeline and Reinforcement learning pipelines with high quality mix of various datasets as mentioned above. With rigorus SFT-RL cycles we have improved Granite-4.1 model's tool calling, instruction following and chat capabilities. For further details please check our [Granite-4.1 Blog]((https://huggingface.co/blog/ibm-granite/granit-4-1)).
607
+
608
+ **Infrastructure:**
609
+ We trained the Granite 4.1 Language Models utilizing an NVIDIA GB200 NVL72 cluster hosted in CoreWeave. Intra-rack communication occurs via the 72-GPU NVLink domain, and a non-blocking, full Fat-Tree NDR 400 Gb/s InfiniBand network provides inter-rack communication. This cluster provides a scalable and efficient infrastructure for training our models over thousands of GPUs.
610
+
611
+ **Ethical Considerations and Limitations:**
612
+ Granite 4.1 Instruction Models are primarily finetuned using instruction-response pairs mostly in English, but also multilingual data covering multiple languages. Although this model can handle multilingual dialog use cases, its performance might not be similar to English tasks. In such case, introducing a small number of examples (few-shot) can help the model in generating more accurate outputs. While this model has been aligned by keeping safety in consideration, the model may in some cases produce inaccurate, biased, or unsafe responses to user prompts. So we urge the community to use this model with proper safety testing and tuning tailored for their specific tasks.
613
+
614
+ **Resources**
615
+ - ⭐️ Learn about the latest updates with Granite: https://www.ibm.com/granite
616
+ - 📄 Get started with tutorials, best practices, and prompt engineering advice: https://www.ibm.com/granite/docs/
617
+ - 💡 Learn about the latest Granite learning resources: https://ibm.biz/granite-learning-resources
618
+
619
+ <!-- ## Citation
620
+ ```
621
+ @misc{granite-models,
622
+ author = {author 1, author2, ...},
623
+ title = {},
624
+ journal = {},
625
+ volume = {},
626
+ year = {2024},
627
+ url = {https://arxiv.org/abs/0000.00000},
628
+ }
629
+ ``` -->