Downloads · 30 days
62
11% of all-time downloads
FuseAI/FuseChat-Gemma-2-9B-Instruct
FuseChat-Gemma-2-9B-Instruct is a machine learning model from FuseAI. Use it for the machine learning task on the model card, and read the license before you ship it in a product.
Downloads · 30 days
62
11% of all-time downloads
All-time downloads
569
Public
Parameters
9.2B
55.5 GB on disk
Likes
7
Public
Click a slice to open those files.
.safetensors18.5 GB · 100%
From the Hugging Face model README
We present FuseChat-3.0, a series of models crafted to enhance performance by integrating the strengths of multiple source LLMs into more compact target LLMs. To achieve this fusion, we utilized four powerful source LLMs: Gemma-2-27B-It, Mistral-Large-Instruct-2407, Qwen-2.5-72B-Instruct, and Llama-3.1-70B-Instruct. For the target LLMs, we employed three widely-used smaller models—Llama-3.1-8B-Instruct, Gemma-2-9B-It, and Qwen-2.5-7B-Instruct—along with two even more compact models—Llama-3.2-3B-Instruct and Llama-3.2-1B-Instruct. The implicit model fusion process involves a two-stage training pipeline comprising Supervised Fine-Tuning (SFT) to mitigate distribution discrepancies between target and source LLMs, and Direct Preference Optimization (DPO) for learning preferences from multiple source LLMs. The resulting FuseChat-3.0 models demonstrated substantial improvements in tasks related to general conversation, instruction following, mathematics, and coding. Notably, when Llama-3.1-8B-Instruct served as the target LLM, our fusion approach achieved an average improvement of 6.8 points across 14 benchmarks. Moreover, it showed significant improvements of 37.1 and 30.1 points on instruction-following test sets AlpacaEval-2 and Arena-Hard respectively. We have released the FuseChat-3.0 models and datasets on Huggingface.
Combining the strengths of multiple large language models (LLMs) represents a promising approach to enhance individual model capabilities. Model fusion is a technique that integrates the strengths of robust source LLMs into a target LLM.
Previous iterations of the FuseChat series employed probabilistic distribution matrices generated by source models to transfer knowledge to target models. We refer to this method as explicit model fusion (EMF) because it involves a well-defined knowledge transfer process. While applicable to models with varying architectures and sizes, and without increasing memory overhead during inference, this approach presents notable challenges such as vocabulary alignment and the merging of distribution matrices from different LLMs. These issues complicate model fusion, reduce its efficiency, and may introduce noise and errors and affect the fusion results.
FuseChat-3.0, however, takes a different approach by enhancing a single LLM through implicit learning from robust open-source LLMs, a process we term implicit model fusion (IMF). The concept of IMF has been widely utilized to improve the performance of weaker models. For instance, a weak model can be boosted through fine-tuning with outputs from stronger LLMs. Moreover, a reward model can be trained using outputs from various LLMs, enabling it to learn and capture the differences in capabilities between the LLMs. Zephyr further collects responses from multiple LLMs and ranks them with GPT-4 to obtain preference data for training the policy. Inspired by recent alignment techniques, we propose an IMF method to transfer the capabilities of source LLMs to a target LLM through preference optimization.
Our IMF method follows a three-stage process aimed at effectively transferring capabilities from source LLMs to a target LLM. First, during dataset construction, we sample N responses from each of the source LLMs and annotate these responses using an external reward model. Second, in the supervised fine-tuning (SFT) stage, we fine-tune the target model using the best responses, which not only enhances the target model's capabilities but also helps mitigate the distributional gap between the source and target models. Finally, in the direct preference optimization (DPO) stage, we optimize the target model by using the best and worst responses from the source models as preference pairs, further enhancing the target model's performance. The complete pipeline will be detailed in the following paragraph.
Our datasets were designed to enhance model's instruction following, general conversation, mathematics, coding, and Chinese-language capabilities. We selected data from open-source community datasets, applying targeted filtering and preprocessing. Key datasets and filtering criteria included:
For each dataset's prompts, we synthesized responses mainly from four different series of source models, specifically Gemma-2-27b-It, Mistral-Large-Instruct-2407, Qwen-2.5-72B-Instruct, and Llama-3.1-70B-Instruct.
The sampling parameters for different models are detailed in Table below.
<table class="js-sort-table table hidden"> <tr> <td class="js-sort-string"><strong>Source LLMs</strong></td> <td class="js-sort-string"><strong>Sampling Params</strong></td> </tr> <tr> <td>Gemma-2-27b-It</td> <td>Temp 0.8 Top-p 0.95</td> </tr> <tr> <td>Mistral-Large-Instruct-2407</td> <td>Temp 0.8 Top-p 0.95</td> </tr> <tr> <td>Qwen-2.5-(Math)-72B-Instruct</td> <td>Temp 0.7 Top-p 0.8 Repetition penalty 1.05</td> </tr> <tr> <td>Llama-3.1-70B-Instruct</td> <td>Temp 0.8 Top-p 0.95</td> </tr> </table>Unlike the original approach in WRPO, which constructs preference pairs from target model responses and treats source model responses as additional positive samples, our research in mathematics and coding domains revealed that sampling from multiple source models yields more and higher-quality preference pair data. Based on this insight, FuseChat-3.0 leverages the best and worst response pairs generated by source models as preference pairs to optimize the target model. This refined approach not only preserves the core advantages of implicit model fusion but also results in a more streamlined and practical implementation, making it particularly well-suited for real-world applications within the open-source community.
Our final dataset comprised 158,667 total entries, with 94,539 entries for the SFT phase and 64,128 preference pairs for the DPO phase. The overall composition of the datasets is shown below.
<table class="js-sort-table table hidden"> <tr> <td class="js-sort-string"><strong>Dataset</strong></td> <td class="js-sort-number"><strong>Total Count</strong></td> <td class="js-sort-number"><strong>SFT Count</strong></td> <td class="js-sort-number"><strong>DPO Count</strong></td> <td class="js-sort-string"><strong>Category</strong></td> </tr> <tr> <td><a href="https://huggingface.co/datasets/openbmb/UltraFeedback" target="_blank">UltraFeedback</a></td> <td>51098</td> <td>20439</td> <td>30659</td> <td>Instruction following</td> </tr> <tr> <td><a href="https://huggingface.co/datasets/Magpie-Align/Magpie-Pro-DPO-100K-v0.1" target="_blank">Magpie-Pro-DPO</a></td> <td>20374</td> <td>8149</td> <td>12225</td> <td>Instruction following</td> </tr> <tr> <td><a href="https://huggingface.co/datasets/nvidia/HelpSteer2" target="_blank">HelpSteer2</a></td> <td>9435</td> <td>3774</td> <td>5661</td> <td>Instruction following</td> </tr> <tr> <td><a href="https://huggingface.co/datasets/nvidia/OpenMathInstruct-2" target="_blank">OpenMathInstruct-2</a></td> <td>51803</td> <td>40188</td> <td>11615</td> <td>Mathematics</td> </tr> <tr> <td><a href="https://huggingface.co/datasets/greengerong/leetcode" target="_blank">leetcode</a></td> <td>3113</td> <td>1877</td> <td>1236</td> <td>Coding</td> </tr> <tr> <td><a href="https://huggingface.co/datasets/bigcode/self-oss-instruct-sc2-exec-filter-50k" target="_blank">self-oss-instruct-sc2</a></td> <td>12892</td> <td>10160</td> <td>2732</td> <td>Coding</td> </tr> <tr> <td><a href="https://huggingface.co/datasets/llamafactory/alpaca_gpt4_zh" target="_blank">alpaca_gpt4_zh</a></td> <td>2471</td> <td>2471</td> <td>0</td> <td>Chinese Language</td> </tr> <tr> <td><a href="https://huggingface.co/datasets/Magpie-Align/Magpie-Qwen2-Pro-200K-Chinese" target="_blank">Magpie-Qwen2-Pro</a></td> <td>7481</td> <td>7481</td> <td>0</td> <td>Chinese Language</td> </tr> <tr> <td><strong>Total</strong></td> <td>158667</td> <td>94539</td> <td>64128</td> <td>All</td> </tr> </table>The implicit model fusion process involves a two-stage training pipeline comprising Supervised Fine-Tuning (SFT) to mitigate distribution discrepancies between target and source LLMs, and Direct Preference Optimization (DPO) for learning preferences from multiple source LLMs.
We used Llama-Factory as our fine-tuning library. For all target models, we fine-tuned for 3 epochs, with a batch size of 128 and a maximum sequence length of 2048 tokens. A cosine learning rate schedule with a warmup ratio of 0.1 is employed. Different models' learning rates are shown in the table below.
<table class="js-sort-table table hidden"> <tr> <td class="js-sort-string"><strong>Target Models</strong></td> <td class="js-sort-string"><strong>Learning rate</strong></td> </tr> <tr> <td>Llama-3.1-8B-Instruct</td> <td>5e-6</td> </tr> <tr> <td>Qwen-2.5-7B-Instruct</td> <td>2e-6</td> </tr> <tr> <td>Gemma-2-9B-It</td> <td>2e-6</td> </tr> <tr> <td>Llama-3.2-(1/3)B-Instruct</td> <td>5e-6</td> </tr> </table>We used alignment-handbook as our DPO training library. For all Target SFT models, we trained for 1 epoch, set maximum sequence length to 2048, used cosine learning rate with a warmup ratio of 0.1. We saved checkpoints every 100 steps and selected the best from the last two checkpoints. For Llama-3.1 and Llama-3.2 series models, we introduced length normalization in DPO training, as shown in the formula below.
Different models' hyperparameters are shown in the table below.
<table class="js-sort-table table hidden"> <tr> <td class="js-sort-string"><strong>Target SFT Models</strong></td> <td class="js-sort-string"><strong>Learning rate</strong></td> <td class="js-sort-string"><strong>β</strong></td> <td class="js-sort-string"><strong>Length normalize</strong></td> </tr> <tr> <td>FuseChat-Llama-3.1-8B-SFT</td> <td>8e-7</td> <td>10</td> <td>Yes</td> </tr> <tr> <td>FuseChat-Qwen-2.5-7B-SFT</td> <td>3e-7</td> <td>0.01</td> <td>No</td> </tr> <tr> <td>FuseChat-Gemma-2-9B-SFT</td> <td>5e-7</td> <td>0.01</td> <td>No</td> </tr> <tr> <td>FuseChat-Llama-3.2-(1/3)B-SFT</td> <td>1e-6</td> <td>10</td> <td>Yes</td> </tr> </table>The evaluation of instruction-tuned models mainly focuses on the model performance of instruction following, natural language understanding, general question answering, reasoning, mathematics, coding, etc. For the evaluation of FuseChat-3.0, we include 14 benchmarks and organize them into four categories:
We include more details and release our evaluation code at FuseEval.
The evaluation results of five series fused models are as follows, showing that our FuseChat-3.0 models achieved varying degrees of improvement across different target models. When selecting Llama-3.1-8B-Instruct as the target model, our fusion model FuseChat-Llama-3.1-8B-Instruct achieved an average performance improvement of 6.8 points across 14 benchmarks. Notably, it showed significant improvements of 37.1 and 30.1 points on instruction-following test sets AlpacaEval-2 and Arena-Hard respectively. Additionally, FuseChat-Llama-3.1-8B-Instruct outperformed AllenAI's recently released Llama-3.1-Tulu-3-8B model on all benchmarks except GSM8K and GPQA-Diamond. All these results demonstrate the effectiveness and success of FuseChat-3.0.
@inproceedings{yang2025weightedreward,
title={Weighted-Reward Preference Optimization for Implicit Model Fusion},
author={Ziyi Yang and Fanqi Wan and Longguang Zhong and Tianyuan Shi and Xiaojun Quan},
booktitle={The Thirteenth International Conference on Learning Representations},
year={2025},
url={https://openreview.net/forum?id=fq24pEb8SL}
}