Datasets:
Formats:
parquet
Languages:
English
Size:
100K - 1M
Tags:
cosmopedia-v2
cerebro-spheroid
teacher-digestion
qwen2.5
dynamic-loss-weighting
information-density
License:
Initialize Cosmopedia v2 digested dataset card
Browse files
README.md
ADDED
|
@@ -0,0 +1,71 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: odc-by
|
| 3 |
+
task_categories:
|
| 4 |
+
- text-generation
|
| 5 |
+
- question-answering
|
| 6 |
+
language:
|
| 7 |
+
- en
|
| 8 |
+
tags:
|
| 9 |
+
- cosmopedia-v2
|
| 10 |
+
- cerebro-spheroid
|
| 11 |
+
- teacher-digestion
|
| 12 |
+
- qwen2.5-1.5b
|
| 13 |
+
- dynamic-loss-weighting
|
| 14 |
+
- information-density
|
| 15 |
+
- pretraining
|
| 16 |
+
size_categories:
|
| 17 |
+
- 10M<n<100M
|
| 18 |
+
configs:
|
| 19 |
+
- config_name: default
|
| 20 |
+
data_files:
|
| 21 |
+
- split: train
|
| 22 |
+
path: "data/train-*.parquet"
|
| 23 |
+
---
|
| 24 |
+
|
| 25 |
+
# Cosmopedia v2 Teacher-Digested Pretraining Corpus
|
| 26 |
+
|
| 27 |
+
This dataset is a teacher-digested transformation of [HuggingFaceTB/smollm-corpus](https://huggingface.co/datasets/HuggingFaceTB/smollm-corpus) (Cosmopedia v2 split, 39.13M documents, ~30 Billion tokens).
|
| 28 |
+
Each document is digested by **Qwen2.5-1.5B-Instruct** to compute dynamic per-token information-density loss weights, losslessly projected onto **CerebroSpheroid's 32,000 vocabulary**.
|
| 29 |
+
|
| 30 |
+
## Dataset Schema
|
| 31 |
+
|
| 32 |
+
Each row contains:
|
| 33 |
+
- `id` (*string*): Unique sample identifier (`cosmo2_{shard:05d}_{row:07d}`).
|
| 34 |
+
- `prompt` (*string*): Original stimulus/topic prompt that generated the document.
|
| 35 |
+
- `audience` (*string*): Target pedagogical audience (e.g. `college_students`, `general`).
|
| 36 |
+
- `format` (*string*): Pedagogical format (e.g. `textbook`, `webpage`, `educational_article`).
|
| 37 |
+
- `tokens` (*list<int32>*): CerebroSpheroid SentencePiece token IDs (vocab size 32,000).
|
| 38 |
+
- `target_weights` (*list<float16>*): Dynamic next-token loss weights $w_t \in [0.2, 4.0]$ ($E[w_t] = 1.0$).
|
| 39 |
+
- `seq_len` (*int32*): Number of tokens in the sequence.
|
| 40 |
+
- `mean_weight` (*float32*): Sequence average loss weight.
|
| 41 |
+
- `max_weight` (*float32*): Peak information-density weight in the document.
|
| 42 |
+
- `min_weight` (*float32*): Minimum floor weight in the document.
|
| 43 |
+
|
| 44 |
+
## Information-Density Mathematical Formulation
|
| 45 |
+
|
| 46 |
+
For each sequence with teacher causal language model $Q$:
|
| 47 |
+
$$\mathcal{L}_{Q, t} = -\log P_Q(x_t \mid x_{<t})$$
|
| 48 |
+
$$\mathcal{H}_{Q, t} = -\sum_{v \in \mathcal{V}_Q} P_Q(v \mid x_{<t}) \log P_Q(v \mid x_{<t})$$
|
| 49 |
+
$$D_t = \mathcal{L}_{Q, t} + \beta \mathcal{H}_{Q, t}$$
|
| 50 |
+
$$z_t = \frac{D_t - \mu_D}{\sigma_D}$$
|
| 51 |
+
$$w_t = \text{clip}\left(1 + \alpha \tanh(z_t), w_{\min}, w_{\max}\right)$$
|
| 52 |
+
|
| 53 |
+
Normalized so that $\frac{1}{T}\sum_{t=1}^T w_t = 1.0$.
|
| 54 |
+
|
| 55 |
+
## Streaming Usage with PyTorch & CerebroSpheroid
|
| 56 |
+
|
| 57 |
+
```python
|
| 58 |
+
from datasets import load_dataset
|
| 59 |
+
|
| 60 |
+
# Stream directly with zero Qwen runtime overhead:
|
| 61 |
+
dataset = load_dataset(
|
| 62 |
+
"AjitKumar-Bio/cosmopedia-v2-digested",
|
| 63 |
+
split="train",
|
| 64 |
+
streaming=True
|
| 65 |
+
)
|
| 66 |
+
|
| 67 |
+
for sample in dataset:
|
| 68 |
+
tokens = sample["tokens"]
|
| 69 |
+
weights = sample["target_weights"]
|
| 70 |
+
# Feed directly into CerebroSpheroid pretraining loss
|
| 71 |
+
```
|