arXivDaily arXiv每日学术速递 周一至周五更新
感恩节,周五至周末无更新,大家顺遂。周一再来吧
arXiv 2406.09041cs.CLcs.AIcs.LG
收藏

ME-Switch:一种面向大语言模型的内存高效专家切换框架

ME-Switch: A Memory-Efficient Expert Switching Framework for Large Language Models

ZIP Lab, Monash University(莫纳什大学ZIP实验室);SenseTime Research(商汤科技研究院);Beihang University(北京航空航天大学);Zhejiang University(浙江大学)

Jing Liu, Ruihao Gong, Mingyang Zhang, Yefei He, Jianfei Cai, Bohan Zhuang

AI总结:

本文提出 ME-Switch 框架,通过显著性感知增量压缩与模型级领域路由,实现多 LLM 专家的低内存、低开销切换服务。

摘要:

大语言模型(LLM)的开发包括先在海量数据上预训练基础模型,随后在任务特定数据上进行微调,以创建专门的专家。服务这些专家会带来严峻的内存挑战,因为将所有专家加载到设备上并不现实,而根据用户请求在专家之间频繁切换又会产生大量 I/O 开销。以往方法将专家权重分解为预训练权重加增量权重,然后使用按输出通道划分的步长对增量权重进行量化,以减小模型体积。然而,这些方法忽视了一个事实:在极低比特宽度下,增量权重的某些输入通道会造成显著的量化误差。此外,现有方法假设用户请求对应的合适模型是预先已知的,但实际情况并非如此。为此,我们提出 ME-Switch,这是一种为服务多个 LLM 量身定制的内存高效专家切换框架。为压缩描述增量权重所需的比特数,我们提出一种显著性感知的增量压缩方法,该方法基于重建误差识别显著输入通道,并应用混合精度量化,将非显著通道降至低位,同时保持显著通道完整,从而在不损害性能的情况下降低存储需求。此外,我们开发了一种模型级路由方法,通过执行领域分类,高效地将用户查询引导至最合适的专家。大量实验表明,ME-Switch 具有可观的内存效率和路由性能。例如,在服务来自 Mistral-7B 系列的三个模型时,ME-Switch 将模型体积减小 1.74 倍,并在指令遵循、数学推理和代码生成任务上保持几乎无损的性能。值得注意的是,我们的方法能够在单张 NVIDIA A100 GPU 上高效服务 16 个 Mistral-7B 模型。

英文摘要:

LLM development involves pre-training a foundation model on massive data, followed by fine-tuning on task-specific data to create specialized experts. Serving these experts can pose significant memory challenges, as loading all experts onto devices is impractical, and frequent switching between experts in response to user requests can incur substantial I/O costs. Previous approaches decompose the expert weights as the pre-trained weights plus delta weights, followed by quantizing the delta weights using output channel-wise step sizes to reduce the model size. However, these methods overlook the fact that certain input channels of delta weights can cause significant quantization errors at extremely low bitwidths. Additionally, existing methods assume that the appropriate model for a user request is known in advance, which is not the case in practice. To this end, we introduce ME-Switch, a memory-efficient expert switching framework tailored for serving multiple LLMs. To condense the number of bits required for describing the delta weights, we propose a salient-aware delta compression method that identifies salient input channels based on reconstruction error and applies mixed-precision quantization, reducing non-salient channels to low bits while keeping salient ones intact, cutting storage demand without compromising performance. Moreover, we develop a model-level routing method that efficiently directs user queries to the most suitable expert by performing domain classification. Extensive experiments show the promising memory efficiency and routing performance of ME-Switch. For example, when serving three models from the Mistral-7B family, ME-Switch reduces the model size by $1.74\times$ and maintains nearly lossless performance on instruction, mathematical reasoning, and code generation tasks. Notably, our method can efficiently serve 16 Mistral-7B models on a single NVIDIA A100 GPU.

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

↑