original_text vs text: BPB metric, acc_per_char and prediction rows normalize by different lengths
- 主要語言
- Python
- 星號
- 70
- 分支
- 21
- 平均合併
- 2 天 11 小時
- 30 天內合併 PR
- 41
描述
Claude Code · https://claude.ai/code/session_01LMFjgUqHjQA3aCeB4QmEHZ — from gregorybchris's agent review of #361 (posted on #363), verified in code.
When `strip_thinking` removes a reasoning trace, logprobs still describe the whole generation, but the code normalizes by different texts:
- `BitsPerByteScorer` (`common/scorers/base.py`) and the prediction row (`runners/io/builders.py`: `bits_per_byte`, `logits_per_char`) divide by `metadata["original_text"]` when present.
- `BPBMetricByteAvg.compute` and `_select_gold_output` (`common/metrics/base.py`) divide by the stripped `output.text`; an output that is entirely a trace becomes empty and is dropped.
- `acc_per_char` (`common/metrics/base.py` ~L656) divides by `len(output.text)`.
Latent today — BPB and MC tasks are loglikelihood-only and never carry a trace — but #361's scorer test makes the combination nominally supported. Also `num_chars_all` is emitted only when `original_text` exists, unlike `num_tokens_all`, so readers can KeyError on non-thinking runs.
Suggested fix: an `LMOutput.full_text` property (`metadata.get("original_text") or text`) used by all four sites, and `num_chars_all` emitted unconditionally.
貢獻指南
這個儲存庫沒有索引到貢獻指南
研究方向
Start with LMOutput and the cited implementations in common/scorers/base.py, common/metrics/base.py, and runners/io/builders.py. Review the scorer test from #361, then trace how original_text and text determine normalization and output selection. Done means all four calculations use the full generated text and num_chars_all is emitted for every run without KeyErrors.
由索引模型根據 Issue 內容生成。
評估
- 技術堆疊
- python
- 領域
- data
- Issue 類型
- 缺陷
- 難度
- 3/5
- 預估耗時
- 1-2 天
- 活躍度
- 活躍
- 描述清晰度
- 描述清楚
- 新手友好度
- 75/100