[论文解读] Knowledge Fusion of Large Language Models
FuseLLM 提出了一种知识融合框架,通过轻量级的持续训练将来自多种不同 LLM 的概率分布外化并合并到目标 LLM 中,从而在推理、常识以及代码生成任务上提升性能。
While training large language models (LLMs) from scratch can generate models with distinct functionalities and strengths, it comes at significant costs and may result in redundant capabilities. Alternatively, a cost-effective and compelling approach is to merge existing pre-trained LLMs into a more potent model. However, due to the varying architectures of these LLMs, directly blending their weights is impractical. In this paper, we introduce the notion of knowledge fusion for LLMs, aimed at combining the capabilities of existing LLMs and transferring them into a single LLM. By leveraging the generative distributions of source LLMs, we externalize their collective knowledge and unique strengths, thereby potentially elevating the capabilities of the target model beyond those of any individual source LLM. We validate our approach using three popular LLMs with different architectures--Llama-2, MPT, and OpenLLaMA--across various benchmarks and tasks. Our findings confirm that the fusion of LLMs can improve the performance of the target model across a range of capabilities such as reasoning, commonsense, and code generation. Our code, model weights, and data are public at \url{https://github.com/fanqiwan/FuseLLM}.
研究动机与目标
- 通过利用现有模型来提出比从头训练单个大型 LLM 更具成本效益的替代方案。
- 将具有不同架构的多个源 LLM 的知识外化并融合到目标 LLM 中。
- 开发一个轻量级的持续训练框架,使跨模型的概率分布对齐并融合。
- 证明融合可在多个基准上超越各个单独源模型和基本基线。
提出的方法
- 将每个源 LLM 的知识表示为其在文本序列上的逐标记概率分布。
- 使用 MinED(最小编辑距离)策略在模型之间对齐标记化以映射分布。
- 使用所选的融合函数(MinCE 或 AvgCE)对齐的分布进行融合,形成目标分布 P_t。
- 训练目标 LLM,使标准 CLM 损失与匹配 Q_t 与 P_t 的融合损失的加权和最小化(L = λ L_CLM + (1-λ) L_Fusion)。
- 在紧凑语料库(MiniPile)上进行持续训练,以传递融合后的知识,而无需从头进行完整再训练。
- 比较两种融合策略(MinCE 和 AvgCE)以及两种对齐标准(MinED 和 EM);结果显示 MinCE 和 MinED 的效果更好。
实验结果
研究问题
- RQ1将多种不同的开源 LLM 的知识融合是否能够产生一个超越每个单独源模型的目标模型?
- RQ2对齐并融合概率分布是否提供了超越权重合并或集成的更优替代方案用于 LLM 融合?
- RQ3标记对齐、融合函数选择以及源模型数量如何影响在推理、常识和代码生成任务上的融合性能?
- RQ4紧凑的持续训练语料库是否足以将融合后的知识有效转移到目标模型?
主要发现
- FuseLLM 在27个 BBH 任务上,相对于原始 Llama-2 7B 实现了平均相对提升 5.16%。
- FuseLLM 在常识基准测试上始终优于基线(平均提升 +1.25%)。
- 在代码生成(MultiPL-E)中,FuseLLM 相对于 Llama-2 CLM 平均提升 6.36%,尽管并不总是达到 OpenLLaMA 或 MPT。
- 融合三种不同的 7B 模型(Llama-2、OpenLLaMA、MPT)带来显著提升,MinCE 在各基准上优于 AvgCE。
- MinED 对齐在所有评估任务中始终优于 exact-match(EM)对齐,且 MinCE 在所有评估任务中优于 AvgCE。
- FuseLLM 在 BBH、CS 和 ME 任务上优于知识蒸馏的 Llama-2 13B 基线,在 BBH 上获得更大的相对提升。
更好的研究,从现在开始
从论文设计到论文写作,大幅缩短您的研究时间。
无需绑定信用卡
本解读由 AI 生成,并经人工编辑审核。