> This page is for version 0.5.0 · 26.06.
> For other versions, use one of these documentation indexes:
> - Nightly (default): https://docs.nvidia.com/nemo/automodel/nightly/llms.txt
> - Latest: https://docs.nvidia.com/nemo/automodel/latest/llms.txt
> - 0.7.0 · 26.10: https://docs.nvidia.com/nemo/automodel/v0.7/llms.txt
> - 0.5.0 · 26.06: https://docs.nvidia.com/nemo/automodel/v0.5/llms.txt
> - 0.4.0 · 26.04: https://docs.nvidia.com/nemo/automodel/v0.4/llms.txt

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.nvidia.com/nemo/automodel/llms.txt.

# nemo_automodel.components.models.nemotron_decision.scorer

Scoring and checkpoint-contract checks for Nemotron Decision post-training.

## Module Contents

### Functions

| Name                                                                                                            | Description                                                                                                    |
| --------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- |
| [`full_finetune_trainable`](#nemo_automodel-components-models-nemotron_decision-scorer-full_finetune_trainable) | Whether backbone fine-tuning trains this parameter: decoder layers and final norm, not embeddings or the head. |
| [`gather_head_rows`](#nemo_automodel-components-models-nemotron_decision-scorer-gather_head_rows)               | Rows of the frozen, bias-free decision head for `token_ids`.                                                   |
| [`option_logits`](#nemo_automodel-components-models-nemotron_decision-scorer-option_logits)                     | Option logits of one question: one bidirectional read of `prompt + [mask]`, head restricted to the codes.      |
| [`require_decision_config`](#nemo_automodel-components-models-nemotron_decision-scorer-require_decision_config) | Reject checkpoints whose runtime contract this recipe does not implement.                                      |

### Data

[`FULL_FINETUNE_PREFIXES`](#nemo_automodel-components-models-nemotron_decision-scorer-FULL_FINETUNE_PREFIXES)

[`_WRAPPER_SEGMENTS`](#nemo_automodel-components-models-nemotron_decision-scorer-_WRAPPER_SEGMENTS)

### API

```python
nemo_automodel.components.models.nemotron_decision.scorer.full_finetune_trainable(
    parameter_name: str
) -> bool
```

Whether backbone fine-tuning trains this parameter: decoder layers and final norm, not embeddings or the head.

Activation-checkpoint and `torch.compile` wrapper segments in the name are ignored.

```python
nemo_automodel.components.models.nemotron_decision.scorer.gather_head_rows(
    model: torch.nn.Module,
    token_ids: typing.Sequence[int]
) -> torch.Tensor
```

Rows of the frozen, bias-free decision head for `token_ids`.

All ranks must call this when the head weight is a sharded `DTensor`.

**Parameters:**

**`model`** `nn.Module`

Model exposing the decision head through `get_output_embeddings()`.

---

**`token_ids`** `Sequence[int]`

Vocabulary ids of the rows to gather, length `T`.

---

**Returns:** `torch.Tensor`

Tensor of shape `[T, hidden]` in the head's dtype (a copy).

```python
nemo_automodel.components.models.nemotron_decision.scorer.option_logits(
    model: torch.nn.Module,
    input_ids: typing.Sequence[int],
    code_token_ids: typing.Sequence[int],
    mask_token_id: int,
    rows: dict[int, torch.Tensor],
    device: torch.device
) -> torch.Tensor
```

Option logits of one question: one bidirectional read of `prompt + [mask]`, head restricted to the codes.

Equivalent to `diffusion_head(hidden[:, -1])[code_token_ids]`; the frozen head rows are used directly so the
head never has to run under a sharded wrapper.

**Parameters:**

**`model`** `nn.Module`

Backbone returning the last hidden state for `input_ids` (`output_last_hidden_states_only=True`).

---

**`input_ids`** `Sequence[int]`

Prompt token ids, length `L` (no mask).

---

**`code_token_ids`** `Sequence[int]`

Single-token code of each option, length `N`.

---

**`mask_token_id`** `int`

Mask token appended as the answer slot.

---

**`rows`** `dict[int, torch.Tensor]`

Frozen head rows by vocabulary id, each of shape `[hidden]`.

---

**`device`** `torch.device`

Device of the token ids.

---

**Returns:** `torch.Tensor`

fp32 tensor of shape `[N]`.

```python
nemo_automodel.components.models.nemotron_decision.scorer.require_decision_config(
    config: typing.Any
) -> None
```

Reject checkpoints whose runtime contract this recipe does not implement.

The recipe trains Nemotron 3.5 Decision checkpoints: a text Ministral 3 encoder read with fully bidirectional
attention, one question per read, and the decision head at the mask token. Vision and quantized variants need
their own input and storage paths and are not run silently as the text model.

**Parameters:**

**`config`** `Any`

Hugging Face config (attribute access) of the checkpoint.

---

**Raises:**

* `ValueError`: If the architecture, attention or storage format is unsupported.

```python
nemo_automodel.components.models.nemotron_decision.scorer.FULL_FINETUNE_PREFIXES = ('encoder.layers.', 'encoder.norm.')
```

```python
nemo_automodel.components.models.nemotron_decision.scorer._WRAPPER_SEGMENTS = ('_checkpoint_wrapped_module.', '_orig_mod.')
```