victor HF Staff funmaker commited on
Commit
9ef7a22
·
verified ·
0 Parent(s):

Duplicate from openbmb/InfLLM-V2-data-5B

Browse files

Co-authored-by: funcy <funmaker@users.noreply.huggingface.co>

.gitattributes ADDED
@@ -0,0 +1,59 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ *.7z filter=lfs diff=lfs merge=lfs -text
2
+ *.arrow filter=lfs diff=lfs merge=lfs -text
3
+ *.bin filter=lfs diff=lfs merge=lfs -text
4
+ *.bz2 filter=lfs diff=lfs merge=lfs -text
5
+ *.ckpt filter=lfs diff=lfs merge=lfs -text
6
+ *.ftz filter=lfs diff=lfs merge=lfs -text
7
+ *.gz filter=lfs diff=lfs merge=lfs -text
8
+ *.h5 filter=lfs diff=lfs merge=lfs -text
9
+ *.joblib filter=lfs diff=lfs merge=lfs -text
10
+ *.lfs.* filter=lfs diff=lfs merge=lfs -text
11
+ *.lz4 filter=lfs diff=lfs merge=lfs -text
12
+ *.mds filter=lfs diff=lfs merge=lfs -text
13
+ *.mlmodel filter=lfs diff=lfs merge=lfs -text
14
+ *.model filter=lfs diff=lfs merge=lfs -text
15
+ *.msgpack filter=lfs diff=lfs merge=lfs -text
16
+ *.npy filter=lfs diff=lfs merge=lfs -text
17
+ *.npz filter=lfs diff=lfs merge=lfs -text
18
+ *.onnx filter=lfs diff=lfs merge=lfs -text
19
+ *.ot filter=lfs diff=lfs merge=lfs -text
20
+ *.parquet filter=lfs diff=lfs merge=lfs -text
21
+ *.pb filter=lfs diff=lfs merge=lfs -text
22
+ *.pickle filter=lfs diff=lfs merge=lfs -text
23
+ *.pkl filter=lfs diff=lfs merge=lfs -text
24
+ *.pt filter=lfs diff=lfs merge=lfs -text
25
+ *.pth filter=lfs diff=lfs merge=lfs -text
26
+ *.rar filter=lfs diff=lfs merge=lfs -text
27
+ *.safetensors filter=lfs diff=lfs merge=lfs -text
28
+ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
29
+ *.tar.* filter=lfs diff=lfs merge=lfs -text
30
+ *.tar filter=lfs diff=lfs merge=lfs -text
31
+ *.tflite filter=lfs diff=lfs merge=lfs -text
32
+ *.tgz filter=lfs diff=lfs merge=lfs -text
33
+ *.wasm filter=lfs diff=lfs merge=lfs -text
34
+ *.xz filter=lfs diff=lfs merge=lfs -text
35
+ *.zip filter=lfs diff=lfs merge=lfs -text
36
+ *.zst filter=lfs diff=lfs merge=lfs -text
37
+ *tfevents* filter=lfs diff=lfs merge=lfs -text
38
+ # Audio files - uncompressed
39
+ *.pcm filter=lfs diff=lfs merge=lfs -text
40
+ *.sam filter=lfs diff=lfs merge=lfs -text
41
+ *.raw filter=lfs diff=lfs merge=lfs -text
42
+ # Audio files - compressed
43
+ *.aac filter=lfs diff=lfs merge=lfs -text
44
+ *.flac filter=lfs diff=lfs merge=lfs -text
45
+ *.mp3 filter=lfs diff=lfs merge=lfs -text
46
+ *.ogg filter=lfs diff=lfs merge=lfs -text
47
+ *.wav filter=lfs diff=lfs merge=lfs -text
48
+ # Image files - uncompressed
49
+ *.bmp filter=lfs diff=lfs merge=lfs -text
50
+ *.gif filter=lfs diff=lfs merge=lfs -text
51
+ *.png filter=lfs diff=lfs merge=lfs -text
52
+ *.tiff filter=lfs diff=lfs merge=lfs -text
53
+ # Image files - compressed
54
+ *.jpg filter=lfs diff=lfs merge=lfs -text
55
+ *.jpeg filter=lfs diff=lfs merge=lfs -text
56
+ *.webp filter=lfs diff=lfs merge=lfs -text
57
+ # Video files - compressed
58
+ *.mp4 filter=lfs diff=lfs merge=lfs -text
59
+ *.webm filter=lfs diff=lfs merge=lfs -text
README.md ADDED
@@ -0,0 +1,97 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: apache-2.0
3
+ language:
4
+ - en
5
+ - zh
6
+ tags:
7
+ - long-context
8
+ - infllm
9
+ ---
10
+
11
+ # InfLLM-V2 Long-Context Training Dataset with 5B Tokens
12
+
13
+ **Project Links**: [[Paper](https://arxiv.org/abs/2509.24663)] [[InfLLM-V2 Models](https://huggingface.co/openbmb/InfLLM-V2-Long-Sparse-Base)] [[CUDA Kernel Code](https://github.com/OpenBMB/infllmv2_cuda_impl)]
14
+
15
+ ---
16
+
17
+ ## 🚀 About InfLLM-V2
18
+
19
+ **InfLLM-V2** is a native sparse attention framework designed for the efficient processing of long-sequence texts. Its core advantage is the ability to maintain high performance comparable to dense attention in short-text scenarios—without any extra parameters—while seamlessly switching to a sparse mode for long-text scenarios, achieving significant end-to-end acceleration.
20
+
21
+ To support community reproduction and further exploration, we are open-sourcing the full suite of resources for the InfLLM-V2 project, including:
22
+ * **Initial Weights**: [InfLLM-V2-Short-Dense-Base](https://huggingface.co/openbmb/InfLLM-V2-Short-Dense-Base) (The base model before continued training on long texts).
23
+ * **Training Data**: `InfLLM-V2-data-5B` (📍 **This Dataset**).
24
+ * **Final Model**: [InfLLM-V2-Long-Sparse-Base](https://huggingface.co/openbmb/InfLLM-V2-Long-Sparse-Base) (The final model after being trained on long-text data).
25
+
26
+ ## ✨ Dataset Description
27
+
28
+ This dataset contains **5B tokens** of long-text data used for training **InfLLM-V2**.
29
+
30
+ We demonstrate that **only 5B tokens of high-quality long-text data** are needed to successfully unlock the model's powerful sparse attention capabilities, without resorting to the trillion-scale data required by other methods. Using this dataset, researchers can efficiently reproduce our results or explore more advanced training methods for long-context models.
31
+
32
+ ### Data Composition and Specifications
33
+
34
+ **1. Data Composition**
35
+
36
+ This dataset is a carefully curated mixture from sources including web data, source code, scientific papers, and Wikipedia, augmented with a selection of high-quality in-house data.
37
+
38
+ **2. Specifications**
39
+
40
+ - **Total Tokens**: Approximately 5 Billion (5B).
41
+ - **Tokenizer**: Processed using the tokenizer from [MiniCPM4](https://huggingface.co/openbmb/MiniCPM4.1-8B).
42
+ - **Data Format**: Sharded Parquet (`.parquet`).
43
+ - **Data Fields**:
44
+ - `input_ids`: (list[int]) The list of encoded Token IDs.
45
+ - `text`: (string) The original text.
46
+
47
+ ### How to Use
48
+
49
+ Given the large size of the dataset, it is **highly recommended** to load it in **streaming mode** using the Hugging Face `datasets` library to avoid memory exhaustion.
50
+
51
+ ```python
52
+ from datasets import load_dataset
53
+
54
+ # Recommended: Load in streaming mode to save memory
55
+ ds = load_dataset("openbmb/InfLLM-V2-data-5B", split="train", streaming=True)
56
+ ```
57
+
58
+ ## The InfLLM-V2 Training Workflow
59
+
60
+ The long-context capability of InfLLM-V2 is achieved through continued training on high-quality long-text data.
61
+
62
+ - **Step 1: Start from the base model.**
63
+ - [**InfLLM-V2-Short-Dense-Base**](https://huggingface.co/openbmb/InfLLM-V2-Short-Dense-Base): The base model pre-trained on short texts, featuring dense attention.
64
+
65
+ - **Step 2: Continue training on this dataset.**
66
+ - Use this dataset (`InfLLM-V2-data-5B`) to perform continued training on the base model.
67
+
68
+ - **Step 3: Get the final long-context model.**
69
+ - [**InfLLM-V2-Long-Sparse-Base**](https://huggingface.co/openbmb/InfLLM-V2-Long-Sparse-Base): The final model after training, equipped with powerful long-context and sparse attention capabilities.
70
+
71
+ ## Related Projects
72
+
73
+ - **Models:**
74
+
75
+ - **[openbmb/MiniCPM4.1-8B](https://huggingface.co/openbmb/MiniCPM4.1-8B):** A model trained with InfLLM V2, support fusion thinking.
76
+ - **[openbmb/MiniCPM4-8B](https://huggingface.co/openbmb/MiniCPM4-8B):** A model trained with InfLLM V2.
77
+
78
+ - **CUDA Kernels:**
79
+ - [OpenBMB/infllmv2_cuda_impl](https://github.com/OpenBMB/infllmv2_cuda_impl): The CUDA implementation of the core sparse attention kernels for InfLLM-V2.
80
+ - **Training Data:**
81
+ - [openbmb/InfLLM-V2-data-5B](https://huggingface.co/datasets/openbmb/InfLLM-V2-data-5B) (This dataset).
82
+
83
+ ## Citation
84
+
85
+ If you use our work in your research, please cite our paper:
86
+
87
+ ```bibtex
88
+ @misc{zhao2025infllmv2densesparseswitchableattention,
89
+ title={InfLLM-V2: Dense-Sparse Switchable Attention for Seamless Short-to-Long Adaptation},
90
+ author={Weilin Zhao and Zihan Zhou and Zhou Su and Chaojun Xiao and Yuxuan Li and Yanghao Li and Yudi Zhang and Weilun Zhao and Zhen Li and Yuxiang Huang and Ao Sun and Xu Han and Zhiyuan Liu},
91
+ year={2025},
92
+ eprint={2509.24663},
93
+ archivePrefix={arXiv},
94
+ primaryClass={cs.CL},
95
+ url={https://arxiv.org/abs/2509.24663},
96
+ }
97
+ ```
train/data-00000-of-00020.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:66b4001230c9cc9594e1f402942fc16c4dd9a343eb3bcbf09a6971543df52022
3
+ size 1452134127
train/data-00001-of-00020.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:fcaa7ec112212dd0c235b96ac342d02a7b45763cc95c3af386c467cfeb8855d7
3
+ size 91801766
train/data-00002-of-00020.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:66815671bff194e9eb79274890ad598ab3bfe0827f8b8ab1a02e347bb9968729
3
+ size 600476779
train/data-00003-of-00020.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:ea76612f1d3121f206ddb84872d216538807accc23de502579dcee3c0b38924e
3
+ size 46353101
train/data-00004-of-00020.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:451e336588f961b9be34c0cce3ac82259a218cfac8efde8cce27da3acf1a2c98
3
+ size 46430946
train/data-00005-of-00020.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:e35d15c926516e29555826b9b2fed6eef6ad2bb77192b108ed45f1019b2d361d
3
+ size 246978139
train/data-00006-of-00020.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:6a31a7c47dbab888cb0d3074eae64c629fade841ae3e1686b9d08d4d5e727e55
3
+ size 104619867
train/data-00007-of-00020.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:38cd6eb54333337243ce98c2313cc317a6dc99a45fc8e35b8999d862eade24b8
3
+ size 106066233
train/data-00008-of-00020.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:e1f8e4c25bd9500ebf45efd93d41d190fc97cb6e6df97a8f8bcd47e071917c49
3
+ size 853763034
train/data-00009-of-00020.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:01cfde89c31669a968b5d4cf416dc4f82d80dda54f279247201b9261d208b8d7
3
+ size 3694723191
train/data-00010-of-00020.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:678b4f7484ba466384eddb6361641c79c0c395641c1b692c02885c4f946be123
3
+ size 1332248848
train/data-00011-of-00020.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:2b95489c250e1dd5683bf37e4f642d2297d0d612836e77952475e99c5c9d9512
3
+ size 1100653745
train/data-00012-of-00020.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:e1712878d1be8f52d16552ca810b876c754053d3d48459f3b52b19b36c3c4f19
3
+ size 1734323929
train/data-00013-of-00020.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:c7084a7412c6b90b023a6e3fc5e31c3d6a85dcb0f5e342bb70ec05470d42f4a6
3
+ size 843804396
train/data-00014-of-00020.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:39068407e48b3d130242158d3589fbb9e9284ba31cf7c0fbba854739f7ed0d58
3
+ size 42003267
train/data-00015-of-00020.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:35e432314043b9d05b398fb5e14b50732bdcb08a9a566e386978c1fc69281bba
3
+ size 41809815
train/data-00016-of-00020.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:aa072743c7b26d60ad267c6237b622cb838fd9ecbdb0a9f302f5b22061cfa3e2
3
+ size 1556773736
train/data-00017-of-00020.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:7db22a84433245431dbeb0ec87ef2e6e8eb3d34100d385bf6f243df76c3f55d5
3
+ size 872793873
train/data-00018-of-00020.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:5d60fdbda7d4e5c227a6aee9ac11417fb3248259d1374d527beb1ca60efb698a
3
+ size 873761175
train/data-00019-of-00020.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:7c1d7646523d9b3d041d2519f60b9fc0ea2c21fadc71216f29fa7dc7a2186ba8
3
+ size 502427564