BlockDiffuse-Data / README.md
tahamajs's picture
Upload README.md with huggingface_hub
8f96669 verified
|
Raw History Blame Contribute Delete
4.57 kB
---
license: apache-2.0
tags:
- flow-matching
- continuous-latents
- math-reasoning
- qwen2.5
- block-diffusion
- non-autoregressive
size_categories:
- 10K<n<100K
task_categories:
- text-generation
language:
- en
---
# πŸ“¦ BlockDiffuse Precomputed Latents & Reasoning Datasets
[![License: Apache 2.0](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
[![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)
[![HuggingFace Model](https://img.shields.io/badge/HF%20Model-tahamajs%2FBlockDiffuse-yellow.svg)](https://huggingface.co/tahamajs/BlockDiffuse)
[![HuggingFace Space](https://img.shields.io/badge/HF%20Space-BlockDiffuse--Blog-blueviolet.svg)](https://huggingface.co/spaces/tahamajs/BlockDiffuse-Blog)
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**.
---
## πŸ”¬ Dataset Overview & Extraction Pipeline
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:
```
Discrete Prompt Tokens (L_p) ──► Qwen2.5-0.5B (Layer 12) ──► Prompt Latents c [L_p x 896]
Discrete Target Tokens (100) ──► Qwen2.5-0.5B (Layer 12) ──► Target Latents z_1 [100 x 896]
```
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**.
---
## πŸ“ File Manifest & Specifications
| File Name | File Size | Description | Shape / Keys |
| :--- | :--- | :--- | :--- |
| `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` |
| `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]}` |
| `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"}` |
| `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"}` |
---
## πŸš€ How to Load and Use
### 1. Direct Python Loading via `torch.load`
```python
import torch
# Load tokenized sequences
tokenized_data = torch.load("reasoning_tokenized_qwen.pt", map_location="cpu")
print("Tokenized sample count:", len(tokenized_data["input_ids"]))
# Load precomputed continuous latents
latents_data = torch.load("precomputed_reasoning_latents_qwen.pt", map_location="cpu")
print("Prompt latents shape:", latents_data["prompt_latents"][0].shape) # [L_p, 896]
print("Target latents shape:", latents_data["target_latents"][0].shape) # [100, 896]
```
### 2. Training BlockDiffuse DiT with this Dataset
```bash
# Clone official codebase
git clone https://github.com/Hooshaai/BlockDiffuse.git
cd BlockDiffuse
# Train with the precomputed full dataset
python train.py \
--config_train configs/gpu_full_capacity_improved.yaml \
--config_dit configs/gpu_full_capacity_improved.yaml \
--data_path ./data/precomputed_real_qwen_full.pt \
--max_steps 20000 \
--output_dir ./checkpoints_improved
```
---
## πŸ“ Latent Space Normalization & Properties
- **Dimensionality**: $d_{\text{model}} = 896$ per token position.
- **Layer Origin**: Extracted after RMSNorm from Transformer Block 12 of `Qwen2.5-0.5B-Instruct`.
- **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.
---
## πŸ“œ Citation
```bibtex
@article{blockdiffuse2026,
title={BlockDiffuse: Fully Parallel Latent Space Reasoning Generation with Diffusion Transformers},
author={Hooshaai Research},
journal={GitHub / HuggingFace Technical Report},
year={2026},
url={https://github.com/Hooshaai/BlockDiffuse}
}
```