Source-linked AI summary

Triplet-Block Diffusion RWKV

Ke Lin, Yiyang Luo, Zhaolong Su, Yunya Song, Anyi Rao

arXiv:2605.25969v1cs.CL

TL;DR

Causal language models decode sequentially and face quadratic attention costs, while diffusion needs bidirectional conditioning that causal backbones lack. B3D-RWKV introduces triplet-block training and block-wise iterative denoising to combine these paradigms, achieving comparable benchmark performance and 1.6× average throughput over RWKV-7. Its broader generality is structurally argued but empirically validated only on one RWKV-7 backbone.

  • Problem

    Causal models are efficient but sequential and unidirectional, whereas diffusion models require bidirectional attention, creating an architectural mismatch.

  • Method

    Triplet-block layout adapts a strictly causal RWKV backbone for diffusion, using parallel token selection without changing the backbone parameters.

  • Results

    1.6× average decoding throughput over RWKV-7 is achieved while maintaining nearly identical performance and comparable reasoning results.

  • Takeaways & Limitations

    The method offers a way to transform pre-trained causal language models into diffusion language models without architectural changes.

  • Takeaways & Limitations

    Empirical validation covers only a single 7.2B RWKV-7 backbone, leaving other RWKV variants and non-RWKV linear-time backbones for future work.

Abstract

from arXiv · show

Causal Transformer language models suffer from strictly sequential decoding and a quadratic per-step attention cost. While linear-time causal models and discrete diffusion models each address these weaknesses, their integration remains inherently inconsistent: diffusion requires bidirectional attention, while causal models are unidirectional. To unify these architectures, we propose $B^3D-RWKV$, a diffusion RWKV variant that integrates the model's $O(L)$ inference efficiency with parallel, bidirectional discrete-diffusion through a \emph{triplet-block layout} method. $B^3D-RWKV-7.2B$ reaches comparable accuracy on an 8-task suite versus existing models while significantly outperforming baselines in decoding throughput with an average of $\mathbf{1.6\times}$ speedup.

1 Introduction

Causal models offer efficient inference but conflict with diffusion’s need for bidirectional conditioning. B3D-RWKV addresses this mismatch with triplet-block training and reports comparable reasoning with faster decoding.

  • Causal decoding is sequential and uses quadratic attention, while diffusion requires bidirectional attention that causal models do not provide.
  • The triplet-block method places each logical block into two masked copies and one clean copy to support diffusion training on a causal backbone.The clean copy refreshes the recurrent state before the next block.
  • B3D-RWKV-7.2B integrates parallel token selection into RWKV-7 without modifying its original parameters.
  • 1.6× higher decoding throughput is achieved than the RWKV-7 baseline while matching its reasoning capabilities at comparable generation lengths.

2 Related Work

Related work combines masked or discrete diffusion objectives with parallel decoding, while linear-time recurrent and state-space backbones target efficient causal inference. The paper positions its approach at their intersection.

  • Discrete-diffusion and masked language models: Discrete-diffusion language modeling developed from masked-language pretraining toward confidence-thresholded parallel decoding and larger instruction-tuned systems.
  • DiffuMamba is identified as the closest prior design, but it modifies Mamba into a bidirectional block rather than preserving the original architecture.
  • Linear-time recurrent and state-space backbones: Linear-time alternatives include RWKV, Mamba, RetNet, Gated Linear Attention, and Hyena, reporting Transformer-comparable perplexity with lower wall-clock and memory costs.

3 Method

The method uses triplicated logical blocks to create pseudo-bidirectional conditioning while retaining a strictly causal, linear-time backbone. Inference then denoises each block iteratively using confidence-based commits.

  • Method overview: The framework combines triplet-block layout training with a block-wise iterative denoising sampler for strictly causal language models.
  • Triplet-block layout: Each logical block is expanded into masked and clean physical copies, with the masked copies sharing one mask pattern and supervised positions receiving cross-entropy loss.
  • Pseudo-bidirectional access: Pseudo-bidirectional conditioning combines causal left context in the loss-bearing copy with right-context information absorbed from the earlier masked copy.
  • Backbone requirements: The construction requires strict causality and a forward-propagating state, properties stated to hold across several linear-time backbone families.
  • Block-wise iterative denoising: At inference, an all-MASK block is repeatedly decoded, committing positions above threshold τ or using a top-kmin fallback to ensure progress.

4 Experiments

B3D-RWKV-7.2B is evaluated on an 8-task suite against comparable-scale baselines, matching RWKV-7 performance while improving decoding throughput. Its results are stronger on some simpler reasoning tasks but weaker on complex structural problems.

  • Evaluation Setup: The evaluation covers eight general and mathematical reasoning tasks, using comparable-scale baselines released in roughly the same period.The suite includes MMLU, ARC-Challenge, ARC-Easy, PIQA, RACE, GSM8K, MATH, and GPQA.
  • Benchmark Results: B3D-RWKV performs comparably to similar-scale diffusion language models and matches the RWKV-7 baseline.The comparison concerns downstream performance on general and math reasoning tasks.
  • Benchmark Results: B3D-RWKV outperforms other models on ARC-Challenge and RACE, while parallel decoding may reduce accuracy on highly structured mathematical problems.MATH requires exact symbolic and numerical agreement, making it sensitive to local errors from parallel decoding.
  • Benchmark Results: B3D-RWKV achieves comparable or superior performance on simpler tasks but experiences an acceptable drop on complex structural problems.The passage attributes this pattern to parallel-decoding issues associated with diffusion language models.
  • Inference Throughput: The model achieves an average 1.6× higher throughput than RWKV-7 across context lengths from 1K to 512K while maintaining nearly identical performance.Changing sampling parameters reaches 2.02× speedup with a slight quality drop.

5 Conclusion

The paper introduces triplet-block layout training as a no-architecture-change method for adapting causal language models to diffusion generation. B3D-RWKV reports 1.6× throughput over the original RWKV model while maintaining comparable performance.

  • Conclusion: Triplet-block layout training adapts strictly causal language models into generative diffusion language models without architectural changes.The method is presented as the paper’s central training contribution.
  • Conclusion: B3D-RWKV achieves 1.6× throughput compared with the original RWKV model while maintaining comparable performance to existing models.The method offers an efficient way to transform pretrained causal language models into diffusion language models.

Limitations

The reported limitations concern empirical coverage, triplet-layout sequence overhead, narrow post-training data without reinforcement-learning alignment, and limited optimization for tool calling or coding.

  • Empirical Scope: The universality claim is structurally argued but empirically validated only on one 7.2B RWKV-7 backbone.Validation on smaller RWKV checkpoints, other RWKV variants, and non-RWKV backbones such as Mamba is left for future work.
  • Training Cost: The triplet layout increases physical sequence length by 3× per logical block in exchange for pseudo-bidirectional access.The approach remains feasible because RWKV-7 has linear-in-length complexity.
  • Training Data: Post-training uses 4.9B tokens from TÜLU 3 SFT and curated reasoning trajectories, without large-scale further pretraining or reinforcement-learning alignment.The resulting narrow, stylistically biased distribution may cause catastrophic forgetting and accuracy regression on some tasks.
  • Application Scope: The model was not specifically optimized for tool calling or coding because of computational constraints.The pretrained RWKV capabilities support success on some simple coding tasks, with broader improvements deferred to future work.

Ethical Considerations

The paper documents inherited safety limitations and training choices for mask sampling, including full-mask augmentation and forced masking of EOS and PAD positions.

  • Ethical Considerations: B3D-RWKV inherits the base checkpoint’s biases and inaccuracies because fine-tuning changes architectural behavior but not safety properties.The authors recommend reviewing outputs before user-facing or fact-sensitive deployment.
  • Mask Sampling: A 10% full-mask override reduces the training–inference distribution gap because inference begins each new block fully masked.The override is applied per logical block.
  • Mask Sampling: The EOS position is force-masked in every sample to improve stopping supervision under uniform per-block masking.Without this rule, EOS is supervised in fewer than half of samples.
  • Mask Sampling: PAD positions in the EOS-containing block are also force-masked to prevent a trailing-PAD shortcut from determining EOS predictions.This makes the model predict EOS from upstream content rather than visible PAD.
  • Implementation: Two unused tokenizer slots are reused for MASK and PAD, so the embedding table and output projection require no extension.ID 65,535 is MASK and ID 65,534 is PAD; ID 0 remains EOS.

A.2 Inference Sampler

The inference sampler denoises one logical block at a time, committing sufficiently confident tokens while guaranteeing progress through a low-confidence fallback.

  • Inference Sampler: At each iteration, tokens whose top-1 probability exceeds threshold τ are committed, with a top-kmin fallback when too few meet the threshold.The fallback guarantees strictly positive progress per iteration.
  • Inference Sampler: The loop ends when every position is committed, after which the clean block is appended to the committed prefix and the next block begins.This is the sampler’s block-wise progression rule.
  • Inference Sampler: Figure 3 compares sampling steps and commit threshold τ against decoding throughput and accuracy on ARC-E.These are the two sampler controls evaluated in the figure.
  • Architecture and Model Layout: The triplet layout expands each 2,048-token sample into 6,144 physical tokens across 64 logical blocks of size B = 32.Each logical block is represented by contiguous b1, b2, and b3 copies.

B Implementation Notes

The implementation records the distributed training configuration, dataset, precision settings, and memory constraints used for B3D-RWKV-7.2B reproducibility.

  • Training Configuration: The run used approximately 500 H100 hours on 8× H100 80GB GPUs for two epochs.This configuration is documented for exact reproduction rather than claimed as a contribution.
  • Training Data: The training mixture contains 4.97 billion tokens from three publicly named datasets.The datasets are hosted through Huggingface Datasets.
  • Precision: Training used bf16 activations with fp32 optimizer state, gradient accumulation, and inter-rank communication.The configuration explicitly sets the relevant DeepSpeed precision controls.
  • Parallelism: DeepSpeed ZeRO Stage 2 without offload ran on 8 GPUs with an effective batch size of 128 samples per step.The batch combines 4 samples per GPU with 4 gradient-accumulation steps.
  • Memory: Activations and the wkv scratchpad dominate single-GPU memory and constrain increasing the micro-batch beyond 4.This observation applies to the current context length.
  • Licensing: The model follows the Apache-2.0 license from RWKV.No further licensing modification is reported.

C Performance

Performance measurements show linear-context latency, a throughput–accuracy trade-off controlled by sampling and commitment settings, and strong decoding throughput across evaluated workloads.

  • Throughput: 43,000 tokens per second was sustained during training on 8× H100 80GB SXM GPUs at micro-batch 4 and context length 6,144.This is the reported post-configuration training throughput.
  • Throughput: 222.1 tok/s was the mean inference decoding throughput across 6,284 production-style requests.Per-request rates ranged from 74.7 to 785.4 tok/s, with a standard deviation of 124.6.
  • Latency: End-to-end latency rose from 91 ms at 1K tokens to 45.8 s at 512K tokens, growing close to linearly with prefilled context length.The reported trend is attributed to the RWKV-7 backbone’s lack of quadratic attention.
  • Sampling Steps: At 8 sampling steps, throughput was 581 tok/s with 18.7% accuracy, while 32 steps reached 79.3% accuracy at 213 tok/s.The largest jump was +30.8 accuracy points for a 26% throughput drop between 16 and 24 steps.
  • Commit Threshold: At τ = 0.3, throughput reached 772 tok/s with 11.2% accuracy, whereas τ = 0.9 recovered 79.3% accuracy at 213 tok/s.The authors use τ = 0.9 as the default and lower values when latency matters more than accuracy.

D Samples

The appendix includes B3D-RWKV-7.2B samples spanning general, complex, coding, reasoning, translation, arithmetic, and factual tasks. It also specifies a standard helpful-assistant prompt and mentions external proofreading and coding tools.

  • Generated samples: B3D-RWKV-7.2B samples demonstrate responses to general and complex tasks.The samples appear in the Appendix.
  • Prompting: The default system prompt is “You are a helpful assistant”.
  • AI usage: The text states that Grammarly and Gemini were used for proofreading, while Claude Code was used for coding.
  • Task examples: Examples cover factual questions, translation, arithmetic, programming, biology, reading-rate calculation, and biography requests.The examples include answers about Washington, D.C., Spanish translation, arithmetic, Fibonacci numbers, embryonic sacs, reading time, and Einstein.
Loading 2605.25969v1…