研究专家模型压缩误差如何影响推理准确率,发现浅层压缩影响小,深层压缩反而可能提升性能。
MoE-Compression: How the Compression Error of Experts Affects the Inference Accuracy of MoE Model?
- 用有界有损压缩算法压缩非激活专家,降低显存传输开销。
- 浅层专家在有界误差下准确率几乎不变,中层误差会显著降低性能。
- 深层专家引入误差有时能提升准确率,适合对精度容忍度高的场景。
随着混合专家(MoE)推理模型在大语言模型学习中的广泛应用,如何在有限的GPU内存约束下高效服务MoE模型已成为重要挑战。将未激活的专家卸载到主内存被证明是一种有效方法,但随之带来专家在显存与主内存间传输的开销问题。为此,我们提出采用有界有损压缩算法(如SZ3和CuSZp)对非激活专家进行压缩,以减少推理过程中的数据传输开销。我们在多个基准测试上进行了广泛实验,全面分析了不同专家在压缩引入误差后对整体推理准确率的影响。结果表明,负责注意力机制和输入令牌向量表示转换的浅层专家,在有界误差下表现出极小的准确率下降;而作为模型推理核心的中层专家,其误差会显著损害推理性能;有趣的是,主要负责指令遵循与输出整合的深层专家引入有界误差后,有时反而能提升推理准确率。
原文摘要 · Abstract (English)
With the widespread application of Mixture of Experts (MoE) reasoning models in the field of LLM learning, efficiently serving MoE models under limited GPU memory constraints has emerged as a significant challenge. Offloading the non-activated experts to main memory has been identified as an efficient approach to address such a problem, while it brings the challenges of transferring the expert between the GPU memory and main memory. We need to explore an efficient approach to compress the expert and analyze how the compression error affects the inference performance. To bridge this gap, we propose employing error-bounded lossy compression algorithms (such as SZ3 and CuSZp) to compress non-activated experts, thereby reducing data transfer overhead during MoE inference. We conduct extensive experiments across various benchmarks and present a comprehensive analysis of how compression-induced errors in different experts affect overall inference accuracy. The results indicate that experts in the shallow layers, which are primarily responsible for the attention mechanism and the transformation of input tokens into vector representations, exhibit minimal degradation in inference accuracy when subjected to bounded errors. In contrast, errors in the middle-layer experts, which are central to model reasoning, significantly impair inference accuracy. Interestingly, introducing bounded errors in the deep-layer experts, which are mainly responsible for instruction following and output integration, can sometimes lead to improvements in inference accuracy.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。