Introduction
Post-Training Quantization (PTQ) is a critical technique for deploying Large Language Models (LLMs) on resource-constrained hardware. By reducing weight precision from 16-bit floating point (FP16) to low-bit formats like 4-bit or 3-bit, PTQ significantly lowers memory and computational requirements. However, aggressive quantization often leads to performance degradation. The First-Order Enhanced Method (FOEM) addresses a fundamental oversight in existing PTQ frameworks: the neglect of first-order gradient information during error compensation.
The Problem: Accumulated Deviation in PTQ
Standard PTQ methods, such as GPTQ, utilize a second-order Taylor expansion to minimize the reconstruction error of layer outputs. These methods typically assume that a pre-trained model resides at a local minimum where the first-order gradient is zero. Consequently, they ignore the first-order term in their optimization objectives.
However, FOEM identifies a "well-trained trap." As quantization proceeds column-by-column, the "latent" weights—the floating-point weights adjusted to compensate for previous quantization errors—drift away from their original values. This accumulated deviation means the model is no longer at the local minimum, making the first-order gradient non-negligible. Ignoring this "first-order error" results in suboptimal weight updates and significant accuracy loss, particularly in low-bit (e.g., 3-bit) regimes.
The FOEM Method: Re-introducing First-Order Terms
FOEM re-incorporates the first-order term into the quantization optimization objective. To avoid the prohibitive computational cost of calculating exact gradients via backpropagation for every step, FOEM employs a clever gradient approximation: $g(W) \approx (W - \mathbb{W})H$, where $W$ is the current latent weight, $\mathbb{W}$ is the original weight, and $H$ is the Hessian matrix.
Since the Hessian matrix is already computed for second-order compensation in methods like GPTQ, FOEM obtains gradient information with minimal additional overhead. To ensure stability, the authors introduce a stabilization factor ($\beta \approx 0.1$) that prevents large gradients from amplifying approximation errors.
Experimental Evaluation
The researchers evaluated FOEM across a diverse range of models, including Llama-2, Llama-3, Llama-3.2, Qwen3, Phi-1.5B, and Mistral-7B. Performance was measured using perplexity (WikiText2, C4) and zero-shot accuracy on reasoning tasks (PIQA, ARC, HellaSwag, etc.), as well as 5-shot MMLU accuracy.
Key Results and Analysis
FOEM consistently outperforms baseline methods like RTN, GPTQ, and GPTAQ, especially at 3-bit quantization.
Notable highlights include:
- Llama3-8B (3-bit): FOEM achieved a 17.3% reduction in perplexity compared to GPTQ and improved MMLU accuracy from 53.8% to 56.1%.
- Phi-1.5B (3-bit): FOEM was the only method to maintain an MMLU score above 40, demonstrating its robustness for smaller models under extreme compression.
- Efficiency: FOEM is faster than GPTAQ. For instance, quantizing Llama3-8B took approximately 829 seconds with FOEM, compared to 1112 seconds for GPTAQ, while delivering superior accuracy.
The success of FOEM on the Mamba-1.4B architecture (a non-Transformer State Space Model) further suggests that first-order error is a universal challenge in sequential PTQ, regardless of model architecture.
Conclusion and Future Work
FOEM demonstrates that first-order gradients are essential for accurate weight compensation in low-bit LLM quantization. By providing a computationally efficient way to include these terms, FOEM sets a new standard for PTQ accuracy. Future research may explore automated tuning of the stabilization factor $\beta$ and the application of FOEM to even more aggressive 2-bit quantization scenarios. Its "plug-and-play" nature makes it a strong candidate for integration into mainstream quantization libraries.
Summary updated