original_text vs text: BPB metric, acc_per_char and prediction rows normalize by different lengths
- Linguagem predominante
- Python
- Estrelas
- 70
- Forks
- 21
- Merge médio
- 2d 11h
- PRs com merge (30d)
- 41
Descrição
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.
Guia de contribuição
Nenhum guia de contribuição indexado para este repositório
Direção de pesquisa
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.
Escrita pelo modelo de indexação a partir do texto da issue.
Avaliação
- Stack de tecnologia
- python
- Domínio
- data
- Tipo de issue
- Bug
- Dificuldade
- 3/5
- Tempo estimado
- 1-2 dias
- Status de atividade
- Ativa
- Clareza
- Claramente especificada
- Facilidade para iniciantes
- 75/100