arXiv:2506.07533cs.CV2025-06ACL被引 12

通过专家混合机制实现长文本推理的高效低精度量化

MoQAE: Mixed-Precision Quantization for Long-Context LLM Inference via Mixture of Quantization-Aware Experts

  • 用多专家模型动态选择不同精度的量化方案
  • 在多个数据集上同时提升速度与内存效率
  • 适合追求高吞吐长文本生成的部署场景

长上下文大语言模型推理面临键值缓存(KV cache)内存消耗过高的挑战。现有量化方法难以兼顾效果与效率。本文提出MoQAE,一种基于量化感知专家混合的混合精度量化方法。首先将不同位宽量化配置视为专家,采用传统专家混合(MoE)策略选择最优配置;为避免逐个输入令牌至路由器带来的效率问题,改为分块输入。其次,设计轻量级仅路由器微调流程,通过综合损失函数学习模型准确率与内存占用之间的权衡。最后引入路由冻结(RF)与路由共享(RS)机制,进一步降低推理开销。在多个基准数据集上的实验表明,该方法在效率和有效性上均优于当前最先进的KV缓存量化方案。

原文摘要 · Abstract (English)

One of the primary challenges in optimizing large language models (LLMs) for long-context inference lies in the high memory consumption of the Key-Value (KV) cache. Existing approaches, such as quantization, have demonstrated promising results in reducing memory usage. However, current quantization methods cannot take both effectiveness and efficiency into account. In this paper, we propose MoQAE, a novel mixed-precision quantization method via mixture of quantization-aware experts. First, we view different quantization bit-width configurations as experts and use the traditional mixture of experts (MoE) method to select the optimal configuration. To avoid the inefficiency caused by inputting tokens one by one into the router in the traditional MoE method, we input the tokens into the router chunk by chunk. Second, we design a lightweight router-only fine-tuning process to train MoQAE with a comprehensive loss to learn the trade-off between model accuracy and memory usage. Finally, we introduce a routing freezing (RF) and a routing sharing (RS) mechanism to further reduce the inference overhead. Extensive experiments on multiple benchmark datasets demonstrate that our method outperforms state-of-the-art KV cache quantization approaches in both efficiency and effectiveness.

量化长文本MoE推理优化

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。