ModelOpt for Researchers: Fast Experimentation Workflows

July 23, 2026 · View on GitHub

Model optimization research depends on short feedback loops: test a hypothesis cheaply, compare candidates reproducibly, and spend full-scale compute only on the most promising experiments. This guide collects practical ModelOpt workflows for that iterative research process.

Current workflows include:

The guide will grow as additional research workflows are documented. It complements the feature-specific examples by connecting them into experimentation strategies rather than replacing their detailed instructions.

Efficient evaluation with LM-Eval Harness

LM-Eval Harness supports many accuracy benchmarks, but full runs are often too slow for every iteration of model pruning, distillation, or quantization. Use progressively larger evaluation subsets to reject weak candidates quickly and reserve full runs for the most promising models.

In LM-Eval, --limit N evaluates the first N samples of each individual task. For task groups such as MMLU and MMLU-Pro, the limit applies to every subject, not to the group as a whole.

The following table gives a practical progression for LM-Eval's MMLU-Pro task group, which contains 14 subjects and 12,032 questions. Example times assume Qwen3-8B, a batch size of 4, and subject-level parallelism on eight H100 80GB GPUs:

Limit per subjectQuestions evaluatedWorst-case 95% margin of errorExample time
10140±8.3 percentage points~3 minutes
50700±3.7 percentage points~14 minutes
1001,400±2.6 percentage points~28 minutes
2002,800±1.9 percentage points~56 minutes
None12,032±0.9 percentage points4 hours

The example times scale an approximately four-hour full run by the fraction of questions evaluated. Actual time depends on the model, hardware, batch size, and parallelism.

The margins of error are conservative planning estimates. They use 50% accuracy, the normal approximation for a binomial proportion confidence interval.

These estimates treat benchmark questions as independent random samples from a broader population of possible questions. Because --limit selects the first samples, limited scores may also be affected by dataset ordering and should not be reported as final benchmark results.

Add --log_samples for paired per-question analysis. When multiple GPUs are available, use data parallelism to split samples across model copies; see the LM-Eval examples for commands.

Track downstream quality over time during distillation

Validation KD and CE losses show whether the student is fitting the teacher and validation data, but they do not necessarily predict downstream accuracy. Keep the Megatron checkpoints saved at validation intervals, export them to Hugging Face format, and evaluate the resulting checkpoints to see when downstream quality improves, plateaus, or regresses.

See the Megatron-Bridge distillation guide for how to retain and export intermediate distillation checkpoints.

Evaluate the teacher, pruned student, and each exported checkpoint. Follow the LM-Eval Harness instructions and use the efficient evaluation workflow to choose limits.

The following experiment pruned Qwen3-8B to 0.7x and distilled the same student for approximately 100 million tokens using four data recipes. All runs used a global batch size of 8 and sequence length of 4,096. MMLU used 25 questions per subject (1,425 total), and MMLU-Pro used 50 per subject (700 total). The tables show representative checkpoints; token counts are derived from the consumed fixed-length training sequences.

Measured compute per data recipe on eight H100 80GB GPUs:

StageCheckpointsTimeGPU use
Distillation to 100M tokens-~2h10m8 GPUs
MMLU trajectory21~51m8 GPUs
MMLU-Pro trajectory13~3h50mTwo checkpoints in parallel, 4 GPUs each
Total-~6h50mExcludes Slurm queue and worker setup
Baseline modelMMLUMMLU-Pro
Teacher: Qwen3-8B74.93% (full)58.62% (full)
Pruned 0.7x student48.69% (full)23.09% (full)

WikiText

  • Dataset: Salesforce/wikitext (wikitext-103-v1)
  • Teacher CE: 2.6834
Training tokensValidation KDValidation CEMMLUMMLU-Pro
00.82613.345848.69% (full)23.09% (full)
0.7M0.30312.657059.72%25.00%
3.3M0.23432.609163.58%29.29%
39.3M0.14952.566565.89%39.86%
78.6M0.13152.569966.46%39.57%
100.0M0.12912.586367.30%40.57%

Nemotron v2

  • Dataset: nvidia/Nemotron-Post-Training-Dataset-v2 (math and stem)
  • Teacher CE: 1.1566
Training tokensValidation KDValidation CEMMLUMMLU-Pro
00.51871.473948.69% (full)23.09% (full)
0.7M0.19191.093158.74%13.14%
3.3M0.13421.055060.56%14.29%
39.3M0.06751.029664.63%6.14%
78.6M0.06131.077365.61%7.71%
100.0M0.05821.051665.75%11.29%

50/50 WikiText and Nemotron v2 blend

  • Dataset: 50/50 blend of WikiText and Nemotron v2 math and stem
  • Teacher CE: 1.9025
Training tokensValidation KDValidation CEMMLUMMLU-Pro
00.66622.378048.69% (full)23.09% (full)
0.7M0.24791.836357.89%12.57%
3.3M0.18242.026562.46%23.14%
39.3M0.11641.915767.44%33.86%
78.6M0.09731.850367.72%41.57%
100.0M0.09161.768068.28%41.71%

Nemotron 3

Training tokensValidation KDValidation CEMMLUMMLU-Pro
00.63951.911348.69% (full)23.09% (full)
0.7M0.24241.591057.05%24.86%
3.3M0.16041.519062.46%36.86%
39.3M0.09781.414467.23%45.00%
78.6M0.08901.411267.93%47.14%
100.0M0.08451.465667.37%47.71%

Interesting observations include:

  • All four data recipes recover MMLU to about 66% to 68% by 100 million tokens. The 50/50 blend is numerically highest at 68.28%.
  • Nemotron 3 produces the strongest MMLU-Pro trajectory, reaching 47.71%.
  • Although Nemotron v2 performs poorly alone, its 50/50 blend with WikiText slightly outperforms WikiText alone on both final benchmarks.
  • Nemotron v2 KD continues to decrease, but its MMLU-Pro score remains below the pruned baseline. The severe MMLU-Pro regression appears to come from overfitting to Nemotron v2-style responses, even though MMLU-Pro prompts ask the model to answer in a specific multiple-choice style.

Prepare token-budgeted data blends

Preparing complete distillation datasets can consume unnecessary time and storage during early experiments. ModelOpt can preserve source weights while preparing only a requested token budget. See Prepare token-budgeted data blends for the configuration format, commands, and generated outputs.

Planned topics

Future additions can cover:

  • Iterative pruning and distillation workflows