You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(recipes): correct validation loss averaging in LLM KD recipe
_forward_backward_step returns per-token-averaged losses, but the
validation loop accumulated them without un-averaging first. This caused
val_loss to be divided twice (yielding an artificially small value) and
ce_loss/kd_loss to be reported as raw sums instead of per-token means.
Multiply each per-batch loss by its num_label_tokens before accumulating,
then divide by total_num_label_tokens at the end for a proper weighted
average — matching the pattern used in the parent FinetuneRecipe.
Signed-off-by: khazic <khazzz1c@gmail.com>
0 commit comments