math-tiers / README.md
swan07's picture
Update README.md
8b2b632 verified
metadata
license: cc-by-4.0
language:
  - en
tags:
  - pretraining
  - numerical-reasoning
  - tiered-corpus
size_categories:
  - n>1T

Math-Tiers: A Tiered Pretraining Corpus for Studying Numerical Reasoning

A large-scale English pretraining corpus split into three tiers by mathematical content density. Designed for controlled experiments studying how data composition during pretraining affects numerical reasoning in language models.

Tiers

Tier Description Shards Size Est. Tokens Sources
T0 Pure narrative: no digits, number words, or math 648 542 GB ~113B RedPajama-Book, PleIAs/English-PD, Project Gutenberg, Institutional Books, FineWeb
T1 Everyday numeric language: blocks formal math only 1,216 314 GB ~66B allenai/c4 (English)
T2 Full math content: unfiltered 751 580 GB ~121B HuggingFaceTB/finemath (finemath-3plus)
Total 2,615 1,437 GB ~300B

Format

Each tier is stored as sharded JSONL files: T0/T0_0000.jsonl, T1/T1_0000.jsonl, T2/T2_0000.jsonl, etc.

Each line is a JSON object with:

{"text": "...", "source": "english-pd", "token_estimate": 1234}
  • text: The filtered document text
  • source: Origin dataset identifier
  • token_estimate: Approximate whitespace-split token count

Filtering

All tiers use sentence-level filtering: documents are split into sentences (NLTK punkt), individual sentences matching the blocklist are removed, and remaining sentences are rejoined. This preserves more text than paragraph-level filtering.

T0 Blocklist (aggressive: removes all numeric content)

  • Digits: All characters 0-9
  • Operators: + - * / = ^ % < > and Unicode math symbols
  • Fraction characters: ½ ¼ ¾ etc.
  • Number words: zero through trillion, ordinals (first–twelfth), once/twice/thrice, half/quarter/double/triple/dozen
  • Math terms: equation, variable, polynomial, derivative, integral, theorem, eigenvalue, topology, etc.
  • Patterns: LaTeX math ($...$, \frac{}, \sum, \int, etc.)

T1 Blocklist (moderate: removes formal math only)

  • No digit or operator blocking — everyday numbers pass through
  • Math terms: equation, variable, polynomial, derivative, integral, theorem, eigenvalue, topology, etc.
  • Patterns: LaTeX math expressions

T2 Blocklist

None. All content from finemath-3plus is included.

Intended Use

This corpus supports a pretraining experiment with the following design:

  1. Base model: Train from scratch on T0 (pure narrative) for 60B tokens
  2. Model 0: Continue base on T0 (held-out shards) for 20B tokens
  3. Model 1: Continue base on T1 (everyday numeric) for 20B tokens
  4. Model 2: Continue base on T2 (full math) for 20B tokens

Comparing Models 0/1/2 isolates the effect of mathematical content exposure during the second training phase, controlling for total compute and training procedure.

Sources