> This page is for version Nightly (default).
> 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.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.nvidia.com/nemo/automodel/_mcp/server.

# nemo_automodel.components.models.d1.text_readout

Model-owned frozen text features and released D1 option-scoring semantics.

## Module Contents

### Classes

| Name                                                                                           | Description                                                      |
| ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------- |
| [`D1CausalTextReadout`](#nemo_automodel-components-models-d1-text_readout-D1CausalTextReadout) | Final-token features and max-over-answer-alias logits for D1-3B. |
| [`D1OmniTextReadout`](#nemo_automodel-components-models-d1-text_readout-D1OmniTextReadout)     | Sequence features and calibrated marker logits for D1 Omni text. |
| [`D1TextReadout`](#nemo_automodel-components-models-d1-text_readout-D1TextReadout)             | One variant's feature boundary and trainable released readout.   |

### Functions

| Name                                                                                                   | Description                                                    |
| ------------------------------------------------------------------------------------------------------ | -------------------------------------------------------------- |
| [`_validate_feature_pairs`](#nemo_automodel-components-models-d1-text_readout-_validate_feature_pairs) | Reject missing feature slots before variant-specific scoring.  |
| [`_validate_text_input`](#nemo_automodel-components-models-d1-text_readout-_validate_text_input)       | Require the single-question, unpadded frozen-feature boundary. |

### API

```python
class nemo_automodel.components.models.d1.text_readout.D1CausalTextReadout(
    model: nemo_automodel.components.models.d1.vl_model.Lfm2VlForConditionalGeneration,
    examples: collections.abc.Sequence[nemo_automodel.components.models.d1.records.D1TextExample]
)
```

Final-token features and max-over-answer-alias logits for D1-3B.

**`head`**

---

**`token_ids`**

---

**`token_index`**

---

```python
nemo_automodel.components.models.d1.text_readout.D1CausalTextReadout.extract_features(
    input_ids: torch.Tensor,
    attention_mask: torch.Tensor
) -> torch.Tensor
```

Return the causal final-token state before the tied vocabulary projection.

**Parameters:**

**`input_ids`** `torch.Tensor`

Long Tensor of shape \[1, sequence] on the model device.

---

**`attention_mask`** `torch.Tensor`

Boolean Tensor of shape \[1, sequence], all true.

---

**Returns:** `torch.Tensor`

Tensor of shape \[hidden] containing the final normalized token state.

```python
nemo_automodel.components.models.d1.text_readout.D1CausalTextReadout.score(
    features: collections.abc.Sequence[torch.Tensor],
    examples: collections.abc.Sequence[nemo_automodel.components.models.d1.records.D1TextExample],
    head: torch.nn.Module
) -> list[torch.Tensor]
```

Apply answer-alias maxima without introducing a new temperature.

**Parameters:**

**`features`** `Sequence[torch.Tensor]`

Tensors of shape \[hidden] on the head device.

---

**`examples`** `Sequence[D1TextExample]`

Causal questions whose alias vocabulary IDs were prepared
by this readout, in feature order.

---

**`head`** `nn.Module`

The additive answer-row adapter or a frozen reference copy.

---

**Returns:** `list[torch.Tensor]`

List of float32 Tensors of shape \[options], in each example's option order.

```python
class nemo_automodel.components.models.d1.text_readout.D1OmniTextReadout(
    model: nemo_automodel.components.models.d1.model.D1OmniModel
)
```

Sequence features and calibrated marker logits for D1 Omni text.

**`head`** `= model.head.float()`

---

```python
nemo_automodel.components.models.d1.text_readout.D1OmniTextReadout.extract_features(
    input_ids: torch.Tensor,
    attention_mask: torch.Tensor
) -> torch.Tensor
```

Return normalized text states before the released marker head.

**Parameters:**

**`input_ids`** `torch.Tensor`

Long Tensor of shape \[1, sequence] on the model device.

---

**`attention_mask`** `torch.Tensor`

Boolean Tensor of shape \[1, sequence], all true.

---

**Returns:** `torch.Tensor`

Tensor of shape \[sequence, hidden], retaining its backbone graph

```python
nemo_automodel.components.models.d1.text_readout.D1OmniTextReadout.score(
    features: collections.abc.Sequence[torch.Tensor],
    examples: collections.abc.Sequence[nemo_automodel.components.models.d1.records.D1TextExample],
    head: torch.nn.Module
) -> list[torch.Tensor]
```

Pad text features, score marker rows, and apply released calibration.

**Parameters:**

**`features`** `Sequence[torch.Tensor]`

Tensors of shape \[sequence, hidden] on the head device;
sequence lengths may differ. Readout arithmetic uses float32.

---

**`examples`** `Sequence[D1TextExample]`

Marker questions with released text temperatures, aligned
with features and retaining internal false/true noul order.

---

**`head`** `nn.Module`

The released Omni marker head or a frozen reference copy.

---

**Returns:** `list[torch.Tensor]`

List of float32 Tensors of shape \[options], in each example's option order,

```python
class nemo_automodel.components.models.d1.text_readout.D1TextReadout()
```

Protocol

One variant's feature boundary and trainable released readout.

`head` is the only trainable module in this frozen-feature workflow.
A feature must be scored by the readout that produced it: causal features
have shape \[hidden], while Omni features have shape \[sequence, hidden].

**`head`** `Module`

Return the trainable released head or additive answer-row adapter.

---

```python
nemo_automodel.components.models.d1.text_readout.D1TextReadout.extract_features(
    input_ids: torch.Tensor,
    attention_mask: torch.Tensor
) -> torch.Tensor
```

Encode one unpadded text question without applying the readout.

**Parameters:**

**`input_ids`** `torch.Tensor`

Long Tensor of shape \[1, sequence] on the model device.

---

**`attention_mask`** `torch.Tensor`

Boolean Tensor of shape \[1, sequence], all true.

---

**Returns:** `torch.Tensor`

Tensor of shape \[hidden] for a causal final-token feature, or

```python
nemo_automodel.components.models.d1.text_readout.D1TextReadout.score(
    features: collections.abc.Sequence[torch.Tensor],
    examples: collections.abc.Sequence[nemo_automodel.components.models.d1.records.D1TextExample],
    head: torch.nn.Module
) -> list[torch.Tensor]
```

Score aligned features using the variant's option and calibration rules.

**Parameters:**

**`features`** `Sequence[torch.Tensor]`

Tensors of shape \[hidden] for the causal variant, or
\[sequence, hidden] for Omni, on the head device, one per example.

---

**`examples`** `Sequence[D1TextExample]`

Publisher-encoded questions in the same order as features.

---

**`head`** `nn.Module`

This variant's trainable readout, or a frozen reference copy.

---

**Returns:** `list[torch.Tensor]`

List of float32 Tensors of shape \[options], one per example in its

```python
nemo_automodel.components.models.d1.text_readout._validate_feature_pairs(
    features: collections.abc.Sequence[torch.Tensor],
    examples: collections.abc.Sequence[nemo_automodel.components.models.d1.records.D1TextExample]
) -> None
```

Reject missing feature slots before variant-specific scoring.

**Parameters:**

**`features`** `Sequence[torch.Tensor]`

Tensors of shape \[hidden] or \[sequence, hidden], one per example.

---

**`examples`** `Sequence[D1TextExample]`

Publisher-encoded questions in feature order.

---

```python
nemo_automodel.components.models.d1.text_readout._validate_text_input(
    input_ids: torch.Tensor,
    attention_mask: torch.Tensor
) -> None
```

Require the single-question, unpadded frozen-feature boundary.

**Parameters:**

**`input_ids`** `torch.Tensor`

Long Tensor of shape \[1, sequence] with nonempty sequence.

---

**`attention_mask`** `torch.Tensor`

Boolean Tensor of shape \[1, sequence], all true, on the
same device as input_ids.

---