Open weights · Field guide

MACaQ revisits the calibration step in low-precision inference

MACaQ investigates four-bit weights and activations after training. Calibration determines how the numerical range seen in examples translates to inference.

In this article
MACaQ — Quantizing a 122B model: 64 min. The authors report 32.5 GB of GPU memory during quantization.

MACaQ’s researchers describe a post-training procedure that treats each linear layer independently. They apply channel scaling and a block-Hadamard transform to activations and account for the inverse transformation in the weights. The arrangement makes calibration a concrete question: which observed activation ranges should determine the numerical representation used on a later, unseen input?

Time to prepare weights and time to serve requests

The MACaQ authors report quantizing a 122-billion-parameter model in 64 minutes with 32.5 GB of GPU memory. That is a statement about the quantization procedure. It is not a specification for running every subsequent inference request on the resulting model. The working set of a layer-local calibration process can differ substantially from the weights, activations and caches needed during serving. A comparison should record preparation time separately from per-request latency, especially when one prepared model will serve a large number of requests.

The Layer-Local Transformation

In traditional quantization methods, input activations are transformed by a matrix before being quantized, and the corresponding inverse transform is absorbed into the weight matrix. This often requires propagating those transforms backward through layers, which introduces dependencies between operations. For example, if a layer’s activation distribution shifts due to a transformation, earlier layers may need their normalization parameters or residual branches adjusted. MACaQ avoids this by applying only two operations per linear layer: first, a per-channel scale that divides the weight columns and adjusts corresponding activation channels; second, a block-Hadamard transform that rotates the activation data in blocks of elements. These transforms are applied online during inference, not at quantization time. Because each layer operates independently, no neighboring layers need to be modified or re-quantized. The transformation matrices themselves are stored locally within each layer and do not require cross-layer communication.

As a result, quantizing one layer does not affect normalization layers or residual branches downstream. The cost of these operations grows with input dimension but is offset by the fact that output dimensions grow faster in larger layers, so the relative overhead diminishes as model size increases.

Improving Quantization Quality Through Flip-Refinement

While round-to-nearest quantization provides a baseline for assigning FP4 codes to activation values, it often fails to capture subtle variations in signal distribution. To improve accuracy, MACaQ introduces Flip-Refinement—a coordinate-descent procedure that revisits individual code assignments after initial placement. It operates within the constraints of MXFP4’s E2M1 format: each element has a four-bit code with one sign bit, two exponent bits, and one mantissa bit.

Flip-Refinement works incrementally, scanning each activation block and testing if shifting its FP4 code to a neighboring level yields better output fidelity. Because it operates on individual codes rather than full matrices, it is computationally efficient and can be applied in parallel across layers. The process starts with a standard round-to-nearest assignment and then iteratively refines the codes until no further improvement is found or a maximum number of iterations is reached.

The method was evaluated on two benchmark tasks: IFEval, which assesses instruction-following capabilities in language generation, and MATH-500, a dataset of free-form math problems requiring multi-step reasoning. Calibration used the WikiText-2 training set, with evaluation performed on both WikiText-2 (in-distribution) and C4 (out-of-distribution). Perplexity scores were used as the primary metric to compare model quality across methods.

A key limitation remains: because MACaQ operates layer-by-layer without cross-layer feedback, it cannot compensate for errors introduced by one layer’s quantization in another. This means that while the method is fast and modular, it does not achieve full error correction across the network. A secondary pass using cross-layer statistics could be added, but would likely increase quantization time to match or exceed other methods.

The Layer-Local Transformation in MACaQ

MACaQ applies a per-channel scaling and a block-Hadamard transform to each linear layer’s activations independently, without requiring cross-layer coordination. This transformation is applied at inference time, meaning the activation data passes through these operations on-the-fly as it flows through the network. The per-channel scale adjusts input channels based on their RMS activation magnitude: high-activation channels are attenuated by a smaller scaling factor, while low-activation ones receive larger factors to maintain dynamic range. After scaling, the block-Hadamard transform redistributes energy across transformed channels, reducing outliers and spreading high-energy values into more stable, Gaussian-like distributions. This process is applied only to activations, with no changes to the original weights—instead, the inverse transforms are absorbed directly into the weight matrix during quantization. As a result, each layer operates in isolation, enabling a streaming implementation where only one layer needs to be loaded into memory at any time. This design eliminates architecture-specific dependencies and allows MACaQ to generalize across different network topologies.

Evaluation of Flip-Refinement on Perplexity and Hessian Objectives

Flip-Refinement is introduced as a coordinate-descent procedure that iteratively adjusts FP4 activation codes to adjacent representable values, guided by the local curvature of the loss function via Hessian estimation. The method evaluates only two neighboring code states at each step—those immediately above and below the current value—and computes the gain in objective function reduction for each move. This greedy refinement is applied after the initial quantization and during calibration, using training data from WikiText-2 to estimate Hessians in transformed coordinates. Results show that while Flip-Refinement reduces the Hessian-based calibration objective across layers—particularly in large models like Qwen3-4B—it does not consistently improve model perplexity over simpler code refinement methods. However, when evaluated on full models with multiple layers, the improvement in perplexity is marginal, suggesting that local objective minimization does not always translate into better overall model behavior.

How Perplexity Matches Prior Methods

MACaQ achieves or matches the perplexity of prior methods like DuQuant++ and MR-GPTQ on Llama-3-8B, and reaches parity with their best results in just 11 times less quantization time. This indicates that the layer-local transformation and refinement process effectively preserves model fidelity despite significant reduction in precision. Importantly, the improvement is not due to a single component but emerges from the combination of activation scaling, Hadamard rotation, and targeted code refinement. The absence of gains in perplexity when using importance matrices or exact block minimization shows that the model’s behavior is sensitive to local dynamics rather than global patterns. This implies that while Hessian-based optimization improves numerical stability during calibration, it does not necessarily lead to better language modeling outcomes. Thus, the results suggest a trade-off: higher precision in intermediate layers may be beneficial for calibration accuracy but not for final performance. The findings support using simple code refinement over complex search procedures when evaluating model quality in real-world settings.

The Boundary of Cross-Layer Error Compensation

However, the experimental evidence shows that such a pass would likely increase quantization time significantly—by orders of magnitude in some cases—without yielding consistent improvements in generative performance.

What Distinguishes Competing Explanations for Flip-Refinement’s Impact

The effectiveness of Flip-Refinement as a Hessian-aware refinement step hinges on whether it genuinely improves the gradient alignment between quantized activations and original floating-point values. One explanation posits that Flip-Refinement reduces reconstruction error by better matching the local curvature of activation distributions, especially in regions where FP4 codes would otherwise clip or misrepresent signal magnitude. An alternative interpretation suggests that the improvement stems from a statistical bias in how activation channels are distributed across training data—meaning Flip-Refinement simply exploits pre-existing patterns rather than correcting underlying model errors. This distinction is testable: if Flip-Refinement’s benefit were purely due to data distribution, then removing calibration tokens or using synthetic input distributions should yield similar performance gains. This supports the view that Flip-Refinement acts as a targeted correction mechanism tuned to local Hessian structure, not just a data-driven pattern matcher.

The Open Question of Generative Fidelity in Long Sequences

Despite strong performance on fixed-text metrics and image diffusion tasks, MACaQ leaves an open question about its behavior under long-sequence generation: whether quantization errors accumulate over time in ways that degrade semantic coherence or factual accuracy. In practical applications such as chatbots or code generation, the model must maintain consistency across hundreds of tokens, making it critical to understand how small per-token distortions compound. This gap means that while MACaQ may perform well at token-level reconstruction, its behavior in real-world generative workflows remains unverified. A competing explanation would be that the layer-local design inherently limits error accumulation because each layer is independently calibrated and operates under stable transformation rules—thus preventing cascading drift. Conversely, another view holds that even small activation distortions can grow over time due to residual gradients, especially when high-precision operations are required in later stages of generation. Until such experiments are conducted, the claim of robustness in generative settings remains speculative, even if it is supported by short-horizon performance metrics.

Hessian-Weighted Exponent Selection: A Trade-Off in Shared Scale Optimization

In MXFP4 quantization, every block of weights shares a single E8M0 scale—a power-of-two exponent that governs the dynamic range of the transformed values. This shared scale introduces a fundamental tension: smaller exponents offer finer resolution near zero, which is crucial for capturing small activation differences, but risk clipping large values during quantization. Larger exponents avoid clipping at the cost of coarse representation, reducing precision in the center of the distribution. MACaQ addresses this by introducing Hessian-Weighted Exponent Selection, a mechanism that evaluates candidate exponents not uniformly, but based on local statistical properties of each weight row and block.

For any given transformed weight row, MACaQ considers a small set of candidate exponents centered around the standard exponent derived from the block’s maximum value. This standard exponent is computed directly from the magnitude distribution within the block—effectively identifying where the peak activation energy lies. For each candidate exponent, the method rounds the block to the nearest E2M1 grid and computes a loss function that reflects how well the quantized values preserve the original signal structure. The selection process is not random; it uses local data to determine which scale best balances resolution and clipping for that specific block.

In such cases, a block with large dynamic range might suffer from clipping due to an overly conservative scale, while one with small values could lose precision under a too-aggressive scale. By screening candidates locally, MACaQ adapts the shared scale to each block’s unique energy profile. This is particularly effective because activation magnitudes in neural networks are not uniformly distributed—they exhibit strong channel-specific variance.

A hypothetical contrast illustrates this: consider two adjacent blocks in a linear layer—one with high-energy, sparse activations (e.g., from a vision transformer’s attention head), and another with low-energy, smooth gradients (e.g., from a language model’s feedforward layer). This leads to more faithful reconstruction of both activation patterns.

The selected exponent is then fixed throughout the Flip-Refinement phase—a greedy optimization that adjusts individual FP4 codes to adjacent representable values by minimizing a ridge-regularized Hessian objective. This prevents the refinement from inadvertently shifting codes into regions where the scale is too coarse or too fine.

A key insight emerges: the exponent selection process acts as a form of local dynamic range calibration. It does not rely on cross-layer information, preserving MACaQ’s layer-local design. Yet it improves quantization quality by aligning the scale with actual activation energy, rather than assuming uniformity across blocks. This is especially important in models where certain layers exhibit extreme variance—such as in diffusion or vision tasks where attention heads respond to high-contrast inputs.

If this mechanism were absent, MACaQ would likely suffer from suboptimal quantization in high-dynamic-range regions, leading to increased error accumulation during inference. Conversely, if the exponent selection were too aggressive or poorly tuned, it might introduce instability in low-magnitude channels, reducing overall fidelity. The experimental evidence suggests that the local screening process provides a consistent improvement in both Hessian objectives and downstream performance metrics like perplexity—without increasing computational cost.

Ultimately, Hessian-Weighted Exponent Selection demonstrates how a simple yet data-driven adjustment of shared scales can significantly improve quantization quality by respecting the intrinsic statistical structure of activations. It does so without requiring cross-layer dependencies or complex optimization pipelines, reinforcing MACaQ’s core principle: effective quantization need not sacrifice speed or simplicity.

A Hypothetical Comparison of Calibration and Serving Overhead

In Scenario B, the model is calibrated incrementally during serving via a streaming process where only one layer’s activations are retained at any time, consistent with MACaQ’s design of per-layer independence.

The measurement protocol defines two distinct times: calibration preparation time (from start to completion) and per-request inference latency (time from request arrival to output generation). The observable measurements include total time spent preparing the model, average latency per request during serving, and peak GPU memory usage across both phases.

Crucially, these outcomes are conditional on assumptions about data access patterns, activation distribution, and layer independence. The working set during calibration (e.g., stored activations) can differ significantly from what’s needed during serving (e.g., real-time transforms). This divergence means that comparing total time or latency without separating preparation from per-request execution risks misrepresenting the true cost of deployment.

The thought experiment underscores a key limitation in current evaluation practices: conflating model preparation with runtime performance. Without clear separation between these phases—especially when one model serves many requests—the benefits of MACaQ’s streaming approach remain speculative.

Ultimately, while MACaQ achieves faster calibration and lower memory use in theory, whether this translates to better real-world performance depends on how activation errors propagate across sequences. The absence of data showing actual perplexity or generation quality differences between the two scenarios means that any conclusion about superiority remains conditional. What is clear is that a proper evaluation must track both preparation time and per-request latency independently—otherwise, the true value of low-precision quantization in production environments remains obscured.