QATFactory: A Versatile, Deployment-Aligned Framework for Quantization-aware Training and Distillation of LLMs
Weili Xu, Jisen Li, Yuqing Jian, Chenxi Li, Zhizhou Sha, Yifan Yu, Qingyang Wu, Chenfeng Xu, Zhongzhu Zhou, Tianyi Zhang, Ben Athiwaratkun
Abstract
Large language model (LLM) inference is increasingly moving toward lower precision to realize the throughput of hardware accelerators, but aggressive post-training quantization (PTQ) can degrade model quality. We present QATFactory, an open-source framework for deployment-aligned quantization-aware distillation (QAD) and reinforcement learning (QARL). QATFactory simulates deployment-time quantization while performing matrix multiplications in BF16, allowing models to adapt to quantization noise without requiring training hardware that natively supports the target format; for example, it supports NVFP4 training on H100 GPUs, which lack FP4 Tensor Cores. The framework supports NVFP4, MXFP4, and 's Q4_K format; dense and mixture-of-experts models; and both full-parameter and LoRA-based training. It exports checkpoints directly to vLLM and without an additional lossy conversion step or added inference overhead. With QATFactory, we conduct extensive experiments on models ranging from 8B to 230B parameters and evaluate exported checkpoints in production inference engines. Across models and formats, QAD consistently improves deployed-model quality over strong PTQ baselines. On Qwen3.5-9B, QAD achieves average benchmark accuracies of 68.9% under NVFP4 and 66.0% under MXFP4, outperforming the best PTQ results of 65.4% and 56.4%, respectively. Through our experiments, we found that although both FP4 formats quantize weights and activations at deployment, the best training strategy is format-dependent: NVFP4 generally performs better when only weights are quantized during training, whereas MXFP4 benefits from quantizing both weights and activations. At a fixed training token budget, training on fewer 32K sequences improves average accuracy by 1.9 points over training on more 4K sequences.
Create a lesson
Metadata
- Comments
- Preprint, code at https://github.com/QATFactory/QATFactory
Related papers
RebaseKV: Hiding Prefill Latency in Multi-Agent LLMs via Optimistic Cache Alignment
Shared title terminologycs.LGJiayu Qin, Ankith M S, Harpreet Kaur et al.
FastCI: Efficient GPU-Intensive CI for LLM Training Frameworks
Shared title terminologycs.LGTianshuo Qiao, Naiqian Zheng, Xiaopeng Liu et al.
FedFit: Federated Fine-Tuning of LLMs via Vector-Bank Parameterization and Quantization
Shared title terminologycs.LGHang Zou, Chao Zhang, Yuzhi Yang et al.
HADRec: A Hierarchy-Aware Drug Recommendation Framework by Fusing Molecular Knowledge and Electronic Health Record
Shared title terminologycs.LGJunke Wang, Hongshun Ling, Li Zhang et al.
Training-Aware Target Coverage for Synthetic Data Selection
Shared title terminologycs.LGYang Ba, Michelle V. Mancenido, Rong Pan
XOR-Trellis: Ultra-Low-Complexity Dequantization and Curvature-Aware Hadamard-Free LLM Quantization
Shared title terminologycs.LGXiaofan Que, Nir Elkayam, Spandan Pyakurel et al.