Back to Models
ibm-granite logo

ibm-granite/granite-4.1-3b-base

ibm-granitegeneral

mof-class3-qualified

Granite-4.1-3B-Base

Model Summary: Granite‑4.1‑3B‑Base is a decoder‑only language model with long‑context capabilities, designed to support a broad range of general text‑to‑text generation tasks, as well as fill‑in‑the‑Middle (FIM) code completion. This model shares the same underlying architecture and weights as Granite 4.0 3B Micro, which is trained from scratch on approximately 15 trillion tokens following a four-stage training strategy: 10 trillion tokens in the first stage, 2 trillion in the second, another 2 trillion in the third, and 0.5 trillion in the final stage. An additional training phase is applied to expand the model’s context window to 512K tokens.

Supported Languages: 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.

Intended Use: Prominent use cases of LLMs in text-to-text generation include summarization, text classification, extraction, question-answering, code-completion (including FIM), and long-context generation tasks. All Granite Base models are able to handle these tasks as they were trained on a large amount of data from various domains. Moreover, they can serve as baseline to create specialized models for specific application scenarios.

Generation: This is a simple example of how to use Granite-4.1-3B-Base model.

Install the following libraries:

pip install torch torchvision torchaudio
pip install accelerate
pip install transformers

Then, copy the code snippet below to run the example.

from transformers import AutoModelForCausalLM, AutoTokenizer
device = "cuda"

model_path = "ibm-granite/granite-4.1-3b-base"

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
input_text = "The capital of France is"
# tokenize the text
input_tokens = tokenizer(input_text, return_tensors="pt").to(device)
# generate output tokens
output = model.generate(**input_tokens, max_length=10)
# decode output tokens into text
output = tokenizer.batch_decode(output)
# print output
print(output[0])

Expected output:

The capital of France is Paris.

Evaluation Results:

BenchmarksMetric3B Dense8B Dense30B Dense
General Tasks
MMLU5-shot66.4773.6078.44
MMLU-Pro5-shot,CoT37.1644.5849.51
BBH3-shot, CoT63.8473.8380.66
AGI EVAL3-shot54.3261.6869.20
DROP5-shot66.0472.3678.57
SimpleQAno-judge-short-form6.857.9210.54
Math Tasks
GSM8K8-shot72.9373.5483.78
Minerva Math4-shot38.0043.4245.66
Code Tasks
HumanEvalpass@1 [StarCoder Prompt]76.1979.2481.52
HumanEvalpass@159.7668.2967.68
HumanEval+pass@154.2762.8062.20
MBPPpass@181.4863.7683.60
MBPP+pass@168.2553.9769.58
Eval+ Avg65.9462.2170.76
Multilingual Tasks
MMMLU5-shot56.5964.7373.36
INCLUDE5-shot51.7757.6067.07
MGSM8-shot58.4863.6874.40
Multilingual Benchmarks and the included languages:
Benchmarks# LangsLanguages
MMMLU11ar, de, en, es, fr, ja, ko, pt, zh, bn, hi
INCLUDE14hi, bn, ta, te, ar, de, es, fr, it, ja, ko, nl, pt, zh
MGSM5en, es, fr, ja, zh

Model Architecture:

Granite-4.1-3B-Base is based on a decoder-only dense transformer architecture. Core components of this architecture are: GQA, RoPE, MLP with SwiGLU, RMSNorm, and shared input/output embeddings.

Model3B Dense8B Dense30B Dense
Embedding size256040964096
Number of layers404064
Attention head size64128128
Number of attention heads403232
Number of KV heads888
MLP / Shared expert hidden size81921280032768
MLP activationSwiGLUSwiGLUSwiGLU
Sequence length131072131072131072
Position embeddingRoPERoPERoPE
# Parameters3B8B30B

Training Data: This model is trained on a mix of open source and proprietary data following a five-phase training strategy. We refer to phase-1 and phase-2 as pre-training and phase-3, phase-4, and phase-5 as mid-training.

StageCharacteristics3B Dense8B Dense30B Dense
IGeneral mixture of training data, warmup, and power scheduler for learning rate.10T10T10T
IIGeneral mixture of training data with higher percentages of code and math with power scheduler for learning rate.2T2T2T
IIIHigh quality training data, exponential decay of learning rate.2T2T2T
IVHigh quality training data, linear decay to zero for learning rate.500B500B500B
VLong Context Extension with exponential learning rate schedule.396B396B396B

Infrastructure: 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.

Ethical Considerations and Limitations: The use of Large Language Models involves risks and ethical considerations people must be aware of, including but not limited to: bias and fairness, misinformation, and autonomous decision-making. Granite-4.1-3B-Base model is not an exception in this regard. Even though this model is suited for multiple generative AI tasks, it has not undergone any safety alignment and it may produce problematic outputs. Additionally, it remains uncertain whether smaller models might exhibit increased susceptibility to hallucination in generation scenarios by copying text verbatim from the training dataset due to their reduced sizes and memorization capacities. This aspect is currently an active area of research, and we anticipate more rigorous exploration, comprehension, and mitigations in this domain. Regarding ethics, a latent risk associated with all Large Language Models is their malicious utilization. We urge the community to use Granite-4.1-3B-Base model with ethical intentions and in a responsible way. To enhance safety in enterprise deployments, we recommend using Granite 4.1 Language models alongside Granite Guardian, a model designed to detect and flag risks in inputs and outputs across key dimensions outlined in the IBM AI Risk Atlas.

Resources

Visit Website

0 reviews

5
0
4
0
3
0
2
0
1
0
Likes14
Downloads
📝

No reviews yet

Be the first to review ibm-granite/granite-4.1-3b-base!

Model Info

Provideribm-granite
Categorygeneral
Reviews0
Avg. Rating / 5.0

Community

Likes14
Downloads

Rating Guidelines

★★★★★Exceptional
★★★★Great
★★★Good
★★Fair
Poor