BlockDiffuse-Data / README.md
tahamajs's picture
Deploy fully comprehensive Dataset Card with tensor schemas and extraction details
4b35acc verified
|
Raw History Blame Contribute Delete
5.57 kB
metadata
license: apache-2.0
tags:
  - flow-matching
  - continuous-latents
  - math-reasoning
  - qwen2.5
  - block-diffusion
  - non-autoregressive
  - gsm8k
  - chain-of-thought
size_categories:
  - 10K<n<100K
task_categories:
  - text-generation
language:
  - en

πŸ“¦ BlockDiffuse Precomputed Latents & Reasoning Datasets

License: Apache 2.0 Base Model HuggingFace Model HuggingFace Space

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.


πŸ“‘ Table of Contents

  1. Dataset Pipeline & Extraction Architecture
  2. Dataset Files Manifest & Specifications
  3. Data Formats & Internal Tensor Keys
  4. How to Load and Inspect with PyTorch
  5. End-to-End Training Instructions
  6. Citation

1. Dataset Pipeline & Extraction Architecture

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:

Discrete Prompt Tokens (L_p) ──► Qwen2.5 (Layers 1..12) ──► Prompt Latents c [L_p x 896]
Discrete Target Tokens (100) ──► Qwen2.5 (Layers 1..12) ──► Target Latents z_1 [100 x 896]

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.


2. Dataset Files Manifest & Specifications

File Name File Size Description Target Tasks Samples Count
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
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
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
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

3. Data Formats & Internal Tensor Keys

Each .pt file is a serialized Python dictionary with the following tensor schema:

{
    "prompt_latents": torch.Tensor,   # Shape: [N, max_prompt_len, 896] (float32 / bfloat16)
    "target_latents": torch.Tensor,   # Shape: [N, 100, 896] (Target latents z_1 at Layer 12)
    "target_tokens": torch.Tensor,    # Shape: [N, 100] (Ground truth discrete token IDs for CE loss)
    "prompt_lens": torch.Tensor,      # Shape: [N] (Exact token length of each prompt prefix)
}

4. How to Load and Inspect with PyTorch

import torch

# 1. Inspect Tokenized Sequences
tokenized = torch.load("reasoning_tokenized_qwen.pt", map_location="cpu")
print("Total tokenized entries:", len(tokenized["input_ids"]))
print("Sample input_ids shape:", tokenized["input_ids"][0].shape)

# 2. Inspect Continuous Latents
latents = torch.load("precomputed_reasoning_latents_qwen.pt", map_location="cpu")
print("Prompt latents shape:", latents["prompt_latents"].shape)  # [N, L_p, 896]
print("Target latents shape:", latents["target_latents"].shape)  # [N, 100, 896]
print("Target tokens shape:", latents["target_tokens"].shape)    # [N, 100]

5. End-to-End Training Instructions

To train a BlockDiffuse DiT model from scratch using these precomputed latents:

# 1. Clone official repository
git clone https://github.com/Hooshaai/BlockDiffuse.git
cd BlockDiffuse

# 2. Train with the full precomputed 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

6. Citation

@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}
}