File size: 7,180 Bytes
87ab091
cc85dcc
 
 
 
7944460
70ab9b4
cc85dcc
 
 
 
 
 
24a1655
ae848f8
24a1655
 
 
ae848f8
 
 
70ab9b4
 
 
 
 
 
 
 
ae848f8
 
 
 
cc4d2ad
 
 
 
 
 
 
 
87ab091
f8eecad
 
 
5b86301
f8eecad
5b86301
 
 
cc4d2ad
5b86301
 
 
095dfd5
 
 
70ab9b4
 
095dfd5
 
5b86301
f8eecad
cc85dcc
 
ae848f8
 
70ab9b4
cc85dcc
 
f8eecad
cc85dcc
f8eecad
cc85dcc
f8eecad
cc85dcc
 
 
 
ae848f8
095dfd5
 
5b86301
 
cc85dcc
 
f8eecad
ae848f8
24a1655
70ab9b4
095dfd5
ae848f8
095dfd5
ae848f8
24a1655
cc85dcc
0fc741c
cc85dcc
0fc741c
095dfd5
0fc741c
5b86301
0fc741c
cc85dcc
 
 
 
0fc741c
cc85dcc
0fc741c
cc85dcc
 
 
 
 
 
 
 
 
 
 
0fc741c
70ab9b4
0fc741c
095dfd5
cc85dcc
5b86301
cc85dcc
 
 
70ab9b4
 
095dfd5
 
be71a27
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
---
pretty_name: Cayley Math
language:
- en
- zh
license: apache-2.0
license_name: mixed-upstream-licenses
task_categories:
- text-generation
tags:
- pretraining
- language-modeling
- mathematics
configs:
- config_name: anholon-phase1
  default: true
  data_files:
  - split: train
    path:
    - phase1/preview/full/train-initial.parquet
    - phase1/preview/full/train-continuation.parquet
    - phase1/preview/full/train-rest-14672b537052.parquet
    - phase1/preview/full/train-rest-7d766bf7f01e.parquet
    - phase1/preview/full/train-rest-8d08c3c8fd37.parquet
    - phase1/preview/full/train-rest-a3846b4799ee.parquet
    - phase1/preview/full/train-rest-bd420910b68f.parquet
    - phase1/preview/full/train-rest-bee1b70f5d99.parquet
    - phase1/preview/full/train-rest-d4222945b5bb.parquet
    - phase1/preview/full/train-rest-d93823f0124c.parquet
  - split: validation
    path: phase1/preview/full/validation.parquet
  - split: test
    path: phase1/preview/full/test.parquet
- config_name: openai-math
  data_files:
  - split: train
    path: components/openai-math/data/train.parquet
  - split: validation
    path: components/openai-math/data/dev.parquet
  - split: test
    path: components/openai-math/data/test.parquet
---

# Cayley-Math

Cayley-Math is a collaboratively maintained collection of mathematical text for language-model research. Contributors can publish cleaned collections as separately versioned components. The first component is a frozen mirror of the mathematics subset prepared for Anholon Phase 1.

| Collection | Location | Maintenance |
| --- | --- | --- |
| Anholon Phase 1 mathematics mirror | [Phase 1 bundle](phase1/README.md) | Anholon data maintainers |
| OpenAI mathematics manuscripts | [OpenAI Math component](components/openai-math/README.md) | Source extraction and OMP DeepSeek metadata |
| Contributed mathematics collections | [Component guide](components/README.md) | Each component's contributors |

## Phase 1 Files

| Use | Files | Coverage |
| --- | --- | --- |
| Train with the frozen release | [NumPy archives](https://huggingface.co/datasets/MMLA-ORG/Cayley-Math/tree/main/phase1/math) | 1,071,000,000 training labels across three batches |
| Browse every packed mathematics window | [Data Studio](https://huggingface.co/datasets/MMLA-ORG/Cayley-Math/viewer/anholon-phase1/train) | 1,009,501 training rows plus validation and test |
| Trace sources and terms | [Source catalog](phase1/sources.json) · [Attribution guide](phase1/attribution/README.md) | All included components |

## Phase 1 Summary

| Split | Loss-bearing labels | Packed rows |
| --- | ---: | ---: |
| Train, initial batch | 50,000,000 | 43,833 |
| Train, continuation | 200,000,000 | 103,132 |
| Train, full pretraining continuation | 821,000,000 | 862,536 |
| Development | 1,024 | 1 |
| Test | 1,024 | 1 |

Sources include mathematical arXiv passages cached by Common Pile, excerpts from the Stacks Project, and textbooks by Wen-Wei Li. Each window has up to 2,048 token positions and uses the same 32,768-piece SentencePiece vocabulary as the full corpus.

## Repository Structure

```text
phase1/
├── math/                # Mathematics archive and packed manifest
├── attribution/         # Document-level sources, licenses, and notices
├── preview/            # Full text viewer under full/
├── sources.json        # Component counts and provenance references
└── upload-manifest.json # File sizes and hashes by repository path
components/              # Independently contributed collections
tokenizer/               # SentencePiece model and vocabulary for Phase 1
examples/                # Synthetic illustration of a source record
```

## Browse the dataset

Select [`anholon-phase1`](https://huggingface.co/datasets/MMLA-ORG/Cayley-Math/viewer/anholon-phase1/train) in Data Studio. The `train` split contains all 43,833 initial mathematics windows, 103,132 first continuation windows, and 862,536 full pretraining continuation windows. The original validation and test splits each contain one row. Select `openai-math` for the independently contributed collection.

Each Parquet row decodes one frozen window and records its batch, row number within that batch and split, supervised label count, source, license and attribution. Padding and control tokens are omitted in the displayed text. Consecutive windows can share a boundary token. The NumPy archives contain the original token IDs and label masks.

The Parquet files and their hashes are in [phase1/preview/full](https://huggingface.co/datasets/MMLA-ORG/Cayley-Math/tree/main/phase1/preview/full). The Stacks Project rows have a [compressed editable UTF-8 copy](phase1/preview/full/stacks-transparent.txt.gz) with the source notices and GFDL text.

## Data Fields

Each shard contains three `int32` arrays with shape `[rows, 2048]`. The `input_ids` array uses zero for padding. The `labels` array stores shifted targets and masks unused positions with `-100`. The `role_ids` array is zero throughout plain pretraining text.

## Loading the Training Pack

Set `HF_DATA_REVISION` to a commit SHA for reproducible access. The bundle uses the included Phase 1 tokenizer.

```python
import os
import subprocess
from pathlib import Path

from huggingface_hub import snapshot_download

root = Path(snapshot_download(
    repo_id="MMLA-ORG/Cayley-Math",
    repo_type="dataset",
    revision=os.environ.get("HF_DATA_REVISION", "main"),
    endpoint="https://huggingface.co",
    allow_patterns=["phase1/math/**", "phase1/upload-manifest.json", "tokenizer/**"],
    local_dir="cayley-phase1",
))
math = root / "phase1" / "math"
subprocess.run(["tar", "--zstd", "-xf", str(math / "math.tar.zst"), "-C", str(math)], check=True)
```

Use `math/manifest.json` to locate and verify the extracted initial arrays. The [continuation bundle](phase1/math/continuation-4b/README.md) has its own archive and manifest. The [full pretraining math continuation](phase1/math/pretrain-rest-16p42b/README.md) adds 821M training labels with its own archives and attribution. Development and test are small monitoring splits.

## Processing and Source Terms

The Phase 1 mirror preserves the original mathematics group assignments, splits and training labels. When building a new training mix from Cayley-Math, record the selected commit, component paths and file digests. Check overlap with any existing Anholon mathematics data before combining the components.

Source terms are recorded per document. Common Pile arXiv text and Wen-Wei Li excerpts retain their applicable Creative Commons terms. The Stacks Project passages retain GFDL 1.2 or later. See the [batch notes](phase1/README.md) and attribution and notices in `phase1/attribution/math-rights/`.

The [full pretraining continuation source terms](phase1/math/pretrain-rest-16p42b/README.md) cover MathOverflow, Cross Validated, arXiv, and OpenAI Math.

## Citation and Revision

For research records, cite MMLA-ORG, *Cayley-Math*, the component and its Hugging Face revision. Cite the component's upstream works as listed in its attribution. See the [MMLA project](https://mmla-org.github.io/) for the model family.