#2409·slime

gpqa: when no option letter can be extracted, a single-letter gold label is substring-matched against the whole reply, so a reply that never answers can score 1.0

Author: shaurya416Created Sep 24, 2026Updated Sep 24, 2026

slime/rollout/rm_hub/gpqa.py:117-124 runs when _extract_letter_from_response returns None, meaning the early return at :99-101 does not fire:

python
    if label_text:
        candidate_answers.append(label_text)

    normalized_targets = {_normalize_text(text) for text in candidate_answers if text}
    normalized_response = _normalize_text(_strip_chain_of_thought(response))
    for target in normalized_targets:
        if target and target in normalized_response:
            return 1.0

For a letter label such as "C", label_text is "C". At :84-85 the same string is already classified as an option letter. Line 117 then adds it again as answer text. After _normalize_text it becomes "c", and in tests it against the whole normalized reply with no word boundary. So when no letter can be extracted, the gold letter matches inside ordinary words: c in can, a in and, b in but.

The choice text goes through the same unbounded containment test, so numeric choices match inside longer numbers ("11" in "2011" or "111").

This matters for letter-labelled data. All 198 rows of zyzshishui0627/gpqa_diamond gpqa_eval.jsonl, the dataset used by examples/eval_multi_task/multi_task.yaml, have a single-letter label (A:67, C:57, D:52, B:22). Their metadata contains choices (a dict), correct_letter, correct_answer and valid_letters ["A","B","C","D"], and reaches async_rm through --metadata-key (default "metadata").

Measured

Method and substitutions:

  • Checkout at HEAD 8ee9c1e.
  • gpqa.py is stdlib-only. The unmodified file was loaded directly by file path, byte-identical, with nothing stubbed. compute_gpqa_reward was called directly. async_rm was not run. That rm_type: gpqa goes straight to compute_gpqa_reward (rm_hub/__init__.py:85-86) comes from reading the code.
  • Rows come from the real gpqa_eval.jsonl file. Where the gold column lists A / B / C / D, the same reply was scored against each gold letter.
  • pytest was not installed, so tests/test_rm_gpqa.py ran through a small stand-in runner.
gold reply current expected
A / B / C / D (row 1) reasoning cut off with no </think>, no final answer and no standalone capital letter ("...compare them with each of the candidate values one by one, starting with the smallest, which is") 1.0 / 1.0 / 1.0 / 1.0 0.0
A / B / C / D I'm sorry, but I can't help with that. 1.0 / 1.0 / 1.0 / 0.0 0.0
A / B / C / D I cannot answer this question because it is ambiguous. 1.0 / 1.0 / 1.0 / 0.0 0.0
A / B / C / D The question is unclear and I decline to respond. 1.0 / 0.0 / 1.0 / 1.0 0.0
C No comment. 1.0 0.0
B ("11") I looked at 2011 and gave up / the count is 111 1.0 / 1.0 0.0
C The answer is B. (control, wrong letter) 0.0 0.0
C Hmm. (control, no a/b/c/d) 0.0 0.0
C The answer is C. (control, right letter) 1.0 1.0
C It is 10^-4 eV (intended text fallback) 1.0 1.0
C `` / / ... 0.0 0.0
  • Across all 32 (reply × gold letter) combinations, the reward matched one rule with zero mismatches. A reply scores 1.0 exactly when no letter was extracted and either the gold letter or the gold choice text occurs as a substring of the normalized reply.
  • The refusal I'm sorry, but I can't help with that. averages 0.742 when scored against all 198 real rows, each with its own gold.
  • The cut-off reply in the first table row scores 1.0 on all 198 rows.

The cut-off reply is a constructed case, not an observed rollout. Real long traces that get truncated often contain a standalone capital that is a valid letter, such as a sentence-initial "A". The fallback at gpqa.py:45 then extracts a letter, and the substring branch never runs. That fallback has a separate weakness of its own. The substring path applies reliably to short replies that never name a letter, such as refusals, "I can't answer" and "No comment." It applies only to some truncated traces.

Consequence

Nothing upstream filters these replies. sglang_rollout.py handles only ABORTED samples specially (:330) and reports truncated as a separate list (:677), next to rewards it does not change. So under rm_type: gpqa, some replies that never commit to an option are scored as correct. On the measured rows, a refusal outscores a committed wrong answer (1.0 vs 0.0). This inflates eval accuracy by an amount that depends on how often replies lack an extractable letter. Used as a training reward, it would pay for not committing. No effect on a real training or eval run was measured.

tests/test_rm_gpqa.py does not cover this case. Its only containment test ('Definitely paris.') uses a full-text label. Its no-match test uses the non-letter label "some answer". No test sends a single-letter label into the substring check.

Suggested fix

The file already has both ideas this fix needs:

  • gpqa.py:84 treats a one-character label in valid_letters as an option letter.
  • gpqa.py:45 and rm_hub/f1.py:9 use \b-style boundaries.

Apply both in the text fallback. Stop adding a letter label as answer text, and match text candidates on whole normalized tokens, since the normalized strings are space-delimited:

python
    if label_text and not (len(label_text) == 1 and label_text.upper() in valid_letters):
        candidate_answers.append(label_text)
    ...
    normalized_response = f" {_normalize_text(_strip_chain_of_thought(response))} "
    for target in normalized_targets:
        if target and f" {target} " in normalized_response:
            return 1.0

Both changes are needed. With token boundaries alone, the article a in "I can't give a straight answer." still matches gold A.

Results with both changes applied to a copy:

  • Every row in the table gives the expected value.
  • The text-fallback controls (It is 10^-4 eV, Definitely paris.) still score 1.0.
  • The existing tests/test_rm_gpqa.py passes unchanged (21/21, same as before the change).

Regression tests can be added for the letter-label refusal case and the numeric-substring case.

One risk remains. A short numeric choice that appears as its own token in the reply (... 11 ...) still matches. That comes with any text fallback and is much narrower.

Happy to open the PR.