hw3-sft-30b-a3b-fix
Full-parameter supervised fine-tune of nvidia/NVIDIA-Nemotron-3-Nano-30B-A3B-Base-BF16 (31.6B parameters, about 3B active per token), made for a course project as the SFT stage before reinforcement learning with verifiable rewards. These are research checkpoints from a single run, not a tuned release.
This run is a replica of rgould/hw3-sft-30b-a3b with one change. Training packs several samples into each 16,384-token row. In NeMo RL v0.6.0, the attention layers respect the boundaries between packed samples but the Mamba layers do not, so each sample after the first in a row starts from the Mamba state left by the samples before it. This run uses the upstream fix (NeMo RL #2529, backported), so Mamba state resets at every sample. The data, data order, learning rate schedule and batch size are the same as in the original run.
Checkpoints
Each saved checkpoint is on its own branch; main holds the final one (step 773, one epoch).
Validation loss is on 1,024 held-out samples from the same mix, packed as in training. Here the
Mamba state resets between packed samples, so the Base model's value is 0.8037 (0.7954 with the
unfixed packing used for the original run's numbers).
| Branch | Step | Val loss |
|---|---|---|
step-100 … step-700 | 100–700 | added as training runs |
main | 773 (final) | added as training finishes |
Training
- Framework: NeMo RL v0.6.0, Megatron backend, pipeline parallel 7, optimizer state on CPU.
- Objective: next-token loss on assistant turns only.
- Sequence packing: samples packed into 16,384-token rows with modified first-fit decreasing. Attention is masked at sample boundaries and Mamba state resets at each sample (NeMo RL #2529).
- Optimizer: AdamW (β 0.9 / 0.95, weight decay 0.1, gradient clip 1.0), bf16.
- Schedule: 773 steps × 1,024 samples (about 2.57B tokens, one epoch); 23 warmup steps, then cosine decay from 3e-5 to 3e-6. The peak learning rate came from a 40-step sweep (1e-5 to 2e-4) transferred to the full run's token horizon with the scaling law of Bjorck et al. (ICLR 2025).
- MoE router: auxiliary load-balancing loss off; the expert-bias update was kept.
Data
792,102 samples sampled from NVIDIA's post-training datasets, by token share: math 25% (Nemotron-SFT-Math-v3, Nemotron-Math-v2), code 20% (Nemotron-Competitive-Programming-v1, text-to-SQL from Nemotron-SFT-Competitive-Programming-v2), instruction following and chat 20% (Nemotron-SFT-Instruction-Following-Chat-v2), agentic tool use 20% (Nemotron-SFT-Agentic-v2), science 12% (Nemotron-Science-v1), general code 2% (Nemotron-SFT-OpenCode-v1) and safety about 1% (Nemotron-SFT-Safety-v1). About 87% of training tokens carry a reasoning trace; the rest train the model's reasoning-off mode.
User turns were decontaminated with 13-gram overlap against AIME 2024/2025, MATH-500, GPQA-Diamond, MMLU, MMLU-Pro, LiveCodeBench, HumanEval, MBPP, IFEval, IFBench and BFCL v3, which removed 6,141 samples (0.77%).
Usage
The chat template (chat_template.jinja) puts reasoning in <think>…</think> and writes tool calls
as XML. Reasoning is on by default; pass enable_thinking=False in the chat-template arguments to
turn it off.
from vllm import LLM, SamplingParams
llm = LLM("rgould/hw3-sft-30b-a3b", revision="main", trust_remote_code=True,
mamba_ssm_cache_dtype="float32")
params = SamplingParams(temperature=1.0, top_p=1.0, max_tokens=16384)
print(llm.chat([{"role": "user", "content": "What is the sum of the divisors of 36?"}], params)[0].outputs[0].text)
Sampling at temperature 1.0 and top-p 1.0 works best for reasoning (0.6 and 0.95 for tool calls). Greedy decoding can fall into repetition loops on long reasoning traces.
License
Licensed by NVIDIA Corporation under the NVIDIA Nemotron Model License. The full license text is in
LICENSE and the attribution notice in NOTICE.