Skip to content

About

No description, website, or topics provided.

Resources

Code of conduct

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

Blurring the Block Boundaries (B3)

Code for Blurring the Block Boundaries: Overlapping Block Denoising for Efficient Diffusion Language Models (arXiv:2611.14387). It reproduces the main results table (DiffusionGemma 26B, LLaDA 2.1 flash 100B, LLaDA 2.1 mini 16B; base vs. B3; 10 benchmarks), the threshold Pareto sweep, the block-size ablation and the FlowBlock / MBD-LMs baselines.

Block-diffusion models denoise one block at a time. B3 starts denoising the next block (the trail) while the current one (the lead) is still converging, both in one forward pass; a gate measured from the generation itself decides when the trail starts. On LLaDA 2.1 the MoE layers run on vLLM's fused MoE kernel, as in every paper number.

Layout

b3/
  gate.py                  self-calibrating trail-spawn gate
  models/gemma_engine.py   DiffusionGemma decoding: single-block baseline and B3
  models/llada_engine.py   LLaDA 2.1 decoding: single-block baseline and B3
  models/llada_forward.py  exact prefix KV cache
  baselines/               FlowBlock and MBD-LMs on the same LLaDA forward
  eval/                    benchmark runner, lm-eval tasks, code benchmarks, results table
configs/                   one file per (model, method)
  pareto/  block_size/  baselines/

Install

The Dockerfile installs the package versions the paper ran with. Without Docker (Python 3.12, CUDA 12.8), in this order, so the pinned transformers commit is the one installed:

pip install -r requirements.txt
pip install "vllm==0.19.1" "torch==2.10.0" "protobuf<6"
REV=a8609bed2ad1593e7d756006525a10053d4d5bc6
pip install "transformers @ git+https://github.com/huggingface/transformers.git@$REV"
pip install --no-deps -e .
python -c "import nltk; nltk.download('punkt_tab'); nltk.download('punkt')"

Data

  • lm-eval datasets download from the Hugging Face Hub. GPQA is gated: accept its terms and set HF_TOKEN. Its terms forbid publishing its examples, so do not publish GPQA run outputs.
  • Models and datasets come from their original sources under their own licenses.
  • HumanEval+ / MBPP+: evalplus downloads its datasets into $XDG_CACHE_HOME/evalplus on first use. If its sandbox cannot set memory limits in your container, export EVALPLUS_MAX_MEMORY_BYTES=-1.
  • LiveCodeBench: put test5.jsonl and test6.jsonl from livecodebench/code_generation_lite in data/livecodebench/ (342 problems).

Scoring the code benchmarks executes model-written code. Run it in an isolated environment.

Main table

for arm in gemma_base gemma_b3 llada_flash_base llada_flash_b3 llada_mini_base llada_mini_b3; do
  for task in gsm8k_cot math500 aime26 omni_math gpqa_diamond ifeval humaneval_plus mbpp_plus bbeh livecodebench; do
    python -m b3.eval.run --config configs/$arm.yaml --task $task --output_dir runs/$arm/$task
  done
done
python -m b3.eval.summarize --runs runs

The paper's numbers are in RESULTS.md. Exact versions, data revisions and the run layout behind them are in REPRODUCIBILITY.md.

Each run uses eval_args.num_instances workers of eval_args.gpus_per_instance GPUs. The paper's throughput numbers come from DiffusionGemma on 2 A100 40GB GPUs, LLaDA 2.1 flash on 2 H200 141GB and LLaDA 2.1 mini on 1 A100 40GB per worker; TPS depends on the hardware, TPF and accuracy do not.

BBEH reports the adjusted harmonic mean of its 23 subtasks. TPS and TPF are per-document tokens per second and tokens per decoder forward, averaged over documents.

For lm-eval tasks, --shard I/N runs every N-th document starting at I. Run I = 0..N-1 into runs/<arm>/<task>/shard_I/ and summarize pools them.

Other experiments

experiment configs
Pareto: Gemma entropy_bound 0.001–10, LLaDA mini threshold 0.3–0.95 configs/pareto/ (the main configs are 0.1 and 0.7)
Block size: Gemma canvas 128–512, LLaDA mini block 32–128 configs/block_size/ (main: 256 and 64)
FlowBlock / MBD-LMs on LLaDA mini, block 32 and 64 configs/baselines/

The baselines ran on 8 benchmarks (no Omni-MATH or BBEH), with each method's math settings on GSM8K, MATH500, AIME and GPQA-D and its code settings on HumanEval+, MBPP+, LiveCodeBench and IFEval.

License

CC-BY-NC-4.0 (LICENSE, NOTICE). Code derived from other projects keeps its original license; it is listed, with the license texts, in THIRD_PARTY_NOTICES.md.

This code is being released solely for academic and scientific reproducibility purposes, in support of the methods and findings described in the associated publication. Pull requests are not being accepted in order to maintain the code exactly as it was used in the paper.

Citation

@misc{mann2026blurring,
  title  = {Blurring the Block Boundaries: Overlapping Block Denoising
            for Efficient Diffusion Language Models},
  author = {Mann, Amir and Fhima, Jonathan and Brody, Shaked and Avitan, Or
            and Zamir, Asif and Tsiper, Shahar and Nayman, Niv},
  year   = {2026},
  eprint = {2611.14387},
  archivePrefix = {arXiv},
  primaryClass  = {cs.CL},
  url    = {https://arxiv.org/abs/2611.14387}
}

About

No description, website, or topics provided.

Resources

Code of conduct

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages