Skip to content

In development. Expect rough edges and changes. The source code is not public yet.

Hugging Face 22 min read Deep dive hardMaster

Granite 4.2 LLMs: How They're Built

Granite 4.2 is IBM's family of dense decoder-only reasoning LLMs (3B, 8B, 30B), post-trained from Granite-4.1 bases pre-trained on ~15T tokens with a five-phase schedule reaching 512K context. SFT uses ~7.2M samples (~100B tokens) mixing agentic trajectories from many harnesses with non-agentic data, filtered by LLM judges and SHA-256 deduplication. A chain of warm-started asynchronous GRPO stages follows: RLVR, skill boosters, agentic RL in real sandboxes for SWE, terminal and search on the 8B and 30B models, and RLHF. The post gives per-stage hyperparameters, a KL schedule tied to reward type, and off-policy handling via bounded staleness and truncated importance sampling.

Related posts

  • Granite 4.1 LLMs: How They’re Built

    Hugging Face hardMaster

    Granite 4.1 is IBM's family of dense decoder-only LLMs (3B, 8B, 30B) trained on ~15T tokens through five pre-training phases that shift from web-heavy data to math/code, high-quality annealing with chain-of-thought and instruction data, and staged long-context extension to 512K with model merging after each stage. SFT uses ~4.1M samples curated by an LLM-as-Judge rubric with hard-reject rules plus deterministic filtering and deduplication. A four-stage RL pipeline follows, using on-policy GRPO with DAPO loss and dynamic sampling turned off: multi-domain RL, RLHF, identity/calibration, then math RL to recover math scores lost during RLHF. Per-stage learning rates and KL coefficients are given, and the 8B instruct model matches or beats the earlier 32B-A9B MoE Granite 4.0-H-Small.

  • SmolLM3: smol, multilingual, long-context reasoner

    Hugging Face hardMaster

    SmolLM3 is a fully open 3B decoder model trained on 11.2T tokens that outperforms Llama-3.2-3B and Qwen2.5-3B and is competitive with 4B models, with dual think/no_think reasoning modes, six languages and 128k context. The recipe uses GQA, NoPE on every 4th layer, intra-document masking and no weight decay on embeddings, trained on 384 H100s with a three-stage web/code/math mixture under a WSD schedule. Mid-training extends context to 64k via RoPE theta increases (YaRN for 128k) and adds 140B tokens of reasoning traces. Post-training combines SFT on synthetic Qwen3-32B reasoning data with Anchored Preference Optimization, then uses model merging to recover the long-context performance lost during reasoning training.

  • GLM-5.2: Built for Long-Horizon Tasks

    Hugging Face hardMaster

    GLM-5.2 is Z.ai's MIT-licensed flagship model for long-horizon coding-agent work, with a 1M-token context and selectable thinking effort levels. It scores 81.0 on Terminal-Bench 2.1 and lands near Claude Opus 4.8 on FrontierSWE. Architecturally, IndexShare reuses one sparse-attention indexer across every four DSA layers, cutting per-token FLOPs 2.9× at 1M context. An improved MTP draft layer, using shared indices and KV, rejection sampling and an end-to-end TV loss, raises speculative-decoding acceptance length by 20%. Post-training switches from group-wise optimization to critic-based PPO, which handles compacted sub-traces, and uses slime for agentic RL plus a two-stage rule-and-LLM-judge guard that blocks reward-hacking tool calls online without aborting rollouts.

  • Open-R1: a fully open reproduction of DeepSeek-R1

    Hugging Face easyNovice

    Open-R1 is a Hugging Face project to openly reconstruct DeepSeek-R1's missing training data and code, since only the model weights were released. DeepSeek-R1 builds on the 671B MoE DeepSeek-V3. R1-Zero was trained with pure reinforcement learning using GRPO and simple accuracy and format rewards, while R1 added a cold-start SFT phase followed by further RL and rejection sampling to improve readability. The plan has three steps: distill a reasoning dataset from R1 to replicate the R1-Distill models, replicate the pure-RL R1-Zero pipeline with new math, reasoning and code datasets, and demonstrate multi-stage base → SFT → RL training.

  • Build a Domain-Specific Embedding Model in Under a Day

    Hugging Face mediumAdept

    A single-GPU pipeline fine-tunes Llama-Nemotron-Embed-1B-v2 for a specific domain in under a day without manual labels. An LLM generates synthetic single- and multi-hop QA pairs from raw documents, which are quality-filtered. The base model then mines hard negatives, using a 95% margin ceiling to avoid false negatives. Training is a contrastive biencoder run at temperature 0.02, followed by BEIR evaluation, ONNX/TensorRT export and serving through NIM. On NVIDIA docs this gave about 10% gains in NDCG@10 and Recall@10, and Atlassian raised Jira Recall@60 from 0.751 to 0.951. The guide also covers practical defaults: 1–2 epochs for real data, LR 1e-5, and 1 positive plus 4 hard negatives per query.

The quest for software engineering knowledge.

Look:
Layout: