FlowBlock is a training-free, wavefront-parallel decoding framework that accelerates block-wise diffusion language models (dLLMs) by exploiting token-to-token self-correction to break serial block dependencies.

Stars

118

7-day growth

+28

Forks

1

Open issues

0

License

Apache-2.0

Last updated

2026-07-21

AI repository intelligence
FR-AI / ANALYSIS

Why it is worth attention

It delivers up to 4× throughput and 77% lower latency over prior diffusion LMs on math/code benchmarks while preserving or improving accuracy, without any additional training.

Who it is for

  • Researchers in efficient LLM inference
  • Practitioners deploying diffusion language models
  • Developers working on self-correcting or block-wise autoregressive models
  • Engineers optimizing batched serving for generative AI

Use cases

  • Batch serving of math and code generation tasks with high throughput
  • Single-request decoding acceleration for interactive applications
  • Low-latency inference for latency-sensitive pipelines
  • Evaluating trade-offs between parallelism and accuracy under fixed compute budgets

Strengths

  • Training-free: runs unmodified LLaDA-2.x weights
  • Measured accuracy gains: +1.3 points average on 8 math/code benchmarks
  • Substantial speedup: up to 2.95× / 4.01× higher TPS than LLaDA-2.1 / LLaDA-2.0 under batched serving
  • Provides gated wavefront decoding and heterogeneous packing for efficient GPU utilization

Considerations

  • Currently supports only LLaDA-2.x model family (not general autoregressive LLMs)
  • Requires ~80 GB GPU memory for the 16B-A1B MoE checkpoints
  • Inference backend limited to SGLang (no native vLLM or TensorRT-LLM support mentioned)

README quick start

Wavefront-Parallel Decoding for Self-Correcting Diffusion Language Models

FlowBlock is a training-free parallel decoding framework for block-wise diffusion language models (dLLMs). Block-wise dLLMs such as LLaDA-2.x decode one block at a time, which makes inter-block decoding strictly serial. FlowBlock observes that the token-to-token (T2T) self-correction ability of LLaDA-2.1 series enable a downstream block start from an informative draft instead of a finalized predecessor — so block finality becomes a scheduling resource rather than a hard dependency.

FlowBlock is built on two mechanisms:

  • Gated Wavefront Decoding (GWD) — admits blocks into a bounded wavefront only when a readiness gate (SPAWN_TH) is satisfied, jointly refines active blocks via T2T editing, and commits blocks in order under a windowed block-causal mask that preserves exact frozen-prefix KV-cache reuse.
  • Heterogeneous Wavefront Packing (HWP) — gives each request its own wavefront while packing all active windows into dense, shape-stable batched forwards, so asynchronous progress stays GPU-efficient in batched serving.

✨ Highlights

  • Up to 2.95× / 4.01× higher TPS than LLaDA-2.1 / LLaDA-2.0 under batched serving (1.57× / 3.17× at batch size 1), with up to 53.6% / 77.1% lower latency.
  • Accuracy preserved or improved: +1.3 points on average across eight math / code benchmarks.
  • No training: runs the unmodified LLaDA-2.1 series weights.

🛠️ Installation

Requirements: Linux, NVIDIA GPU(s) with ~80 GB memory for the 16B-A1B MoE checkpoints, CUDA 12.x driver.

git clone  FlowBlock
cd FlowBlock

conda create -n flowblock python=3.11 -y
conda activate flowblock

# 1) Install PyTorch matching your CUDA version (validated: 2.8.0 + cu128)
pip install torch==2.8.0 --index-url https://download.pytorch.org/whl/cu128

# 2) Install the base dependencies (sglang, lm-eval, ...)
pip install -r requirements.txt

# 3) Install vLLM last — this is a separate step on purpose
pip install vllm==0.10.2

The dinfer package is used directly from source — the evaluation scripts set PYTHONPATH automatically, no pip install step is needed. Verify the setup:

PYTHONPATH="$PWD/dInfer/python" python -c \
  "from dinfer.decoding import FlowBlockJointDiffusionLLM, flowblock_packed; print('Flo

Description

FlowBlock: Wavefront-Parallel Decoding Framework for Self-Correcting Diffusion Language Models

Related repositories

Similar projects matched by category, topics, and programming language.

lopopolo
Featured
lopopolo GitHub avatar

harness-engineering

Harness Engineering is a methodology for improving coding agent outputs by carefully crafting the environment around them—providing curated context, tools, and executable constraints that encode an organization’s nonfunctional requirements and cumulative lessons.

AI & Machine LearningAI Agents
2,390
slvDev
Featured
slvDev GitHub avatar

esp32-ai

A 28.9 million parameter language model runs on an $8 ESP32-S3 microcontroller entirely on-device, generating simple stories at about 9.5 tokens per second.

AI & Machine LearningLarge Language Models
1,960
littledivy
Featured
littledivy GitHub avatar

mimic

mimic captures traffic from any iOS or web app and automatically generates a Python client library that lets you call the app's API like a regular library.

AI & Machine Learning
1,482