Datasets:
Reorganize into parquet/ and json/ folders + remove em dashes - verified dual configs
Browse files- .gitattributes +1 -0
- README.md +195 -187
- json/test.json +0 -0
- json/train.json +3 -0
- json/val.json +0 -0
- parquet/test.parquet +3 -0
- parquet/train.parquet +3 -0
- parquet/val.parquet +3 -0
.gitattributes
CHANGED
|
@@ -59,3 +59,4 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
|
| 59 |
*.mp4 filter=lfs diff=lfs merge=lfs -text
|
| 60 |
*.webm filter=lfs diff=lfs merge=lfs -text
|
| 61 |
data/train.json filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
| 59 |
*.mp4 filter=lfs diff=lfs merge=lfs -text
|
| 60 |
*.webm filter=lfs diff=lfs merge=lfs -text
|
| 61 |
data/train.json filter=lfs diff=lfs merge=lfs -text
|
| 62 |
+
json/train.json filter=lfs diff=lfs merge=lfs -text
|
README.md
CHANGED
|
@@ -1,187 +1,195 @@
|
|
| 1 |
-
---
|
| 2 |
-
license: apache-2.0
|
| 3 |
-
task_categories:
|
| 4 |
-
- text-generation
|
| 5 |
-
- question-answering
|
| 6 |
-
language:
|
| 7 |
-
- en
|
| 8 |
-
pretty_name: Arithmetic-Reasoning
|
| 9 |
-
size_categories:
|
| 10 |
-
- 100K<n<1M
|
| 11 |
-
tags:
|
| 12 |
-
- math
|
| 13 |
-
- reasoning
|
| 14 |
-
- synthetic
|
| 15 |
-
- arithmetic
|
| 16 |
-
- chain-of-thought
|
| 17 |
-
- small-lm
|
| 18 |
-
configs:
|
| 19 |
-
- config_name: default
|
| 20 |
-
data_files:
|
| 21 |
-
- split: train
|
| 22 |
-
path:
|
| 23 |
-
- split: validation
|
| 24 |
-
path:
|
| 25 |
-
- split: test
|
| 26 |
-
path:
|
| 27 |
-
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
#
|
| 50 |
-
|
| 51 |
-
|
| 52 |
-
|
| 53 |
-
|
| 54 |
-
|
| 55 |
-
|
| 56 |
-
|
| 57 |
-
|
| 58 |
-
|
| 59 |
-
|
| 60 |
-
|
| 61 |
-
|
| 62 |
-
|
| 63 |
-
|
| 64 |
-
|
| 65 |
-
|
| 66 |
-
-
|
| 67 |
-
|
| 68 |
-
|
| 69 |
-
|
| 70 |
-
|
| 71 |
-
|
| 72 |
-
|
| 73 |
-
|
| 74 |
-
|
| 75 |
-
|
| 76 |
-
|
| 77 |
-
|
| 78 |
-
|
| 79 |
-
|
| 80 |
-
|
| 81 |
-
|
| 82 |
-
|
|
| 83 |
-
|
|
| 84 |
-
|
|
| 85 |
-
|
|
| 86 |
-
| | *
|
| 87 |
-
|
| 88 |
-
|
| 89 |
-
|
| 90 |
-
|
| 91 |
-
|
| 92 |
-
|
| 93 |
-
|
| 94 |
-
```
|
| 95 |
-
|
| 96 |
-
|
| 97 |
-
|
| 98 |
-
|
| 99 |
-
|
| 100 |
-
|
| 101 |
-
|
| 102 |
-
|
| 103 |
-
|
| 104 |
-
|
| 105 |
-
|
| 106 |
-
|
| 107 |
-
|
| 108 |
-
|
| 109 |
-
|
| 110 |
-
|
| 111 |
-
|
| 112 |
-
|
| 113 |
-
|
| 114 |
-
|
| 115 |
-
|
| 116 |
-
|
| 117 |
-
|
| 118 |
-
|
| 119 |
-
|
| 120 |
-
|
|
| 121 |
-
|
| 122 |
-
|
| 123 |
-
|
| 124 |
-
|
| 125 |
-
|
| 126 |
-
|
| 127 |
-
|
| 128 |
-
|
| 129 |
-
|
| 130 |
-
|
| 131 |
-
|
| 132 |
-
|
| 133 |
-
|
| 134 |
-
|
| 135 |
-
|
| 136 |
-
|
| 137 |
-
|
| 138 |
-
|
| 139 |
-
###
|
| 140 |
-
|
| 141 |
-
|
| 142 |
-
|
| 143 |
-
|
| 144 |
-
|
| 145 |
-
|
| 146 |
-
|
| 147 |
-
|
| 148 |
-
|
| 149 |
-
|
| 150 |
-
|
| 151 |
-
|
| 152 |
-
|
| 153 |
-
|
| 154 |
-
|
| 155 |
-
#
|
| 156 |
-
|
| 157 |
-
|
| 158 |
-
|
| 159 |
-
|
| 160 |
-
###
|
| 161 |
-
|
| 162 |
-
|
| 163 |
-
#
|
| 164 |
-
|
| 165 |
-
|
| 166 |
-
|
| 167 |
-
|
| 168 |
-
|
| 169 |
-
|
| 170 |
-
|
| 171 |
-
###
|
| 172 |
-
|
| 173 |
-
|
| 174 |
-
|
| 175 |
-
|
| 176 |
-
|
| 177 |
-
|
| 178 |
-
|
| 179 |
-
|
| 180 |
-
|
| 181 |
-
|
| 182 |
-
|
| 183 |
-
|
| 184 |
-
|
| 185 |
-
|
| 186 |
-
|
| 187 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: apache-2.0
|
| 3 |
+
task_categories:
|
| 4 |
+
- text-generation
|
| 5 |
+
- question-answering
|
| 6 |
+
language:
|
| 7 |
+
- en
|
| 8 |
+
pretty_name: Arithmetic-Reasoning
|
| 9 |
+
size_categories:
|
| 10 |
+
- 100K<n<1M
|
| 11 |
+
tags:
|
| 12 |
+
- math
|
| 13 |
+
- reasoning
|
| 14 |
+
- synthetic
|
| 15 |
+
- arithmetic
|
| 16 |
+
- chain-of-thought
|
| 17 |
+
- small-lm
|
| 18 |
+
configs:
|
| 19 |
+
- config_name: default
|
| 20 |
+
data_files:
|
| 21 |
+
- split: train
|
| 22 |
+
path: parquet/train.parquet
|
| 23 |
+
- split: validation
|
| 24 |
+
path: parquet/val.parquet
|
| 25 |
+
- split: test
|
| 26 |
+
path: parquet/test.parquet
|
| 27 |
+
- config_name: json
|
| 28 |
+
data_files:
|
| 29 |
+
- split: train
|
| 30 |
+
path: json/train.json
|
| 31 |
+
- split: validation
|
| 32 |
+
path: json/val.json
|
| 33 |
+
- split: test
|
| 34 |
+
path: json/test.json
|
| 35 |
+
---
|
| 36 |
+
|
| 37 |
+

|
| 38 |
+
|
| 39 |
+
# SagheerLab/Arithmetic-Reasoning
|
| 40 |
+
|
| 41 |
+
> A high-quality synthetic arithmetic and elementary mathematics reasoning dataset for training and evaluating small language models - not an "ultimate math" claim, but a clean, verified, tiered reasoning dataset where every answer is programmatically checked.
|
| 42 |
+
|
| 43 |
+
This dataset was built to train **100M-ish models** that benefit disproportionately from clean, unambiguous examples. At 150K examples (135K train / 7.5K val / 7.5K test) it is designed as a *reasoning* dataset: every sample has an instruction, a step-by-step reasoning trace, and a final answer, all verified to be mathematically correct.
|
| 44 |
+
|
| 45 |
+
### Why this dataset?
|
| 46 |
+
|
| 47 |
+
Small models (25M-100M) trained on our earlier 5-minute budget went from 0.5% → 89.8% with scratchpad formats and to **98.3%** with `reverse-answers + scratchpad` - format and verification matter more than scale. This release distills those findings into a publishable, 100% verified dataset.
|
| 48 |
+
|
| 49 |
+
## Quickstart
|
| 50 |
+
|
| 51 |
+
```python
|
| 52 |
+
from datasets import load_dataset
|
| 53 |
+
ds = load_dataset("SagheerLab/Arithmetic-Reasoning")
|
| 54 |
+
print(ds["train"][0])
|
| 55 |
+
# {'instruction': 'What is 86 percent of 5.6.', 'reasoning': '5.6*86=481.6 | 481.6/100=4.816', 'answer': '4.816', ...}
|
| 56 |
+
|
| 57 |
+
# pretraining text format
|
| 58 |
+
print(ds["train"][0]["text"])
|
| 59 |
+
# Calculate 86 percent of 5.6.
|
| 60 |
+
# 5.6*86=481.6 | 481.6/100=4.816
|
| 61 |
+
# Answer: 4.816
|
| 62 |
+
```
|
| 63 |
+
|
| 64 |
+
```python
|
| 65 |
+
from huggingface_hub import snapshot_download
|
| 66 |
+
snapshot_download("SagheerLab/Arithmetic-Reasoning", repo_type="dataset", local_dir="./arithmetic-reasoning")
|
| 67 |
+
```
|
| 68 |
+
|
| 69 |
+
Both `JSON` and `Parquet` are provided (`parquet/train.parquet` via `default` config + `json/train.json` via `json` config) - use either.
|
| 70 |
+
|
| 71 |
+
# Dataset Summary
|
| 72 |
+
|
| 73 |
+
- **Size:** 150,000 examples (135K train / 7.5K val / 7.5K test), 100% programmatically verified
|
| 74 |
+
- **Generation:** deterministic `src/generate_data_v4.py` with `NAMES 120 + OBJECTS 150 + VERBS 100` for lexical variation, de-duplicated (<1% dupes)
|
| 75 |
+
- **Tiers:** `easy 30% (1-2 digits, 1 step) | intermediate 35% (3-4 digits, 2-3 steps) | hard 25% (5-6 digits, 3-8 steps) | very hard 10% (competition/GSM8K-style)`
|
| 76 |
+
- **License:** Apache 2.0 - see [Licensing](#licensing-information)
|
| 77 |
+
|
| 78 |
+
# Problem Types - Top 10 + 8 more
|
| 79 |
+
|
| 80 |
+
We cover 18+ operation families. Each `instruction` is sampled from 20+ phrasings with varied names/objects so at 1M tokens <1% duplicates.
|
| 81 |
+
|
| 82 |
+
| # | Operation | Example Instruction | Reasoning | Answer |
|
| 83 |
+
|---|-----------|---------------------|-----------|--------|
|
| 84 |
+
| 1 | **Addition** | `Calculate 313921 + 108618.` | `313921 + 108618 = 422539` | `422539` |
|
| 85 |
+
| 2 | **Subtraction** | `Please compute 964047 - 52578.9.` | `964047-50000=914047 | ... | 911468.1` | `911468.1` |
|
| 86 |
+
| 3 | **Multiplication** | `Calculate 3088 x 1685.` | `3088*5*10^0=15440 | running=15440 | ... | 5203280` | `5203280` |
|
| 87 |
+
| 4 | **Division** | `Divide 7763506128 by 8856.` | `77635/8856=8 | 8*8856=70848 | ... | 876638` | `876638` |
|
| 88 |
+
| 5 | **Percentages** | `What is 86 percent of 5.6.` | `5.6*86=481.6 | 481.6/100=4.816` | `4.816` |
|
| 89 |
+
| 6 | **Comparison** | `Which is smaller, 107473 or 709570?` | `107473 < 709570 | 107473 is smaller` | `107473 is smaller` |
|
| 90 |
+
| 7 | **Fractions** | `Find 3/4 of 8324.` | `8324/4=2081 | 2081*3=6243` | `6243` |
|
| 91 |
+
| 8 | **Word Problems** | `Layla has 95 bags with 608 lemons each and found 152 more lemons. How many lemons total?` | `95*608=57760 | 57760+152=57912` | `57912 lemons` |
|
| 92 |
+
| 9 | **Algebra** | `Solve for x: x + 39 = 150` | `x = 150 - 39 = 111` | `111` |
|
| 93 |
+
| 10 | **Geometry** | `What is the area of a rectangle 884 by 752?` | `884*752=664768` | `664768` |
|
| 94 |
+
| | *+ 8 more:* `ratios, powers/roots, decimals, halving/doubling, sequences, multi-step, hard arithmetic, quantitative reasoning` - see `operation` field for full list. | | | |
|
| 95 |
+
|
| 96 |
+
Full per-operation counts in `150K`:
|
| 97 |
+
`word problems 13.6% | multi-step 10.7% | ratios 9.7% | hard arithmetic 5.7% | algebra 7.4% | fractions 4.6% | sequences 5.3% | geometry 5.1% | ...` (see `Per-operation` in generation log)
|
| 98 |
+
|
| 99 |
+
# Dataset Structure
|
| 100 |
+
|
| 101 |
+
### Data Instances
|
| 102 |
+
```json
|
| 103 |
+
{
|
| 104 |
+
"instruction": "What is 86 percent of 5.6.",
|
| 105 |
+
"reasoning": "5.6*86=481.6 | 481.6/100=4.816",
|
| 106 |
+
"answer": "4.816",
|
| 107 |
+
"text": "What is 86 percent of 5.6.\n5.6*86=481.6 | 481.6/100=4.816\nAnswer: 4.816",
|
| 108 |
+
"operation": "percentage",
|
| 109 |
+
"difficulty": "easy",
|
| 110 |
+
"num_steps": 1,
|
| 111 |
+
"max_digits": 2
|
| 112 |
+
}
|
| 113 |
+
```
|
| 114 |
+
|
| 115 |
+
### Data Fields
|
| 116 |
+
- `instruction` (string): the question, varied phrasing with names/objects
|
| 117 |
+
- `reasoning` (string): step-by-step trace (`|` separates steps, `\n` for long division), last step is `answer`
|
| 118 |
+
- `answer` (string): final answer only (with unit for word problems, e.g. `57912 lemons`)
|
| 119 |
+
- `text` (string): `instruction + "\n" + reasoning + "\nAnswer: " + answer` for pretraining
|
| 120 |
+
- `operation` (string): `addition | subtraction | multiplication | division | percentage | comparison | fractions | ... | word problems`
|
| 121 |
+
- `difficulty` (string): `easy | intermediate | hard | very hard`
|
| 122 |
+
- `num_steps` (int): reasoning steps (1 for easy, 2-3 for intermediate, 3-8 for hard)
|
| 123 |
+
- `max_digits` (int): largest operand digits (1-6)
|
| 124 |
+
|
| 125 |
+
### Data Splits
|
| 126 |
+
| Split | Size | Path |
|
| 127 |
+
|-------|------|------|
|
| 128 |
+
| train | 135,000 | `parquet/train.parquet` + `json/train.json` |
|
| 129 |
+
| validation | 7,500 | `parquet/val.parquet` + `json/val.json` |
|
| 130 |
+
| test | 7,500 | `parquet/test.parquet` + `json/test.json` |
|
| 131 |
+
|
| 132 |
+
All splits are IID from same generator, `seed 42`, `balanced-sizes`, `max_digits 6`.
|
| 133 |
+
|
| 134 |
+
# Dataset Creation
|
| 135 |
+
|
| 136 |
+
### Curation Rationale
|
| 137 |
+
Small LMs benefit from clean, unambiguous, verified reasoning traces. We built this to provide a tiered, diverse arithmetic reasoning dataset where `easy` teaches columns, `intermediate` teaches decomposition, `hard` teaches 3-8 step planning, and `very hard` teaches GSM8K-style 4-5 op word problems.
|
| 138 |
+
|
| 139 |
+
### Source Data
|
| 140 |
+
Synthetic - generated by `src/generate_data_v4.py` (deterministic, efficient, <30s for 150K). No web crawl.
|
| 141 |
+
|
| 142 |
+
Generation uses:
|
| 143 |
+
- `PROMPT_TEMPLATES` 20+ per op (so at 100K <1% duplicate instructions)
|
| 144 |
+
- `NAMES 120 + OBJECTS 150 + VERBS 100` for word problems (e.g., `Jaxson had 133 rainbows...` not just `Sarah had...`)
|
| 145 |
+
- `balanced-sizes` uniform 1-6 digits, `DIVISOR_MAX_DIGITS 4`, `scratchpad-mul v2`, `scratchpad-div v3`, `scratchpad-sub`
|
| 146 |
+
|
| 147 |
+
### Data processing steps
|
| 148 |
+
1. Generate 150K raw examples with `seed 42`
|
| 149 |
+
2. Verification pipeline (100%):
|
| 150 |
+
```python
|
| 151 |
+
true = calc(instruction) # independent python calc
|
| 152 |
+
assert answer == true
|
| 153 |
+
assert reasoning.split("|")[-1].strip().endswith(answer) or reasoning.split("\n")[-1].strip() == answer
|
| 154 |
+
assert reasoning lines are arithmetically valid
|
| 155 |
+
# else drop & regenerate (seen set ensures <1% dupes)
|
| 156 |
+
```
|
| 157 |
+
3. Deduplicate `instruction` strings via `seen` set
|
| 158 |
+
4. Shuffle and split 90/5/5, write `JSONL` + `Parquet`, copy `best_3440x1440.png` banner
|
| 159 |
+
|
| 160 |
+
### Personal and Sensitive Information
|
| 161 |
+
None - all synthetic. Names are sampled from common first names, no real PII.
|
| 162 |
+
|
| 163 |
+
# Considerations for Using the Data
|
| 164 |
+
|
| 165 |
+
### Social Impact
|
| 166 |
+
Helps make reasoning training accessible for small models without web-scale data. No harmful content.
|
| 167 |
+
|
| 168 |
+
### Discussion of Biases
|
| 169 |
+
Word problems sample `NAMES` uniformly from a US-centric list - not representative of global names. Objects are everyday items. No systematic bias in math, but phrasing reflects English templates.
|
| 170 |
+
|
| 171 |
+
### Other Known Limitations
|
| 172 |
+
- English only, 1-6 digit arithmetic (no logs, no negative numbers yet - planned for v2)
|
| 173 |
+
- Fractions are `a/b` where `a` divisible by `b` (exact)
|
| 174 |
+
- Division is exact or integer quotient (no decimal remainder except `very hard` GSM8K remainder)
|
| 175 |
+
- Sequences are `+step`, `*2`, `Fibonacci`, `+3/*2 alternating` - not full competition variety
|
| 176 |
+
|
| 177 |
+
# Additional Information
|
| 178 |
+
|
| 179 |
+
### Licensing Information
|
| 180 |
+
**Apache 2.0** - permissive, allows commercial use, modification, distribution, and private use with attribution and a patent grant. You must include copyright/license notices. See `LICENSE` file.
|
| 181 |
+
|
| 182 |
+
### Citation
|
| 183 |
+
No citation required, but if you use this dataset please cite:
|
| 184 |
+
|
| 185 |
+
```
|
| 186 |
+
@dataset{sagheerlab_arithmetic_reasoning_2026,
|
| 187 |
+
title={Arithmetic-Reasoning: A High-Quality Synthetic Arithmetic Reasoning Dataset for Small LMs},
|
| 188 |
+
author={SagheerLab},
|
| 189 |
+
year={2026},
|
| 190 |
+
url={https://huggingface.co/datasets/SagheerLab/Arithmetic-Reasoning}
|
| 191 |
+
}
|
| 192 |
+
```
|
| 193 |
+
|
| 194 |
+
### Contributions
|
| 195 |
+
Thanks to the synthetic data verification pipeline and tiered difficulty design. Banner image `best_3440x1440.png` included at repo root.
|
json/test.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
json/train.json
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:bc1f3b05a45f4f91444982d7ed6a822d0dae2717cbaa5130e663a15b2b1f44bc
|
| 3 |
+
size 40159803
|
json/val.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
parquet/test.parquet
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:9d65467c71b5403237c70801a498aaaf9339c80035a65c87f83516e61d764884
|
| 3 |
+
size 746006
|
parquet/train.parquet
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:7c3d5e4a5f9de6b6cd5f1f37fc93e47e5c855c1692ccc5de61e234bfab930a78
|
| 3 |
+
size 12574963
|
parquet/val.parquet
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:e68483e98b570310d75d90c31066a0a891947562df5ed1fef28f46c065824159
|
| 3 |
+
size 742818
|