将多个安全检测模型合并为一个,提升效率并保持性能。
HM3: Heterogeneous Multi-Class Model Merging
- 提出HM3方法,无需训练即可融合不同标签空间的分类模型。
- 合并后推理速度最高提升44%,部分模型F1得分超越原模型。
- 自合并实验揭示低性能模型更受益于任务向量压缩,启发模型调优新思路。
基础语言模型部署中常引入辅助防护模型以过滤或分类文本,识别越狱尝试、偏见或有毒内容,或确保主题一致性。这些额外模型增加推理复杂度与成本,尤其因多数为大语言模型。为此,我们探索无需训练的模型融合技术,将多模型整合为单一多功能模型。提出异构多类别模型融合(HM3),适用于标签空间不同的多分类器。不同于需大量训练的参数高效微调(如LoRA),近期进展实现无需训练的模型融合。实验显示,基于BERT的防护模型经融合后,平均F1分数高于原始模型,且推理时间最多减少44%。引入自融合机制评估任务向量密度降低的影响,发现表现较差的仇恨言论分类器从中获益,而高性能分类器则无明显改善,提示任务向量压缩在模型调优中的适用性存疑。
原文摘要 · Abstract (English)
Foundation language model deployments often include auxiliary guard-rail models to filter or classify text, detecting jailbreak attempts, biased or toxic output, or ensuring topic adherence. These additional models increase the complexity and cost of model inference, especially since many are also large language models. To address this issue, we explore training-free model merging techniques to consolidate these models into a single, multi-functional model. We propose Heterogeneous Multi-Class Model Merging (HM3) as a simple technique for merging multi-class classifiers with heterogeneous label spaces. Unlike parameter-efficient fine-tuning techniques like LoRA, which require extensive training and add complexity during inference, recent advancements allow models to be merged in a training-free manner. We report promising results for merging BERT-based guard models, some of which attain an average F1-score higher than the source models while reducing the inference time by up to 44%. We introduce self-merging to assess the impact of reduced task-vector density, finding that the more poorly performing hate speech classifier benefits from self-merging while higher-performing classifiers do not, which raises questions about using task vector reduction for model tuning.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。