OverwhelmingFit's picture
Correct public access status and clarify upstream data terms
16258b5 verified
|
Raw History Blame Contribute Delete
6.18 kB
metadata
pretty_name: Math-Shepherd-614 (SOPO evaluation subset)
task_categories:
  - text-classification
tags:
  - math-shepherd
  - stepwise-verification
  - hallucination-detection
data_files:
  - split: test
    path: math_shepherd_614_test_20260327.parquet

Math-Shepherd-614 evaluation subset

This repository packages a 614-example Math-Shepherd step-verification test subset and a runnable evaluation script. It is intended to document the evaluation data relevant to the SOPO paper (Appendix F.4); the exact selection procedure and the authors' original Math-Shepherd scoring implementation have not been independently confirmed. The data file alone and the accompanying script should not be represented as independently reproducing the paper's 89.02 mean span-F1.

Dataset

The Parquet file math_shepherd_614_test_20260327.parquet contains 614 rows with three columns:

  • prompt: the math problem.
  • completions: an ordered list of solution steps.
  • labels: one Boolean per step; true means correct and false means incorrect.

The file has 1,794 correctly labeled and 1,395 incorrectly labeled steps. There are 334 examples with at least one incorrect step and 280 with no incorrect steps. Every row (including its step text and labels) was found as an exact match in the publicly available trl-lib/math_shepherd test split. This demonstrates provenance at the record level; it does not prove how the original paper selected its subset. The Parquet file's SHA-256 is e01fabbc80b99f01307aa9095b9e186f13cae392ed0bff983dcbdd61ee0d1087.

Load the dataset with datasets (install it separately with python -m pip install datasets), or read the Parquet file with pyarrow:

from datasets import load_dataset

test = load_dataset("OverwhelmingFit/SOPO-Math-Shepherd-614", split="test")
print(len(test))  # 614

The repository is publicly accessible. This release includes test data only; it is not a training split. Public availability does not establish a license for the underlying third-party data; see Source and redistribution before reusing or redistributing the records.

Evaluate using a local OpenAI-compatible vLLM endpoint

Place run_math_shepherd.py, sopo_eval_common.py, the Parquet file, and requirements.txt in the same directory. Python 3.9+ is recommended.

python -m pip install -r requirements.txt
python -m unittest discover -s . -p test_run_math_shepherd.py  # offline validation, no model server
python run_math_shepherd.py \
  --data-file math_shepherd_614_test_20260327.parquet \
  --model-name YOUR_SERVED_MODEL_NAME \
  --model-url http://localhost:7010/v1 \
  --num-threads 32 \
  --output-dir ./test_result

--model-name must match the model name exposed by your vLLM OpenAI-compatible server. The default endpoint is http://localhost:7010/v1, the default generation limit is 8,000 tokens, and a complete run should write 614 JSON Lines records plus a _metric.json file. The API client sends api_key="EMPTY" for local vLLM. Use --max-samples N only for a quick smoke test; it is not the full 614-example evaluation. You can recompute metrics from a saved run without contacting the model:

python run_math_shepherd.py --filepath ./test_result/YOUR_RUN.jsonl

The metric-only command writes a separate _recomputed_metric.json file and leaves the original _metric.json intact.

The paper reports a mean over 10 inference runs. To obtain comparable run counts with this script, invoke the full command 10 separate times, check each output's test_data_size is 614, and average the metrics entry for All → span_level → f1 from the ten _metric.json files. This alone does not establish equivalence to the paper's unpublished prompt, decoding and scoring settings.

Exact scoring behavior of this implementation

  1. Concatenate completions with a single newline to form the evaluated response. Each step labeled false becomes a gold character span, including the separator newline following that step (except the last).
  2. Ask the model for a JSON "hallucination list" containing copied erroneous text spans; retry malformed responses up to three times (first attempt with temperature 0, retries at 0.4). Invalid model outputs abort the complete run rather than being silently scored as no hallucination.
  3. An empty list yields no predicted span. For a nonempty list, find the earliest successfully located text substring in the response. Align this position using the starts of gold incorrect steps, then predict the entire suffix from that aligned point to the response end. The overlap of predicted and gold character positions determines micro-aggregated span precision, recall, and F1. The script also reports case-level metrics.

Important limitation: step 3 uses the gold annotations when constructing the predicted span. This is a label-dependent scoring rule, which can affect the resulting F1 and is not a standard gold-independent conversion of predictions to spans. We have not verified that this rule matches the SOPO authors' original Math-Shepherd protocol. Share results with the rule disclosed; do not label this implementation an exact reproduction of 89.02 without confirming the original protocol and running the original model.

Source and redistribution

This subset's records match the trl-lib/math_shepherd test split, which attributes its processed format to the original Math-Shepherd project. See the original dataset and paper for citations. Neither of those two dataset cards states a data license. This repository is public, but the upstream redistribution terms have not been confirmed. Public access is not a grant of permission to reuse or redistribute the underlying third-party data; check the applicable terms with the upstream rights holders before doing so. This card does not assign a new license to third-party data.