Normalized metadata (stored in metadata_json)
{
"metadata": {},
"card_data": {
"license": "apache-2.0",
"library_name": "transformers",
"tags": [
"language",
"unsloth",
"granite-4.0"
],
"base_model": [
"ibm-granite/granite-4.0-h-1b"
],
"frontmatter": {
"license": "apache-2.0",
"library_name": "transformers",
"tags": [
"language",
"unsloth",
"granite-4.0"
],
"base_model": [
"ibm-granite/granite-4.0-h-1b"
]
},
"hero_image_url": "https://github.com/unslothai/unsloth/raw/main/images/unsloth%20new%20logo.png",
"summary": "**Model Summary:** Granite-4.0-H-1B is a lightweight instruct model finetuned from *Granite-4.0-H-1B-Base* using a combination of open source instruction datasets with permissive license and internally collected synthetic datasets. This model is developed using a diverse set of techniques including supervised finetuning, reinforcement learning, and model merging. **Supported Languages:** English, German, Spanish, French, Japanese, Portuguese, Arabic, Czech, Italian, Korean, Dutch, and Chinese. Users may fine-tune Granite 4.0 Nano models to support languages beyond those included in this list. **Intended use:** Granite 4.0 Nano instruct models feature strong instruction following capabilities bringing advanced AI capabilities within reach for on-device deployments and research use cases. Additionally, their compact size makes them well-suited for fine-tuning on specialized domains without requiring massive compute resources. *Capabilities* * Summarization * Text classification * Text extraction * Question-answering * Retrieval Augmented Generation (RAG) * Code related tasks * Function-calling tasks * Multilingual dialog use cases * Fill-In-the-Middle (FIM) code completions Need to test the examples. (especially the tool calling and RAG ones) --> **Generation:** This is a simple example of how to use Granite-4.0-H-1B model. Install the following libraries: ``shell pip install torch torchvision torchaudio pip install accelerate pip install transformers ` Then, copy the snippet from the section that is relevant for your use case. `python import torch from transformers import AutoModelForCausalLM, AutoTokenizer device = \"cuda\" model_path = \"ibm-granite/granite-4.0-h-1b\" tokenizer = AutoTokenizer.from_pretrained(model_path) # drop device_map if running on CPU model = AutoModelForCausalLM.from_pretrained(model_path, device_map=device) model.eval() # change input text as desired chat = [ { \"role\": \"user\", \"content\": \"Please list one IBM Research laboratory located in the United States. You should only output its name and location.\" }, ] chat = tokenizer.apply_chat_template(chat, tokenize=False, add_generation_prompt=True) # tokenize the text input_tokens = tokenizer(chat, return_tensors=\"pt\").to(device) # generate output tokens output = model.generate(**input_tokens, max_new_tokens=100) # decode output tokens into text output = tokenizer.batch_decode(output) # print output print(output[0]) ` Expected output: `shell userPlease list one IBM Research laboratory located in the United States. You should only output its name and location. assistantAlmaden Research Center, San Jose, California ` **Tool-calling:** Granite-4.0-H-1B 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. This is an example of how to use Granite-4.0-H-1B model tool-calling ability: `python import torch from transformers import AutoModelForCausalLM, AutoTokenizer device = \"cuda\" model_path = \"ibm-granite/granite-4.0-h-1b\" tokenizer = AutoTokenizer.from_pretrained(model_path) # drop device_map if running on CPU model = AutoModelForCausalLM.from_pretrained(model_path, device_map=device) model.eval() tools = [ { \"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\"] } } } ] # change input text as desired chat = [ { \"role\": \"user\", \"content\": \"What's the weather like in Boston right now?\" }, ] chat = tokenizer.apply_chat_template(chat, \\ tokenize=False, \\ tools=tools, \\ add_generation_prompt=True) # tokenize the text input_tokens = tokenizer(chat, return_tensors=\"pt\").to(device) # generate output tokens output = model.generate(**input_tokens, max_new_tokens=100) # decode output tokens into text output = tokenizer.batch_decode(output) # print output print(output[0]) ` Expected output: `shell systemYou are a helpful assistant with access to the following tools. You may call one or more tools to assist with the user query. You are provided with function signatures within XML tags: {\"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\"]}}} For each tool call, return a json object with function name and arguments within XML tags: {\"name\": , \"arguments\": } . 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. userWhat's the weather like in Boston right now? assistant {\"name\": \"get_current_weather\", \"arguments\": {\"city\": \"Boston\"}} ` **Evaluation Results:** Benchmarks Metric 350M Dense H 350M Dense 1B Dense H 1B Dense General Tasks MMLU 5-shot 35.01 36.21 59.39 59.74 MMLU-Pro 5-shot, CoT 12.13 14.38 34.02 32.86 BBH 3-shot, CoT 33.07 33.28 60.37 59.68 AGI EVAL 0-shot, CoT 26.22 29.61 49.22 52.44 GPQA 0-shot, CoT 24.11 26.12 29.91 29.69 Alignment Tasks IFEval Instruct, Strict 61.63 67.63 80.82 82.37 IFEval Prompt, Strict 49.17 55.64 73.94 74.68 IFEval Average 55.4 61.63 77.38 78.53 Math Tasks GSM8K 8-shot 30.71 39.27 76.35 69.83 GSM Symbolic 8-shot 26.76 33.7 72.3 65.72 Minerva Math 0-shot, CoT 13.04 5.76 45.28 49.4 DeepMind Math 0-shot, CoT 8.45 6.2 34 34.98 Code Tasks HumanEval pass@1 39 38 74 73 HumanEval+ pass@1 37 35 69 68 MBPP pass@1 48 49 65 69 MBPP+ pass@1 38 44 57 60 CRUXEval-O pass@1 23.75 25.5 33.13 36 BigCodeBench pass@1 11.14 11.23 30.18 29.12 Tool Calling Tasks BFCL v3 39.32 43.32 54.82 50.21 Multilingual Tasks MULTIPLE pass@1 15.99 14.31 32.24 36.11 MMMLU 5-shot 28.23 27.95 45 49.43 INCLUDE 5-shot 27.74 27.09 42.12 43.35 MGSM 8-shot 14.72 16.16 37.84 27.52 Safety SALAD-Bench 97.12 96.55 93.44 96.4 AttaQ 82.53 81.76 85.26 82.85 Multilingual Benchmarks and thr included languages: Benchmarks # Langs Languages MMMLU 11 ar, de, en, es, fr, ja, ko, pt, zh, bn, hi INCLUDE 14 hi, bn, ta, te, ar, de, es, fr, it, ja, ko, nl, pt, zh MGSM 5 en, es, fr, ja, zh **Model Architecture:** Granite-4.0-H-1B baseline is based on a decoder-only dense transformer architecture. Core components of this architecture are: GQA, Mamba2, MLP with SwiGLU, RMSNorm, and shared input/output embeddings. Model 350M Dense H 350M Dense 1B Dense H 1B Dense Embedding size 1024 768 2048 1536 Number of layers 28 attention 4 attention / 28 Mamba2 40 attention 4 attention / 36 Mamba2 Attention head size 64 64 128 128 Number of attention heads 16 12 16 12 Number of KV heads 4 4 4 4 Mamba2 state size - 128 - 128 Number of Mamba2 heads - 48 - 48 MLP / Shared expert hidden size 2048 2048 4096 4096 Num. Experts - - - - Num. active Experts - - - - Expert hidden size - - - - MLP activation SwiGLU SwiGLU SwiGLU SwiGLU Sequence length 32K 32K 128K 128K Position embedding RoPE NoPE RoPE NoPE # Parameters 350M 340M 1.6B 1.5B # Active parameters 350M 340M 1.6B 1.5B **Training Data:** 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. **Infrastructure:** We trained the Granite 4.0 Nano 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. **Ethical Considerations and Limitations:** Granite 4.0 Nano Instruct 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. **Resources**",
"quick_links": [],
"benchmark_table_html": "<table>\n<thead>\n <tr>\n <th style=\"text-align:left; background-color: #001d6c; color: white;\">Benchmarks</th>\n <th style=\"text-align:left; background-color: #001d6c; color: white;\">Metric</th>\n <th style=\"text-align:center; background-color: #001d6c; color: white;\">350M Dense</th>\n <th style=\"text-align:center; background-color: #001d6c; color: white;\">H 350M Dense</th>\n <th style=\"text-align:center; background-color: #001d6c; color: white;\">1B Dense</th>\n <th style=\"text-align:center; background-color: #001d6c; color: white;\">H 1B Dense</th>\n </tr>\n</thead>\n <tbody>\n<tr>\n <td colspan=\"6\" style=\"text-align:center; background-color: #FFFFFF; color: #2D2D2D; font-style:italic;\">\n General Tasks\n </td>\n</tr>\n<tr>\n <td style=\"text-align:left; background-color: #FFFFFF; color: #2D2D2D;\">MMLU</td>\n <td style=\"text-align:left; background-color: #FFFFFF; color: #2D2D2D;\">5-shot</td>\n <td style=\"text-align:right; background-color: #FFFFFF; color: #2D2D2D;\">35.01</td> \n <td style=\"text-align:right; background-color: #FFFFFF; color: #2D2D2D;\">36.21</td>\n <td style=\"text-align:right; background-color: #FFFFFF; color: #2D2D2D;\">59.39</td>\n <td style=\"text-align:right; background-color: #DAE8FF; color: #2D2D2D;\">59.74</td>\n</tr>\n<tr>\n <td style=\"text-align:left; background-color: #FFFFFF; color: #2D2D2D;\">MMLU-Pro</td>\n <td style=\"text-align:left; background-color: #FFFFFF; color: #2D2D2D;\">5-shot, CoT</td>\n <td style=\"text-align:right; background-color: #FFFFFF; color: #2D2D2D;\">12.13</td> \n <td style=\"text-align:right; background-color: #FFFFFF; color: #2D2D2D;\">14.38</td>\n <td style=\"text-align:right; background-color: #FFFFFF; color: #2D2D2D;\">34.02</td>\n <td style=\"text-align:right; background-color: #DAE8FF; color: #2D2D2D;\">32.86</td>\n</tr>\n<tr>\n <td style=\"text-align:left; background-color: #FFFFFF; color: #2D2D2D;\">BBH</td>\n <td style=\"text-align:left; background-color: #FFFFFF; color: #2D2D2D;\">3-shot, CoT</td>\n <td style=\"text-align:right; background-color: #FFFFFF; color: #2D2D2D;\">33.07</td> \n <td style=\"text-align:right; background-color: #FFFFFF; color: #2D2D2D;\">33.28</td>\n <td style=\"text-align:right; background-color: #FFFFFF; color: #2D2D2D;\">60.37</td>\n <td style=\"text-align:right; background-color: #DAE8FF; color: #2D2D2D;\">59.68</td>\n</tr>\n<tr>\n <td style=\"text-align:left; background-color: #FFFFFF; color: #2D2D2D;\">AGI EVAL</td>\n <td style=\"text-align:left; background-color: #FFFFFF; color: #2D2D2D;\">0-shot, CoT</td>\n <td style=\"text-align:right; background-color: #FFFFFF; color: #2D2D2D;\">26.22</td> \n <td style=\"text-align:right; background-color: #FFFFFF; color: #2D2D2D;\">29.61</td>\n <td style=\"text-align:right; background-color: #FFFFFF; color: #2D2D2D;\">49.22</td>\n <td style=\"text-align:right; background-color: #DAE8FF; color: #2D2D2D;\">52.44</td>\n</tr>\n<tr>\n <td style=\"text-align:left; background-color: #FFFFFF; color: #2D2D2D;\">GPQA</td>\n <td style=\"text-align:left; background-color: #FFFFFF; color: #2D2D2D;\">0-shot, CoT</td>\n <td style=\"text-align:right; background-color: #FFFFFF; color: #2D2D2D;\">24.11</td> \n <td style=\"text-align:right; background-color: #FFFFFF; color: #2D2D2D;\">26.12</td>\n <td style=\"text-align:right; background-color: #FFFFFF; color: #2D2D2D;\">29.91</td>\n <td style=\"text-align:right; background-color: #DAE8FF; color: #2D2D2D;\">29.69</td>\n</tr>\n<tr>\n <td colspan=\"6\" style=\"text-align:center; background-color: #FFFFFF; color: #2D2D2D; font-style:italic;\">\n Alignment Tasks\n </td>\n</tr>\n<tr>\n <td style=\"text-align:left; background-color: #FFFFFF; color: #2D2D2D;\">IFEval</td>\n <td style=\"text-align:left; background-color: #FFFFFF; color: #2D2D2D;\">Instruct, Strict</td>\n <td style=\"text-align:right; background-color: #FFFFFF; color: #2D2D2D;\">61.63</td> \n <td style=\"text-align:right; background-color: #FFFFFF; color: #2D2D2D;\">67.63</td>\n <td style=\"text-align:right; background-color: #FFFFFF; color: #2D2D2D;\">80.82</td>\n <td style=\"text-align:right; background-color: #DAE8FF; color: #2D2D2D;\">82.37</td>\n</tr>\n<tr>\n <td style=\"text-align:left; background-color: #FFFFFF; color: #2D2D2D;\">IFEval</td>\n <td style=\"text-align:left; background-color: #FFFFFF; color: #2D2D2D;\">Prompt, Strict</td>\n <td style=\"text-align:right; background-color: #FFFFFF; color: #2D2D2D;\">49.17</td> \n <td style=\"text-align:right; background-color: #FFFFFF; color: #2D2D2D;\">55.64</td>\n <td style=\"text-align:right; background-color: #FFFFFF; color: #2D2D2D;\">73.94</td>\n <td style=\"text-align:right; background-color: #DAE8FF; color: #2D2D2D;\">74.68</td>\n</tr>\n<tr>\n <td style=\"text-align:left; background-color: #FFFFFF; color: #2D2D2D;\">IFEval</td>\n <td style=\"text-align:left; background-color: #FFFFFF; color: #2D2D2D;\">Average</td>\n <td style=\"text-align:right; background-color: #FFFFFF; color: #2D2D2D;\">55.4</td> \n <td style=\"text-align:right; background-color: #FFFFFF; color: #2D2D2D;\">61.63</td>\n <td style=\"text-align:right; background-color: #FFFFFF; color: #2D2D2D;\">77.38</td>\n <td style=\"text-align:right; background-color: #DAE8FF; color: #2D2D2D;\">78.53</td>\n</tr>\n<tr>\n <td colspan=\"6\" style=\"text-align:center; background-color: #FFFFFF; color: #2D2D2D; font-style:italic;\">\n Math Tasks\n </td>\n</tr> \n<tr>\n <td style=\"text-align:left; background-color: #FFFFFF; color: #2D2D2D;\">GSM8K</td>\n <td style=\"text-align:left; background-color: #FFFFFF; color: #2D2D2D;\">8-shot</td>\n <td style=\"text-align:right; background-color: #FFFFFF; color: #2D2D2D;\">30.71</td> \n <td style=\"text-align:right; background-color: #FFFFFF; color: #2D2D2D;\">39.27</td>\n <td style=\"text-align:right; background-color: #FFFFFF; color: #2D2D2D;\">76.35</td>\n <td style=\"text-align:right; background-color: #DAE8FF; color: #2D2D2D;\">69.83</td>\n</tr>\n<tr>\n <td style=\"text-align:left; background-color: #FFFFFF; color: #2D2D2D;\">GSM Symbolic</td>\n <td style=\"text-align:left; background-color: #FFFFFF; color: #2D2D2D;\">8-shot</td>\n <td style=\"text-align:right; background-color: #FFFFFF; color: #2D2D2D;\">26.76</td> \n <td style=\"text-align:right; background-color: #FFFFFF; color: #2D2D2D;\">33.7</td>\n <td style=\"text-align:right; background-color: #FFFFFF; color: #2D2D2D;\">72.3</td>\n <td style=\"text-align:right; background-color: #DAE8FF; color: #2D2D2D;\">65.72</td>\n</tr>\n<tr>\n <td style=\"text-align:left; background-color: #FFFFFF; color: #2D2D2D;\">Minerva Math</td>\n <td style=\"text-align:left; background-color: #FFFFFF; color: #2D2D2D;\">0-shot, CoT</td>\n <td style=\"text-align:right; background-color: #FFFFFF; color: #2D2D2D;\">13.04</td> \n <td style=\"text-align:right; background-color: #FFFFFF; color: #2D2D2D;\">5.76</td>\n <td style=\"text-align:right; background-color: #FFFFFF; color: #2D2D2D;\">45.28</td>\n <td style=\"text-align:right; background-color: #DAE8FF; color: #2D2D2D;\">49.4</td>\n</tr>\n<tr>\n <td style=\"text-align:left; background-color: #FFFFFF; color: #2D2D2D;\">DeepMind Math</td>\n <td style=\"text-align:left; background-color: #FFFFFF; color: #2D2D2D;\">0-shot, CoT</td>\n <td style=\"text-align:right; background-color: #FFFFFF; color: #2D2D2D;\">8.45</td> \n <td style=\"text-align:right; background-color: #FFFFFF; color: #2D2D2D;\">6.2</td>\n <td style=\"text-align:right; background-color: #FFFFFF; color: #2D2D2D;\">34</td>\n <td style=\"text-align:right; background-color: #DAE8FF; color: #2D2D2D;\">34.98</td>\n</tr>\n<tr>\n <td colspan=\"6\" style=\"text-align:center; background-color: #FFFFFF; color: #2D2D2D; font-style:italic;\">\n Code Tasks\n </td>\n</tr> \n<tr>\n <td style=\"text-align:left; background-color: #FFFFFF; color: #2D2D2D;\">HumanEval</td>\n <td style=\"text-align:left; background-color: #FFFFFF; color: #2D2D2D;\">pass@1</td>\n <td style=\"text-align:right; background-color: #FFFFFF; color: #2D2D2D;\">39</td> \n <td style=\"text-align:right; background-color: #FFFFFF; color: #2D2D2D;\">38</td>\n <td style=\"text-align:right; background-color: #FFFFFF; color: #2D2D2D;\">74</td>\n <td style=\"text-align:right; background-color: #DAE8FF; color: #2D2D2D;\">73</td>\n</tr>\n<tr>\n <td style=\"text-align:left; background-color: #FFFFFF; color: #2D2D2D;\">HumanEval+</td>\n <td style=\"text-align:left; background-color: #FFFFFF; color: #2D2D2D;\">pass@1</td>\n <td style=\"text-align:right; background-color: #FFFFFF; color: #2D2D2D;\">37</td> \n <td style=\"text-align:right; background-color: #FFFFFF; color: #2D2D2D;\">35</td>\n <td style=\"text-align:right; background-color: #FFFFFF; color: #2D2D2D;\">69</td>\n <td style=\"text-align:right; background-color: #DAE8FF; color: #2D2D2D;\">68</td>\n</tr>\n<tr>\n <td style=\"text-align:left; background-color: #FFFFFF; color: #2D2D2D;\">MBPP</td>\n <td style=\"text-align:left; background-color: #FFFFFF; color: #2D2D2D;\">pass@1</td>\n <td style=\"text-align:right; background-color: #FFFFFF; color: #2D2D2D;\">48</td> \n <td style=\"text-align:right; background-color: #FFFFFF; color: #2D2D2D;\">49</td>\n <td style=\"text-align:right; background-color: #FFFFFF; color: #2D2D2D;\">65</td>\n <td style=\"text-align:right; background-color: #DAE8FF; color: #2D2D2D;\">69</td>\n</tr>\n<tr>\n <td style=\"text-align:left; background-color: #FFFFFF; color: #2D2D2D;\">MBPP+</td>\n <td style=\"text-align:left; background-color: #FFFFFF; color: #2D2D2D;\">pass@1</td>\n <td style=\"text-align:right; background-color: #FFFFFF; color: #2D2D2D;\">38</td> \n <td style=\"text-align:right; background-color: #FFFFFF; color: #2D2D2D;\">44</td>\n <td style=\"text-align:right; background-color: #FFFFFF; color: #2D2D2D;\">57</td>\n <td style=\"text-align:right; background-color: #DAE8FF; color: #2D2D2D;\">60</td>\n</tr>\n<tr>\n <td style=\"text-align:left; background-color: #FFFFFF; color: #2D2D2D;\">CRUXEval-O</td>\n <td style=\"text-align:left; background-color: #FFFFFF; color: #2D2D2D;\">pass@1</td>\n <td style=\"text-align:right; background-color: #FFFFFF; color: #2D2D2D;\">23.75</td> \n <td style=\"text-align:right; background-color: #FFFFFF; color: #2D2D2D;\">25.5</td>\n <td style=\"text-align:right; background-color: #FFFFFF; color: #2D2D2D;\">33.13</td>\n <td style=\"text-align:right; background-color: #DAE8FF; color: #2D2D2D;\">36</td>\n</tr>\n<tr>\n <td style=\"text-align:left; background-color: #FFFFFF; color: #2D2D2D;\">BigCodeBench</td>\n <td style=\"text-align:left; background-color: #FFFFFF; color: #2D2D2D;\">pass@1</td>\n <td style=\"text-align:right; background-color: #FFFFFF; color: #2D2D2D;\">11.14</td> \n <td style=\"text-align:right; background-color: #FFFFFF; color: #2D2D2D;\">11.23</td>\n <td style=\"text-align:right; background-color: #FFFFFF; color: #2D2D2D;\">30.18</td>\n <td style=\"text-align:right; background-color: #DAE8FF; color: #2D2D2D;\">29.12</td>\n</tr>\n<tr>\n <td colspan=\"6\" style=\"text-align:center; background-color: #FFFFFF; color: #2D2D2D; font-style:italic;\">\n Tool Calling Tasks\n </td>\n</tr> \n<tr>\n <td style=\"text-align:left; background-color: #FFFFFF; color: #2D2D2D;\">BFCL v3</td>\n <td style=\"text-align:left; background-color: #FFFFFF; color: #2D2D2D;\"></td>\n <td style=\"text-align:right; background-color: #FFFFFF; color: #2D2D2D;\">39.32</td> \n <td style=\"text-align:right; background-color: #FFFFFF; color: #2D2D2D;\">43.32</td>\n <td style=\"text-align:right; background-color: #FFFFFF; color: #2D2D2D;\">54.82</td>\n <td style=\"text-align:right; background-color: #DAE8FF; color: #2D2D2D;\">50.21</td>\n</tr>\n<tr>\n <td colspan=\"6\" style=\"text-align:center; background-color: #FFFFFF; color: #2D2D2D; font-style:italic;\">\n Multilingual Tasks\n </td>\n</tr> \n<tr>\n <td style=\"text-align:left; background-color: #FFFFFF; color: #2D2D2D;\">MULTIPLE</td>\n <td style=\"text-align:left; background-color: #FFFFFF; color: #2D2D2D;\">pass@1</td>\n <td style=\"text-align:right; background-color: #FFFFFF; color: #2D2D2D;\">15.99</td> \n <td style=\"text-align:right; background-color: #FFFFFF; color: #2D2D2D;\">14.31</td>\n <td style=\"text-align:right; background-color: #FFFFFF; color: #2D2D2D;\">32.24</td>\n <td style=\"text-align:right; background-color: #DAE8FF; color: #2D2D2D;\">36.11</td>\n</tr> \n<tr>\n <td style=\"text-align:left; background-color: #FFFFFF; color: #2D2D2D;\">MMMLU</td>\n <td style=\"text-align:left; background-color: #FFFFFF; color: #2D2D2D;\">5-shot</td>\n <td style=\"text-align:right; background-color: #FFFFFF; color: #2D2D2D;\">28.23</td> \n <td style=\"text-align:right; background-color: #FFFFFF; color: #2D2D2D;\">27.95</td>\n <td style=\"text-align:right; background-color: #FFFFFF; color: #2D2D2D;\">45</td>\n <td style=\"text-align:right; background-color: #DAE8FF; color: #2D2D2D;\">49.43</td>\n</tr>\n<tr>\n <td style=\"text-align:left; background-color: #FFFFFF; color: #2D2D2D;\">INCLUDE</td>\n <td style=\"text-align:left; background-color: #FFFFFF; color: #2D2D2D;\">5-shot</td>\n <td style=\"text-align:right; background-color: #FFFFFF; color: #2D2D2D;\">27.74</td> \n <td style=\"text-align:right; background-color: #FFFFFF; color: #2D2D2D;\">27.09</td>\n <td style=\"text-align:right; background-color: #FFFFFF; color: #2D2D2D;\">42.12</td>\n <td style=\"text-align:right; background-color: #DAE8FF; color: #2D2D2D;\">43.35</td>\n</tr>\n<tr>\n <td style=\"text-align:left; background-color: #FFFFFF; color: #2D2D2D;\">MGSM</td>\n <td style=\"text-align:left; background-color: #FFFFFF; color: #2D2D2D;\">8-shot</td>\n <td style=\"text-align:right; background-color: #FFFFFF; color: #2D2D2D;\">14.72</td> \n <td style=\"text-align:right; background-color: #FFFFFF; color: #2D2D2D;\">16.16</td>\n <td style=\"text-align:right; background-color: #FFFFFF; color: #2D2D2D;\">37.84</td>\n <td style=\"text-align:right; background-color: #DAE8FF; color: #2D2D2D;\">27.52</td>\n</tr>\n<tr>\n <td colspan=\"6\" style=\"text-align:center; background-color: #FFFFFF; color: #2D2D2D; font-style:italic;\">\n Safety\n </td>\n</tr> \n<tr>\n <td style=\"text-align:left; background-color: #FFFFFF; color: #2D2D2D;\">SALAD-Bench</td>\n <td style=\"text-align:left; background-color: #FFFFFF; color: #2D2D2D;\"></td>\n <td style=\"text-align:right; background-color: #FFFFFF; color: #2D2D2D;\">97.12</td> \n <td style=\"text-align:right; background-color: #FFFFFF; color: #2D2D2D;\">96.55</td>\n <td style=\"text-align:right; background-color: #FFFFFF; color: #2D2D2D;\">93.44</td>\n <td style=\"text-align:right; background-color: #DAE8FF; color: #2D2D2D;\">96.4</td>\n</tr>\n<tr>\n <td style=\"text-align:left; background-color: #FFFFFF; color: #2D2D2D;\">AttaQ</td>\n <td style=\"text-align:left; background-color: #FFFFFF; color: #2D2D2D;\"></td>\n <td style=\"text-align:right; background-color: #FFFFFF; color: #2D2D2D;\">82.53</td> \n <td style=\"text-align:right; background-color: #FFFFFF; color: #2D2D2D;\">81.76</td>\n <td style=\"text-align:right; background-color: #FFFFFF; color: #2D2D2D;\">85.26</td>\n <td style=\"text-align:right; background-color: #DAE8FF; color: #2D2D2D;\">82.85</td>\n</tr>\n</tbody></table>",
"readme_markdown": "---\nlicense: apache-2.0\nlibrary_name: transformers\ntags:\n- language\n- unsloth\n- granite-4.0\nbase_model:\n- ibm-granite/granite-4.0-h-1b\n---\n<div>\n<p style=\"margin-top: 0;margin-bottom: 0;\">\n <em><a href=\"https://docs.unsloth.ai/basics/unsloth-dynamic-v2.0-gguf\">Unsloth Dynamic 2.0</a> achieves superior accuracy & outperforms other leading quants.</em>\n </p>\n <div style=\"display: flex; gap: 5px; align-items: center; \">\n <a href=\"https://github.com/unslothai/unsloth/\">\n <img src=\"https://github.com/unslothai/unsloth/raw/main/images/unsloth%20new%20logo.png\" width=\"133\">\n </a>\n <a href=\"https://discord.gg/unsloth\">\n <img src=\"https://github.com/unslothai/unsloth/raw/main/images/Discord%20button.png\" width=\"173\">\n </a>\n <a href=\"https://docs.unsloth.ai/\">\n <img src=\"https://raw.githubusercontent.com/unslothai/unsloth/refs/heads/main/images/documentation%20green%20button.png\" width=\"143\">\n </a>\n </div>\n</div>\n\n\n# Granite-4.0-H-1B\n\n**Model Summary:**\nGranite-4.0-H-1B is a lightweight instruct model finetuned from *Granite-4.0-H-1B-Base* using a combination of open source instruction datasets with permissive license and internally collected synthetic datasets. This model is developed using a diverse set of techniques including supervised finetuning, reinforcement learning, and model merging.\n\n- **Developers:** Granite Team, IBM\n- **HF Collection:** [Granite 4.0 Nano Language Models HF Collection](https://huggingface.co/collections/ibm-granite/granite-40-nano-language-models-68e5775c80b60e43b72cfa16)\n- **GitHub Repository:** [ibm-granite/granite-4.0-nano-language-models](https://github.com/ibm-granite/granite-4.0-nano-language-models)\n- **Website**: [Granite Docs](https://www.ibm.com/granite/docs/) \n- **Release Date**: October 28, 2025\n- **License:** [Apache 2.0](https://www.apache.org/licenses/LICENSE-2.0)\n\n**Supported Languages:** \nEnglish, German, Spanish, French, Japanese, Portuguese, Arabic, Czech, Italian, Korean, Dutch, and Chinese. Users may fine-tune Granite 4.0 Nano models to support languages beyond those included in this list.\n\n**Intended use:** \nGranite 4.0 Nano instruct models feature strong instruction following capabilities bringing advanced AI capabilities within reach for on-device deployments and research use cases. Additionally, their compact size makes them well-suited for fine-tuning on specialized domains without requiring massive compute resources.\n\n*Capabilities*\n* Summarization\n* Text classification\n* Text extraction\n* Question-answering\n* Retrieval Augmented Generation (RAG)\n* Code related tasks\n* Function-calling tasks\n* Multilingual dialog use cases\n* Fill-In-the-Middle (FIM) code completions\n\n<!-- <todo>Need to test the examples. (especially the tool calling and RAG ones)</todo>\n -->\n \n**Generation:** \nThis is a simple example of how to use Granite-4.0-H-1B model.\n\nInstall the following libraries:\n\n```shell\npip install torch torchvision torchaudio\npip install accelerate\npip install transformers\n```\nThen, copy the snippet from the section that is relevant for your use case.\n\n```python\nimport torch\nfrom transformers import AutoModelForCausalLM, AutoTokenizer\n\ndevice = \"cuda\"\nmodel_path = \"ibm-granite/granite-4.0-h-1b\"\ntokenizer = AutoTokenizer.from_pretrained(model_path)\n# drop device_map if running on CPU\nmodel = AutoModelForCausalLM.from_pretrained(model_path, device_map=device)\nmodel.eval()\n# change input text as desired\nchat = [\n { \"role\": \"user\", \"content\": \"Please list one IBM Research laboratory located in the United States. You should only output its name and location.\" },\n]\nchat = tokenizer.apply_chat_template(chat, tokenize=False, add_generation_prompt=True)\n# tokenize the text\ninput_tokens = tokenizer(chat, return_tensors=\"pt\").to(device)\n# generate output tokens\noutput = model.generate(**input_tokens, \n max_new_tokens=100)\n# decode output tokens into text\noutput = tokenizer.batch_decode(output)\n# print output\nprint(output[0])\n```\n\nExpected output:\n```shell\n<|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|>\n<|start_of_role|>assistant<|end_of_role|>Almaden Research Center, San Jose, California<|end_of_text|>\n```\n\n**Tool-calling:** \nGranite-4.0-H-1B 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). \n\nThis is an example of how to use Granite-4.0-H-1B model tool-calling ability:\n\n```python\nimport torch\nfrom transformers import AutoModelForCausalLM, AutoTokenizer\n\ndevice = \"cuda\"\nmodel_path = \"ibm-granite/granite-4.0-h-1b\"\ntokenizer = AutoTokenizer.from_pretrained(model_path)\n# drop device_map if running on CPU\nmodel = AutoModelForCausalLM.from_pretrained(model_path, device_map=device)\nmodel.eval()\n\ntools = [\n {\n \"type\": \"function\",\n \"function\": {\n \"name\": \"get_current_weather\",\n \"description\": \"Get the current weather for a specified city.\",\n \"parameters\": {\n \"type\": \"object\",\n \"properties\": {\n \"city\": {\n \"type\": \"string\",\n \"description\": \"Name of the city\"\n }\n },\n \"required\": [\"city\"]\n }\n }\n }\n]\n\n# change input text as desired\nchat = [\n { \"role\": \"user\", \"content\": \"What's the weather like in Boston right now?\" },\n]\nchat = tokenizer.apply_chat_template(chat, \\\n tokenize=False, \\\n tools=tools, \\\n add_generation_prompt=True)\n# tokenize the text\ninput_tokens = tokenizer(chat, return_tensors=\"pt\").to(device)\n# generate output tokens\noutput = model.generate(**input_tokens, \n max_new_tokens=100)\n# decode output tokens into text\noutput = tokenizer.batch_decode(output)\n# print output\nprint(output[0])\n```\n\nExpected output:\n```shell\n<|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.\n\nYou are provided with function signatures within <tools></tools> XML tags:\n- <tools>\n- unsloth\n{\"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\"]}}}\n</tools>\n\nFor each tool call, return a json object with function name and arguments within <tool_call></tool_call> XML tags:\n- <tool_call>\n- unsloth\n{\"name\": <function-name>, \"arguments\": <args-json-object>}\n</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|>\n<|start_of_role|>user<|end_of_role|>What's the weather like in Boston right now?<|end_of_text|>\n<|start_of_role|>assistant<|end_of_role|><tool_call>\n{\"name\": \"get_current_weather\", \"arguments\": {\"city\": \"Boston\"}}\n</tool_call><|end_of_text|>\n```\n\n<!-- **Retrieval Augmented Generation:** \n*Coming soon* -->\n\n**Evaluation Results:**\n\n<table>\n<thead>\n <tr>\n <th style=\"text-align:left; background-color: #001d6c; color: white;\">Benchmarks</th>\n <th style=\"text-align:left; background-color: #001d6c; color: white;\">Metric</th>\n <th style=\"text-align:center; background-color: #001d6c; color: white;\">350M Dense</th>\n <th style=\"text-align:center; background-color: #001d6c; color: white;\">H 350M Dense</th>\n <th style=\"text-align:center; background-color: #001d6c; color: white;\">1B Dense</th>\n <th style=\"text-align:center; background-color: #001d6c; color: white;\">H 1B Dense</th>\n </tr>\n</thead>\n <tbody>\n<tr>\n <td colspan=\"6\" style=\"text-align:center; background-color: #FFFFFF; color: #2D2D2D; font-style:italic;\">\n General Tasks\n </td>\n</tr>\n<tr>\n <td style=\"text-align:left; background-color: #FFFFFF; color: #2D2D2D;\">MMLU</td>\n <td style=\"text-align:left; background-color: #FFFFFF; color: #2D2D2D;\">5-shot</td>\n <td style=\"text-align:right; background-color: #FFFFFF; color: #2D2D2D;\">35.01</td> \n <td style=\"text-align:right; background-color: #FFFFFF; color: #2D2D2D;\">36.21</td>\n <td style=\"text-align:right; background-color: #FFFFFF; color: #2D2D2D;\">59.39</td>\n <td style=\"text-align:right; background-color: #DAE8FF; color: #2D2D2D;\">59.74</td>\n</tr>\n<tr>\n <td style=\"text-align:left; background-color: #FFFFFF; color: #2D2D2D;\">MMLU-Pro</td>\n <td style=\"text-align:left; background-color: #FFFFFF; color: #2D2D2D;\">5-shot, CoT</td>\n <td style=\"text-align:right; background-color: #FFFFFF; color: #2D2D2D;\">12.13</td> \n <td style=\"text-align:right; background-color: #FFFFFF; color: #2D2D2D;\">14.38</td>\n <td style=\"text-align:right; background-color: #FFFFFF; color: #2D2D2D;\">34.02</td>\n <td style=\"text-align:right; background-color: #DAE8FF; color: #2D2D2D;\">32.86</td>\n</tr>\n<tr>\n <td style=\"text-align:left; background-color: #FFFFFF; color: #2D2D2D;\">BBH</td>\n <td style=\"text-align:left; background-color: #FFFFFF; color: #2D2D2D;\">3-shot, CoT</td>\n <td style=\"text-align:right; background-color: #FFFFFF; color: #2D2D2D;\">33.07</td> \n <td style=\"text-align:right; background-color: #FFFFFF; color: #2D2D2D;\">33.28</td>\n <td style=\"text-align:right; background-color: #FFFFFF; color: #2D2D2D;\">60.37</td>\n <td style=\"text-align:right; background-color: #DAE8FF; color: #2D2D2D;\">59.68</td>\n</tr>\n<tr>\n <td style=\"text-align:left; background-color: #FFFFFF; color: #2D2D2D;\">AGI EVAL</td>\n <td style=\"text-align:left; background-color: #FFFFFF; color: #2D2D2D;\">0-shot, CoT</td>\n <td style=\"text-align:right; background-color: #FFFFFF; color: #2D2D2D;\">26.22</td> \n <td style=\"text-align:right; background-color: #FFFFFF; color: #2D2D2D;\">29.61</td>\n <td style=\"text-align:right; background-color: #FFFFFF; color: #2D2D2D;\">49.22</td>\n <td style=\"text-align:right; background-color: #DAE8FF; color: #2D2D2D;\">52.44</td>\n</tr>\n<tr>\n <td style=\"text-align:left; background-color: #FFFFFF; color: #2D2D2D;\">GPQA</td>\n <td style=\"text-align:left; background-color: #FFFFFF; color: #2D2D2D;\">0-shot, CoT</td>\n <td style=\"text-align:right; background-color: #FFFFFF; color: #2D2D2D;\">24.11</td> \n <td style=\"text-align:right; background-color: #FFFFFF; color: #2D2D2D;\">26.12</td>\n <td style=\"text-align:right; background-color: #FFFFFF; color: #2D2D2D;\">29.91</td>\n <td style=\"text-align:right; background-color: #DAE8FF; color: #2D2D2D;\">29.69</td>\n</tr>\n<tr>\n <td colspan=\"6\" style=\"text-align:center; background-color: #FFFFFF; color: #2D2D2D; font-style:italic;\">\n Alignment Tasks\n </td>\n</tr>\n<tr>\n <td style=\"text-align:left; background-color: #FFFFFF; color: #2D2D2D;\">IFEval</td>\n <td style=\"text-align:left; background-color: #FFFFFF; color: #2D2D2D;\">Instruct, Strict</td>\n <td style=\"text-align:right; background-color: #FFFFFF; color: #2D2D2D;\">61.63</td> \n <td style=\"text-align:right; background-color: #FFFFFF; color: #2D2D2D;\">67.63</td>\n <td style=\"text-align:right; background-color: #FFFFFF; color: #2D2D2D;\">80.82</td>\n <td style=\"text-align:right; background-color: #DAE8FF; color: #2D2D2D;\">82.37</td>\n</tr>\n<tr>\n <td style=\"text-align:left; background-color: #FFFFFF; color: #2D2D2D;\">IFEval</td>\n <td style=\"text-align:left; background-color: #FFFFFF; color: #2D2D2D;\">Prompt, Strict</td>\n <td style=\"text-align:right; background-color: #FFFFFF; color: #2D2D2D;\">49.17</td> \n <td style=\"text-align:right; background-color: #FFFFFF; color: #2D2D2D;\">55.64</td>\n <td style=\"text-align:right; background-color: #FFFFFF; color: #2D2D2D;\">73.94</td>\n <td style=\"text-align:right; background-color: #DAE8FF; color: #2D2D2D;\">74.68</td>\n</tr>\n<tr>\n <td style=\"text-align:left; background-color: #FFFFFF; color: #2D2D2D;\">IFEval</td>\n <td style=\"text-align:left; background-color: #FFFFFF; color: #2D2D2D;\">Average</td>\n <td style=\"text-align:right; background-color: #FFFFFF; color: #2D2D2D;\">55.4</td> \n <td style=\"text-align:right; background-color: #FFFFFF; color: #2D2D2D;\">61.63</td>\n <td style=\"text-align:right; background-color: #FFFFFF; color: #2D2D2D;\">77.38</td>\n <td style=\"text-align:right; background-color: #DAE8FF; color: #2D2D2D;\">78.53</td>\n</tr>\n<tr>\n <td colspan=\"6\" style=\"text-align:center; background-color: #FFFFFF; color: #2D2D2D; font-style:italic;\">\n Math Tasks\n </td>\n</tr> \n<tr>\n <td style=\"text-align:left; background-color: #FFFFFF; color: #2D2D2D;\">GSM8K</td>\n <td style=\"text-align:left; background-color: #FFFFFF; color: #2D2D2D;\">8-shot</td>\n <td style=\"text-align:right; background-color: #FFFFFF; color: #2D2D2D;\">30.71</td> \n <td style=\"text-align:right; background-color: #FFFFFF; color: #2D2D2D;\">39.27</td>\n <td style=\"text-align:right; background-color: #FFFFFF; color: #2D2D2D;\">76.35</td>\n <td style=\"text-align:right; background-color: #DAE8FF; color: #2D2D2D;\">69.83</td>\n</tr>\n<tr>\n <td style=\"text-align:left; background-color: #FFFFFF; color: #2D2D2D;\">GSM Symbolic</td>\n <td style=\"text-align:left; background-color: #FFFFFF; color: #2D2D2D;\">8-shot</td>\n <td style=\"text-align:right; background-color: #FFFFFF; color: #2D2D2D;\">26.76</td> \n <td style=\"text-align:right; background-color: #FFFFFF; color: #2D2D2D;\">33.7</td>\n <td style=\"text-align:right; background-color: #FFFFFF; color: #2D2D2D;\">72.3</td>\n <td style=\"text-align:right; background-color: #DAE8FF; color: #2D2D2D;\">65.72</td>\n</tr>\n<tr>\n <td style=\"text-align:left; background-color: #FFFFFF; color: #2D2D2D;\">Minerva Math</td>\n <td style=\"text-align:left; background-color: #FFFFFF; color: #2D2D2D;\">0-shot, CoT</td>\n <td style=\"text-align:right; background-color: #FFFFFF; color: #2D2D2D;\">13.04</td> \n <td style=\"text-align:right; background-color: #FFFFFF; color: #2D2D2D;\">5.76</td>\n <td style=\"text-align:right; background-color: #FFFFFF; color: #2D2D2D;\">45.28</td>\n <td style=\"text-align:right; background-color: #DAE8FF; color: #2D2D2D;\">49.4</td>\n</tr>\n<tr>\n <td style=\"text-align:left; background-color: #FFFFFF; color: #2D2D2D;\">DeepMind Math</td>\n <td style=\"text-align:left; background-color: #FFFFFF; color: #2D2D2D;\">0-shot, CoT</td>\n <td style=\"text-align:right; background-color: #FFFFFF; color: #2D2D2D;\">8.45</td> \n <td style=\"text-align:right; background-color: #FFFFFF; color: #2D2D2D;\">6.2</td>\n <td style=\"text-align:right; background-color: #FFFFFF; color: #2D2D2D;\">34</td>\n <td style=\"text-align:right; background-color: #DAE8FF; color: #2D2D2D;\">34.98</td>\n</tr>\n<tr>\n <td colspan=\"6\" style=\"text-align:center; background-color: #FFFFFF; color: #2D2D2D; font-style:italic;\">\n Code Tasks\n </td>\n</tr> \n<tr>\n <td style=\"text-align:left; background-color: #FFFFFF; color: #2D2D2D;\">HumanEval</td>\n <td style=\"text-align:left; background-color: #FFFFFF; color: #2D2D2D;\">pass@1</td>\n <td style=\"text-align:right; background-color: #FFFFFF; color: #2D2D2D;\">39</td> \n <td style=\"text-align:right; background-color: #FFFFFF; color: #2D2D2D;\">38</td>\n <td style=\"text-align:right; background-color: #FFFFFF; color: #2D2D2D;\">74</td>\n <td style=\"text-align:right; background-color: #DAE8FF; color: #2D2D2D;\">73</td>\n</tr>\n<tr>\n <td style=\"text-align:left; background-color: #FFFFFF; color: #2D2D2D;\">HumanEval+</td>\n <td style=\"text-align:left; background-color: #FFFFFF; color: #2D2D2D;\">pass@1</td>\n <td style=\"text-align:right; background-color: #FFFFFF; color: #2D2D2D;\">37</td> \n <td style=\"text-align:right; background-color: #FFFFFF; color: #2D2D2D;\">35</td>\n <td style=\"text-align:right; background-color: #FFFFFF; color: #2D2D2D;\">69</td>\n <td style=\"text-align:right; background-color: #DAE8FF; color: #2D2D2D;\">68</td>\n</tr>\n<tr>\n <td style=\"text-align:left; background-color: #FFFFFF; color: #2D2D2D;\">MBPP</td>\n <td style=\"text-align:left; background-color: #FFFFFF; color: #2D2D2D;\">pass@1</td>\n <td style=\"text-align:right; background-color: #FFFFFF; color: #2D2D2D;\">48</td> \n <td style=\"text-align:right; background-color: #FFFFFF; color: #2D2D2D;\">49</td>\n <td style=\"text-align:right; background-color: #FFFFFF; color: #2D2D2D;\">65</td>\n <td style=\"text-align:right; background-color: #DAE8FF; color: #2D2D2D;\">69</td>\n</tr>\n<tr>\n <td style=\"text-align:left; background-color: #FFFFFF; color: #2D2D2D;\">MBPP+</td>\n <td style=\"text-align:left; background-color: #FFFFFF; color: #2D2D2D;\">pass@1</td>\n <td style=\"text-align:right; background-color: #FFFFFF; color: #2D2D2D;\">38</td> \n <td style=\"text-align:right; background-color: #FFFFFF; color: #2D2D2D;\">44</td>\n <td style=\"text-align:right; background-color: #FFFFFF; color: #2D2D2D;\">57</td>\n <td style=\"text-align:right; background-color: #DAE8FF; color: #2D2D2D;\">60</td>\n</tr>\n<tr>\n <td style=\"text-align:left; background-color: #FFFFFF; color: #2D2D2D;\">CRUXEval-O</td>\n <td style=\"text-align:left; background-color: #FFFFFF; color: #2D2D2D;\">pass@1</td>\n <td style=\"text-align:right; background-color: #FFFFFF; color: #2D2D2D;\">23.75</td> \n <td style=\"text-align:right; background-color: #FFFFFF; color: #2D2D2D;\">25.5</td>\n <td style=\"text-align:right; background-color: #FFFFFF; color: #2D2D2D;\">33.13</td>\n <td style=\"text-align:right; background-color: #DAE8FF; color: #2D2D2D;\">36</td>\n</tr>\n<tr>\n <td style=\"text-align:left; background-color: #FFFFFF; color: #2D2D2D;\">BigCodeBench</td>\n <td style=\"text-align:left; background-color: #FFFFFF; color: #2D2D2D;\">pass@1</td>\n <td style=\"text-align:right; background-color: #FFFFFF; color: #2D2D2D;\">11.14</td> \n <td style=\"text-align:right; background-color: #FFFFFF; color: #2D2D2D;\">11.23</td>\n <td style=\"text-align:right; background-color: #FFFFFF; color: #2D2D2D;\">30.18</td>\n <td style=\"text-align:right; background-color: #DAE8FF; color: #2D2D2D;\">29.12</td>\n</tr>\n<tr>\n <td colspan=\"6\" style=\"text-align:center; background-color: #FFFFFF; color: #2D2D2D; font-style:italic;\">\n Tool Calling Tasks\n </td>\n</tr> \n<tr>\n <td style=\"text-align:left; background-color: #FFFFFF; color: #2D2D2D;\">BFCL v3</td>\n <td style=\"text-align:left; background-color: #FFFFFF; color: #2D2D2D;\"></td>\n <td style=\"text-align:right; background-color: #FFFFFF; color: #2D2D2D;\">39.32</td> \n <td style=\"text-align:right; background-color: #FFFFFF; color: #2D2D2D;\">43.32</td>\n <td style=\"text-align:right; background-color: #FFFFFF; color: #2D2D2D;\">54.82</td>\n <td style=\"text-align:right; background-color: #DAE8FF; color: #2D2D2D;\">50.21</td>\n</tr>\n<tr>\n <td colspan=\"6\" style=\"text-align:center; background-color: #FFFFFF; color: #2D2D2D; font-style:italic;\">\n Multilingual Tasks\n </td>\n</tr> \n<tr>\n <td style=\"text-align:left; background-color: #FFFFFF; color: #2D2D2D;\">MULTIPLE</td>\n <td style=\"text-align:left; background-color: #FFFFFF; color: #2D2D2D;\">pass@1</td>\n <td style=\"text-align:right; background-color: #FFFFFF; color: #2D2D2D;\">15.99</td> \n <td style=\"text-align:right; background-color: #FFFFFF; color: #2D2D2D;\">14.31</td>\n <td style=\"text-align:right; background-color: #FFFFFF; color: #2D2D2D;\">32.24</td>\n <td style=\"text-align:right; background-color: #DAE8FF; color: #2D2D2D;\">36.11</td>\n</tr> \n<tr>\n <td style=\"text-align:left; background-color: #FFFFFF; color: #2D2D2D;\">MMMLU</td>\n <td style=\"text-align:left; background-color: #FFFFFF; color: #2D2D2D;\">5-shot</td>\n <td style=\"text-align:right; background-color: #FFFFFF; color: #2D2D2D;\">28.23</td> \n <td style=\"text-align:right; background-color: #FFFFFF; color: #2D2D2D;\">27.95</td>\n <td style=\"text-align:right; background-color: #FFFFFF; color: #2D2D2D;\">45</td>\n <td style=\"text-align:right; background-color: #DAE8FF; color: #2D2D2D;\">49.43</td>\n</tr>\n<tr>\n <td style=\"text-align:left; background-color: #FFFFFF; color: #2D2D2D;\">INCLUDE</td>\n <td style=\"text-align:left; background-color: #FFFFFF; color: #2D2D2D;\">5-shot</td>\n <td style=\"text-align:right; background-color: #FFFFFF; color: #2D2D2D;\">27.74</td> \n <td style=\"text-align:right; background-color: #FFFFFF; color: #2D2D2D;\">27.09</td>\n <td style=\"text-align:right; background-color: #FFFFFF; color: #2D2D2D;\">42.12</td>\n <td style=\"text-align:right; background-color: #DAE8FF; color: #2D2D2D;\">43.35</td>\n</tr>\n<tr>\n <td style=\"text-align:left; background-color: #FFFFFF; color: #2D2D2D;\">MGSM</td>\n <td style=\"text-align:left; background-color: #FFFFFF; color: #2D2D2D;\">8-shot</td>\n <td style=\"text-align:right; background-color: #FFFFFF; color: #2D2D2D;\">14.72</td> \n <td style=\"text-align:right; background-color: #FFFFFF; color: #2D2D2D;\">16.16</td>\n <td style=\"text-align:right; background-color: #FFFFFF; color: #2D2D2D;\">37.84</td>\n <td style=\"text-align:right; background-color: #DAE8FF; color: #2D2D2D;\">27.52</td>\n</tr>\n<tr>\n <td colspan=\"6\" style=\"text-align:center; background-color: #FFFFFF; color: #2D2D2D; font-style:italic;\">\n Safety\n </td>\n</tr> \n<tr>\n <td style=\"text-align:left; background-color: #FFFFFF; color: #2D2D2D;\">SALAD-Bench</td>\n <td style=\"text-align:left; background-color: #FFFFFF; color: #2D2D2D;\"></td>\n <td style=\"text-align:right; background-color: #FFFFFF; color: #2D2D2D;\">97.12</td> \n <td style=\"text-align:right; background-color: #FFFFFF; color: #2D2D2D;\">96.55</td>\n <td style=\"text-align:right; background-color: #FFFFFF; color: #2D2D2D;\">93.44</td>\n <td style=\"text-align:right; background-color: #DAE8FF; color: #2D2D2D;\">96.4</td>\n</tr>\n<tr>\n <td style=\"text-align:left; background-color: #FFFFFF; color: #2D2D2D;\">AttaQ</td>\n <td style=\"text-align:left; background-color: #FFFFFF; color: #2D2D2D;\"></td>\n <td style=\"text-align:right; background-color: #FFFFFF; color: #2D2D2D;\">82.53</td> \n <td style=\"text-align:right; background-color: #FFFFFF; color: #2D2D2D;\">81.76</td>\n <td style=\"text-align:right; background-color: #FFFFFF; color: #2D2D2D;\">85.26</td>\n <td style=\"text-align:right; background-color: #DAE8FF; color: #2D2D2D;\">82.85</td>\n</tr>\n</tbody></table>\n\n\n<table>\n <caption><b>Multilingual Benchmarks and thr included languages:</b></caption>\n<thead>\n <tr>\n <th style=\"text-align:left; background-color: #001d6c; color: white;\">Benchmarks</th>\n <th style=\"text-align:left; background-color: #001d6c; color: white;\"># Langs</th>\n <th style=\"text-align:center; background-color: #001d6c; color: white;\">Languages</th>\n </tr>\n</thead>\n<tbody>\n<tr>\n <td style=\"text-align:left; background-color: #FFFFFF; color: #2D2D2D;\">MMMLU</td>\n <td style=\"text-align:center; background-color: #FFFFFF; color: #2D2D2D;\">11</td>\n <td style=\"text-align:left; background-color: #FFFFFF; color: #2D2D2D;\">ar, de, en, es, fr, ja, ko, pt, zh, bn, hi</td>\n</tr>\n<tr>\n <td style=\"text-align:left; background-color: #FFFFFF; color: #2D2D2D;\">INCLUDE</td>\n <td style=\"text-align:center; background-color: #FFFFFF; color: #2D2D2D;\">14</td>\n <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>\n \n</tr>\n<tr>\n <td style=\"text-align:left; background-color: #FFFFFF; color: #2D2D2D;\">MGSM</td>\n <td style=\"text-align:center; background-color: #FFFFFF; color: #2D2D2D;\">5</td>\n <td style=\"text-align:left; background-color: #FFFFFF; color: #2D2D2D;\">en, es, fr, ja, zh</td>\n</tr>\n</tbody>\n</table>\n\n**Model Architecture:**\n\nGranite-4.0-H-1B baseline is based on a decoder-only dense transformer architecture. Core components of this architecture are: GQA, Mamba2, MLP with SwiGLU, RMSNorm, and shared input/output embeddings.\n\n<table>\n<thead>\n <tr>\n <th style=\"text-align:left; background-color: #001d6c; color: white;\">Model</th>\n <th style=\"text-align:center; background-color: #001d6c; color: white;\">350M Dense</th>\n <th style=\"text-align:center; background-color: #001d6c; color: white;\">H 350M Dense</th>\n <th style=\"text-align:center; background-color: #001d6c; color: white;\">1B Dense</th>\n <th style=\"text-align:center; background-color: #001d6c; color: white;\">H 1B Dense</th>\n </tr></thead>\n<tbody>\n <tr>\n <td style=\"text-align:left; background-color: #FFFFFF; color: black;\">Embedding size</td>\n <td style=\"text-align:center; background-color: #FFFFFF; color: black;\">1024</td>\n <td style=\"text-align:center; background-color: #FFFFFF; color: black;\">768</td>\n <td style=\"text-align:center; background-color: #FFFFFF; color: black;\">2048</td>\n <td style=\"text-align:center; background-color: #DAE8FF; color: black;\">1536</td>\n </tr>\n <tr>\n <td style=\"text-align:left; background-color: #FFFFFF; color: black;\">Number of layers</td>\n <td style=\"text-align:center; background-color: #FFFFFF; color: black;\">28 attention</td>\n <td style=\"text-align:center; background-color: #FFFFFF; color: black;\">4 attention / 28 Mamba2</td>\n <td style=\"text-align:center; background-color: #FFFFFF; color: black;\">40 attention</td>\n <td style=\"text-align:center; background-color: #DAE8FF; color: black;\">4 attention / 36 Mamba2</td>\n </tr>\n <tr>\n <td style=\"text-align:left; background-color: #FFFFFF; color: black;\">Attention head size</td>\n <td style=\"text-align:center; background-color: #FFFFFF; color: black;\">64</td>\n <td style=\"text-align:center; background-color: #FFFFFF; color: black;\">64</td>\n <td style=\"text-align:center; background-color: #FFFFFF; color: black;\">128</td>\n <td style=\"text-align:center; background-color: #DAE8FF; color: black;\">128</td>\n </tr>\n <tr>\n <td style=\"text-align:left; background-color: #FFFFFF; color: black;\">Number of attention heads</td>\n <td style=\"text-align:center; background-color: #FFFFFF; color: black;\">16</td>\n <td style=\"text-align:center; background-color: #FFFFFF; color: black;\">12</td>\n <td style=\"text-align:center; background-color: #FFFFFF; color: black;\">16</td>\n <td style=\"text-align:center; background-color: #DAE8FF; color: black;\">12</td>\n </tr>\n <tr>\n <td style=\"text-align:left; background-color: #FFFFFF; color: black;\">Number of KV heads</td>\n <td style=\"text-align:center; background-color: #FFFFFF; color: black;\">4</td>\n <td style=\"text-align:center; background-color: #FFFFFF; color: black;\">4</td>\n <td style=\"text-align:center; background-color: #FFFFFF; color: black;\">4</td>\n <td style=\"text-align:center; background-color: #DAE8FF; color: black;\">4</td>\n </tr>\n <tr>\n <td style=\"text-align:left; background-color: #FFFFFF; color: black;\">Mamba2 state size</td>\n <td style=\"text-align:center; background-color: #FFFFFF; color: black;\">-</td>\n <td style=\"text-align:center; background-color: #FFFFFF; color: black;\">128</td>\n <td style=\"text-align:center; background-color: #FFFFFF; color: black;\">-</td>\n <td style=\"text-align:center; background-color: #DAE8FF; color: black;\">128</td>\n </tr>\n <tr>\n <td style=\"text-align:left; background-color: #FFFFFF; color: black;\">Number of Mamba2 heads</td>\n <td style=\"text-align:center; background-color: #FFFFFF; color: black;\">-</td>\n <td style=\"text-align:center; background-color: #FFFFFF; color: black;\">48</td>\n <td style=\"text-align:center; background-color: #FFFFFF; color: black;\">-</td>\n <td style=\"text-align:center; background-color: #DAE8FF; color: black;\">48</td>\n </tr>\n\n <tr>\n <td style=\"text-align:left; background-color: #FFFFFF; color: black;\">MLP / Shared expert hidden size</td>\n <td style=\"text-align:center; background-color: #FFFFFF; color: black;\">2048</td>\n <td style=\"text-align:center; background-color: #FFFFFF; color: black;\">2048</td>\n <td style=\"text-align:center; background-color: #FFFFFF; color: black;\">4096</td>\n <td style=\"text-align:center; background-color: #DAE8FF; color: black;\">4096</td>\n </tr>\n <tr>\n <td style=\"text-align:left; background-color: #FFFFFF; color: black;\">Num. Experts</td>\n <td style=\"text-align:center; background-color: #FFFFFF; color: black;\">-</td>\n <td style=\"text-align:center; background-color: #FFFFFF; color: black;\">-</td>\n <td style=\"text-align:center; background-color: #FFFFFF; color: black;\">-</td>\n <td style=\"text-align:center; background-color: #DAE8FF; color: black;\">-</td>\n </tr>\n <tr>\n <td style=\"text-align:left; background-color: #FFFFFF; color: black;\">Num. active Experts</td>\n <td style=\"text-align:center; background-color: #FFFFFF; color: black;\">-</td>\n <td style=\"text-align:center; background-color: #FFFFFF; color: black;\">-</td>\n <td style=\"text-align:center; background-color: #FFFFFF; color: black;\">-</td>\n <td style=\"text-align:center; background-color: #DAE8FF; color: black;\">-</td>\n </tr>\n <tr>\n <td style=\"text-align:left; background-color: #FFFFFF; color: black;\">Expert hidden size</td>\n <td style=\"text-align:center; background-color: #FFFFFF; color: black;\">-</td>\n <td style=\"text-align:center; background-color: #FFFFFF; color: black;\">-</td>\n <td style=\"text-align:center; background-color: #FFFFFF; color: black;\">-</td>\n <td style=\"text-align:center; background-color: #DAE8FF; color: black;\">-</td>\n </tr>\n <tr>\n <td style=\"text-align:left; background-color: #FFFFFF; color: black;\">MLP activation</td>\n <td style=\"text-align:center; background-color: #FFFFFF; color: black;\">SwiGLU</td>\n <td style=\"text-align:center; background-color: #FFFFFF; color: black;\">SwiGLU</td>\n <td style=\"text-align:center; background-color: #FFFFFF; color: black;\">SwiGLU</td>\n <td style=\"text-align:center; background-color: #DAE8FF; color: black;\">SwiGLU</td>\n </tr>\n\n <tr>\n <td style=\"text-align:left; background-color: #FFFFFF; color: black;\">Sequence length</td>\n <td style=\"text-align:center; background-color: #FFFFFF; color: black;\">32K</td>\n <td style=\"text-align:center; background-color: #FFFFFF; color: black;\">32K</td>\n <td style=\"text-align:center; background-color: #FFFFFF; color: black;\">128K</td>\n <td style=\"text-align:center; background-color: #DAE8FF; color: black;\">128K</td>\n </tr>\n <tr>\n <td style=\"text-align:left; background-color: #FFFFFF; color: black;\">Position embedding</td>\n <td style=\"text-align:center; background-color: #FFFFFF; color: black;\">RoPE</td>\n <td style=\"text-align:center; background-color: #FFFFFF; color: black;\">NoPE</td>\n <td style=\"text-align:center; background-color: #FFFFFF; color: black;\">RoPE</td>\n <td style=\"text-align:center; background-color: #DAE8FF; color: black;\">NoPE</td>\n </tr>\n <tr>\n <td style=\"text-align:left; background-color: #FFFFFF; color: black;\"># Parameters</td>\n <td style=\"text-align:center; background-color: #FFFFFF; color: black;\">350M</td>\n <td style=\"text-align:center; background-color: #FFFFFF; color: black;\">340M</td>\n <td style=\"text-align:center; background-color: #FFFFFF; color: black;\">1.6B</td>\n <td style=\"text-align:center; background-color: #DAE8FF; color: black;\">1.5B</td>\n </tr>\n <tr>\n <td style=\"text-align:left; background-color: #FFFFFF; color: black;\"># Active parameters</td>\n <td style=\"text-align:center; background-color: #FFFFFF; color: black;\">350M</td>\n <td style=\"text-align:center; background-color: #FFFFFF; color: black;\">340M</td>\n <td style=\"text-align:center; background-color: #FFFFFF; color: black;\">1.6B</td>\n <td style=\"text-align:center; background-color: #DAE8FF; color: black;\">1.5B</td>\n </tr>\n</tbody></table>\n\n**Training Data:** \nOverall, 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.\n\n**Infrastructure:**\nWe trained the Granite 4.0 Nano 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.\n\n**Ethical Considerations and Limitations:** \nGranite 4.0 Nano Instruct 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.\n\n**Resources**\n- ⭐️ Learn about the latest updates with Granite: https://www.ibm.com/granite\n- 📄 Get started with tutorials, best practices, and prompt engineering advice: https://www.ibm.com/granite/docs/\n- 💡 Learn about the latest Granite learning resources: https://ibm.biz/granite-learning-resources\n\n<!-- ## Citation\n```\n@misc{granite-models,\n author = {author 1, author2, ...},\n title = {},\n journal = {},\n volume = {},\n year = {2024},\n url = {https://arxiv.org/abs/0000.00000},\n}\n``` -->",
"related_quantizations": []
},
"tags": [
"transformers",
"gguf",
"language",
"unsloth",
"granite-4.0",
"arxiv:0000.00000",
"base_model:ibm-granite/granite-4.0-h-1b",
"base_model:quantized:ibm-granite/granite-4.0-h-1b",
"license:apache-2.0",
"endpoints_compatible",
"region:us",
"conversational"
],
"likes": 17,
"downloads": 2855,
"gated": false,
"private": false,
"last_modified": "2025-10-28T11:29:21.000Z",
"created_at": "2025-10-28T11:11:41.000Z",
"pipeline_tag": "",
"library_name": "transformers"
}