nemo_automodel.recipes.decision.train_nemotron_decision
nemo_automodel.recipes.decision.train_nemotron_decision
Post-train Nemotron 3.5 Decision checkpoints on SystemOne records (LoRA or backbone fine-tuning).
Every question of a record is its own read, rendered with the checkpoint’s own decision contract
(decision_template.jinja and decision.json: the question’s option order and the checkpoint’s codes), which
ends in the mask token. The bidirectional Ministral 3 encoder reads it, and the frozen decision head’s logits at the
mask, restricted to the option codes, give the answer distribution. Supervision, the objective and the metrics are the shared decision
components: question_targets aligns answers, rewards and soft labels with each prompt’s option order,
assemble_decision_batch and DecisionLoss (loss.mode: sft) compute the loss, and DecisionEvaluator
scores validation and test. Training reads keep the checkpoint’s option order unless train.canonical_fraction is
below 1, in which case the remaining share is shuffled and re-coded by position.
peftset: LoRA on the attention/MLP projections; embeddings and the decision head stay frozen.peft: null: backbone fine-tuning of the encoder blocks and final norm; embeddings and the decision head stay frozen.mode: evalscores the configured checkpoint (orinit_fromstage) on validation and test.
Validation selects the published stage (LOWEST_VAL): most correct validation decisions, then lowest NLL; for LoRA
the starting checkpoint (step 0) is a saved, selectable stage; backbone fine-tuning selects among trained stages. Report
the test split separately; the validation split is not an untouched test. Export a selected stage as a complete
servable checkpoint with examples/decision/export_nemotron_decision.py.
Run with::
automodel examples/decision/nemotron_decision_support_routing_lora.yaml —nproc-per-node 1
Module Contents
Classes
Functions
Data
API
Bases: BaseRecipe
LoRA or full post-training of Nemotron 3.5 Decision checkpoints (see module docstring).
Encode every supervised question of records in the checkpoint’s option order.
Training keeps the questions the objective weights (a gold answer, or soft labels when they replace the gold target); evaluation keeps the questions the evaluator scores (a gold answer or rewards).
Parameters:
Validated SystemOne records of one split.
Whether the split trains the model.
Returns: list[_Decision]
The decisions, and the number of questions this model cannot read (media, a question that does not fit
Initialize weights from a published stage of the same base, method and readout contract.
Option logits of prompt, fp32 tensor of shape [options] in prompt order.
Write metrics_{split}.json (evaluator summary) and predictions_{split}.jsonl on the main rank.
Publish the trainable weights (LoRA adapter or consolidated full weights) as an immutable stage.
Supervision of prompt’s question, aligned with the prompt’s option order.
One-question loss targets with the configured question weights, on device (CPU by default).
Train; returns the validation-selected stage (the last stage when there is no validation split).
Selection record of the current weights on the validation split, or None without one.
Score every decision of split with the shared DecisionEvaluator.
Every rank runs the same number of forwards; padded duplicates are scored once.
Returns: tuple[dict[str, Any], list[dict[str, Any]]]
The evaluator summary and its per-decision predictions, identical on every rank.
Evaluate (mode: eval) or train, then report validation and test metrics of the selected weights.
Check the checkpoint contract, build the model, encode the splits and the optimizer.
One supervised question of a record, encoded in the checkpoint’s option order.
Serving prompt of the question (option labels and codes in prompt order).
The validated SystemOne record that holds the question.
Supervision aligned with prompt.labels.
CLI entry point: python -m nemo_automodel.recipes.decision.train_nemotron_decision --config <yaml>.
Lower-is-better scalar that orders stages by correct validation decisions, then by lower cross-entropy.
The cross-entropy term lies in [0, 0.99], below the gap of one correct decision, so the order is exactly
lexicographic for any validation size (every stage is scored on the same validation decisions).
Parameters:
Number of correctly decided labelled validation questions.
Mean validation cross-entropy, the evaluator’s nll (clipped to 99).