Executive Summary
As Large Language Models (LLMs) continue to scale, low-bit weight-only post-training quantization (PTQ) has become essential for memory-efficient deployment on consumer hardware. However, standard PTQ often degrades the reasoning and long-form generation capabilities of these models. Logit-aware Final-block Quantization (LFQ) addresses this shortfall by aligning the quantized model's output probabilities with the original model using a simple cross-entropy loss on the final transformer block. This targeted adjustment significantly boosts performance on complex generative tasks—such as advanced mathematics and strict instruction following—without sacrificing baseline language understanding.
The Problem: Why Standard PTQ Fails at Generation
The current gold standard for compressing LLMs is block-wise PTQ, which quantizes the model one block at a time. It does this by minimizing the Mean Squared Error (MSE) between the outputs of the original full-precision (FP) block and the newly quantized block.
While MSE-based PTQ works well for maintaining low perplexity (predicting the next word in a general sense) and achieving high scores on multiple-choice benchmarks like MMLU, it struggles significantly with generative tasks. When an LLM must follow complex instructions or generate an extended "chain of thought" for a math problem, standard quantized models often diverge from the correct logical path.
The authors identify two primary culprits for this degradation:
- Ignoring the LM Head: Standard block-wise optimization ignores the final "unembedding" layer (the LM Head) that translates hidden states into actual word probabilities.
- The MSE Trap: MSE is a distance metric, not a probability metric. A quantized block might achieve a very low MSE compared to the original, yet still "flip" the top-1 token prediction. Over long responses, these minor probability shifts compound into glaring logical errors.
Methodology: Introducing LFQ
To rectify this discrepancy, the researchers introduce LFQ (Logit-aware Final-block Quantization). LFQ is a "plug-and-play" enhancement designed to integrate seamlessly into existing PTQ frameworks like FlexRound or OmniQuant.
The strategy is elegantly simple and computationally efficient:
- Blocks 1 to (N-1): Quantize these intermediate layers using standard MSE-based methods.
- The Final Block (N): Instead of MSE, optimize this block using cross-entropy loss between the logits (raw output scores) of the FP model and the quantized model.
By incorporating the LM Head into the optimization of the very last transformer block, LFQ forces the quantized model to replicate the probability distribution of the original model. This ensures that the relative "ranking" of tokens remains consistent, which is far more critical for accurate text generation than simply matching the raw numerical values of the hidden layers.
Key Insights
- Preserving Reasoning Anchors: In reasoning models (like DeepSeek-R1), certain tokens act as logical anchors—words like "Wait," "But," or "Therefore." Standard PTQ often becomes overconfident in the wrong tokens or underconfident in these critical pivots. LFQ keeps these probability distributions closer to the original, keeping the reasoning chain on track.
- MSE vs. Cross-Entropy: The paper demonstrates a striking phenomenon: a quantized model with a higher MSE can actually perform better if its cross-entropy is lower. This proves that for generative AI, the industry has often been optimizing for the wrong metric.
- High Efficiency: Quantizing an entire model with cross-entropy is computationally prohibitive. LFQ proves that fixing just the final block is sufficient to recover the vast majority of generation quality.
- Framework Agnosticism: LFQ is a new way to train quantization parameters, not a new quantization format. Consequently, LFQ-quantized models remain fully compatible with existing high-speed inference kernels like GPTQ or AWQ.
Evaluation and Results
The researchers evaluated LFQ across diverse model families (Qwen2.5, Llama 3.1/3.2, DeepSeek-R1-Distill) and rigorous benchmarks, yielding impressive results:
- Advanced Math Reasoning: On the highly challenging AIME 2024 benchmark, a 4-bit quantized Qwen-7B model using standard PTQ scored 30.0%. Upgraded with LFQ, the score jumped to 43.3%, nearly closing the gap with the full-precision baseline of 46.6%.
- Instruction Following: On IFEval, LFQ narrowed the performance gap between 4-bit models and their FP counterparts to within a mere 1-2 percentage points.
- Zero Penalty on Baselines: LFQ improved generation quality without degrading performance on standard language understanding benchmarks like MMLU or WikiText2. In some instances, it even offered slight improvements.
- MoE Compatibility: The method proved highly effective even for complex Mixture-of-Experts (MoE) architectures, such as Qwen3-30B.
Limitations and Future Work
While LFQ represents a major step forward for 4-bit quantization, challenges remain:
- The 3-bit Barrier: There is still a noticeable performance drop when moving down to 3-bit quantization, particularly in complex reasoning tasks.
- Weight-Only Focus: The current research focuses exclusively on weight-only quantization. The authors have not yet explored how logit-awareness might benefit "W4A4" (4-bit weights and 4-bit activations) scenarios, which present a much harder optimization landscape.
- Calibration Sensitivity: Like all PTQ methods, LFQ's success depends on the quality of the calibration data, though initial tests show it is relatively robust across different datasets (e.g., C4 vs. WikiText2).
Summary updated