Set Block Decoding is a Language Model Inference Accelerator

Itai Gat, Heli Ben-Hamu, Marton Havasi, Daniel Haziza, Jeremy Reizenstein, Gabriel Synnaeve, David Lopez-Paz, Brian Karrer, Yaron LipmanarXiv 2025 · DOI

Introduction

Large Language Models (LLMs) have revolutionized natural language processing, yet their deployment remains constrained by the inherent latency of autoregressive decoding. In standard Next Token Prediction (NTP), generating a sequence requires a full forward pass for every token. Because these models are massive, inference is typically memory-bound: the time spent transferring weights from memory to the processor far exceeds the actual computation time.

To address this, researchers at FAIR (Meta) introduced Set Block Decoding (SBD). SBD is a novel inference acceleration method that allows models to predict multiple future tokens in parallel without requiring auxiliary "draft" models or fundamental architectural changes. By fine-tuning existing models to predict a "set" of future tokens, SBD achieves a 3x to 5x speedup in generation.

Methodology

The core innovation of SBD lies in treating a block of future tokens as a set that can be predicted simultaneously. This is achieved through three primary components:

1. Hybrid Architecture and Attention

SBD integrates standard NTP with Masked Token Prediction (MATP) within a single Transformer. During training and inference, the model employs standard causal attention for past tokens. However, for the "future block" of tokens being predicted, it utilizes bidirectional attention. This allows the tokens within the future block to interact with one another, ensuring that the parallel predictions are contextually consistent.

SBD training and inference mechanisms. (a) shows the hybrid training objective with bidirectional attention for the future block; (b) illustrates the iterative block-based inference process.

2. The Entropy Bounded (EB) Sampler

Rather than predicting a fixed-length sequence, SBD uses an Entropy Bounded (EB) Sampler to determine which tokens to accept. The model evaluates the uncertainty (entropy) of the masked tokens in the future block. If the model exhibits high confidence in multiple tokens—even if they are non-consecutive—it accepts them all in a single forward pass. This flexibility avoids the "brittleness" of traditional speculative decoding, where a single incorrect guess in a sequence can invalidate the entire block.

3. Fine-tuning with Joint Loss

SBD is implemented by fine-tuning pre-trained NTP models (such as Llama-3.1 8B and Qwen-3 8B). The training process uses a joint loss function that combines standard NTP loss with MATP loss. Ablation studies indicate that maintaining the NTP loss is critical; without it, the model's general reasoning capabilities tend to degrade.

Experimental Results

The researchers evaluated SBD using Llama-3.1 8B and Qwen-3 8B models fine-tuned on a 70-billion token dataset comprising reasoning, math, and instruction-following data.

Speedup and Accuracy

SBD demonstrated significant efficiency gains across various benchmarks, including LiveCodeBench and GSM8K. As shown in the performance analysis, SBD-tuned models achieved speedups ranging from 3.6x to 4.7x compared to their standard NTP counterparts. Crucially, this acceleration was achieved with zero loss in performance; in several cases, the SBD models slightly outperformed the original NTP models in accuracy (Pass@1).

Performance vs. Speedup for Llama-3.1 and Qwen-3. SBD models (circles) achieve 3.6x to 4.7x speedups over standard NTP (stars) while maintaining or improving Pass@1 accuracy.

Hardware Efficiency

Using "Roofline Analysis" on NVIDIA H100 GPUs, the authors confirmed that the reduction in the number of forward passes (NFEs) translates directly into wall-clock speedups. Because LLM decoding is memory-bound, computing a block of tokens (e.g., 16 tokens) requires nearly the same amount of time as computing a single token, provided the computation fits within the GPU's arithmetic intensity limits.

Conclusion and Future Work

Set Block Decoding provides a "drop-in" optimization for LLM deployment, offering substantial speedups without the complexity of managing multiple models. While currently validated on 8B parameter models, future work will focus on scaling SBD to frontier models (70B+) and developing hardware-aware kernels to further optimize the bidirectional attention masks used during inference.

Summary updated

BibTeX
@misc{gat2025set,
  author = {Itai Gat and Heli Ben-Hamu and Marton Havasi and Daniel Haziza and Jeremy Reizenstein and Gabriel Synnaeve and David Lopez-Paz and Brian Karrer and Yaron Lipman},
  title = {{Set Block Decoding is a Language Model Inference Accelerator}},
  year = {2025},
  eprint = {2509.04185},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2509.04185},
}
Figure