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 files1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071---license: odc-bytask_categories:- text-generation- question-answeringlanguage:- entags:- cosmopedia-v2- cerebro-spheroid- teacher-digestion- qwen2.5-1.5b- dynamic-loss-weighting- information-density- pretrainingsize_categories:- 10M<n<100Mconfigs:- config_name: default data_files: - split: train path: "data/train-*.parquet"---
# Cosmopedia v2 Teacher-Digested Pretraining Corpus
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).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**.
## Dataset Schema
Each row contains:- `id` (*string*): Unique sample identifier (`cosmo2_{shard:05d}_{row:07d}`).- `prompt` (*string*): Original stimulus/topic prompt that generated the document.- `audience` (*string*): Target pedagogical audience (e.g. `college_students`, `general`).- `format` (*string*): Pedagogical format (e.g. `textbook`, `webpage`, `educational_article`).- `tokens` (*list<int32>*): CerebroSpheroid SentencePiece token IDs (vocab size 32,000).- `target_weights` (*list<float16>*): Dynamic next-token loss weights $w_t \in [0.2, 4.0]$ ($E[w_t] = 1.0$).- `seq_len` (*int32*): Number of tokens in the sequence.- `mean_weight` (*float32*): Sequence average loss weight.- `max_weight` (*float32*): Peak information-density weight in the document.- `min_weight` (*float32*): Minimum floor weight in the document.
## Information-Density Mathematical Formulation
For each sequence with teacher causal language model $Q$:$$\mathcal{L}_{Q, t} = -\log P_Q(x_t \mid x_{<t})$$$$\mathcal{H}_{Q, t} = -\sum_{v \in \mathcal{V}_Q} P_Q(v \mid x_{<t}) \log P_Q(v \mid x_{<t})$$$$D_t = \mathcal{L}_{Q, t} + \beta \mathcal{H}_{Q, t}$$$$z_t = \frac{D_t - \mu_D}{\sigma_D}$$$$w_t = \text{clip}\left(1 + \alpha \tanh(z_t), w_{\min}, w_{\max}\right)$$
Normalized so that $\frac{1}{T}\sum_{t=1}^T w_t = 1.0$.
## Streaming Usage with PyTorch & CerebroSpheroid
```pythonfrom datasets import load_dataset
# Stream directly with zero Qwen runtime overhead:dataset = load_dataset( "AjitKumar-Bio/cosmopedia-v2-digested", split="train", streaming=True)
for sample in dataset: tokens = sample["tokens"] weights = sample["target_weights"] # Feed directly into CerebroSpheroid pretraining loss```README.mdAdded+71