SHARP / README.md
ZaandaTeika's picture
Update README.md
09d69d5 verified
|
Raw History Blame Contribute Delete
9.69 kB
metadata
license: cc-by-4.0
language:
  - en
task_categories:
  - text-classification
  - token-classification
tags:
  - process-reward-model
  - prm
  - hallucination-detection
  - math
  - reasoning
  - step-level
size_categories:
  - 10K<n<100K
dataset_info:
  - config_name: SHARP-GSM8K
    features:
      - name: question
        dtype: string
      - name: steps
        list: string
      - name: step_labels
        list: int64
    splits:
      - name: train
        num_bytes: 4794720
        num_examples: 7559
      - name: test
        num_bytes: 600174
        num_examples: 840
    download_size: 4445298
    dataset_size: 5394894
  - config_name: SHARP-GSM8K-SPAN
    features:
      - name: question
        dtype: string
      - name: model_answer
        list: string
      - name: hallucination_annotation
        list: string
    splits:
      - name: train
        num_bytes: 10270129
        num_examples: 7559
      - name: test
        num_bytes: 1389542
        num_examples: 840
    download_size: 10718610
    dataset_size: 11659671
  - config_name: SHARP-Math
    features:
      - name: question
        dtype: string
      - name: steps
        list: string
      - name: step_labels
        list: int64
    splits:
      - name: train
        num_bytes: 8363185
        num_examples: 10021
      - name: test
        num_bytes: 986219
        num_examples: 1114
    download_size: 8320840
    dataset_size: 9349404
  - config_name: SHARP-Math-SPAN
    features:
      - name: question
        dtype: string
      - name: model_answer
        list: string
      - name: hallucination_annotation
        list: string
    splits:
      - name: train
        num_bytes: 19132078
        num_examples: 10021
      - name: test
        num_bytes: 2151022
        num_examples: 1114
    download_size: 20271171
    dataset_size: 21283100
configs:
  - config_name: SHARP-GSM8K
    data_files:
      - split: train
        path: SHARP-GSM8K/train-*
      - split: test
        path: SHARP-GSM8K/test-*
  - config_name: SHARP-GSM8K-SPAN
    data_files:
      - split: train
        path: SHARP-GSM8K-SPAN/train-*
      - split: test
        path: SHARP-GSM8K-SPAN/test-*
  - config_name: SHARP-Math
    data_files:
      - split: train
        path: SHARP-Math/train-*
      - split: test
        path: SHARP-Math/test-*
  - config_name: SHARP-Math-SPAN
    data_files:
      - split: train
        path: SHARP-Math-SPAN/train-*
      - split: test
        path: SHARP-Math-SPAN/test-*

SHARP

Introduction

SHARP is a corpus for step-level hallucination detection in mathematical reasoning. Open 7B models were asked to solve GSM8K and MATH problems, and a large teacher model then marked the exact fragments of each solution that are wrong or unsupported. The result is a step-labelled corpus that can be used to train Process Reward Models (PRMs), to benchmark error localization, or to study where small models go off the rails.

The corpus is published in two parallel views:

  • step view — SHARP-GSM8K, SHARP-Math. Solutions split into steps with one binary label per step, cut at the first faulty step. This is the format used to train the SHARP PRMs.
  • span view — SHARP-GSM8K-SPAN, SHARP-Math-SPAN. The same solutions, untruncated, carrying the raw <HAL>...</HAL> markup exactly as the annotator produced it.

Row i of a step subset and row i of the matching span subset describe the same solution, so the two views can be joined by position.

Subsets

Config Rows (train / test) Fields
SHARP-GSM8K 7,559 / 840 question, steps, step_labels
SHARP-GSM8K-SPAN 7,559 / 840 question, model_answer, hallucination_annotation
SHARP-Math 10,021 / 1,114 question, steps, step_labels
SHARP-Math-SPAN 10,021 / 1,114 question, model_answer, hallucination_annotation

Step view

{
  "question": "1 chocolate bar costs $1.50 and can be broken into 3 sections ...",
  "steps": [
    "Let's first determine the number of chocolate bars needed. ...",
    "Number of chocolate bars = Number of scouts * S'mores per scout / S'mores per bar ...",
    "Number of chocolate bars = 15 * 2 / 3 = 5 bars"
  ],
  "step_labels": [1, 1, 0]
}

step_labels[i] == 1 means the step is sound, 0 means it contains a hallucination. Because every solution is truncated at its first error, a row has either no zero at all, or exactly one zero as its last label. In other words, steps is always a valid reasoning prefix, and the last step is the first place where the model went wrong.

Span view

{
  "question": "1 chocolate bar costs $1.50 and can be broken into 3 sections ...",
  "model_answer": ["Let's first determine ...", "Number of chocolate bars = ...", "..."],
  "hallucination_annotation": ["Let's first determine ...", "Number of chocolate bars = <HAL>15 * 2 / 3 = 5</HAL> bars", "..."]
}

model_answer is the untruncated generation split on blank lines; hallucination_annotation is the same text with minimal erroneous fragments wrapped in <HAL>...</HAL>. Solutions with no error carry no tags.

Pipeline

1. Problems

GSM8K Math
Source openai/gsm8k (main) qwedsacf/competition_math (train)
Unique problems 8,399 11,135

The GSM8K part draws on both official splits — 7,464 problems come from train and 935 from test — so it must not be used to evaluate a solver on GSM8K test. The train/test split published here is a split of SHARP itself, not of the underlying benchmarks.

2. Generation

Solutions were sampled with vLLM, four independent samples per problem, temperature 0.7, top-p 0.8, using a plain math system prompt asking for step-by-step reasoning with steps separated by blank lines.

| Generator | mistralai/Mathstral-7B-v0.1 |

Deliberately choosing mid-sized generators is what makes the corpus useful: their solutions contain a realistic mix of sound and faulty reasoning rather than being almost always right or almost always wrong.

3. Annotation

Every generation was annotated by openai/gpt-oss-120b served with vLLM. The annotator receives the problem and the solution and returns the solution verbatim with the minimal wrong fragments wrapped in <HAL>...</HAL>; a clean solution is returned as the literal string No hallucinations. Annotations that failed to reproduce the source text were repaired or regenerated before the corpus was assembled.

4. Conversion to step labels

  1. Split the annotated solution into steps on blank lines.
  2. Label a step 0 if any <HAL> span intersects it, otherwise 1.
  3. Truncate steps and step_labels at the first 0, keeping that step. A PRM therefore only ever sees a prefix that is correct up to its final step, which removes the ambiguity of scoring reasoning that continues after an error has already been made.

Usage

from datasets import load_dataset

step = load_dataset("ZaandaTeika/SHARP", "SHARP-Math", split="train")
span = load_dataset("ZaandaTeika/SHARP", "SHARP-Math-SPAN", split="train")

print(step[0]["step_labels"])                 # e.g. [1, 1, 1, 0]
print(span[0]["hallucination_annotation"][0])  # same solution with <HAL> markup

To build a PRM training example, append a <extra_0> marker to every step and join with blank lines:

def build_prompt(question, steps):
    body = "\n\n".join(f"{s.strip()}<extra_0>" for s in steps)
    return f"Question: {question}\n\nSolution:\n{body}"

Models trained on SHARP

Model Base Supervision
Qwen2.5-1.5B-SHARP-Span Qwen2.5-Math-1.5B-Instruct span
Qwen2.5-1.5B-SHARP-Step Qwen2.5-Math-1.5B-Instruct step
Qwen2.5-7B-SHARP-Span Qwen2.5-Math-7B-Instruct span
Qwen2.5-7B-SHARP-Step Qwen2.5-Math-7B-Instruct step

Limitations

  • Labels are model-generated. They come from GPT-OSS-120B, not from humans, and inherit its biases. Per-step agreement with an independent annotator is moderate (κ 0.689), so individual labels are noisier than the solution-level signal.
  • Step boundaries follow blank lines in the generator's output. Where a model wrote a numbered list on consecutive lines, several logical steps can end up inside one step string.

Source Data and Attribution

We sourced GSM8K from OpenAI's official repository: https://huggingface.co/datasets/openai/gsm8k. This dataset is protected by the MIT license.

We sourced MATH from https://huggingface.co/datasets/qwedsacf/competition_math, a mirror of the original release by Hendrycks et al. This dataset is protected by the MIT license.

Please defer to the GSM8K and MATH dataset cards for further details on their collection and annotation process.

Reasoning traces were generated with Mathstral-7B-v0.1; hallucination annotations were produced with gpt-oss-120b. All three are released under the Apache 2.0 License, and gpt-oss-120b additionally carries the gpt-oss usage policy. None of these licenses restrict the redistribution of model outputs.

Additional Information

Licensing Information

The reasoning traces and hallucination annotations we provide are licensed under the CC BY 4.0 license.