RegMix: Data Mixture as Regression for Language Model Pre-training
Paper • 2407.01492 • Published • 41
Error code: TooBigContentError
Need help to make the dataset viewer work? Make sure to review how to configure the dataset viewer, and open a discussion for direct support.
Mirror of sail/regmix-data-sample with precomputed 1024-dim L2-normalized embeddings from Marqo/dunzhang-stella_en_400M_v5.
This dataset preserves the original RegMix domain JSONL text and adds Stella embeddings organized for downstream clustering and mixture analysis.
train/arxiv: 79,387 rowstrain/dm_mathematics: 64,147 rowstrain/enron_emails: 30,905 rowstrain/europarl: 4,348 rowstrain/freelaw: 169,944 rowstrain/github: 300,000 rowstrain/gutenberg_pg_19: 2,276 rowstrain/hackernews: 52,544 rowstrain/nih_exporter: 58,972 rowstrain/philpapers: 2,024 rowstrain/pile_cc: 300,000 rowstrain/pubmed_abstracts: 300,000 rowstrain/pubmed_central: 150,000 rowstrain/stackexchange: 84,651 rowstrain/ubuntu_irc: 623 rowstrain/uspto_backgrounds: 300,000 rowstrain/wikipedia_en: 265,170 rowsvalidation/arxiv: 2,406 rowsvalidation/dm_mathematics: 1,922 rowsvalidation/enron_emails: 1,010 rowsvalidation/europarl: 157 rowsvalidation/freelaw: 5,101 rowsvalidation/github: 18,195 rowsvalidation/gutenberg_pg_19: 80 rowsvalidation/hackernews: 1,632 rowsvalidation/nih_exporter: 1,884 rowsvalidation/philpapers: 64 rowsvalidation/pile_cc: 52,790 rowsvalidation/pubmed_abstracts: 29,895 rowsvalidation/pubmed_central: 5,911 rowsvalidation/stackexchange: 30,378 rowsvalidation/ubuntu_irc: 22 rowsvalidation/uspto_backgrounds: 11,415 rowsvalidation/wikipedia_en: 17,511 rowsEach parquet shard under data/{split}/{domain}.parquet contains:
| Column | Type | Description |
|---|---|---|
example_id |
int64 | Stable join key |
split |
string | train or validation |
domain |
string | RegMix domain name |
source_file |
string | Original JSONL filename |
line_idx |
int32 | Line index in source file |
text |
string | Original document text |
text_char_len |
int32 | Character length of text |
embedding |
list[float32] | L2-normalized Stella vector |
indices/global_index.parquet maps each example_id to its shard path and row index.
from datasets import load_dataset
import numpy as np
ds = load_dataset("quinnlue/regmix-data-sample-stella", split="train")
emb = np.stack(ds["embedding"], dtype=np.float32) # [N, 1024]
ids = np.array(ds["example_id"], dtype=np.int64)
domains = ds["domain"]
from datasets import load_dataset
arxiv = load_dataset(
"quinnlue/regmix-data-sample-stella",
data_files={"train": "data/train/arxiv.parquet"},
split="train",
)
from datasets import load_dataset
import numpy as np
from sklearn.cluster import KMeans
ds = load_dataset("quinnlue/regmix-data-sample-stella", split="train")
emb = np.stack(ds["embedding"], dtype=np.float32)
ids = np.array(ds["example_id"], dtype=np.int64)
kmeans = KMeans(n_clusters=128, n_init=10, random_state=0)
cluster_ids = kmeans.fit_predict(emb)
assignments = {int(example_id): int(cluster_id) for example_id, cluster_id in zip(ids, cluster_ids)}
If you use this dataset, please cite the RegMix paper:
@article{liu2024regmix,
title={RegMix: Data Mixture as Regression for Language Model Pre-training},
author={Liu, Qian and Zheng, Xiaosen and Muennighoff, Niklas and Zeng, Guangtao and Dou, Longxu and Pang, Tianyu and Jiang, Jing and Lin, Min},
journal={arXiv preprint arXiv:2407.01492},
year={2024}
}