# GSM8K (2021)

> 8.5k grade-school math word problems with step-by-step solutions.

Page: https://mralbu.github.io/ai-datasets/d/gsm8k

## Key facts

- Category: LLMs
- Task: Multi-step grade-school math word problems
- Creators: Karl Cobbe et al. (OpenAI)
- Size: 8,792 problems
- Splits: train 7,473, test 1,319
- Input: A word problem in English
- Labels: A worked solution ending in "#### <number>"
- License: MIT
- Paper: [Training Verifiers to Solve Math Word Problems](https://arxiv.org/abs/2110.14168)
- Homepage: https://github.com/openai/grade-school-math
- Hugging Face: [openai/gsm8k](https://huggingface.co/datasets/openai/gsm8k)
- Sampled at Hub revision 740312add88f781978c0658806c59bc2815b9866 (2026-11-07)

## Why it matters

The benchmark that made "can LLMs reason?" measurable. Problems take 2–8 steps of basic arithmetic, so failures come from multi-step reasoning, not hard math. It became the standard test for chain-of-thought prompting and is now largely saturated by frontier models.

## Worth knowing

- Solutions include calculator annotations like <<16-3-4=9>>; the original paper used them to call a calculator during generation.
- The final answer always follows "####", which makes automatic grading a simple string match.
- Written by human contractors to avoid web text, but later studies found signs of contamination and released fresh look-alike sets (e.g. GSM1k).

## Get the data

```bash
# pip install -U huggingface_hub
hf download openai/gsm8k --repo-type dataset \
  --local-dir gsm8k
```

```python
from datasets import load_dataset   # pip install datasets

ds = load_dataset("openai/gsm8k", "main")
print(ds)
```

```python
import polars as pl

df = pl.read_parquet("hf://datasets/openai/gsm8k@~parquet/main/test/*.parquet")
print(df.shape)
```

## Related datasets

- [MATH](https://huggingface.co/datasets/EleutherAI/hendrycks_math): 2021, competition-level math, much harder (on this site: https://mralbu.github.io/ai-datasets/d/math)
- [GSM-Symbolic](https://huggingface.co/datasets/apple/GSM-Symbolic): 2024, templated variants to probe robustness
- [AIME 2025](https://huggingface.co/datasets/MathArena/aime_2025): 2025, olympiad-qualifier problems with integer answers, for reasoning models (on this site: https://mralbu.github.io/ai-datasets/d/aime-2025)

## Landmark papers

- [Chain-of-Thought Prompting Elicits Reasoning in Large Language Models](https://arxiv.org/abs/2201.11903) (2022)
- [Self-Consistency Improves Chain of Thought Reasoning](https://arxiv.org/abs/2203.11171) (2022)

## Papers on this site that use it

- [Chain of thought (2022)](https://mralbu.github.io/ai-datasets/p/chain-of-thought.md): Show the model worked examples that reason step by step, and it starts reasoning step by step too.
- [Self-consistency (2022)](https://mralbu.github.io/ai-datasets/p/self-consistency.md): Sample many chains of thought instead of one, and take the most common final answer.
- [LLaMA (2023)](https://mralbu.github.io/ai-datasets/p/llama.md): Smaller models trained longer on public data alone, matching models many times their size, with the weights given to researchers.
- [Muon (2025)](https://mralbu.github.io/ai-datasets/p/muon.md): Shows that Muon, which orthogonalizes each weight matrix's update, trains large language models with about half the compute AdamW needs.
