Lecture 15 · Case Study: Pre-Training Nemotron 3 Nano

Scalable AI: Bridging Theory, Understanding, and Practice · Lecture 15。个人学习讲义与配套实验,按主题整理并持续修订。

课程源码 ZIP ↓

个人整理的学习笔记,非官方讲义;课程来源与整理说明见课程介绍。配套示例未逐一运行验证。

本篇目录

Maps to: UC Berkeley EE 290/194 Scalable AI, Spring 2026 Lecture 8, Case Study: The Pre-Training of Nano-V3 (guest lecture by Roger Waleffe, NVIDIA; slides lecture8.pdf): pre-training data, model architecture, the pre-training decisions and how they were tested. The Fall 2026 offering’s Lecture 12 covers the same case study; its slides were not public when these notes were written. Recommended reading: NVIDIA, Nemotron 3 Nano: Open, Efficient Mixture-of-Experts Hybrid Mamba-Transformer Model for Agentic Reasoning (arXiv:2512.20848) and the Nemotron 3 White Paper (arXiv:2512.20856); the model card of nvidia/NVIDIA-Nemotron-3-Nano-30B-A3B-BF16; Waleffe et al., An Empirical Study of Mamba-based Language Models (arXiv:2406.07887); Dao and Gu, Transformers are SSMs (Mamba-2, arXiv:2405.21060); NVIDIA, Nemotron-H (arXiv:2504.03624); Su et al., Nemotron-CC (arXiv:2412.02595); DeepSeek-V3 §2.2 (multi-token prediction, arXiv:2412.19437); Arora et al., Zoology (associative recall, arXiv:2312.04927). Code: code/lecture15/ contains:

  • hybrid_math.py: parameter, cache and decode accounting, checked against the released checkpoint;
  • tiny_hybrid.py: a laptop-sized hybrid Mamba-2 / attention / MoE language model with an optional MTP head, and the associative-recall task;
  • ablation_planner.py;
  • five demos;
  • data/nano_v3_checkpoint.json: the checkpoint’s tensor shapes, read from its safetensors headers.

Reading time: ~2 hours for the prose; ~6 minutes to run all demos.


0. How to read this lecture

0.1 Learning goals

After this lecture you should be able to:

  1. Read a frontier model’s architecture from its config, and check its parameter count tensor by tensor against the released checkpoint.
  2. Explain each of Nemotron 3’s architecture choices from inference cost:
    • hybrid Mamba-2 / attention (constant per-sequence state);
    • MoE with GQA-2 (few active parameters, small KV cache);
    • multi-token prediction (speculative decoding);
    • latent MoE (more experts for the same FLOPs and traffic).
  3. Describe how a frontier data blend is built: curated web text, rephrased synthetic data, math and code, phases, and why MoEs push toward more unique data.
  4. Plan the hero run and its ablations: compute in each precision, steps and phases of the recipe, ablation budgets, and the minimal effect a benchmark can resolve.
  5. Design and read ablations. Know why continued-training branches are cheaper than from-scratch runs, what they can and cannot tell you, and why single small-scale runs mislead.

0.2 Prerequisites and scope

  • Prerequisites:
    • Lecture 4: MoE, GQA/MLA, Mamba in outline, Lecture 4’s nemotron_h_params.
    • Lecture 9: pre-training, WSD, number formats.
    • Lectures 10–11: data curation, rephrasing, annealing.
    • Lecture 13: evaluating claims fairly.
    • Lecture 14: GPU-hours and goodput.
  • Scope: the pre-training of Nemotron 3 Nano: data, architecture, the decisions and the ablations behind them.
  • Not in scope: its post-training (SFT, RL), which is the subject of Lecture 16 onward.

0.3 Section → code map

SectionIdeaCode in code/lecture15/
§1–§2goals; the data and the blend05_planning_the_hero_run.py (Part C)
§3.1–3.5the architecture: parameters, pattern, cache, decode cost, MoE shapeshybrid_math.py, 01_architecture_accounting.py
§3.2hybrid vs attention-only vs Mamba-only, smalltiny_hybrid.py, 02_hybrid_vs_transformer.py
§3.3–3.4MoE and multi-token prediction, small03_moe_and_mtp.py
§4the hero run: compute, recipe, long contextablation_planner.py, 05_planning_the_hero_run.py
§5ablations: continued branches vs from scratch04_ablation_methods.py

0.4 Notation

  • NN = parameters; NactN_{act} = active parameters per token; DD = training tokens.
  • LL = context length.
  • dd = hidden size.
  • EE = routed experts and kk = experts per token.
  • For Mamba-2: HH heads of dimension PP, and state size NsN_s per head row.

1. Why NVIDIA pre-trains Nemotron

The guest lecture gave three reasons:

  1. To accelerate the ecosystem. Nemotron is an open family of models (Nano, Super, Ultra; about 1,000 derivatives), data (9T tokens of disclosed pre-training data, 30M post-training samples), libraries (NeMo-RL, Minitron, neural architecture search) and research (200+ papers).
  2. To understand where AI is going. Designing GPUs for future workloads requires running those workloads.
  3. To co-design with the hardware. “Faster AI is smarter AI”: for a fixed inference budget, a faster model can think longer. Architectures are chosen for NVFP4, NVL72 racks and the inference engines that run them.

That third point is the thread of this lecture. Every architecture choice in §3 is argued from its effect on the accuracy-vs-inference-speed Pareto frontier.


2. Pre-training data

2.1 The key challenge: open, reproducible data at scale

Few large open pre-training datasets exist, and fewer come with reproducible curation and synthetic-data recipes. NVIDIA has open-sourced about 6.7T tokens of pre-training data.

Nemotron-CC is a Common-Crawl dataset tailored for long-horizon pre-training. V1 has 6.3T tokens: 4.4T globally deduplicated real tokens and 1.9T synthetic. It is built in four steps:

  1. HTML-to-text extraction and filtering.
  2. Language identification and global deduplication (Lecture 10).
  3. Model-based quality labelling: an ensemble of classifiers buckets every document by quality.
  4. Synthetic data generation (Lecture 11), applied by quality:
    • low-quality documents are rewritten in Wikipedia style;
    • high-quality documents are turned into diverse question–answer pairs, distilled, mined for knowledge, and condensed into knowledge lists.

Its high-quality subset beats DCLM by +5.6 MMLU points, and Nemotron-CC has 4× more unique tokens than DCLM. V2 adds eight more Common Crawl snapshots (2024–2025) and translated multilingual synthetic QA.

Nemotron-CC-Math (133B tokens) re-extracts math pages from Common Crawl with a pipeline that preserves equations and code. Its best subset (“4plus”) has 5× more tokens than FineMath and improves on it by +2.5 on math, +5.0 on code and +1.2 on knowledge benchmarks. MIND turns math documents into synthetic dialogues.

2.2 The blend and its phases

The data is divided into categories by domain and quality, and the high-quality sources in each category are weighted up.

  • Nano V2 used three phases, each more concentrated on high-quality data.
  • Nano V3 used two: 23.5T tokens in phase 1 and 1.5T in phase 2. Phase 2 is the high-quality blend placed where the learning rate decays (Lecture 10’s annealing, demo 05).

MoEs changed the blend. In NVIDIA’s experience, MoEs overfit repeated data more than dense models. So Nano V3 reduced the number of epochs over each source and raised the share of synthetic data, which adds unique tokens (perhaps with diminishing returns). The arithmetic (demo 05, Part C):

  • the model card discloses 10.65T unique tokens;
  • training saw 25T;
  • so each token was repeated ~2.35 times on average, more for the best sources.

The tech report’s abstract counts “more than 3 trillion new unique tokens over Nemotron 2”. Lectures 10 and 11 measured both halves of this trade on Atlas World: repetition is nearly free up to ~4 epochs and harmful past ~16, and rephrasing pays when real data is scarce.

2.3 How a blend decision is made: ablations

The slides’ example is from Nemotron-H: how to weight four multilingual sources?

  1. A 1B model is trained for 350B tokens.
  2. It is continued for another 100B tokens with 50% of the data from one multilingual source and 50% from the original blend.
  3. The resulting models are evaluated on Global-MMLU.

The winner, DiverseQA-crawl, got a higher weight in the final blend. §5 tests this protocol.


3. The architecture

3.1 The model, checked tensor by tensor

Nemotron 3 Nano (nvidia/NVIDIA-Nemotron-3-Nano-30B-A3B, released December 2025) has:

  • 52 layers: 23 Mamba-2 mixers, 23 MoE FFNs and 6 GQA attention layers;
  • hidden size 2,688 and a vocabulary of 131,072;
  • MoE layers with 128 routed experts plus 1 shared expert, 6 routed experts per token, squared-ReLU experts of width 1,856, and a shared expert of width 3,712;
  • attention with 32 query heads, 2 KV heads and head dimension 128;
  • Mamba-2 with 64 heads of dimension 64, 8 B/C groups, state size 128, a convolution of width 4, and an FP32 state cache.

The layer pattern (hybrid_override_pattern, M = Mamba-2, E = MoE, * = attention):

MEMEM*EMEMEM*EMEMEM*EMEMEM*EMEMEM*EMEMEMEM*EMEMEMEME

Demo 01 checks Lecture 4’s parameter formula against the safetensors headers of the released checkpoint (13 shards, 6,243 tensors):

componentparametersshare
embedding + head + final norm704,645,7602.2%
Mamba-2 mixers891,070,7842.8%
attention140,378,1120.4%
MoE routed experts29,374,808,06493.0%
MoE shared expert458,981,3761.5%
routers (+ score-correction biases)7,916,4160.0%
layer norms139,7760.0%
total (sum of all tensors)31,577,940,288
formula (Lecture 4’s nemotron_h_params)31,577,940,288exact

The formula reproduces the checkpoint exactly. (The Hugging Face API’s “total” field says 31,577,937,344, which is 2,944 fewer than its own BF16 + FP32 breakdown.) Per token, 6 of 128 routed experts are used, so 3.58B parameters are active (3.23B without the input embedding, which is a lookup and costs no FLOPs). That is the model card’s “3.5B active”, 11.3% of the total.

Note one detail the formula had to get right: the Mamba inner width is heads × head dimension = 4,096, not expand × hidden = 5,376. A first count that used expand overshot the checkpoint by 0.24B parameters.

3.2 Key technology 1: hybrid Mamba-2 / attention

Why. Self-attention is the expensive part of inference: its memory and compute per generated token grow linearly with the sequence length (the KV cache). A state-space model (状态空间模型) like Mamba-2 is a recurrence instead:

St=atSt−1+Δt xtBt⊤,yt=StCt+Dxt,at=exp⁡(ΔtA), A<0,S_t = a_t S_{t-1} + \Delta_t\, x_t B_t^\top,\qquad y_t = S_t C_t + D x_t,\qquad a_t = \exp(\Delta_t A),\ A<0,

where Δt,Bt,Ct\Delta_t, B_t, C_t are computed from the input (that is what makes it selective). During generation the memory and computation per token are constant, whatever the context length.

For training, Mamba-2’s SSD algorithm computes the same outputs for all positions in parallel. For a scalar decay per head it is an attention-like quadratic form, yt=∑s≤tLts(Ct⋅Bs)Δsxsy_t = \sum_{s\le t} L_{ts}(C_t\cdot B_s)\Delta_s x_s with Lts=exp⁡∑s<u≤tΔuAL_{ts} = \exp\sum_{s<u\le t}\Delta_u A. Our tiny_hybrid.Mamba2Mixer implements both forms. The parallel and recurrent forms agree to 2×10−72\times10^{-7}.

The catch. At 8B parameters and 3T tokens, pure Mamba-2 matched transformers on many tasks but fell short on long context, in-context learning and lookup tasks:

RULER (long context)
8B transformer77.6
8B Mamba-252.1
8B hybrid77.0

A recurrent state of fixed size cannot store everything an attention layer can look back at. Hybrids keep a few attention layers: about 8% of layers gave the best accuracy in NVIDIA’s study. On RULER (13 tasks) the 8B / 3T hybrid scored 77.0 vs the transformer’s 70.0, and it did well on 32K and 128K “phonebook” lookups. Nemotron-H-8B (15T tokens) and -56B (20T tokens, the first large-scale FP8 training) followed. Nano V3 uses 6 attention layers of 52 (11.5% of all layers, 21% of the sequence-mixing ones). The first is at index 5, and they are spaced 7–9 layers apart.

What it buys (demo 01). The cache one sequence keeps between decode steps (KV in BF16, Nano’s SSM state in FP32):

contextNano: KVNano: SSM + conv stateNano totalQwen3-30B-A3B (48 attention layers, 4 KV heads)ratio
4K25 MB49 MB74 MB403 MB5.4×
32K201 MB49 MB250 MB3.2 GB12.9×
256K1.6 GB49 MB1.66 GB25.8 GB15.5×
1M6.4 GB49 MB6.5 GB103 GB15.9×

That is 6 KB per token of context vs 96 KB. At short context Nano’s constant state dominates; at long context its 6 thin attention layers do.

Small models on a laptop (demo 02). Attention-only, Mamba-only and hybrid models (4 mixers + 4 FFNs, width 64) trained on Atlas World:

architecturepatternparamsval bits/bytedecode memory at 32Kat 1M
attention only*F*F*F*F230K0.769567 MB2.15 GB
Mamba-2 onlyMFMFMFMF276K0.759340 kB40 kB
hybridMFMF*FMF264K0.759816.8 MB537 MB

On Atlas World’s short, local documents, the models with Mamba layers are better by 0.01 bits/byte, with 15–20% more parameters. The decode memory differs by construction.

The phonebook task. Store nn key–value pairs, then answer every key: multi-query associative recall (Zoology). Width 128, 2 mixers, trained 1,500 steps at a fixed number of pairs, tested at 4–32 pairs (chance 3%):

trained atarchitecture4 pairs812162432
8attention only100%100%86%75%55%39%
8Mamba-2 only17%38%19%11%6%4%
8hybrid14%39%16%10%5%3%
16attention only32%15%8%26%15%11%
16Mamba-2 only18%13%15%35%19%10%
16hybrid87%94%93%91%83%70%

Plan vs reality, and the lesson. We expected “attention and hybrid solve it, Mamba fails at large nn”. What we measured is that which model learns the task in a fixed budget changes with the setting:

  • at 8 pairs, only attention learns it;
  • at 16 pairs, only the hybrid does.

Recall is learned through a sudden transition (an induction-style lookup), and its timing depends on the architecture, the task and the seed. In longer probes (3,000–4,000 steps):

  • Mamba-only reached 75% at 16 pairs but did not generalise to other sizes;
  • the others mostly stayed stuck;
  • a second seed of the attention-only model failed at 8 pairs where the first had succeeded.

A single small-scale, single-seed ablation would have “proved” either architecture better. What does not depend on training luck is the memory: the Mamba layer must fit every pair into a fixed 10 kB state, while attention can always look back. That is the structural reason production hybrids keep a few attention layers, and the reason §5 insists on ablations with several seeds.

3.3 Key technology 2: MoE + GQA-2

MoE replaces FFN layers with mixture-of-experts layers. MoEs give iso-accuracy with 3–4× fewer active parameters, which translates directly into training and inference FLOPs. GQA with 2 KV heads, instead of 8, cuts the KV cache 4×, a reduction similar to MLA’s.

Demo 03 tries MoE on the small model (800 steps, width 64):

FFNtotal paramsactive paramsval bits/byte
dense, dffd_{ff} = 192 (same active as the MoE)172K172K0.7708
MoE: 8 experts × 64 wide, top 2, + 1 shared321K173K0.7701
dense, dffd_{ff} = 576 (same total as the MoE)320K320K0.7705

All three are within the ~0.002 seed noise at this scale. A toy run cannot separate them, and the MoE advantage is a large-scale effect, measured at billions of parameters. What the toy does show is the accounting: the MoE carries the parameters of the big dense model while computing those of the small one.

3.4 Key technology 3: multi-token prediction

MTP appends extra layers that predict the token after next (and further). DeepSeek-V3’s form:

  1. combine the main model’s hidden state at tt with the embedding of token t+1t+1;
  2. run one more block;
  3. predict t+2t+2 with the shared head.

In training it is an auxiliary loss. In inference it is a built-in drafter for speculative decoding: generate more than one token per forward pass of the main model, and verify the extra tokens in the next pass.

Demo 03 adds an MTP module (loss weight 0.3) to the small model:

measure (greedy, validation text)value
main head’s loss: without MTP / with MTP0.7724 / 0.7728 bits/byte (within noise)
main head: top-1 accuracy for token t+1t+148.3%
MTP head: top-1 accuracy for token t+2t+247.4%
acceptance: MTP draft = main model’s next greedy token89.2%
tokens per main-model forward with 1 draft1.89

The draft is right about the true token less than half the time, but it agrees with the main model’s own choice 89% of the time. Agreement with the main model is what greedy speculative decoding checks, so one draft per step yields 1.89 tokens per forward pass, before the cost of running the MTP module.

3.5 Key technology 4: latent MoE, and the trend to smaller GEMMs

Latent MoE routes a compressed vector instead of the full hidden state: experts and routing operate on a latent dimension ℓ<d\ell < d. For the same FLOP and parameter budget, more experts can be both stored and activated, which means higher accuracy at the same inference cost. (Against a Kimi-K2-sized standard MoE, the latent version is more accurate at similar inference cost. Against an iso-accurate larger standard MoE, it is faster.)

The guest lecture’s hypothetical h=8192h = 8192 model makes the trade concrete. Demo 01 reproduces its numbers (FP8 dispatch, BF16 activations):

designFC1 grouped GEMMFC1 FLOPs / tokenactivation memory / tokenEP dispatch / token
non-granular: 1 of 16 experts, dffd_{ff} = 5h(16, s/16, 8192) × (16, 8192, 40960)671M81.9 KB8.2 KB
granular: 8 of 128, dffd_{ff} = 5h/8(128, s/16, 8192) × (128, 8192, 5120)671M81.9 KB65.5 KB
latent: 32 of 512 on ℓ\ell = h/4(512, s/16, 2048) × (512, 2048, 5120)671M327.7 KB65.5 KB

All three cost the same FLOPs; they differ elsewhere:

  • Granularity keeps the activation memory and multiplies expert-parallel traffic 8×.
  • Latent routing keeps that traffic and quadruples the activation memory.
  • Both turn a few large GEMMs into many small ones: from dense models (Llama 3) through non-granular MoEs (Mixtral), granular MoEs (DeepSeek-V3) and latent MoEs (Nemotron 3).

Kernels and parallel layouts must follow that trend. (Nano V3 itself uses a granular MoE with a shared expert; latent MoE arrives in the larger Nemotron 3 models.)

3.6 What it all buys: decode throughput

Decode is memory-bound (Lecture 2). Each step reads the active weights once for the whole batch, plus every sequence’s cache. Demo 01’s first-order roofline on one B200 (180 GB, 8 TB/s; no kernel overheads, uniform routing):

contextNano: batch that fitstokens/sQwen3-30B-A3B: batchtokens/sratioratio at Qwen3’s batch
8K99437,8561256,2086.1×2.0×
32K39417,467311,62710.7×2.6×
128K1155,538749211.2×4.2×
256K592,953326711.1×5.4×

At batch 1 the two read similar bytes per step (6.6 vs 6.9 GB, mostly active weights): single-stream speed is set by active parameters. The hybrid’s advantage is concurrency at long context. More sequences fit, and each step reads less cache.

NVIDIA reports up to 3.3× higher measured throughput than Qwen3-30B-A3B and GPT-OSS-20B. A first-order roofline overstates real systems, but it shows where the advantage comes from.


4. Planning and running the hero run

4.1 The decisions

The guest lecture listed what must be decided before the “hero run” (the one large training run):

  • data: sources, blends, curriculum, tokenizer, token horizon;
  • architecture: overall design, hidden size, number of layers, heads, MTP layers;
  • precision recipe;
  • optimisation: batch size (and its ramp-up), learning rate (maximum, minimum, schedule), weight decay, optimizer and its hyperparameters, auxiliary losses and coefficients, initialisation;
  • code: correctness, optimisations and parallelism, fault tolerance and goodput (Lecture 14).

4.2 The published recipe

From the model card:

  • 25T tokens;
  • batch 3,072 sequences of 8,192 tokens;
  • WSD schedule with 8B tokens of warm-up, peak learning rate 10−310^{-3}, minimum 10−510^{-5}.

In steps (demo 05):

quantityvalue
tokens per step25.2M
steps for 25T tokens~993K
warm-up (8B tokens)318 steps (0.03% of the run)
phase 1 (23.5T) / phase 2 (1.5T)934K / 60K steps
learning rate10−3→10−510^{-3} \to 10^{-5} (100× decay)

WSD vs cosine was itself an ablation. Questions: what maximum learning rate, what fraction of decay, and can WSD match cosine? If it can, it gives the flexibility of Lecture 12: decide when to stop, and branch cooldowns.

4.3 Compute and precision

The hero run is 6NactD6 N_{act} D + attention ≈ 5.1×10235.1\times10^{23} FLOPs. Attention adds 6.2% at 8K context with 6 attention layers. Converted to GPU-hours (demo 05, 40% MFU assumed):

acceleratorGEMM precisionGPU-hourson 1,024 GPUs
H100BF16361K15 days
H100FP8181K7 days
B200BF16159K6 days
B200FP879K3 days
B200NVFP440K2 days

A dense 8B model on the same 25T tokens would cost 2.3× as much. Few active parameters are what make 25T tokens affordable for a 31.6B-parameter model.

NVFP4 (Lecture 9’s 4-bit block-scaled format) doubles FP8 throughput on Blackwell. The precision decision was made by ablation: loss of NVFP4 vs BF16 pre-training runs (an 8B-active MoE on 1T tokens), with the NVFP4 recipe itself (which layers stay in higher precision, scaling) and the effect of model size as variables.

4.4 Long-context extension

The recipe:

  • main pre-training of 25T tokens at 8K sequence length;
  • then about 100B tokens at 512K–1M context, at a constant (tuned) learning rate, with the same tokens per batch;
  • a blend of 80% final pre-training data and 20% synthetic long-context data.

The challenge: short-context benchmarks can degrade. The workaround is to mix short sequences in with the long ones.

Here the hybrid pays in training too (demo 05, Part E). Attention FLOPs per token at context LL grow linearly in LL:

contextattention / 6Nact6N_{act}, Nano (6 attention layers)if all 52 layers were attention
8K0.06×0.5×
128K1.0×8.6×
512K4.0×34.6×
1M8.0×69×

The 100B-token extension at 512K costs Nano ~2% of the hero run’s GPU-hours, against ~13% for an all-attention model of the same size. On RULER-100, the post-trained model scores 92.9 at 256K, 91.3 at 512K and 86.3 at 1M (model card).


5. Ablations: how decisions are tested

5.1 What an ablation budget buys

With 10% of the hero run’s budget (36K H100-hours in BF16), using a 1B dense proxy (demo 05, Part D):

protocolGPU-hours eachhow many fit
from scratch, 450B tokens1,89519
continued: one shared 350B-token base (1,474 once) + 100B-token branches42182

Each ablation must also be measurable. For two models at ~60% accuracy, the smallest difference detectable at 95% is:

benchmarkquestionsminimal detectable gap
MMLU14,0421.1 points
GSM8K1,3193.7 points
a 500-question custom eval5006.1 points
HumanEval16410.6 points

Seed-to-seed training noise comes on top. So ablations are read on large or averaged benchmarks, and with several seeds.

5.2 Do continued branches rank candidates like from-scratch runs?

Demo 04 tests the Nemotron-H protocol on Atlas World. The candidates are its four domains. A blend is 50% natural mix + 50% one source, and the target is the average of the four per-domain losses (the “benchmark average” a team ranks by).

  • From scratch: one 750-step run per blend, WSD decaying over the last 150 steps.
  • Continued: one 600-step base at constant learning rate, then a 150-step decay branch per candidate.
candidategain from scratch (seed 0)gain from scratch (seed 1)gain, continued branch
+ story−0.0220−0.0099−0.0131
+ wiki−0.0075+0.0011−0.0036
+ math+0.0301+0.0339+0.0068
+ code−0.0074−0.0017−0.0059

(Gain = reduction of the average bits/byte vs the natural mix alone.)

Four lessons:

  1. The cheap method agrees. The branches cost 1,350 steps against 3,750 (2.8× cheaper) and pick the same winner (math). They rank the four candidates with Spearman 0.80 against the from-scratch ranking, exactly as well as two from-scratch seeds agree with each other (0.80).
  2. Rank, don’t size. The best source gains +0.0068 in a branch vs +0.0301 from scratch. A short branch moves a model less than training on the blend from the start. Ablations rank candidates; the size of the effect must be confirmed at scale.
  3. Noise decides what can be ranked. A second seed moves the average by up to 0.0094. Math’s lead (0.0375) is far above that; the order of the other three is within it.
  4. The metric is a decision. Math wins the average because math has by far the highest loss, so the average rewards fixing the worst domain. Each source helps its own domain most in all four domains, so a different target would pick a different winner.

Together with §3.2’s recall result, this is the case for how Nemotron’s team works:

  • large proxies;
  • shared bases with branches;
  • several seeds;
  • averaged benchmarks;
  • and confirmation at scale before a choice enters the hero run.

6. The result

The post-trained Nano V3 against similar-sized open models (model card, selected rows; higher is better):

benchmarkNemotron 3 NanoQwen3-30B-A3B-Thinking-2507GPT-OSS-20B
MMLU-Pro78.380.975.0
AIME25 (no tools)89.185.091.7
GPQA (no tools)73.073.471.5
LiveCodeBench v668.366.061.0
SWE-Bench (OpenHands)38.822.034.0
RULER-100 @ 1M86.377.5–
Arena-Hard-V2 (average)67.757.848.6

It is roughly on par in accuracy and ahead at long context. Combined with the throughput advantage of §3.6, it sits further out on the accuracy-vs-speed Pareto frontier, which was the design goal. Per Lecture 13 §2, read these as evaluated by the publisher with its own harness (NeMo Evaluator). §5’s error bars apply.

What comes next, in the guest lecture’s words: DeepSeek-V4’s ideas (sparse attention, Engram tables of Lecture 13) are candidates for the next architecture.


7. Summary

  • Nemotron 3 Nano is a 31.6B-parameter hybrid Mamba-2 / attention MoE with 3.58B active parameters per token. Its config reproduces the released checkpoint tensor by tensor; 93% of its parameters are routed experts.
  • Every architecture choice is an inference-cost argument. Mamba-2 layers keep a constant per-sequence state; 6 attention layers with 2 KV heads keep long-context recall at 6 KB of cache per token (vs 96 KB for Qwen3-30B-A3B). MoE keeps active parameters small; MTP drafts tokens for speculative decoding; latent MoE fits more experts in the same FLOPs and traffic.
  • The data: curated Common Crawl plus large-scale rephrased synthetic data, math and code; 25T tokens in two phases over ~10.6T unique tokens (~2.35 epochs), with fewer epochs and more synthetic data because MoEs overfit repetition.
  • The recipe: WSD from 10−310^{-3} to 10−510^{-5} over ~1M steps of 25M tokens, then ~100B tokens at up to 1M context, where 6 attention layers instead of 52 make the extension ~6× cheaper.
  • Ablations decide. Continued-training branches rank candidates as well as from-scratch runs at a fraction of the cost, but shrink effect sizes. Small single-seed runs can mislead completely, as our recall experiment did. Benchmarks must be large enough to resolve the effect.

8. Common pitfalls

  • Counting a hybrid’s inner width with expand × hidden when the checkpoint uses heads × head dimension. Check against the tensors.
  • Comparing models at batch 1 only. The hybrid’s advantage is concurrency at long context.
  • Quoting active parameters with or without embeddings without saying which.
  • Reading a toy ablation’s winner as a fact without seeds, settings and scale.
  • Trusting a branch’s effect size. Branches are for ranking.
  • Ranking candidates on a benchmark whose resolvable gap exceeds the effect.
  • Long-context extension without mixing in short sequences: short-context scores drop.

9. Exercises

  1. Active parameters. From §3.1’s table, compute Nano’s active parameters per token by hand: shared expert + 6 routed experts per MoE layer, all Mamba, attention, norms, routers, embeddings and head.
Answer

One routed expert: 2 × 2688 × 1856 = 9,977,856. Per MoE layer active: 6 × 9,977,856 + 19,955,712 (shared) + 344,064 + 128 (router + bias) + 2,688 (norm) = 80,169,728; × 23 = 1,843,903,744. Mamba 891,070,784 + its 23 norms counted in the layer-norm row; attention 140,378,112; embeddings + head + final norm 704,645,760; Mamba and attention layer norms 29 × 2,688 = 77,952. Total ≈ 3,580,076,352 = 3.58B, as demo 01 prints.

  1. KV cache. Nano has 6 attention layers with 2 KV heads of dimension 128. How many bytes of BF16 KV cache per token of context? At 1M tokens? Compare with a model with 48 attention layers and 8 KV heads.
Answer

2 (K, V) × 6 × 2 × 128 × 2 B = 6,144 B per token; × 1,048,576 = 6.4 GB. The other: 2 × 48 × 8 × 128 × 2 = 196,608 B per token (32×), 206 GB at 1M.

  1. Steps and warm-up. A run uses batch 2,048 × 8,192 tokens and 15T tokens with 10B warm-up tokens. Steps, warm-up steps, and the share of the run in warm-up?
Answer

16.8M tokens per step; 15e12/16.8e6 = 894K steps; warm-up 596 steps = 0.07% of the run.

  1. Ablation budget. With 50K GPU-hours, from-scratch ablations cost 2,000 GPU-hours each, a shared base 1,500 and each branch 450. How many candidates can each protocol test? If the branch effect is 4× smaller than the from-scratch effect and the noise is the same, what does that do to the smallest effect you can rank?
Answer

25 from scratch; (50,000 − 1,500)/450 = 107 branches. If effects shrink 4× and noise does not, the smallest rankable effect (in hero-run terms) is 4× larger. Branches buy breadth (many candidates), not resolution; promising candidates are re-checked from scratch or with more seeds.

  1. Speculative decoding. An MTP drafter’s draft is accepted with probability 0.85. With one draft per step, how many tokens per main-model forward? With two drafts per step, if the second is accepted (given the first was) with probability 0.7?
Answer

One draft: 1 + 0.85 = 1.85. Two drafts: 1 + 0.85 + 0.85 × 0.7 = 2.45 tokens per forward, minus the cost of running the drafter.

  1. Long context. Using §4.4’s table, why does long-context extension cost ~2% of the hero run for Nano but ~13% for an all-attention model, although it is only 100B tokens (0.4% of 25T)?
Answer

At 512K context attention adds 4× the 6N FLOPs per token for Nano (35× for all-attention), so each extension token costs ~5× (~36×) a pre-training token. 0.4% of the tokens × ~5 ≈ 2%; × ~36 ≈ 13%.

Spring 2026’s Assignment 2 (pre-training from scratch on one 8×H100 node) used a training stack for the hybrid Nemotron-Nano-V3 architecture. The course blog reports students getting a stack that was broken for the hybrid to working speed (up to ~95× throughput) and pre-training base models rivalling a recent 1B model trained on ~68× more data. The lessons of this lecture apply directly:

  • check your parameter accounting against the config;
  • measure what the hybrid layers cost on your kernels;
  • plan ablations with seeds and branches;
  • read effects against benchmark error bars.

No assignment solutions are given here.

11. Research directions

  • The best mix of mixers. How many attention layers, where, and of what kind (full, sliding window, sparse), for a given context distribution.
  • Recall in state-space models. Larger or structured states, or retrieval-augmented SSMs, that close the lookup gap without attention’s cache.
  • Ablation science. Which proxy sizes, branch lengths and metrics predict hero-run decisions; quantifying the rank agreement we measured at 0.80 across scales.
  • Data for MoEs. Repetition tolerance as a function of sparsity; the value of synthetic unique tokens.
  • FP4 pre-training. Which parts of the network need higher precision, and how the loss gap scales with model size.

12. Further reading

  • NVIDIA, Nemotron 3 Nano (arXiv:2512.20848); Nemotron 3 White Paper (arXiv:2512.20856); Nemotron-H (arXiv:2504.03624).
  • Waleffe et al., An Empirical Study of Mamba-based Language Models (arXiv:2406.07887).
  • Gu and Dao, Mamba (arXiv:2312.00752); Dao and Gu, Transformers are SSMs (Mamba-2, arXiv:2405.21060).
  • Su et al., Nemotron-CC (arXiv:2412.02595); Mahabadi et al., Nemotron-CC-Math (2025); Akter et al., MIND (ICLR 2025); Diao et al., Nemotron-CLIMB (NeurIPS 2025).
  • DeepSeek-AI, DeepSeek-V3 (MTP, arXiv:2412.19437); Arora et al., Zoology (arXiv:2312.04927).
  • NVIDIA, Pretraining LLMs with NVFP4 (2025); Hägele et al., Scaling Laws and Compute-Optimal Training Beyond Fixed Training Durations (WSD, arXiv:2405.18392).

13. Next lecture

Lecture 16 · Introduction to Post-Training. A base model like Nano V3 continues any document but knows nothing about roles, turns or tools. Lecture 16 covers:

  • how chat turns, tool calls, reasoning and preferences are written into tokens through a chat template, and which tokens get gradient;
  • what parsers and constrained decoding do at serving time, and why tool results are untrusted input;
  • the post-training lifecycle: SFT, preference tuning (RLHF, DPO and reward over-optimisation), RL with verifiable rewards (GRPO);
  • how to evaluate a model on many capabilities without fooling yourself.

术语表 (Glossary, English → 中文)

English中文
case study / hero run案例研究 / 主训练(最终大规模训练)
hybrid model / layer pattern混合模型 / 层排列模式
state-space model (SSM) / Mamba-2状态空间模型 / Mamba-2
selective / recurrence / state选择性 / 递推 / 状态
structured state-space duality (SSD)结构化状态空间对偶
mixture of experts (MoE) / shared expert / routed expert混合专家 / 共享专家 / 路由专家
active parameters激活参数
grouped-query attention (GQA) / KV cache分组查询注意力 / 键值缓存
multi-token prediction (MTP) / speculative decoding / acceptance rate多词元预测 / 投机解码 / 接受率
latent MoE / granular MoE潜空间专家 / 细粒度专家
expert parallelism (EP) / dispatch专家并行 / 分发
associative recall / induction head联想回忆 / 归纳头
data blend / phase / epoch数据配比 / 阶段 / 轮次
quality labelling / synthetic rephrasing质量标注 / 合成改写
ablation / continued-training branch消融实验 / 续训分支
minimal detectable effect / noise floor最小可检测效应 / 噪声底
warm-up–stable–decay (WSD)预热-稳定-衰减学习率调度
NVFP4 / block scalingNVFP4(4 位块缩放浮点) / 块缩放
long-context extension长上下文扩展
decode / concurrency / roofline解码 / 并发 / 屋顶线模型
Pareto frontier帕累托前沿
← 返回课程目录