math-rollouts
收藏资源简介:
math-rollouts数据集包含了由Qwen2.5-Math-1.5B基础模型及其RL调优版本Qwen2.5-Math-1.5B-Oat-Zero模型生成的数学推理“展开过程”数据,旨在为研究大型语言模型在数学问题上的推理行为、分支采样策略和性能评估提供资源。数据内容主要包括三个部分:1) 问题集:包含12,496个数学问题(来自MATH基准测试的“math12k”超集)及其500个问题的子集(MATH-500),每个问题包含问题描述、解答步骤和最终答案;2) 生成数据:包括“核心”数据(每个可能的第一代词/分支路径)、“展开”数据(模型根据核心路径强制或自然采样生成的完整解题过程文本)以及“评分”数据(对每个生成的解题过程进行正确性等指标评估的结果);3) 自然采样池:包含模型自主选择第一代词生成的解题过程,并内联标注了正确性。数据集规模在10万到100万样本之间,以结构化表格形式存储,包含详细的元数据字段,如问题ID、主题、模型ID、生成配置、分支路径、完成文本、令牌序列、评分结果等。数据生成使用统一的采样配置,确保可复现性。该数据集适用于文本生成、数学推理、模型解释性、采样策略分析、正确性评估等研究任务,用户可以通过提供的Python工具包或直接使用pandas加载数据进行分析和实验。
The math-rollouts dataset contains mathematical reasoning "rollout" data generated by the Qwen2.5-Math-1.5B base model and its RL-tuned variant Qwen2.5-Math-1.5B-Oat-Zero. It aims to provide resources for studying the reasoning behavior, branch sampling strategies, and performance evaluation of large language models on mathematical problems. The dataset mainly consists of three parts: 1. Problem set: It includes 12,496 mathematical problems sourced from the "math12k" superset of the MATH benchmark, along with a 500-problem subset (MATH-500). Each problem contains the problem description, solution steps, and final answer. 2. Generated data: Comprising "core" data (each possible first token/branch path), "rollout" data (full problem-solving process text generated by the model via forced or natural sampling based on core paths), and "scoring" data (results of evaluating metrics including correctness for each generated problem-solving process). 3. Natural sampling pool: It contains problem-solving processes generated by the model autonomously selecting first tokens, with inline annotations of correctness. The dataset ranges from 100,000 to 1,000,000 samples, stored in structured table format with detailed metadata fields such as problem ID, topic, model ID, generation configuration, branch path, completed text, token sequence, scoring results, etc. Unified sampling configurations were employed during data generation to ensure reproducibility. This dataset is applicable to research tasks including text generation, mathematical reasoning, model interpretability, sampling strategy analysis, correctness evaluation, etc. Users can load the data for analysis and experiments via the provided Python toolkit or directly using pandas.
数据集概述
数据集名称:math-rollouts
许可证:MIT
语言:英文
任务类别:文本生成
标签:数学、推理、rollouts、核采样、Qwen2.5-Math、Math-500
数据集规模:100K < 样本数 < 1M
数据集内容
该数据集包含以下模型在数学推理问题上自然采样的 rollouts(推理轨迹):
- Qwen2.5-Math-1.5B(基础模型)
- Qwen2.5-Math-1.5B-Oat-Zero(经过强化学习微调的模型)
此外,还包含 first-token / branch nuclei(首词核)以及 uniform-opener forced rollouts(均匀强制开头的rollouts)。所有生成均无指导信号,仅使用公开检查点的自然采样完成。
数据目录结构
problems/
math500.parquet # 500道 MATH-500 分割问题(含 HF MATH-500 交叉引用)
math_problems.parquet # 完整 ~12.5k 的 MATH 超集("math12k"),含 split 字段
mappings/
math500_to_hf.csv # unique_id 与 HF MATH-500 id 的映射
generations/<model-slug>/
<experiment>/ # 统一生成器分割(nuclei + raw rollouts + scores)
nuclei.parquet
rollouts.parquet
scores.parquet
policies.csv
manifest.json
<pool>.parquet # 自包含的自然采样池(内嵌 is_correct 字段)
model-slug:模型的小写 HF ID(去掉组织名),例如Qwen/Qwen2.5-Math-1.5B→qwen2.5-math-1.5b。
问题ID与分割
每一行都有一个唯一问题ID:unique_id = <split>/<subj>/<n>
| 分割 | 数量 | 含义 |
|---|---|---|
train |
7,496 | math12k 训练部分 |
test |
4,500 | math12k 测试部分(不含 math500) |
math500 |
500 | MATH-500 子集,从 test 中独立出来 |
math500/geometry/9467代表 MATH-500 中几何问题的第 9467 个索引。- 通过
mappings/math500_to_hf.csv可恢复规范的 HF MATH-500 ID(如test/geometry/627.json)。
模型信息
| model-slug | 检查点 | 说明 |
|---|---|---|
qwen2.5-math-1.5b |
Qwen/Qwen2.5-Math-1.5B |
基础模型,首词核分布广泛 |
qwen2.5-math-1.5b-oat-zero |
sail/Qwen2.5-Math-1.5B-Oat-Zero |
RL微调模型,首词分布尖锐,多数问题只有一个开启词(核内唯一) |
生成配置
所有规范运行使用统一采样配置(gen_config_id = 200):
temperature = 0.6 top_p = 0.95 top_k = 20 max_tokens = 3000 max_model_len = 4096
top_k限制核大小。- 使用 bfloat16(vLLM)采样,首词logits近乎相等时,推荐以bf16重新计算核成员/概率。
文件结构与模式
problems/ 目录
math500.parquet(500行):包含unique_id、math500_native_id、subject、subj、level、problem、solution、answer。math_problems.parquet(12,496行):包含unique_id、source_idx、split、subject、subj、level、problem、solution、answer。
Experiment 分割 — generations/<model>/<experiment>/
当前实验为 math500_uniform_k16_d1(深度1首词核,每个开启词强制16个均匀rollouts,覆盖所有500道MATH-500问题),两个模型均已提供。
nuclei.parquet:每个开启词一行,包含model_id、unique_id、subject、answer、depth、branch_path、opener_token_ids、opener_token_strs、fork_token_id、nuc_prob、path_prob、branch_size、terminal、is_thinking。rollouts.parquet:每行一个原始强制样本(不含正确性),包含model_id、unique_id、subject、answer、depth、branch_path、opener_token_ids、run_id、gen_config_id、seed、temperature、top_p、max_gen_len、sample_idx、completion_token_ids、completion_text、num_tokens、finish_reason。scores.parquet:每个rollout×评分器一行,包含model_id、unique_id、run_id、branch_path、sample_idx、scorer_id、is_correct、answer_char_pos、answer_token_frac、leak_class。可通过(model_id, unique_id, run_id, branch_path, sample_idx)与rollouts连接。policies.csv:每个问题的开启词策略准确率摘要,包含unique_id、subject、n_openers、probability、uniform、acc_weighted、oracle。manifest.json:包含model_id、gen_config、gen_config_id、k、max_depth、max_branch、run_id、seed、coverage、n_problems、n_openers、n_rollouts、created_utc。
自然采样池 — generations/<model>/<pool>.parquet
自包含,内嵌 is_correct 字段,无单独分数文件。池包括 math500_passK、math12k_passK、math12k_K64、math12k_L4_5_K64、math12k_additional(可用性因模型而异)。列包含:unique_id、problem_idx、run_id、sample_idx、producer、completion_text、completion_token_ids、num_tokens、is_correct、finish_reason、seed、temperature、top_p、model_id、max_gen_len、gen_config_id、timestamp、subject、level、answer。
分组与准确率
- Experiment分割:分组键为
(model_id, unique_id, branch_path, run_id),准确率 =sum(is_correct) / group_size。 - 池数据:按
(model_id, unique_id)分组,若需刻意合并则加run_id。 branch_path(每次分叉的子索引)是持久的开启词标识。
数据集构建方法
- 问题来源:数学问题池来自
qwedsacf/competition_math(12,500行),每行分配稳定的unique_id,分割依据如下:math500:问题文本与HuggingFaceH4/MATH-500匹配(恰好500个)。test:source_idx >= 7500且非 math500。train:source_idx < 7500。
- Rollouts生成:使用上述配置,通过 Qwen2.5-Math-1.5B 和 Qwen2.5-Math-1.5B-Oat-Zero 公开检查点采样,评分独立进行(CPU)。
- 排除项:内部微调模型和教师指导(交集采样)rollouts不在数据集中。




