Granite 4.2: How IBM Built Its Reasoning Model Family

Granite 4.2 is IBM‘s first family of dense, decoder-only reasoning LLMs, released in 3B, 8B, and 30B sizes under Apache 2.0. Earlier Granite releases were instruction-following assistants; 4.2 adds explicit reasoning. Every model can produce a chain of thought before its answer and run in thinking or non-thinking mode depending on how much deliberation a task needs, with a low-effort mode in between that spends a short reasoning budget on easy questions. All sizes natively support tool calling: served through an OpenAI-compatible endpoint such as vLLM, they emit tool calls in OpenAI function-calling format and plug into agentic harnesses like OpenHands, OpenCode, and Pi without extra glue. SGLang is also supported.

The three sizes share the same architecture and training pipeline at their own scale: a decoder-only dense transformer with grouped-query attention (40 heads, 8 KV heads for 3B; 32 heads, 8 KV heads for 8B and 30B), RoPE with theta = 10,000,000, SwiGLU MLPs, RMSNorm, untied input and output embeddings, and bfloat16. Pre-training runs from scratch on roughly 15T tokens with a five-phase strategy: phases 1-2 are foundational, phases 3-4 are mid-training with progressively higher-quality data annealing, and phase 5 extends the context window to 512K tokens. Each phase has its own data mixture and learning-rate schedule, closely following the previous Granite 4.1 recipe.

SFT combines agentic (31.6%) and non-agentic (68.4%) data: about 7.2M samples, roughly 100B tokens of which about 65B are trainable. The agentic corpus spans software engineering (69%), tool calling (12.1%), terminal use (8.0%), math (3.5%), search (0.8%), and action (0.2%), with trajectories from many scaffolds including OpenHands, OpenCode, Terminus-2, SWE-agent, OpenResearcher, MiniSWE, OpenSeeker, EnvScaler, Goose, Hermes, Codex, and Gemini CLI. Non-agentic data is instruction following (18.8%), coding (18.8%), math (14.6%), multilingual (7.0%), science (5.4%), reasoning (3.0%), and safety (0.8%). Quality control normalizes samples into OpenAI Chat format, uses LLM judges (GPT-OSS-120B, Gemma 4) to remove hallucinated or invalid-tool samples, and deduplicates with SHA-256. SFT trains on packed 128K sequences, global batch size 128, LR 1e-5 after warm-up, about 2 epochs; the 30B gets a second agentic-coding SFT phase at LR 3e-6 with 16% replay.

Post-training is a multi-stage, multi-environment RL curriculum rather than a single run: SFT, RLVR, skill boosters, SWE agent, Terminal agent, Search agent, and RLHF, with each stage an independent GRPO run warm-started from the previous checkpoint. RLVR is the foundational, verifiable-reward stage (math with boxed-answer checking plus Lean proofs, competitive coding under hidden tests, STEM MCQA, structured output and instruction following, tool calls, reasoning puzzles with abstention); 3B and 8B get two rounds, 30B three. Boosters then target instruction following and competitive coding with a light KL penalty. The agentic block is only for 8B/30B: a SWE agent editing real repositories in per-repo sandboxes with hidden-test rewards and the OpenHands harness; a Terminal agent via Harbor/Terminus-2 with up to 64 environment turns and a task-completion reward; and a Search agent doing live multi-hop web research judged by an LLM judge. Final RLHF on every size adds a generative reward model for preference plus a safety reward (jailbreak resistance, refusals) and a reasoning-length penalty. KL follows the reward type: 0 for verifiable/objective rewards (RLVR, SWE round 2), 0.01-0.05 for preference or safety.

The RL loop is asynchronous GRPO with generator and trainer on separate GPU pools feeding a shared buffer; a parameter refresh can land mid-rollout, leaving a trajectory stitched from two policy versions, bounded by a one-update staleness limit and truncated importance sampling. Advantages are group-relative with a leave-one-out baseline, so no value network is needed. Training uses NeMo-RL (Megatron-Core + vLLM generation with Megatron-Bridge for HF and checkpoint conversion) and NeMo-Gym, whose pluggable Resources make verifiers, sandboxes, tools, and reward models look identical to the GRPO loop. Hardware was an NVIDIA GB200 NVL72 cluster hosted by CoreWeave, with 72-GPU NVLink domains, 400 Gb/s InfiniBand NDR fabric, and thousands of GPUs.

Results scale consistently: for 3B/8B/30B, AIME25 78.33/86.67/89.17, HMMT Feb-25 66.67/78.33/89.17, GPQA 66.41 for 30B, MMLU-Pro 77.60, LiveCodeBench v6 75.77, SWE-bench Verified 47.67/57.00 (8B/30B), Terminal-Bench 21 20.56/29.24, and RULER 64K 67.52/80.99/89.96. Twelve languages are supported. Additionally shipped are FP8 (dynamic per-channel weights, per-token activations, no calibration), NVFP4/MXFP4 via GPTQ calibrated on 2K SFT samples, and GGUF via llama.cpp. Transformers quickstarts cover thinking, non-thinking, and low-effort modes, iterative tool calling with early function-call schema, multi-turn tool response, and parsing the model’s thinking block versus its final answer.

Granite 4.2 LLMs: How They're Built

View Original