Update README.md
Browse files
README.md
CHANGED
|
@@ -248,28 +248,15 @@ instruction data about 5; of English, prokaryote and mRNA-splice the run read on
|
|
| 248 |
*Tokens read by Carbon-X* is share x 302B. *Passes* is how many times over the run read the config: below 1, it read
|
| 249 |
only that fraction of it.
|
| 250 |
|
| 251 |
-
|
| 252 |
-
|
| 253 |
-
1. Tokenize `text` with [`HuggingFaceBio/carbon-x`](https://huggingface.co/HuggingFaceBio/carbon-x). It detects DNA in
|
| 254 |
-
text and encodes it with its 6-mer DNA vocabulary. DNA configs already wrap sequences in `<dna>…</dna>`. To
|
| 255 |
-
tokenize a source straight from the Hub, read `hf://datasets/HuggingFaceBio/FineDNA/mid/<source>`.
|
| 256 |
-
2. Sample configs by the *share of training* column. In Megatron, that is the weight of each `--data-path` prefix.
|
| 257 |
-
Within a config, split its weight across shards in proportion to their size, so every document is equally likely.
|
| 258 |
-
3. Train for 302B tokens: 72,000 iterations at a global batch of 512 x 8,192 tokens, from the frozen-DNA-embedding
|
| 259 |
-
Qwen3-14B checkpoint (a short first stage that trains only the new DNA embeddings). The full recipe, including the vocabulary extension and that first stage, is in the
|
| 260 |
-
[Carbon-X midtraining recipe](https://github.com/huggingface/carbon/tree/main/carbon-x/training/midtraining).
|
| 261 |
-
Training longer with the same weights repeats the same data more often; for more unique DNA or English, add data
|
| 262 |
-
from the original datasets linked below.
|
| 263 |
|
| 264 |
### What is in it
|
| 265 |
|
| 266 |
-
**DNA
|
| 267 |
-
up to 100 kbp, in six species groups
|
| 268 |
-
|
| 269 |
-
|
| 270 |
-
more than once, and about 28% of prokaryote and
|
| 271 |
-
20% of mRNA-splice.
|
| 272 |
-
The raw sequences are also in [`HuggingFaceBio/carbon-pretraining-corpus`](https://huggingface.co/datasets/HuggingFaceBio/carbon-pretraining-corpus).
|
| 273 |
Here they are formatted exactly as they were trained on:
|
| 274 |
|
| 275 |
- every sequence is cut to a multiple of 6 bp (the tokenizer reads 6-mers) and wrapped in `<dna>…</dna>`;
|
|
@@ -278,19 +265,23 @@ Here they are formatted exactly as they were trained on:
|
|
| 278 |
- mRNA and prokaryote sequences are uppercased, splice-junction markers (`@`) are removed, and mRNA longer than
|
| 279 |
100,000 bases is dropped.
|
| 280 |
|
| 281 |
-
**Biology text
|
| 282 |
-
|
|
|
|
| 283 |
|
| 284 |
-
1. **Find documents that contain DNA:**
|
| 285 |
-
|
|
|
|
| 286 |
- it has a run of 15 or more nucleotide letters (A, T, C, G, U, N) using at least 3 different ones,
|
| 287 |
- that run is not inside curly braces, which in scraped text is usually LaTeX, and
|
| 288 |
- it mentions a molecular-biology keyword (dna, gene, primer, pcr, ...).
|
| 289 |
-
2. **Split by DNA length:**
|
| 290 |
-
[`
|
| 291 |
-
|
| 292 |
-
|
| 293 |
-
|
|
|
|
|
|
|
| 294 |
|
| 295 |
| config | what it is |
|
| 296 |
|---|---|
|
|
@@ -299,26 +290,15 @@ paper configs were built in two steps; the code is in [`mid/pipeline/`](https://
|
|
| 299 |
| `mid_bio_gemini_nonfim` | genomic regions described by Gemini next to their sequence |
|
| 300 |
| `mid_bio_gemini_fim` | the same kind of documents in Qwen's fill-in-the-middle format: part of each document is moved to the end, and the model learns to fill it in |
|
| 301 |
|
| 302 |
-
**English
|
| 303 |
[DCLM](https://huggingface.co/datasets/HuggingFaceFW/dclm_100BT-shuffled) and
|
| 304 |
[FinePDFs-Edu](https://huggingface.co/datasets/HuggingFaceFW/finepdfs_edu_100BT-shuffled), to keep the model's English.
|
| 305 |
|
| 306 |
-
**Instruction
|
| 307 |
-
(chat and instruction-following splits) and
|
| 308 |
-
(chat), rendered with the
|
| 309 |
-
this keeps it able to
|
| 310 |
-
|
| 311 |
-
### How the mix matches the run
|
| 312 |
-
|
| 313 |
-
Every config was rebuilt from its source and checked against the document counts in the training run's log: each
|
| 314 |
-
holds everything the run sampled from for that source. How much of each the run read is set by the weights, as in the table above.
|
| 315 |
-
Where the run read only part of a config, which documents Megatron happened to draw cannot be recovered, but training
|
| 316 |
-
with the same weights draws the same amount from the same pool.
|
| 317 |
-
|
| 318 |
-
Two pieces of data are included although they never reached the run, so that the pools are complete:
|
| 319 |
-
1,720,988 documents of `mid_dna_eukaryote_invertebrate` and
|
| 320 |
-
1,726,948 of `mid_english_dclm`, from tokenization shards that were missing when Carbon-X
|
| 321 |
-
trained.
|
| 322 |
|
| 323 |
Biology configs also have a `validation` split: the documents held out of training to track loss.
|
| 324 |
|
|
|
|
| 248 |
*Tokens read by Carbon-X* is share x 302B. *Passes* is how many times over the run read the config: below 1, it read
|
| 249 |
only that fraction of it.
|
| 250 |
|
| 251 |
+
The full training setup we used for Carbon-X are in the
|
| 252 |
+
[Carbon-X midtraining recipe](https://github.com/huggingface/carbon/tree/main/carbon-x/training/midtraining).
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 253 |
|
| 254 |
### What is in it
|
| 255 |
|
| 256 |
+
**DNA.** Eukaryote genomic windows from [GENERator](https://huggingface.co/datasets/GenerTeam/pretrain_data_eukaryote),
|
| 257 |
+
up to 100 kbp, in six species groups. mRNA, mRNA with splice and promoter context, and prokaryote genomes (GTDB and
|
| 258 |
+
IMG/PR) from [OpenGenome2](https://huggingface.co/datasets/arcinstitute/opengenome2). The raw sequences are also in
|
| 259 |
+
[`HuggingFaceBio/carbon-pretraining-corpus`](https://huggingface.co/datasets/HuggingFaceBio/carbon-pretraining-corpus).
|
|
|
|
|
|
|
|
|
|
| 260 |
Here they are formatted exactly as they were trained on:
|
| 261 |
|
| 262 |
- every sequence is cut to a multiple of 6 bp (the tokenizer reads 6-mers) and wrapped in `<dna>…</dna>`;
|
|
|
|
| 265 |
- mRNA and prokaryote sequences are uppercased, splice-junction markers (`@`) are removed, and mRNA longer than
|
| 266 |
100,000 bases is dropped.
|
| 267 |
|
| 268 |
+
**Biology text.** Web pages, papers and forum posts that contain DNA, plus synthetic annotations. The web and paper
|
| 269 |
+
configs were built in two steps; the code is in
|
| 270 |
+
[`mid/pipeline/`](https://huggingface.co/datasets/HuggingFaceBio/FineDNA/tree/main/mid/pipeline).
|
| 271 |
|
| 272 |
+
1. **Find documents that contain DNA:**
|
| 273 |
+
[`1_regex_filter.py`](https://huggingface.co/datasets/HuggingFaceBio/FineDNA/blob/main/mid/pipeline/1_regex_filter.py).
|
| 274 |
+
We ran a regex filter over FineWeb-Edu, FinePDFs, PubMed Central, bioRxiv and Biostars. A document is kept when
|
| 275 |
- it has a run of 15 or more nucleotide letters (A, T, C, G, U, N) using at least 3 different ones,
|
| 276 |
- that run is not inside curly braces, which in scraped text is usually LaTeX, and
|
| 277 |
- it mentions a molecular-biology keyword (dna, gene, primer, pcr, ...).
|
| 278 |
+
2. **Split by DNA length:**
|
| 279 |
+
[`2_p90_split.py`](https://huggingface.co/datasets/HuggingFaceBio/FineDNA/blob/main/mid/pipeline/2_p90_split.py),
|
| 280 |
+
which finds DNA with
|
| 281 |
+
[`tag_dna_sequences.py`](https://huggingface.co/datasets/HuggingFaceBio/FineDNA/blob/main/mid/pipeline/tag_dna_sequences.py).
|
| 282 |
+
Documents whose longest DNA sequence is at least 39 bp, the 90th percentile, form `mid_bio_p90_*`; everything else
|
| 283 |
+
forms `mid_bio_rest`. Short runs are mostly primers and motifs, while the p90 documents carry real sequences. In our
|
| 284 |
+
ablations, upweighting them improved DNA benchmarks.
|
| 285 |
|
| 286 |
| config | what it is |
|
| 287 |
|---|---|
|
|
|
|
| 290 |
| `mid_bio_gemini_nonfim` | genomic regions described by Gemini next to their sequence |
|
| 291 |
| `mid_bio_gemini_fim` | the same kind of documents in Qwen's fill-in-the-middle format: part of each document is moved to the end, and the model learns to fill it in |
|
| 292 |
|
| 293 |
+
**English.** [FineWeb-Edu](https://huggingface.co/datasets/HuggingFaceFW/fineweb-edu) (100BT sample),
|
| 294 |
[DCLM](https://huggingface.co/datasets/HuggingFaceFW/dclm_100BT-shuffled) and
|
| 295 |
[FinePDFs-Edu](https://huggingface.co/datasets/HuggingFaceFW/finepdfs_edu_100BT-shuffled), to keep the model's English.
|
| 296 |
|
| 297 |
+
**Instruction.** [Nemotron Instruction-Following-Chat v3](https://huggingface.co/datasets/nvidia/Nemotron-SFT-Instruction-Following-Chat-v3)
|
| 298 |
+
(chat and instruction-following splits) and
|
| 299 |
+
[v2](https://huggingface.co/datasets/nvidia/Nemotron-SFT-Instruction-Following-Chat-v2) (chat), rendered with the
|
| 300 |
+
Qwen3 chat template, reasoning traces kept. Mid-training starts from an instruct model, and this keeps it able to
|
| 301 |
+
follow instructions.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 302 |
|
| 303 |
Biology configs also have a `validation` split: the documents held out of training to track loss.
|
| 304 |
|