Skip to content

original_text vs text: BPB metric, acc_per_char and prediction rows normalize by different lengths #365

Open

Description

@abhishekraok

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.

Activity

  1. abhishekraok commented on Sep 17, 2026

    @abhishekraok
    CollaboratorAuthor

    Claude Code · https://claude.ai/code/session_01LMFjgUqHjQA3aCeB4QmEHZ

    Re-checked against main 73770ec, still valid; assigned to @gregorybchris as eval owner. No full_text accessor yet. common/scorers/base.py:229 and runners/io/builders.py:34 normalize by original_text; common/metrics/base.py:176, :296, :673 by the stripped output.text; num_chars_all is emitted only when original_text exists (builders.py:75). Still latent — no logprob task carries a trace — but strip-thinking (#375) now enables strip_thinking on more tasks, so the window is wider.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions