prolong-64k-qwen3-cut16k
收藏资源简介:
# ProLong-64K Qwen3 Cut-16K (prolong-64k-qwen3-cut16k) [fenghonghao/prolong-64k-qwen3](https://modelscope.cn/datasets/fenghonghao/prolong-64k-qwen3) 经长度过滤 + 随机裁剪后的版本,每行 Qwen3 token 长度 ∈ [1024, 16384]。专为 Qwen3 的 **16K 上下文 continual pretraining** 设计,每行可直接作为训练样本,无需 packing。 ## 裁剪规则 | 源文档长度 L(Qwen3 tokens) | 操作 | 输出行数 | |---|---|---| | L < 1024 | 丢弃 | 0 | | 1024 ≤ L < 16384 | 原样保留 | 1 | | 16384 ≤ L < 49152 | 随机裁剪一个 16384-token 窗口 | 1 | | L ≥ 49152 | 随机裁剪两个不重叠窗口 | 2 | 裁剪种子确定性:`blake2b(f"{subset}|{src_partition}|{src_sample_idx}|{src_doc_idx}")`,可复现。 ## 核心统计 - **4,705,078 行** / **17.3B Qwen3 tokens** - 10 个子集,全部 64 shards 完整 ## Schema | 列名 | 类型 | 含义 | |---|---|---| | `text` | string | 裁剪后文本(裁剪行经 tokenizer 重新解码,保留行复用源文本) | | `input_ids` | list[int32] | Qwen3 token IDs,长度 ∈ [1024, 16384] | | `length` | int32 | `len(input_ids)` | | `domain` | string | 子集名 | | `src_partition` | string | 源分区 ID | | `src_sample_idx` | int32 | 源分区内索引 | | `src_doc_idx` | int32 | 源 packed sample 内文档索引 | | `crop_offset` | int32 | 裁剪起始位置;未裁剪为 -1 | | `crop_idx` | int8 | 0 = 原样/单裁剪/双裁剪第一段,1 = 双裁剪第二段 | ## 各子集汇总 | 子集 | 行数 | Tokens | 平均长度 | 占比 | |---|---|---|---|---| | book | 196,604 | 3.22B | 16,384 | 18.7% | | thestackv1_concat_by_repo | 196,597 | 3.22B | 16,384 | 18.7% | | textbooks | 7,325 | 120M | 16,316 | 0.7% | | fineweb-edu | 1,727,056 | 4.13B | 2,392 | 23.9% | | fineweb-2023-50 | 1,666,249 | 3.53B | 2,119 | 20.4% | | arxiv | 74,718 | 840M | 11,246 | 4.9% | | stackexchange | 244,649 | 452M | 1,847 | 2.6% | | dolmawiki | 271,493 | 653M | 2,407 | 3.8% | | openwebmath | 232,711 | 899M | 3,864 | 5.2% | | tuluv2 | 87,676 | 196M | 2,239 | 1.1% | **分布特征:** - book / thestack 100% 达到 16,384 上限 —— 长上下文骨干 - fineweb-* 占 72% 行数但仅 44% tokens —— 覆盖短上下文场景 - arxiv 在各长度区间分布最均衡 - tuluv2 无 16,384 长度样本(源最长仅 6,924 tokens) <details> <summary>各子集长度分布详情</summary> | 子集 | [1024, 2048) | [2048, 4096) | [4096, 8192) | [8192, 16384) | =16384 | |---|---|---|---|---|---| | book | 0 | 0 | 0 | 0 | 196,604 | | thestackv1_concat_by_repo | 0 | 0 | 0 | 0 | 196,597 | | textbooks | 3 | 15 | 13 | 31 | 7,263 | | fineweb-edu | 1,152,265 | 384,107 | 130,585 | 46,655 | 13,444 | | fineweb-2023-50 | 1,178,471 | 363,213 | 92,926 | 25,191 | 6,448 | | arxiv | 2,213 | 5,774 | 15,692 | 25,391 | 25,648 | | stackexchange | 188,405 | 44,931 | 9,505 | 1,614 | 194 | | dolmawiki | 168,798 | 71,223 | 24,291 | 6,347 | 834 | | openwebmath | 101,689 | 65,668 | 38,849 | 18,293 | 8,212 | | tuluv2 | 42,308 | 45,183 | 178 | 7 | 0 | </details> ## 匹配 ProLong 混合比例 本数据集按行数偏向 fineweb。若需匹配论文 Table 9 配方,在 dataloader 层配置子集权重: | 子集 | 配方占比 | 本数据集占比 | 调整 | |---|---|---|---| | book | 30% | 18.7% | ↑ 1.6× | | thestackv1_concat_by_repo | 30% | 18.7% | ↑ 1.6× | | textbooks | 3% | 0.7% | ↑ 4.3× | | fineweb-edu | 10% | 23.9% | ↓ 0.42× | | fineweb-2023-50 | 10% | 20.4% | ↓ 0.49× | | dolmawiki | 4.1% | 3.8% | ≈ | | stackexchange | 4.1% | 2.6% | ↑ 1.5× | | openwebmath | 3% | 5.2% | ↓ 0.58× | | arxiv | 3% | 4.9% | ↓ 0.62× | | tuluv2 | 3% | 1.1% | ↑ 2.6× | 严格无重复预算:每轮 ~40 亿 token(瓶颈 textbooks 仅 1.2 亿 token)。允许适度重复(textbooks ≤ 2.7×, tuluv2 ≤ 1.6×)可扩展到每轮 ~107 亿 token。 ## 使用方式 ```yaml # VeOmni 16K 训练配置 data: train_path: "ms://fenghonghao/prolong-64k-qwen3-cut16k" data_type: plaintext text_keys: text max_seq_len: 16384 datasets_type: iterable drop_last: true ``` ```python # 直接读 parquet import pyarrow.parquet as pq tbl = pq.read_table("data/book/train-00-of-64.parquet", columns=["text", "input_ids", "length"]) ``` 文件布局:`data/<subset>/train-XX-of-64.parquet`,64 shards × 10 subsets = 640 文件。 ## 数据血缘 ``` princeton-nlp/prolong-data-64K (MDS, Llama-3 tokens) ↓ 反 tokenize fenghonghao/prolong-64k-text (纯文本, ~20.3M docs) ↓ Qwen3 tokenize fenghonghao/prolong-64k-qwen3 (~20.3M docs) ↓ 长度过滤 + 16K 随机裁剪 fenghonghao/prolong-64k-qwen3-cut16k ← 本数据集 (4.7M rows, 17.3B tokens) ``` ## 引用 ```bibtex @article{gao2024prolong, title = {How to Train Long-Context Language Models (Effectively)}, author = {Gao, Tianyu and Wettig, Alexander and Yen, Howard and Chen, Danqi}, journal = {arXiv:2410.02660}, year = {2024}, } @inproceedings{feng2026inplace, title = {In-Place Test-Time Training}, author = {Feng, Guhao and Luo, Shengjie and Hua, Kai and Zhang, Ge and Huang, Wenhao and He, Di and Cai, Tianle}, booktitle = {ICLR}, year = {2026}, } ``` ## License Apache 2.0。各子集源数据保留原 license 条款。



