Add 9 files (README.md/..., batch 1/9)
Browse files- README.md +96 -0
- data/formatted_text/formatted_text-0.jsonl.gz +3 -0
- data/synthetic_instruct/dart-math.jsonl.gz +3 -0
- data/synthetic_instruct/few-shot-0.jsonl.gz +3 -0
- data/synthetic_instruct/few-shot-1.jsonl.gz +3 -0
- data/synthetic_instruct/few-shot-2.jsonl.gz +3 -0
- mix/blend_weights.json +366 -0
- mix/megatron_blend.py +18 -0
- mix/mix_frontload.py +73 -0
README.md
ADDED
|
@@ -0,0 +1,96 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: other
|
| 3 |
+
language:
|
| 4 |
+
- en
|
| 5 |
+
task_categories:
|
| 6 |
+
- text-generation
|
| 7 |
+
tags:
|
| 8 |
+
- reasoning
|
| 9 |
+
- instruct
|
| 10 |
+
- math
|
| 11 |
+
- code
|
| 12 |
+
- pretraining
|
| 13 |
+
- front-loading
|
| 14 |
+
---
|
| 15 |
+
|
| 16 |
+
# MV-FrontLoad-Reasoning-Instruct
|
| 17 |
+
|
| 18 |
+
The **reasoning / instruct subset of MixtureVitae v1** that we "front-load" into pretraining
|
| 19 |
+
(MixtureVitae post-training / front-loading paper). 40 shards, **175.1B tokens**, 119,446,588 documents
|
| 20 |
+
(GPT-NeoX token counts of the data used in our runs). Text only.
|
| 21 |
+
Same layout as [`ontocord/MixtureVitae-v1`](https://huggingface.co/datasets/ontocord/MixtureVitae-v1): `data/<folder>/<name>.jsonl.gz`.
|
| 22 |
+
|
| 23 |
+
Each line: `{"id": ..., "metadata": ..., "text": ...}`. Use the `text` field.
|
| 24 |
+
|
| 25 |
+
## What is front-loading?
|
| 26 |
+
Mix this subset into a web-heavy corpus **during pretraining** (not only at the end).
|
| 27 |
+
Our reference blend is **42.0573 % MV-FrontLoad + 57.9427 % web** (web = Comma 0.1 in the example below).
|
| 28 |
+
Per-shard weights are in [`mix/blend_weights.json`](mix/blend_weights.json).
|
| 29 |
+
|
| 30 |
+
## Mix it into any web dataset
|
| 31 |
+
```bash
|
| 32 |
+
pip install datasets huggingface_hub
|
| 33 |
+
|
| 34 |
+
# Example: Comma 0.1 + MV-FrontLoad (the paper blend)
|
| 35 |
+
python mix/mix_frontload.py --web_dataset common-pile/comma_v0.1_training_dataset \
|
| 36 |
+
--out comma_plus_mv.jsonl.gz --max_docs 1000000
|
| 37 |
+
|
| 38 |
+
# Any other web dataset: change the id (and optionally --mv_share)
|
| 39 |
+
python mix/mix_frontload.py --web_dataset HuggingFaceFW/fineweb-edu --web_name sample-10BT \
|
| 40 |
+
--out fw_plus_mv.jsonl.gz --max_docs 1000000
|
| 41 |
+
```
|
| 42 |
+
For Megatron-LM (tokenized with GPT-NeoX; weights exactly as in our runs):
|
| 43 |
+
```bash
|
| 44 |
+
python mix/megatron_blend.py /path/to/mv_tokenized /path/to/comma_tokenized > blend.txt
|
| 45 |
+
```
|
| 46 |
+
|
| 47 |
+
## Files (40 shards)
|
| 48 |
+
| file | docs (trained) | tokens (B) |
|
| 49 |
+
|---|---|---|
|
| 50 |
+
| `data/synthetic_instruct/dart-math.jsonl.gz` | 1,426,292 | 0.60 |
|
| 51 |
+
| `data/synthetic_instruct/few-shot-0.jsonl.gz` | 3,577,968 | 5.97 |
|
| 52 |
+
| `data/synthetic_instruct/few-shot-1.jsonl.gz` | 3,482,063 | 5.88 |
|
| 53 |
+
| `data/synthetic_instruct/few-shot-2.jsonl.gz` | 2,845,383 | 4.83 |
|
| 54 |
+
| `data/formatted_text/formatted_text-0.jsonl.gz` | 998,235 | 0.59 |
|
| 55 |
+
| `data/formatted_text/formatted_text-1.jsonl.gz` | 723,944 | 0.43 |
|
| 56 |
+
| `data/synthetic_instruct/glaiveai-reasoning-0.jsonl.gz` | 2,564,555 | 4.18 |
|
| 57 |
+
| `data/synthetic_instruct/glaiveai-reasoning-1.jsonl.gz` | 2,556,985 | 4.18 |
|
| 58 |
+
| `data/synthetic_instruct/glaiveai-reasoning-2.jsonl.gz` | 2,564,005 | 4.18 |
|
| 59 |
+
| `data/synthetic_instruct/glaiveai-reasoning-3.jsonl.gz` | 2,565,084 | 4.18 |
|
| 60 |
+
| `data/synthetic_instruct/glaiveai-reasoning-4.jsonl.gz` | 2,011,319 | 5.44 |
|
| 61 |
+
| `data/synthetic_instruct/glaiveai-reasoning-5.jsonl.gz` | 2,558,097 | 4.18 |
|
| 62 |
+
| `data/synthetic_instruct/glaiveai-reasoning-6.jsonl.gz` | 2,562,654 | 4.18 |
|
| 63 |
+
| `data/synthetic_instruct/glaiveai-reasoning-7.jsonl.gz` | 2,563,698 | 4.18 |
|
| 64 |
+
| `data/synthetic_instruct/glaiveai-reasoning-8.jsonl.gz` | 2,250,828 | 3.68 |
|
| 65 |
+
| `data/synthetic_instruct/ling-coder-dpo-0.jsonl.gz` | 250,770 | 0.39 |
|
| 66 |
+
| `data/synthetic_instruct/ling-coder-sft-0.jsonl.gz` | 3,270,254 | 5.37 |
|
| 67 |
+
| `data/synthetic_instruct/ling-coder-sft-1.jsonl.gz` | 593,642 | 0.97 |
|
| 68 |
+
| `data/synthetic_instruct/ling-coder-syntheticqa-0.jsonl.gz` | 7,081,780 | 5.81 |
|
| 69 |
+
| `data/synthetic_instruct/ling-coder-syntheticqa-1.jsonl.gz` | 7,082,200 | 5.81 |
|
| 70 |
+
| `data/synthetic_instruct/ling-coder-syntheticqa-2.jsonl.gz` | 7,080,222 | 5.81 |
|
| 71 |
+
| `data/synthetic_instruct/ling-coder-syntheticqa-3.jsonl.gz` | 2,875,396 | 2.36 |
|
| 72 |
+
| `data/math/math-0.jsonl.gz` | 615,020 | 4.23 |
|
| 73 |
+
| `data/math/math_word_problems-0.jsonl.gz` | 587,102 | 0.46 |
|
| 74 |
+
| `data/synthetic_instruct/misc_instruct.jsonl.gz` | 11,057,192 | 5.51 |
|
| 75 |
+
| `data/synthetic_instruct/nemo_science_math-0.jsonl.gz` | 1,141,410 | 5.73 |
|
| 76 |
+
| `data/synthetic_instruct/nemo_science_math-1.jsonl.gz` | 25,828,968 | 14.34 |
|
| 77 |
+
| `data/synthetic_instruct/nemo_science_math-2.jsonl.gz` | 3,563,981 | 1.99 |
|
| 78 |
+
| `data/synthetic_instruct/open_thoughts-0.jsonl.gz` | 356,372 | 5.92 |
|
| 79 |
+
| `data/synthetic_instruct/open_thoughts-1.jsonl.gz` | 411,575 | 6.62 |
|
| 80 |
+
| `data/synthetic_instruct/open_thoughts-2.jsonl.gz` | 423,973 | 6.14 |
|
| 81 |
+
| `data/synthetic_instruct/os-q2-0.jsonl.gz` | 1,696,808 | 4.60 |
|
| 82 |
+
| `data/synthetic_instruct/os-q2-1.jsonl.gz` | 1,554,838 | 4.71 |
|
| 83 |
+
| `data/synthetic_instruct/os-q2-2.jsonl.gz` | 1,544,681 | 4.70 |
|
| 84 |
+
| `data/synthetic_instruct/os-q2-3.jsonl.gz` | 1,027,798 | 3.36 |
|
| 85 |
+
| `data/synthetic_instruct/prism_math.jsonl.gz` | 996,799 | 5.65 |
|
| 86 |
+
| `data/synthetic_instruct/pyedu_reasoning.jsonl.gz` | 1,609,646 | 3.10 |
|
| 87 |
+
| `data/synthetic_instruct/ring-lite-sft-0.jsonl.gz` | 1,411,484 | 6.78 |
|
| 88 |
+
| `data/synthetic_instruct/ring-lite-sft-1.jsonl.gz` | 1,535,327 | 6.75 |
|
| 89 |
+
| `data/synthetic_instruct/ring-lite-sft-2.jsonl.gz` | 598,240 | 1.36 |
|
| 90 |
+
|
| 91 |
+
## Provenance and caveats
|
| 92 |
+
- Source: MixtureVitae v1 reasoning/instruct pools, decontaminated version (`MixtureVitae-211BT-decontaminated`).
|
| 93 |
+
- 38 of 40 files have exactly the same number of documents as the tokenized shards we trained on.
|
| 94 |
+
- `formatted_text-0/1` are the **unfiltered** versions: they have more documents than the ~1.0M / 0.7M we trained on. They are <1 % of the mix.
|
| 95 |
+
- Decontamination is offline n-gram based and not perfect. Check against your own benchmarks.
|
| 96 |
+
- Each source keeps its own licence; see `metadata` and the MixtureVitae v1 card. Review before commercial use.
|
data/formatted_text/formatted_text-0.jsonl.gz
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:7abe8b1c7e67bc228c0a1d86c3b6b4fd0fd67e277fb6756c244c3825502403b5
|
| 3 |
+
size 8697864391
|
data/synthetic_instruct/dart-math.jsonl.gz
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:4ca3cb40982b45f254fa1b4515dedc364f2e254f8fc48e007b658312a24827cd
|
| 3 |
+
size 699590874
|
data/synthetic_instruct/few-shot-0.jsonl.gz
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:6fba2038fde60d693877c5023303b497a7b5b049586fdff19888dbd650b2e54a
|
| 3 |
+
size 5810065226
|
data/synthetic_instruct/few-shot-1.jsonl.gz
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:574c253137ed9fc03ad6e013a71da061a398efed5b3f0f8bfae950375d0de3d1
|
| 3 |
+
size 5742622331
|
data/synthetic_instruct/few-shot-2.jsonl.gz
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:f54079ba59ac67890fd84990aaac0abf9b82a26642c61ed87732ebfee69f0943
|
| 3 |
+
size 4718043887
|
mix/blend_weights.json
ADDED
|
@@ -0,0 +1,366 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"mv_share": 0.420573073,
|
| 3 |
+
"web_share": 0.579426927,
|
| 4 |
+
"shards": [
|
| 5 |
+
{
|
| 6 |
+
"name": "dart-math",
|
| 7 |
+
"folder": "synthetic_instruct",
|
| 8 |
+
"path": "data/synthetic_instruct/dart-math.jsonl.gz",
|
| 9 |
+
"blend_weight": 0.0014375716,
|
| 10 |
+
"docs": 1426292,
|
| 11 |
+
"tokens": 598680611,
|
| 12 |
+
"mv_internal_weight": 0.003418125629740447
|
| 13 |
+
},
|
| 14 |
+
{
|
| 15 |
+
"name": "few-shot-0",
|
| 16 |
+
"folder": "synthetic_instruct",
|
| 17 |
+
"path": "data/synthetic_instruct/few-shot-0.jsonl.gz",
|
| 18 |
+
"blend_weight": 0.0143267031,
|
| 19 |
+
"docs": 3577968,
|
| 20 |
+
"tokens": 5966394483,
|
| 21 |
+
"mv_internal_weight": 0.03406471792833964
|
| 22 |
+
},
|
| 23 |
+
{
|
| 24 |
+
"name": "few-shot-1",
|
| 25 |
+
"folder": "synthetic_instruct",
|
| 26 |
+
"path": "data/synthetic_instruct/few-shot-1.jsonl.gz",
|
| 27 |
+
"blend_weight": 0.0141292283,
|
| 28 |
+
"docs": 3482063,
|
| 29 |
+
"tokens": 5884155549,
|
| 30 |
+
"mv_internal_weight": 0.03359518049792027
|
| 31 |
+
},
|
| 32 |
+
{
|
| 33 |
+
"name": "few-shot-2",
|
| 34 |
+
"folder": "synthetic_instruct",
|
| 35 |
+
"path": "data/synthetic_instruct/few-shot-2.jsonl.gz",
|
| 36 |
+
"blend_weight": 0.0116084857,
|
| 37 |
+
"docs": 2845383,
|
| 38 |
+
"tokens": 4834385459,
|
| 39 |
+
"mv_internal_weight": 0.02760159041375433
|
| 40 |
+
},
|
| 41 |
+
{
|
| 42 |
+
"name": "formatted_text-0",
|
| 43 |
+
"folder": "formatted_text",
|
| 44 |
+
"path": "data/formatted_text/formatted_text-0.jsonl.gz",
|
| 45 |
+
"blend_weight": 0.0014154299,
|
| 46 |
+
"docs": 998235,
|
| 47 |
+
"tokens": 589459636,
|
| 48 |
+
"mv_internal_weight": 0.0033654791304245004
|
| 49 |
+
},
|
| 50 |
+
{
|
| 51 |
+
"name": "formatted_text-1",
|
| 52 |
+
"folder": "formatted_text",
|
| 53 |
+
"path": "data/formatted_text/formatted_text-1.jsonl.gz",
|
| 54 |
+
"blend_weight": 0.0010270856,
|
| 55 |
+
"docs": 723944,
|
| 56 |
+
"tokens": 427732590,
|
| 57 |
+
"mv_internal_weight": 0.0024421097448623394
|
| 58 |
+
},
|
| 59 |
+
{
|
| 60 |
+
"name": "glaiveai-reasoning-0",
|
| 61 |
+
"folder": "synthetic_instruct",
|
| 62 |
+
"path": "data/synthetic_instruct/glaiveai-reasoning-0.jsonl.gz",
|
| 63 |
+
"blend_weight": 0.010032823,
|
| 64 |
+
"docs": 2564555,
|
| 65 |
+
"tokens": 4178196443,
|
| 66 |
+
"mv_internal_weight": 0.023855124457765747
|
| 67 |
+
},
|
| 68 |
+
{
|
| 69 |
+
"name": "glaiveai-reasoning-1",
|
| 70 |
+
"folder": "synthetic_instruct",
|
| 71 |
+
"path": "data/synthetic_instruct/glaiveai-reasoning-1.jsonl.gz",
|
| 72 |
+
"blend_weight": 0.0100478451,
|
| 73 |
+
"docs": 2556985,
|
| 74 |
+
"tokens": 4184452424,
|
| 75 |
+
"mv_internal_weight": 0.023890842626532106
|
| 76 |
+
},
|
| 77 |
+
{
|
| 78 |
+
"name": "glaiveai-reasoning-2",
|
| 79 |
+
"folder": "synthetic_instruct",
|
| 80 |
+
"path": "data/synthetic_instruct/glaiveai-reasoning-2.jsonl.gz",
|
| 81 |
+
"blend_weight": 0.0100344045,
|
| 82 |
+
"docs": 2564005,
|
| 83 |
+
"tokens": 4178855046,
|
| 84 |
+
"mv_internal_weight": 0.023858884803117198
|
| 85 |
+
},
|
| 86 |
+
{
|
| 87 |
+
"name": "glaiveai-reasoning-3",
|
| 88 |
+
"folder": "synthetic_instruct",
|
| 89 |
+
"path": "data/synthetic_instruct/glaiveai-reasoning-3.jsonl.gz",
|
| 90 |
+
"blend_weight": 0.0100366136,
|
| 91 |
+
"docs": 2565084,
|
| 92 |
+
"tokens": 4179775021,
|
| 93 |
+
"mv_internal_weight": 0.023864137398068756
|
| 94 |
+
},
|
| 95 |
+
{
|
| 96 |
+
"name": "glaiveai-reasoning-4",
|
| 97 |
+
"folder": "synthetic_instruct",
|
| 98 |
+
"path": "data/synthetic_instruct/glaiveai-reasoning-4.jsonl.gz",
|
| 99 |
+
"blend_weight": 0.0130523871,
|
| 100 |
+
"docs": 2011319,
|
| 101 |
+
"tokens": 5435702095,
|
| 102 |
+
"mv_internal_weight": 0.031034766460191328
|
| 103 |
+
},
|
| 104 |
+
{
|
| 105 |
+
"name": "glaiveai-reasoning-5",
|
| 106 |
+
"folder": "synthetic_instruct",
|
| 107 |
+
"path": "data/synthetic_instruct/glaiveai-reasoning-5.jsonl.gz",
|
| 108 |
+
"blend_weight": 0.0100464644,
|
| 109 |
+
"docs": 2558097,
|
| 110 |
+
"tokens": 4183877411,
|
| 111 |
+
"mv_internal_weight": 0.023887559724966034
|
| 112 |
+
},
|
| 113 |
+
{
|
| 114 |
+
"name": "glaiveai-reasoning-6",
|
| 115 |
+
"folder": "synthetic_instruct",
|
| 116 |
+
"path": "data/synthetic_instruct/glaiveai-reasoning-6.jsonl.gz",
|
| 117 |
+
"blend_weight": 0.0100417071,
|
| 118 |
+
"docs": 2562654,
|
| 119 |
+
"tokens": 4181896235,
|
| 120 |
+
"mv_internal_weight": 0.023876248254248077
|
| 121 |
+
},
|
| 122 |
+
{
|
| 123 |
+
"name": "glaiveai-reasoning-7",
|
| 124 |
+
"folder": "synthetic_instruct",
|
| 125 |
+
"path": "data/synthetic_instruct/glaiveai-reasoning-7.jsonl.gz",
|
| 126 |
+
"blend_weight": 0.0100362579,
|
| 127 |
+
"docs": 2563698,
|
| 128 |
+
"tokens": 4179626908,
|
| 129 |
+
"mv_internal_weight": 0.02386329164729954
|
| 130 |
+
},
|
| 131 |
+
{
|
| 132 |
+
"name": "glaiveai-reasoning-8",
|
| 133 |
+
"folder": "synthetic_instruct",
|
| 134 |
+
"path": "data/synthetic_instruct/glaiveai-reasoning-8.jsonl.gz",
|
| 135 |
+
"blend_weight": 0.0088251885,
|
| 136 |
+
"docs": 2250828,
|
| 137 |
+
"tokens": 3675273761,
|
| 138 |
+
"mv_internal_weight": 0.020983722131920696
|
| 139 |
+
},
|
| 140 |
+
{
|
| 141 |
+
"name": "ling-coder-dpo-0",
|
| 142 |
+
"folder": "synthetic_instruct",
|
| 143 |
+
"path": "data/synthetic_instruct/ling-coder-dpo-0.jsonl.gz",
|
| 144 |
+
"blend_weight": 0.0009469291,
|
| 145 |
+
"docs": 250770,
|
| 146 |
+
"tokens": 394351190,
|
| 147 |
+
"mv_internal_weight": 0.00225152098598571
|
| 148 |
+
},
|
| 149 |
+
{
|
| 150 |
+
"name": "ling-coder-sft-0",
|
| 151 |
+
"folder": "synthetic_instruct",
|
| 152 |
+
"path": "data/synthetic_instruct/ling-coder-sft-0.jsonl.gz",
|
| 153 |
+
"blend_weight": 0.0128882092,
|
| 154 |
+
"docs": 3270254,
|
| 155 |
+
"tokens": 5367329783,
|
| 156 |
+
"mv_internal_weight": 0.030644399338423646
|
| 157 |
+
},
|
| 158 |
+
{
|
| 159 |
+
"name": "ling-coder-sft-1",
|
| 160 |
+
"folder": "synthetic_instruct",
|
| 161 |
+
"path": "data/synthetic_instruct/ling-coder-sft-1.jsonl.gz",
|
| 162 |
+
"blend_weight": 0.0023403757,
|
| 163 |
+
"docs": 593642,
|
| 164 |
+
"tokens": 974655810,
|
| 165 |
+
"mv_internal_weight": 0.005564730246056432
|
| 166 |
+
},
|
| 167 |
+
{
|
| 168 |
+
"name": "ling-coder-syntheticqa-0",
|
| 169 |
+
"folder": "synthetic_instruct",
|
| 170 |
+
"path": "data/synthetic_instruct/ling-coder-syntheticqa-0.jsonl.gz",
|
| 171 |
+
"blend_weight": 0.0139523586,
|
| 172 |
+
"docs": 7081780,
|
| 173 |
+
"tokens": 5810497669,
|
| 174 |
+
"mv_internal_weight": 0.03317463598055884
|
| 175 |
+
},
|
| 176 |
+
{
|
| 177 |
+
"name": "ling-coder-syntheticqa-1",
|
| 178 |
+
"folder": "synthetic_instruct",
|
| 179 |
+
"path": "data/synthetic_instruct/ling-coder-syntheticqa-1.jsonl.gz",
|
| 180 |
+
"blend_weight": 0.0139518472,
|
| 181 |
+
"docs": 7082200,
|
| 182 |
+
"tokens": 5810284695,
|
| 183 |
+
"mv_internal_weight": 0.03317342002063931
|
| 184 |
+
},
|
| 185 |
+
{
|
| 186 |
+
"name": "ling-coder-syntheticqa-2",
|
| 187 |
+
"folder": "synthetic_instruct",
|
| 188 |
+
"path": "data/synthetic_instruct/ling-coder-syntheticqa-2.jsonl.gz",
|
| 189 |
+
"blend_weight": 0.013949779,
|
| 190 |
+
"docs": 7080222,
|
| 191 |
+
"tokens": 5809423401,
|
| 192 |
+
"mv_internal_weight": 0.033168502444758274
|
| 193 |
+
},
|
| 194 |
+
{
|
| 195 |
+
"name": "ling-coder-syntheticqa-3",
|
| 196 |
+
"folder": "synthetic_instruct",
|
| 197 |
+
"path": "data/synthetic_instruct/ling-coder-syntheticqa-3.jsonl.gz",
|
| 198 |
+
"blend_weight": 0.0056701032,
|
| 199 |
+
"docs": 2875396,
|
| 200 |
+
"tokens": 2361329886,
|
| 201 |
+
"mv_internal_weight": 0.013481850275279036
|
| 202 |
+
},
|
| 203 |
+
{
|
| 204 |
+
"name": "math-0",
|
| 205 |
+
"folder": "math",
|
| 206 |
+
"path": "data/math/math-0.jsonl.gz",
|
| 207 |
+
"blend_weight": 0.0101631434,
|
| 208 |
+
"docs": 615020,
|
| 209 |
+
"tokens": 4232468718,
|
| 210 |
+
"mv_internal_weight": 0.024164988327723964
|
| 211 |
+
},
|
| 212 |
+
{
|
| 213 |
+
"name": "math_word_problems-0",
|
| 214 |
+
"folder": "math",
|
| 215 |
+
"path": "data/math/math_word_problems-0.jsonl.gz",
|
| 216 |
+
"blend_weight": 0.0010963354,
|
| 217 |
+
"docs": 587102,
|
| 218 |
+
"tokens": 456571850,
|
| 219 |
+
"mv_internal_weight": 0.002606765554864707
|
| 220 |
+
},
|
| 221 |
+
{
|
| 222 |
+
"name": "misc_instruct",
|
| 223 |
+
"folder": "synthetic_instruct",
|
| 224 |
+
"path": "data/synthetic_instruct/misc_instruct.jsonl.gz",
|
| 225 |
+
"blend_weight": 0.013228812,
|
| 226 |
+
"docs": 11057192,
|
| 227 |
+
"tokens": 5509174715,
|
| 228 |
+
"mv_internal_weight": 0.031454253372992326
|
| 229 |
+
},
|
| 230 |
+
{
|
| 231 |
+
"name": "nemo_science_math-0",
|
| 232 |
+
"folder": "synthetic_instruct",
|
| 233 |
+
"path": "data/synthetic_instruct/nemo_science_math-0.jsonl.gz",
|
| 234 |
+
"blend_weight": 0.0137540754,
|
| 235 |
+
"docs": 1141410,
|
| 236 |
+
"tokens": 5727922089,
|
| 237 |
+
"mv_internal_weight": 0.03270317641091587
|
| 238 |
+
},
|
| 239 |
+
{
|
| 240 |
+
"name": "nemo_science_math-1",
|
| 241 |
+
"folder": "synthetic_instruct",
|
| 242 |
+
"path": "data/synthetic_instruct/nemo_science_math-1.jsonl.gz",
|
| 243 |
+
"blend_weight": 0.0344220646,
|
| 244 |
+
"docs": 25828968,
|
| 245 |
+
"tokens": 14335162439,
|
| 246 |
+
"mv_internal_weight": 0.08184562162875321
|
| 247 |
+
},
|
| 248 |
+
{
|
| 249 |
+
"name": "nemo_science_math-2",
|
| 250 |
+
"folder": "synthetic_instruct",
|
| 251 |
+
"path": "data/synthetic_instruct/nemo_science_math-2.jsonl.gz",
|
| 252 |
+
"blend_weight": 0.0047864909,
|
| 253 |
+
"docs": 3563981,
|
| 254 |
+
"tokens": 1993347140,
|
| 255 |
+
"mv_internal_weight": 0.011380878157171035
|
| 256 |
+
},
|
| 257 |
+
{
|
| 258 |
+
"name": "open_thoughts-0",
|
| 259 |
+
"folder": "synthetic_instruct",
|
| 260 |
+
"path": "data/synthetic_instruct/open_thoughts-0.jsonl.gz",
|
| 261 |
+
"blend_weight": 0.0142231104,
|
| 262 |
+
"docs": 356372,
|
| 263 |
+
"tokens": 5923252988,
|
| 264 |
+
"mv_internal_weight": 0.03381840472701875
|
| 265 |
+
},
|
| 266 |
+
{
|
| 267 |
+
"name": "open_thoughts-1",
|
| 268 |
+
"folder": "synthetic_instruct",
|
| 269 |
+
"path": "data/synthetic_instruct/open_thoughts-1.jsonl.gz",
|
| 270 |
+
"blend_weight": 0.015899427,
|
| 271 |
+
"docs": 411575,
|
| 272 |
+
"tokens": 6621359605,
|
| 273 |
+
"mv_internal_weight": 0.03780419627578012
|
| 274 |
+
},
|
| 275 |
+
{
|
| 276 |
+
"name": "open_thoughts-2",
|
| 277 |
+
"folder": "synthetic_instruct",
|
| 278 |
+
"path": "data/synthetic_instruct/open_thoughts-2.jsonl.gz",
|
| 279 |
+
"blend_weight": 0.0147475023,
|
| 280 |
+
"docs": 423973,
|
| 281 |
+
"tokens": 6141637444,
|
| 282 |
+
"mv_internal_weight": 0.03506525559233793
|
| 283 |
+
},
|
| 284 |
+
{
|
| 285 |
+
"name": "os-q2-0",
|
| 286 |
+
"folder": "synthetic_instruct",
|
| 287 |
+
"path": "data/synthetic_instruct/os-q2-0.jsonl.gz",
|
| 288 |
+
"blend_weight": 0.0110429175,
|
| 289 |
+
"docs": 1696808,
|
| 290 |
+
"tokens": 4598853026,
|
| 291 |
+
"mv_internal_weight": 0.026256834326623665
|
| 292 |
+
},
|
| 293 |
+
{
|
| 294 |
+
"name": "os-q2-1",
|
| 295 |
+
"folder": "synthetic_instruct",
|
| 296 |
+
"path": "data/synthetic_instruct/os-q2-1.jsonl.gz",
|
| 297 |
+
"blend_weight": 0.0113138244,
|
| 298 |
+
"docs": 1554838,
|
| 299 |
+
"tokens": 4711672931,
|
| 300 |
+
"mv_internal_weight": 0.026900971855609024
|
| 301 |
+
},
|
| 302 |
+
{
|
| 303 |
+
"name": "os-q2-2",
|
| 304 |
+
"folder": "synthetic_instruct",
|
| 305 |
+
"path": "data/synthetic_instruct/os-q2-2.jsonl.gz",
|
| 306 |
+
"blend_weight": 0.0112839449,
|
| 307 |
+
"docs": 1544681,
|
| 308 |
+
"tokens": 4699229528,
|
| 309 |
+
"mv_internal_weight": 0.02682992712659947
|
| 310 |
+
},
|
| 311 |
+
{
|
| 312 |
+
"name": "os-q2-3",
|
| 313 |
+
"folder": "synthetic_instruct",
|
| 314 |
+
"path": "data/synthetic_instruct/os-q2-3.jsonl.gz",
|
| 315 |
+
"blend_weight": 0.0080636021,
|
| 316 |
+
"docs": 1027798,
|
| 317 |
+
"tokens": 3358109042,
|
| 318 |
+
"mv_internal_weight": 0.019172891983981102
|
| 319 |
+
},
|
| 320 |
+
{
|
| 321 |
+
"name": "prism_math",
|
| 322 |
+
"folder": "synthetic_instruct",
|
| 323 |
+
"path": "data/synthetic_instruct/prism_math.jsonl.gz",
|
| 324 |
+
"blend_weight": 0.013570104,
|
| 325 |
+
"docs": 996799,
|
| 326 |
+
"tokens": 5651306714,
|
| 327 |
+
"mv_internal_weight": 0.03226574612397974
|
| 328 |
+
},
|
| 329 |
+
{
|
| 330 |
+
"name": "pyedu_reasoning",
|
| 331 |
+
"folder": "synthetic_instruct",
|
| 332 |
+
"path": "data/synthetic_instruct/pyedu_reasoning.jsonl.gz",
|
| 333 |
+
"blend_weight": 0.007437475,
|
| 334 |
+
"docs": 1609646,
|
| 335 |
+
"tokens": 3097356693,
|
| 336 |
+
"mv_internal_weight": 0.01768414451012654
|
| 337 |
+
},
|
| 338 |
+
{
|
| 339 |
+
"name": "ring-lite-sft-0",
|
| 340 |
+
"folder": "synthetic_instruct",
|
| 341 |
+
"path": "data/synthetic_instruct/ring-lite-sft-0.jsonl.gz",
|
| 342 |
+
"blend_weight": 0.0162796688,
|
| 343 |
+
"docs": 1411484,
|
| 344 |
+
"tokens": 6779712358,
|
| 345 |
+
"mv_internal_weight": 0.03870830028150661
|
| 346 |
+
},
|
| 347 |
+
{
|
| 348 |
+
"name": "ring-lite-sft-1",
|
| 349 |
+
"folder": "synthetic_instruct",
|
| 350 |
+
"path": "data/synthetic_instruct/ring-lite-sft-1.jsonl.gz",
|
| 351 |
+
"blend_weight": 0.0162081244,
|
| 352 |
+
"docs": 1535327,
|
| 353 |
+
"tokens": 6749917503,
|
| 354 |
+
"mv_internal_weight": 0.0385381885825106
|
| 355 |
+
},
|
| 356 |
+
{
|
| 357 |
+
"name": "ring-lite-sft-2",
|
| 358 |
+
"folder": "synthetic_instruct",
|
| 359 |
+
"path": "data/synthetic_instruct/ring-lite-sft-2.jsonl.gz",
|
| 360 |
+
"blend_weight": 0.0032546531,
|
| 361 |
+
"docs": 598240,
|
| 362 |
+
"tokens": 1355409122,
|
| 363 |
+
"mv_internal_weight": 0.007738615020653023
|
| 364 |
+
}
|
| 365 |
+
]
|
| 366 |
+
}
|
mix/megatron_blend.py
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/usr/bin/env python3
|
| 2 |
+
"""Print a Megatron-LM `--data-path` blend (weight prefix ...) for Comma 0.1 + MV-FrontLoad.
|
| 3 |
+
|
| 4 |
+
You must first tokenize the MV shards yourself (e.g. with Megatron's tools/preprocess_data.py,
|
| 5 |
+
GPT-NeoX tokenizer, `--json-keys text`) to `<MV_PREFIX_DIR>/<name>_text_document`, and have your
|
| 6 |
+
web dataset tokenized to one prefix. Weights are the exact ones used in the paper runs.
|
| 7 |
+
|
| 8 |
+
python megatron_blend.py MV_PREFIX_DIR WEB_PREFIX > blend.txt
|
| 9 |
+
megatron ... --data-path $(cat blend.txt)
|
| 10 |
+
"""
|
| 11 |
+
import json, sys
|
| 12 |
+
from huggingface_hub import hf_hub_download
|
| 13 |
+
|
| 14 |
+
mvdir, web = sys.argv[1], sys.argv[2]
|
| 15 |
+
bw = json.load(open(hf_hub_download("laion/MV-FrontLoad-Reasoning-Instruct", "mix/blend_weights.json", repo_type="dataset")))
|
| 16 |
+
parts = [f"{s['blend_weight']:.10f} {mvdir}/{s['name']}_text_document" for s in bw["shards"]]
|
| 17 |
+
parts.append(f"{bw['web_share']:.10f} {web}")
|
| 18 |
+
print(" ".join(parts))
|
mix/mix_frontload.py
ADDED
|
@@ -0,0 +1,73 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/usr/bin/env python3
|
| 2 |
+
"""Front-load MV-FrontLoad-Reasoning-Instruct into ANY web dataset.
|
| 3 |
+
|
| 4 |
+
Streams both sources and interleaves them so that, in expectation, MV makes up
|
| 5 |
+
`--mv_share` of the documents; inside MV, shards are sampled with the paper's
|
| 6 |
+
per-shard token weights converted to document weights (see blend_weights.json).
|
| 7 |
+
|
| 8 |
+
Example (reproduces the Comma 0.1 + MV-FrontLoad blend: 42.0573% MV / 57.9427% Comma):
|
| 9 |
+
|
| 10 |
+
python mix_frontload.py --web_dataset common-pile/comma_v0.1_training_dataset \
|
| 11 |
+
--web_split train --out comma_plus_mv.jsonl.gz --max_docs 1000000
|
| 12 |
+
|
| 13 |
+
Any other web dataset works the same way, e.g. HuggingFaceFW/fineweb-edu:
|
| 14 |
+
|
| 15 |
+
python mix_frontload.py --web_dataset HuggingFaceFW/fineweb-edu --web_name sample-10BT \
|
| 16 |
+
--mv_share 0.4205731 --out fw_plus_mv.jsonl.gz --max_docs 1000000
|
| 17 |
+
|
| 18 |
+
Output: JSONL.gz with a single "text" field (+ "source": "mv"|"web").
|
| 19 |
+
Requires: pip install datasets huggingface_hub
|
| 20 |
+
"""
|
| 21 |
+
import argparse, gzip, json, os, random
|
| 22 |
+
from datasets import load_dataset
|
| 23 |
+
from huggingface_hub import hf_hub_download
|
| 24 |
+
|
| 25 |
+
MV_REPO = "laion/MV-FrontLoad-Reasoning-Instruct"
|
| 26 |
+
|
| 27 |
+
|
| 28 |
+
def mv_stream(shard):
|
| 29 |
+
ds = load_dataset(MV_REPO, data_files=shard["path"], split="train", streaming=True)
|
| 30 |
+
for r in ds:
|
| 31 |
+
yield r["text"]
|
| 32 |
+
|
| 33 |
+
|
| 34 |
+
def cycle(make_iter):
|
| 35 |
+
while True: # restart when exhausted (repeat epochs)
|
| 36 |
+
for x in make_iter():
|
| 37 |
+
yield x
|
| 38 |
+
|
| 39 |
+
|
| 40 |
+
def main():
|
| 41 |
+
ap = argparse.ArgumentParser()
|
| 42 |
+
ap.add_argument("--web_dataset", required=True, help="HF dataset id of the web corpus")
|
| 43 |
+
ap.add_argument("--web_name", default=None)
|
| 44 |
+
ap.add_argument("--web_split", default="train")
|
| 45 |
+
ap.add_argument("--web_text_column", default="text")
|
| 46 |
+
ap.add_argument("--mv_share", type=float, default=None,
|
| 47 |
+
help="fraction of the final mix coming from MV (default 0.420573 = paper recipe)")
|
| 48 |
+
ap.add_argument("--max_docs", type=int, default=100000)
|
| 49 |
+
ap.add_argument("--seed", type=int, default=0)
|
| 50 |
+
ap.add_argument("--out", required=True)
|
| 51 |
+
a = ap.parse_args()
|
| 52 |
+
|
| 53 |
+
bw = json.load(open(hf_hub_download(MV_REPO, "mix/blend_weights.json", repo_type="dataset")))
|
| 54 |
+
mv_share = a.mv_share if a.mv_share is not None else bw["mv_share"]
|
| 55 |
+
shards = bw["shards"]
|
| 56 |
+
# token weight / avg tokens-per-doc -> relative document sampling weight per shard
|
| 57 |
+
docw = [s["mv_internal_weight"] / (s["tokens"] / s["docs"]) for s in shards]
|
| 58 |
+
# NOTE: --mv_share is applied per DOCUMENT; set it from your own tokens/doc ratio if you need exact token shares.
|
| 59 |
+
rng = random.Random(a.seed)
|
| 60 |
+
mv_iters = [cycle(lambda s=s: mv_stream(s)) for s in shards]
|
| 61 |
+
web_iter = cycle(lambda: (r[a.web_text_column] for r in load_dataset(
|
| 62 |
+
a.web_dataset, a.web_name, split=a.web_split, streaming=True)))
|
| 63 |
+
with gzip.open(a.out, "wt") as f:
|
| 64 |
+
for _ in range(a.max_docs):
|
| 65 |
+
if rng.random() < mv_share:
|
| 66 |
+
i = rng.choices(range(len(shards)), weights=docw)[0]
|
| 67 |
+
f.write(json.dumps({"text": next(mv_iters[i]), "source": "mv"}) + "\n")
|
| 68 |
+
else:
|
| 69 |
+
f.write(json.dumps({"text": next(web_iter), "source": "web"}) + "\n")
|
| 70 |
+
|
| 71 |
+
|
| 72 |
+
if __name__ == "__main__":
|
| 73 |
+
main()
|