[Paper Review] Knowledge Fusion of Large Language Models
FuseLLM proposes a knowledge fusion framework that externalizes and merges probabilistic distributions from multiple diverse LLMs into a target LLM via lightweight continual training, improving performance across reasoning, commonsense, and code generation tasks.
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}.
Motivation & Objective
- Motivate a cost-effective alternative to training a single large LLM from scratch by leveraging existing models.
- Externalize and fuse the knowledge of multiple source LLMs with different architectures into a target LLM.
- Develop a lightweight continual training framework that aligns and fuses probabilistic distributions across models.
- Demonstrate that fusion can outperform individual sources and basic baselines across multiple benchmarks.
Proposed method
- Represent each source LLM's knowledge as its token-level probabilistic distribution over a text sequence.
- Align tokenizations across models using a MinED (minimum edit distance) strategy to map distributions.
- Fuse the aligned distributions with a chosen fusion function (MinCE or AvgCE) to form a target distribution P_t.
- Train the target LLM to minimize a weighted sum of the standard CLM loss and a fusion loss that matches Q_t to P_t (L = λ L_CLM + (1-λ) L_Fusion).
- Use continual training on a compact corpus (MiniPile) to transfer fused knowledge without requiring full retraining from scratch.
- Compare two fusion strategies (MinCE and AvgCE) and two alignment criteria (MinED and EM); show MinCE and MinED yield better results.
Experimental results
Research questions
- RQ1Can knowledge fusion of multiple diverse open-source LLMs produce a target model that surpasses each individual source model?
- RQ2Does aligning and fusing probabilistic distributions offer a superior alternative to weight merging or ensembling for LLM fusion?
- RQ3How do token alignment, fusion function choice, and the number of source models affect fusion performance across reasoning, commonsense, and code generation tasks?
- RQ4Is a compact continual-training corpus sufficient to transfer fused knowledge effectively to the target model?
Key findings
- FuseLLM achieves average relative improvements of 5.16% over the original Llama-2 7B across 27 BBH tasks.
- FuseLLM consistently outperforms baselines on the Common Sense benchmark (average +1.25%).
- In code generation (MultiPL-E), FuseLLM shows an average gain of 6.36% over Llama-2 CLM, though not always matching OpenLLaMA or MPT.
- Fusing three diverse 7B models (Llama-2, OpenLLaMA, MPT) yields notable gains, with MinCE outperforming AvgCE across benchmarks.
- MinED alignment consistently outperforms exact-match (EM) alignment, and MinCE outperforms AvgCE in all evaluated tasks.
- FuseLLM outperforms a knowledge-distilled Llama-2 13B baseline on BBH, CS, and ME tasks, with larger relative gains on BBH.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.