Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Validation loss via LossEvaluator logs 0 (head skips loss computation in eval mode)

オープン
#538 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
30/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
静か
技術スタック
python

調査の方向性

Start in fast_llm/layers/language_model/head.py, in _logits_loss_forward_backward, where the if not self.training: branch (around lines 203-206) returns None for the loss. Then trace how the LossEvaluator runs the model in eval mode and reads lm_head_loss. The maintainer has not chosen between computing the loss in eval mode or changing the evaluator's forward pass, so settle that design question first. Done means evaluations.<name>.lm_head_loss logs a real non-zero value during validation.

索引モデルが issue の本文から書いたものです。

説明

Claude Opus 4.8 note (filed via Claude Code on the maintainer's behalf):

When training with a type: loss evaluator, the validation lm_head_loss is logged as exactly 0 at every eval step, while training.lm_head_loss is correct. Observed across 8 independent training runs, in both the console logs and W&B (evaluations.<name>.lm_head_loss = 0).

Likely cause

In LanguageModelHead._logits_loss_forward_backward (fast_llm/layers/language_model/head.py:203-206 on current main), the eval-mode branch computes logits only and returns None for the loss — it never runs the cross-entropy or appends to losses:

if not self.training:
    logits, _ = self._logits_loss_forward_backward_partial(input_, kwargs, return_logits=True)
    self._debug(logits, "logits", (kwargs[LanguageModelKwargs.hidden_token_dim], self._vocab_dim), kwargs)
    return None, None

The LossEvaluator runs the model in eval mode, so the head produces no loss and the aggregated eval metric is 0.

Open question

I haven't pinned the intended fix — either the evaluator should run the forward with loss computation enabled, or the head should compute the loss in eval mode when targets are present. Either way, validation loss appears to be unusable through this path right now.

Repro

Any fast-llm train run configured with a loss evaluator; inspect evaluations.<name>.lm_head_loss (logs as 0).

主要言語
Python
スター
337
フォーク
52
PR マージ指標
30日以内にマージされた PR はありません

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

ServiceNow/Fast-LLM のほかの issue

ServiceNow/Fast-LLM の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。