From 11a277f5f5e4a4fb5a0702c76a04e0b1eb562f46 Mon Sep 17 00:00:00 2001 From: PratikDhanave Date: Sat, 25 Jul 2026 09:59:34 +0530 Subject: [PATCH] Remove phantom label_smoothing attribute from NpoLoss docstring `NpoLoss`'s docstring documented a `label_smoothing` attribute, but the dataclass has no such field and the NPO loss (`-log_sigmoid(-po_delta)`) has no label-smoothing term. The line is a copy-paste artifact from the sibling `DpoLoss`, which genuinely has and uses `label_smoothing`. A user following the NpoLoss docs would hit a TypeError passing `label_smoothing=`. Drop the stale line so the documented attributes match the actual fields. --- gemma/gm/losses/_npo.py | 1 - 1 file changed, 1 deletion(-) diff --git a/gemma/gm/losses/_npo.py b/gemma/gm/losses/_npo.py index 0af58371..9976ccb4 100644 --- a/gemma/gm/losses/_npo.py +++ b/gemma/gm/losses/_npo.py @@ -30,7 +30,6 @@ class NpoLoss(kd.losses.Loss): Attributes: tau: The temperature of the loss. - label_smoothing: The label smoothing to apply to the loss. tokens: The key to the tokens to predict. sequence_mask: The key to the sequence mask. policy_logits: The key to the policy logits.