tahamajs commited on
Commit
4b35acc
Β·
verified Β·
1 Parent(s): 4880e04

Deploy fully comprehensive Dataset Card with tensor schemas and extraction details

Browse files
Files changed (1) hide show
  1. README.md +61 -34
README.md CHANGED
@@ -7,6 +7,8 @@ tags:
7
  - qwen2.5
8
  - block-diffusion
9
  - non-autoregressive
 
 
10
  size_categories:
11
  - 10K<n<100K
12
  task_categories:
@@ -19,60 +21,91 @@ language:
19
 
20
  [![License: Apache 2.0](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
21
  [![Base Model](https://img.shields.io/badge/Base%20LLM-Qwen2.5--0.5B--Instruct-green.svg)](https://huggingface.co/Qwen/Qwen2.5-0.5B-Instruct)
22
- [![HuggingFace Model](https://img.shields.io/badge/HF%20Model-tahamajs%2FBlockDiffuse-yellow.svg)](https://huggingface.co/tahamajs/BlockDiffuse)
23
- [![HuggingFace Space](https://img.shields.io/badge/HF%20Space-BlockDiffuse--Blog-blueviolet.svg)](https://huggingface.co/spaces/tahamajs/BlockDiffuse-Blog)
24
 
25
- This repository contains the complete pre-extracted dataset files used to train **BlockDiffuse** Diffusion Transformers to generate **100-token blocks in continuous latent space** using **Rectified Flow Matching**.
26
 
27
  ---
28
 
29
- ## πŸ”¬ Dataset Overview & Extraction Pipeline
 
 
 
 
 
 
30
 
31
- Standard language models operate over discrete token vocabularies ($V \approx 151{,}936$). To bypass sequential autoregressive decoding, BlockDiffuse maps prompts and target answer sequences into continuous latent vectors:
 
 
 
 
32
 
33
  ```
34
- Discrete Prompt Tokens (L_p) ──► Qwen2.5-0.5B (Layer 12) ──► Prompt Latents c [L_p x 896]
35
- Discrete Target Tokens (100) ──► Qwen2.5-0.5B (Layer 12) ──► Target Latents z_1 [100 x 896]
36
  ```
37
 
38
- These precomputed continuous tensors allow training the Diffusion Transformer directly on latent trajectory matching without re-computing LLM forward passes on every iteration, accelerating training throughput by **> 12x**.
39
 
40
  ---
41
 
42
- ## πŸ“ File Manifest & Specifications
43
 
44
- | File Name | File Size | Description | Shape / Keys |
45
- | :--- | :--- | :--- | :--- |
46
- | `reasoning_tokenized_qwen.pt` | **12.5 MB** | Pre-tokenized GSM8K & Math reasoning conversations formatted with the Qwen2.5 ChatML template (`<\|im_start\|>...<\|im_end\|>`). | `input_ids`, `attention_mask`, `labels` |
47
- | `precomputed_reasoning_latents_qwen.pt` | **69.1 MB** | Validation subset of continuous target latents ($z_1$) and prompt conditionings ($c$) extracted from Layer 12 of Qwen2.5. | `{"prompt_latents": [N, L_p, 896], "target_latents": [N, 100, 896]}` |
48
- | `precomputed_real_qwen.pt` | **1,045.9 MB** | Intermediate-scale latent training dataset containing 1,000 multi-turn mathematical reasoning trajectories. | `{"prompt_latents", "target_latents", "target_tokens"}` |
49
- | `precomputed_real_qwen_full.pt` | **2,360.3 MB** | Complete production training dataset covering extensive multi-step reasoning problems. | `{"prompt_latents", "target_latents", "target_tokens"}` |
50
 
51
  ---
52
 
53
- ## πŸš€ How to Load and Use
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
54
 
55
- ### 1. Direct Python Loading via `torch.load`
56
  ```python
57
  import torch
58
 
59
- # Load tokenized sequences
60
- tokenized_data = torch.load("reasoning_tokenized_qwen.pt", map_location="cpu")
61
- print("Tokenized sample count:", len(tokenized_data["input_ids"]))
 
62
 
63
- # Load precomputed continuous latents
64
- latents_data = torch.load("precomputed_reasoning_latents_qwen.pt", map_location="cpu")
65
- print("Prompt latents shape:", latents_data["prompt_latents"][0].shape) # [L_p, 896]
66
- print("Target latents shape:", latents_data["target_latents"][0].shape) # [100, 896]
 
67
  ```
68
 
69
- ### 2. Training BlockDiffuse DiT with this Dataset
 
 
 
 
 
70
  ```bash
71
- # Clone official codebase
72
  git clone https://github.com/Hooshaai/BlockDiffuse.git
73
  cd BlockDiffuse
74
 
75
- # Train with the precomputed full dataset
76
  python train.py \
77
  --config_train configs/gpu_full_capacity_improved.yaml \
78
  --config_dit configs/gpu_full_capacity_improved.yaml \
@@ -83,14 +116,8 @@ python train.py \
83
 
84
  ---
85
 
86
- ## πŸ“ Latent Space Normalization & Properties
87
- - **Dimensionality**: $d_{\text{model}} = 896$ per token position.
88
- - **Layer Origin**: Extracted after RMSNorm from Transformer Block 12 of `Qwen2.5-0.5B-Instruct`.
89
- - **Target Block Length**: Exactly 100 contiguous tokens. Shorter sequences are padded to 100 with EOS token latents; longer reasoning traces are chunked with rolling context propagation.
90
-
91
- ---
92
 
93
- ## πŸ“œ Citation
94
  ```bibtex
95
  @article{blockdiffuse2026,
96
  title={BlockDiffuse: Fully Parallel Latent Space Reasoning Generation with Diffusion Transformers},
 
7
  - qwen2.5
8
  - block-diffusion
9
  - non-autoregressive
10
+ - gsm8k
11
+ - chain-of-thought
12
  size_categories:
13
  - 10K<n<100K
14
  task_categories:
 
21
 
22
  [![License: Apache 2.0](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
23
  [![Base Model](https://img.shields.io/badge/Base%20LLM-Qwen2.5--0.5B--Instruct-green.svg)](https://huggingface.co/Qwen/Qwen2.5-0.5B-Instruct)
24
+ [![HuggingFace Model](https://img.shields.io/badge/HF%20Model-Hooshaai%2FBlockDiffuse-yellow.svg)](https://huggingface.co/Hooshaai/BlockDiffuse)
25
+ [![HuggingFace Space](https://img.shields.io/badge/HF%20Space-BlockDiffuse--Blog-blueviolet.svg)](https://huggingface.co/spaces/Hooshaai/BlockDiffuse-Blog)
26
 
27
+ This repository hosts the complete suite of pre-tokenized reasoning datasets and continuous latent trajectory representations extracted from **`Qwen/Qwen2.5-0.5B-Instruct`** for training **BlockDiffuse** Diffusion Transformers via **Rectified Flow Matching**.
28
 
29
  ---
30
 
31
+ ## πŸ“‘ Table of Contents
32
+ 1. [Dataset Pipeline & Extraction Architecture](#1-dataset-pipeline--extraction-architecture)
33
+ 2. [Dataset Files Manifest & Specifications](#2-dataset-files-manifest--specifications)
34
+ 3. [Data Formats & Internal Tensor Keys](#3-data-formats--internal-tensor-keys)
35
+ 4. [How to Load and Inspect with PyTorch](#4-how-to-load-and-inspect-with-pytorch)
36
+ 5. [End-to-End Training Instructions](#5-end-to-end-training-instructions)
37
+ 6. [Citation](#6-citation)
38
 
39
+ ---
40
+
41
+ ## 1. Dataset Pipeline & Extraction Architecture
42
+
43
+ Modern LLMs operate over discrete token vocabularies ($V = 151{,}936$). To train a Diffusion Transformer to denoise entire sequences simultaneously, BlockDiffuse maps prompts and target answers into continuous representation vectors:
44
 
45
  ```
46
+ Discrete Prompt Tokens (L_p) ──► Qwen2.5 (Layers 1..12) ──► Prompt Latents c [L_p x 896]
47
+ Discrete Target Tokens (100) ──► Qwen2.5 (Layers 1..12) ──► Target Latents z_1 [100 x 896]
48
  ```
49
 
50
+ By precomputing and persisting these continuous tensors to disk, BlockDiffuse eliminates redundant forward passes through the LLM during training, boosting training throughput by **> 12x** on single-GPU hardware.
51
 
52
  ---
53
 
54
+ ## 2. Dataset Files Manifest & Specifications
55
 
56
+ | File Name | File Size | Description | Target Tasks | Samples Count |
57
+ | :--- | :--- | :--- | :--- | :--- |
58
+ | `reasoning_tokenized_qwen.pt` | **13.1 MB** | Pre-tokenized GSM8K & Math reasoning traces formatted using the Qwen2.5 ChatML format (`<\|im_start\|>system...user...assistant<\|im_end\|>`). | Token-level evaluation & tokenized baseline training | ~10,000 samples |
59
+ | `precomputed_reasoning_latents_qwen.pt` | **72.4 MB** | Validation subset of continuous target latents ($z_1 \in \mathbb{R}^{B \times 100 \times 896}$) and prompt conditionings ($c \in \mathbb{R}^{B \times L_p \times 896}$). | Rapid model validation & loss metric evaluation | 1,000 trajectories |
60
+ | `precomputed_real_qwen.pt` | **1,045.9 MB** | Intermediate-scale latent training dataset containing multi-turn mathematical reasoning trajectories. | Medium-scale training (1,000–5,000 steps) | 1,000 long traces |
61
+ | `precomputed_real_qwen_full.pt` | **2,360.3 MB** | Complete production-scale training set covering multi-step mathematical and algorithmic reasoning problems. | Full-scale training (20,000 steps) | Full GSM8K + Math traces |
62
 
63
  ---
64
 
65
+ ## 3. Data Formats & Internal Tensor Keys
66
+
67
+ Each `.pt` file is a serialized Python dictionary with the following tensor schema:
68
+
69
+ ```python
70
+ {
71
+ "prompt_latents": torch.Tensor, # Shape: [N, max_prompt_len, 896] (float32 / bfloat16)
72
+ "target_latents": torch.Tensor, # Shape: [N, 100, 896] (Target latents z_1 at Layer 12)
73
+ "target_tokens": torch.Tensor, # Shape: [N, 100] (Ground truth discrete token IDs for CE loss)
74
+ "prompt_lens": torch.Tensor, # Shape: [N] (Exact token length of each prompt prefix)
75
+ }
76
+ ```
77
+
78
+ ---
79
+
80
+ ## 4. How to Load and Inspect with PyTorch
81
 
 
82
  ```python
83
  import torch
84
 
85
+ # 1. Inspect Tokenized Sequences
86
+ tokenized = torch.load("reasoning_tokenized_qwen.pt", map_location="cpu")
87
+ print("Total tokenized entries:", len(tokenized["input_ids"]))
88
+ print("Sample input_ids shape:", tokenized["input_ids"][0].shape)
89
 
90
+ # 2. Inspect Continuous Latents
91
+ latents = torch.load("precomputed_reasoning_latents_qwen.pt", map_location="cpu")
92
+ print("Prompt latents shape:", latents["prompt_latents"].shape) # [N, L_p, 896]
93
+ print("Target latents shape:", latents["target_latents"].shape) # [N, 100, 896]
94
+ print("Target tokens shape:", latents["target_tokens"].shape) # [N, 100]
95
  ```
96
 
97
+ ---
98
+
99
+ ## 5. End-to-End Training Instructions
100
+
101
+ To train a BlockDiffuse DiT model from scratch using these precomputed latents:
102
+
103
  ```bash
104
+ # 1. Clone official repository
105
  git clone https://github.com/Hooshaai/BlockDiffuse.git
106
  cd BlockDiffuse
107
 
108
+ # 2. Train with the full precomputed dataset
109
  python train.py \
110
  --config_train configs/gpu_full_capacity_improved.yaml \
111
  --config_dit configs/gpu_full_capacity_improved.yaml \
 
116
 
117
  ---
118
 
119
+ ## 6. Citation
 
 
 
 
 
120
 
 
121
  ```bibtex
122
  @article{blockdiffuse2026,
123
  title={BlockDiffuse: Fully Parallel Latent Space Reasoning Generation with Diffusion Transformers},