BlockDialect: Block-wise Fine-grained Mixed Format Quantization for Energy-Efficient LLM Inference

Wonsuk Jang, Thierry Tambe

TL;DR

BlockDialect introduces a novel 4-bit quantization method for Large Language Models (LLMs) that assigns a specific number format (a "dialect") to individual blocks of data, rather than just changing their scaling factor. By using a formatbook of FP4 variants and a highly efficient online selection algorithm, it achieves near-full-precision accuracy for both weights and activations while running on highly efficient integer hardware.

The Challenge of Quantizing LLM Activations

Large Language Models are incredibly memory and compute-hungry. Quantization—the process of reducing the precision of numbers (e.g., from 16-bit to 4-bit)—is a standard solution to mitigate these costs. However, LLM activations (the dynamic data flowing through the network) contain massive "outliers" that skew standard scaling methods, making them notoriously difficult to quantize without severe accuracy degradation.

Current hardware-friendly solutions, like the Microscaling (MX) format, divide data into small blocks and assign a shared scaling factor to each block. However, even within these small blocks, data distributions vary wildly. A single, rigid number format often wastes its dynamic range on empty space or clips important outlier values. Furthermore, quantizing activations on the fly (during inference) is computationally expensive. Because of this, many existing methods leave activations in high precision, which bottlenecks both speed and energy efficiency.

Methods: Format Over Scale

Instead of asking "how do we scale this block?", the authors ask "how do we represent it?".

BlockDialect & DialectFP4

The authors created DialectFP4, a "formatbook" of 16 different 4-bit floating-point (FP4) variants. Each variant (or "dialect") is tweaked to capture different maximum magnitudes and outlier distributions. During quantization, each block of data is assigned the dialect that best fits its unique shape.

BlockDialect assigns optimal number formats from a FormatBook to individual blocks of weights and activations.

Hardware-Friendly Integer Math

Crucially, all 16 dialects share a granularity of 0.5. This means their values can be mapped directly to 4-bit unsigned integers (e.g., 0, 0.5, 1.0 map to 0, 1, 2). The heavy lifting of matrix multiplication is then done using highly efficient integer MAC (Multiply-Accumulate) units, avoiding power-hungry floating-point math.

The DialectFP4 formatbook features 16 variants with different dynamic ranges and large magnitude distributions, all sharing a 0.5 granularity.

Two-Stage Online Selection

To quantize activations in real-time, calculating the Mean Squared Error (MSE) to find the best of 16 dialects is far too slow. The authors designed a clever hardware bypass:

  1. Match the Maximum: Pick a pair of dialects whose maximum values match the block's maximum value.
  2. Logical Bit-Operations: Use simple, parallel logical bit-operations (checking if specific binary bits are 1s or 0s) to count which of the two dialects fits the rest of the block's data better. By converting range checks into simple binary logical operations, the hardware overhead for picking the best format drops by ~9x in power and area compared to standard MSE calculations.

Key Insights and Results

The authors evaluated BlockDialect across various models (including LLaMA3-8B, LLaMA2-7B, Mistral-7B) and tasks (common-sense reasoning, GLUE, MMLU, and language modeling).

  • Prioritize the Outliers: In 4-bit quantization, you only get 8 distinct magnitude values. The authors found that accurately representing the largest numbers in a block is far more important for model accuracy than maintaining high precision for the numbers near zero.
  • Massive Accuracy Gains: On LLaMA3-8B, BlockDialect achieved a 10.78% accuracy gain over the standard MXFP4 format, despite using slightly fewer effective bits per parameter (due to the overhead of storing the dialect choice).
  • Full-Path Quantization: Even when quantizing everything to 4-bit (weights, activations, and attention mechanisms), the accuracy only dropped by 5.45% (LLaMA3-8B) and 2.69% (LLaMA2-7B) compared to full FP16 precision.
  • Hardware Efficiency: The custom MAC unit designed for DialectFP4 is 1.58x more power-efficient and 1.54x more area-efficient than FP6 MAC units, which are typically required by other methods to reach similar accuracy levels.

Limitations and Future Work

While BlockDialect shows immense promise, the authors note a few areas for future exploration. They combined BlockDialect with SmoothQuant (a method that mathematically flattens outliers before quantization), and while it showed slight improvements, the interaction isn't perfectly orthogonal. Future work will explore the optimal balance between mathematically flattening outliers and dynamically capturing them with dialects. Additionally, while the paper primarily focused on 1D linear blocks, they briefly tested 2D square blocks (which might better capture channel-wise variance in KV caches). However, 2D blocks introduce zero-padding overhead during the decode phase that requires further optimization.

Summary updated

BibTeX
@inproceedings{jang2025blockdialect,
  author = {Wonsuk Jang and Thierry Tambe},
  title = {{BlockDialect: Block-wise Fine-grained Mixed Format Quantization for Energy-Efficient LLM Inference}},
  booktitle = {International Conference on Machine Learning},
  year = {2025},
  url = {https://openreview.net/forum?id=Y0yXuQtPn8},
}
Figure