arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2605.14844cs.LGcs.AI
收藏

XFP:面向LLM推理的质量导向自适应码本量化与稀疏异常分离

XFP: Quality-Targeted Adaptive Codebook Quantization with Sparse Outlier Separation for LLM Inference

Gemini Stiftung(吉姆米基金会)

Thomas Witt

AI总结:

XFP通过自适应码本量化和稀疏异常分离技术,实现高质量LLM推理,无需Hessian或校准数据,支持动态调整码本大小和异常预算,提升推理速度和精度。

摘要:

我们引入XFP,一种动态权重量化器,用于LLM推理,颠覆传统流程:操作员可指定每通道余弦相似度的严格下限(注意力和共享专家一个严格下限,路由专家MoE一个宽松下限);XFP自动确定码本大小、异常预算和每层打包方式——无需Hessian、无需校准数据、无需手动位宽选择。每个权重矩阵被分解为稀疏fp16异常残差和密集的子字节索引张量,进入每组学习的码本。两种存储模式共享一个自动选择的前端和一个融合解码内核:V2(每通道Lloyd)和V2a(每层共享L=32码本的库)。在Qwen3.5-122B-A10B上使用V2时,XFP在工作站硬件(RTX PRO 6000 Blackwell,TP=2)上达到138 tok/s单流解码速度,94.49% GSM8K严格匹配(3种子,n=3957),比Marlin INT4在TP=1时快49%。对于无法容纳在目标内存范围内的模型,我们提出H-Process:一种基于质量的迭代过程,通过两个余弦阈值找到模型刚好适应仍能产生合理输出的操作点。三个约束定义其搜索空间:操作员设置的阈值、量化加载时的OOM边界和生成时的垃圾边界(余弦相似度引导;基准测试验证)。在Qwen3.5-397B-A17B(512路由专家/层)上,H-Process将全部专家群体放入2x96 GB内存,约3.4有效位,实现100.9 tok/s长输出解码,66.72% GSM8K严格匹配在完整1319问题集上(单种子提交;多种子评估进行中),在内存、吞吐量和精度方面均超越带路由专家剪枝的INT4。

英文摘要:

We introduce XFP, a dynamic weight quantizer for LLM inference that inverts the conventional workflow: the operator specifies reconstruction quality floors on per-channel cosine similarity (one strict floor for attention and shared experts, one lazy floor for routed-expert MoE); XFP determines codebook size, outlier budget, and packing per layer automatically -- no Hessian, no calibration data, no manual bit-width selection. Each weight matrix is decomposed into a sparse fp16 outlier residual and a dense sub-byte index tensor into a per-group learned codebook. Two storage modes share one auto-select frontend and one fused decode kernel: V2 (per-channel Lloyd) and V2a (shared library of L=32 codebooks per layer). On Qwen3.5-122B-A10B under V2, XFP reaches 138 tok/s single-stream decode on workstation hardware (RTX PRO 6000 Blackwell, TP=2) at 94.49% GSM8K strict-match (3 seeds, n=3957), and is 49% faster than Marlin INT4 at TP=1. For models that do not fit in the target memory envelope, we present the H-Process: a quality-driven iteration over the two cosine thresholds that finds the operating point at which the model just fits while still producing sensible output. Three constraints define its search space: the operator-set thresholds, an OOM boundary at quantize-on-load, and a garbage boundary in generation (cosine similarity steers; benches verify). On Qwen3.5-397B-A17B (512 routed experts/layer), the H-Process fits the full expert population into 2x96 GB at ~3.4 effective bits and delivers 100.9 tok/s long-output decode at 66.72% GSM8K strict-match on the full 1319-problem set (single seed at submission; multi-seed evaluation in progress), exceeding INT4 with routed-expert pruning on memory, throughput, and accuracy simultaneously.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑