opencompass icon indicating copy to clipboard operation
opencompass copied to clipboard

`gsm8k_postprocess` breaks numeric answers at thousands separators (`\boxed{$9{,}500}` → `500`, `\boxed{8,000}` → `000`)

Open laa1991 opened this issue 2 months ago • 2 comments

Minimal reproduction:

from opencompass.datasets.gsm8k import gsm8k_postprocess

measured (opencompass installed from PyPI, 0.5.4):

input output
\boxed{9500} 9500 ✅
\boxed{$9{,}500} 500 ❌
\boxed{8,000} 000 ❌
\boxed{10,000} 000 ❌
The answer is $9{,}500. 500 ❌

Impact: any answer containing a comma-separated number is extracted as a different number, and the failure is silent — it is indistinguishable from the model answering wrongly. In our GSM8K run (300 items, deepseek-flash, one leg per harness) this was one of the measurable sources of OpenCompass's losses against the other two harnesses on the same raw answers: the same responses were graded correctly by the other extractors.

Also worth noting: the same postprocessor handles \boxed{...} fine when the number has no separator, so the defect is specifically the , inside a numeric token.

Suggested direction: treat , as a thousands separator when it sits between digits (i.e. strip separators from the numeric token instead of splitting on them), or reuse the numeric normalisation the metric applies.

Note on LaTeX: models often emit \,{,}-style escapes (9{,}500) precisely to avoid a math-mode space, so this input shape is common, not exotic.

laa1991 avatar Sep 18 '26 06:09 laa1991

Follow-up: the reproducible material behind this report is now public — https://github.com/laa1991/silent-zero

  • the one-command reproduction (same task, same prompt, same 16-token budget, only the endpoint changes: 0.0000 ↔ 0.9333) is in the README;
  • raw readings (wire-tapped request fields, usage counters, the firing census with negative controls) are under evidence/;
  • repro/check_silent_zero.py applies the failure definition (success and collapsed and nothing said so) to any results file, and repro/check_harness_specifics.py reproduces the harness-specific parts without any API calls.

Happy to run anything on my side, or to open a PR if you want the fix landed.

laa1991 avatar Sep 18 '26 09:09 laa1991

Opened a fix PR: https://github.com/open-compass/opencompass/pull/2648

It normalizes LaTeX/ASCII thousands separators (and prefers \boxed{...} when present) so cases like \boxed{8,000} / \boxed{{,}500} extract 8000 / 9500 instead of 000 / 500. Unit tests cover the reproduction table from this issue.

FOWEPJF255 avatar Sep 18 '26 15:09 FOWEPJF255