File size: 6,542 Bytes
2e0a316
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
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
---
language:
- en
pretty_name: MicroReason Math
size_categories:
- 100K<n<1M
task_categories:
- text-generation
- question-answering
tags:
- math
- arithmetic
- algebra
- synthetic
- reasoning
- chain-of-thought
- compositional-generalization
configs:
- config_name: benchmark
  data_files:
  - split: val
    path: data/benchmark/val.jsonl
  - split: val_heldout_shape
    path: data/benchmark/val_heldout_shape.jsonl
  - split: test_id
    path: data/benchmark/test_id.jsonl
  - split: test_heldout_shape
    path: data/benchmark/test_heldout_shape.jsonl
  - split: test_extrapolation
    path: data/benchmark/test_extrapolation.jsonl
  - split: test_extrapolation_fresh
    path: data/benchmark/test_extrapolation_fresh.jsonl
- config_name: sft
  data_files:
  - split: train
    path: data/sft/train.jsonl
---

# MicroReason Math

Synthetic arithmetic and linear-algebra problems with exact answers and canonical step-by-step
solutions. They were generated to train and evaluate
[MicroReason-43M](https://huggingface.co/arpjw/microreason-43m), a small language model trained
from scratch.

**Generation and checking:**
- **Source:** every problem comes from a seeded grammar over random expression trees and linear
  equations.
- **Answers:** each answer is verified by an independent exact solver.
- **Steps:** every solution step is checked to be correct.

The benchmark splits test generalization to **unseen problem structures** and to **larger
numbers** than those seen in training.

```python
from datasets import load_dataset

bench = load_dataset("arpjw/microreason-math", "benchmark")   # 6 evaluation splits, 40,000 problems
sft = load_dataset("arpjw/microreason-math", "sft", split="train")   # 100,000 training problems
```

## Examples

```
Compute: 93 - (-90) * (-73)
  1. Multiply: -90 * (-73) = 6570
  2. Subtract: 93 - 6570 = -6477
  answer: -6477

Find x: 23x + 7462 = 15(x - 2721)
  1. Expand: 23x + 7462 = 15x - 40815
  2. Subtract 15x from both sides: 8x + 7462 = -40815
  3. Subtract 7462 from both sides: 8x = -48277
  4. Divide both sides by 8: x = -48277/8
  answer: -48277/8
```

## Splits

| Config / split | Problems | Shapes | What it measures |
| --- | ---: | ---: | --- |
| `benchmark` / `val` | 7,000 | 1,555 | In-distribution validation |
| `benchmark` / `val_heldout_shape` | 6,000 | 1,039 | Validation on problem structures never seen in training |
| `benchmark` / `test_id` | 7,000 | 1,574 | In-distribution test |
| `benchmark` / `test_heldout_shape` | 6,000 | 1,053 | Test on unseen structures (3–5 operators and equations) |
| `benchmark` / `test_extrapolation` | 7,000 | 1,214 | Test with 4–5 digit numbers (training uses 0–999) |
| `benchmark` / `test_extrapolation_fresh` | 7,000 | 1,209 | An independent second extrapolation suite (own seed, frozen separately) |
| `sft` / `train` | 100,000 | 9,407 | Supervised fine-tuning problems |

**Family mix:**
- **Expressions:** 1–5 operators over `+ − × ÷`. In-distribution splits are about 11% 1-op,
  20% 2-op, 16% 3-op, 10% 4-op and 8% 5-op.
- **Equations:** linear equations make up about 35% of in-distribution splits.
- **Held-out-shape splits:** only 3+ operator structures and equations.

**How shapes are held out:** a *shape* is the operator structure of an expression tree, such as
`(- n (* n n))`, or an equation template.
- **Assignment:** each shape is hashed into exactly one of train-visible (80%), held-out-val
  (10%) or held-out-test (10%).
- **Coverage guarantee:** every operator and pairing in a held-out shape also appears in a
  training shape. Held-out problems are new *combinations*, not new primitives.

**Contamination checks:**
- No problem appears in more than one split.
- Every evaluation problem was checked against the 435 k-document general-text corpus
  (Cosmopedia) used in pretraining.

## Fields

| Field | Description |
| --- | --- |
| `id` | Stable record id |
| `prompt` | The problem as posed to the model, e.g. `Compute: …` or `Find x: …` |
| `solution_steps` | Canonical worked solution: post-order reductions or fixed equation moves |
| `final_answer` | Exact answer: an integer, or a reduced fraction like `-48277/8` |
| `answer_type` | `integer` or `rational` |
| `kind` | `expression` or `linear_equation` |
| `math_text` | The bare expression or equation |
| `variable` | `x` for equations, else null |
| `family` | `expression_1op` … `expression_5op`, `linear_equation` |
| `shape` | Structural template (used for held-out splits and cluster bootstrap) |
| `difficulty` | Integer difficulty level |
| `number_range` | `in_distribution` (0–999) or `extrapolation` (4–5 digits) |
| `params` | JSON string of the sampled numbers |
| `seed` | Generator seed (string; a 64-bit unsigned integer) |
| `semantic_fingerprint` | Hash of the canonical problem, used for de-duplication |
| `generator_version` | `3.0` |

## Exact original files

`data/` holds loader-friendly copies, with `seed` and `params` stored as strings. `raw/` holds the
byte-exact files produced by the generator. Their sha256 hashes match the frozen manifests in the
MicroReason repository:

| File | sha256 |
| --- | --- |
| `raw/benchmark_val.jsonl` | `4d9b10b32896…` |
| `raw/benchmark_val_heldout_shape.jsonl` | `fabbcecef5dd…` |
| `raw/benchmark_test_id.jsonl` | `2085da0f3c2e…` |
| `raw/benchmark_test_heldout_shape.jsonl` | `a370443a077d…` |
| `raw/benchmark_test_extrapolation.jsonl` | `28db77f8794d…` |
| `raw/benchmark_test_extrapolation_fresh.jsonl` | `35d481707bd9…` |
| `raw/sft_train.jsonl` | `0020a0e550aa…` |

## How MicroReason-43M scores

Greedy decoding, show-work prompt, exact final answer:

| Model | `test_id` | `test_heldout_shape` | `test_extrapolation` | `test_extrapolation_fresh` |
| --- | ---: | ---: | ---: | ---: |
| `sft-long` | 87.1% | 81.4% | 10.2% | 9.5% |
| `grpo` | 87.8% | 82.0% | 10.1% | 9.3% |
| `extra-sft` | 88.8% | 83.1% | 7.8% | 7.4% |

## Not included

The larger training pools used for pretraining, mid-training, long SFT and RL are not included:
6 M + 5 M + 4 M records. They come from the same generator and are rebuilt deterministically from
their seeds.

## Notes

- **Prompt conventions:** in MicroReason the show-work prompt appends ` Show your work.` to
  `prompt`. Solutions are rendered as numbered lines inside `[steps] … [/steps]`, followed by
  `[answer]…[/answer]`.
- **Purpose:** these are synthetic problems for studying small-model reasoning and generalization.
  They are not representative of natural-language math word problems.