InfiFPO: Implicit Model Fusion via Preference Optimization in Large Language Models
Organizations: The Hong Kong Polytechnic University (PolyU) · Zhejiang University · PolyU-Daya Bay Technology and Innovation Research Institute
Abstract
Model fusion combines multiple Large Language Models (LLMs) with different strengths into a more powerful, integrated model through lightweight training methods. Existing works on model fusion focus primarily on supervised fine-tuning (SFT), leaving preference alignment (PA) --a critical phase for enhancing LLM performance--largely unexplored. The current few fusion methods on PA phase, like WRPO, simplify the process by utilizing only response outputs from source models while discarding their probability information. To address this limitation, we propose InfiFPO, a preference optimization method for implicit model fusion. InfiFPO replaces the reference model in Direct Preference Optimization (DPO) with a fused source model that synthesizes multi-source probabilities at the sequence level, circumventing complex vocabulary alignment challenges in previous works and meanwhile maintaining the probability information. By introducing probability clipping and max-margin fusion strategies, InfiFPO enables the pivot model to align with human preferences while effectively distilling knowledge from source models. Comprehensive experiments on 11 widely-used benchmarks demonstrate that InfiFPO consistently outperforms existing model fusion and preference optimization methods. When using Phi-4 as the pivot model, InfiFPO improve its average performance from 79.95 to 83.33 on 11 benchmarks, significantly improving its capabilities in mathematics, coding, and reasoning tasks.
Figures & tables
| Types | General Data | Math Data | Code Data |
| Dataset | Infinity-Instruct | NuminaMath-1.5 | KodCode-V1-SFT |
| Original Size | 1.4M | 1.4M | 268k |
| Sample Size | 60K | 45K | 45K |
| Models | Math | Code | General Reasoning | InstFol | Text Reasoning | Avg | Model Size | GPU Hours | ||||||
| GSM8K | MATH | ThmQA | MBPP | HEval | BBH | ARC | MMLU | IFEval | DROP | HS | ||||
| Pivot Model | ||||||||||||||
| Phi-4 | 87.41 | 80.04 | 51.12 | 75.40 | 83.54 | 68.84 | 93.90 | 85.62 | 77.34 | 88.67 | 87.62 | 79.95 | 14B | 1.0M |
| Source Models | ||||||||||||||
| Qwen2.5-Instruct | 91.13 | 78.16 | 47.25 | 81.70 | 83.54 | 77.59 | 92.20 | 80.22 | 85.01 | 85.56 | 88.28 | 80.97 | 14B | 1.8M |
| Mistral-Small | 92.42 | 69.84 | 48.50 | 68.80 | 84.15 | 81.59 | 91.86 | 81.69 | 82.25 | 86.52 | 91.84 | 79.95 | 24B | 1.6M |
| Method | Math | Code | All |
| WRPO | 75.94 0.0 | 84.84 0.0 | 82.80 0.0 |
| InfiFPO | 76.31 0.4 | 85.20 0.2 | 83.32 0.5 |
| IPO | 75.29 0.0 | 83.93 0.0 | 82.38 0.0 |
| InfiFPO | 76.37 1.1 | 84.54 0.5 | 83.15 0.8 |
| Method | LN | PC | Math | Code | All |
| Phi4 | 72.85 0.0 | 79.47 0.0 | 79.95 0.0 | ||
| InfiFPO | 72.72 0.1 | 78.42 1.0 | 79.51 0.4 | ||
| ✓ | 75.06 2.4 | 83.99 4.5 | 82.86 2.9 | ||
| ✓ | 74.39 1.3 | 81.32 1.9 | 81.41 1.5 | ||
| ✓ | ✓ | 75.80 3.1 | 85.15 5.6 | 83.33 3.3 |
| Num | Math | Code | All |
| 1 | 74.91 0.0 | 81.91 0.0 | 81.54 0.0 |
| 2 | 75.53 0.6 | 82.49 0.5 | 82.20 0.6 |
| 3 | 75.60 0.6 | 83.99 2.0 | 82.74 1.2 |
| 4 | 75.25 0.3 | 85.21 3.3 | 83.14 1.6 |
| 5 | 75.80 0.8 | 85.15 3.2 | 83.33 1.7 |
Appendix figures & tables11 assets
Supplementary material from the paper’s appendix.
Appendix
| Dataset | Prompt Format |
| IFEval | {prompt}\nPlease directly give the correct answer: |
| ARC-C | Question: {question}\nA . {textA}\nB . {textB}\nC . {textC}\nD . {textD}\nDirectly give me the correct answer option, and then explain: |
| Hellaswag | {ctx}\nQuestion : Which ending makes the most sense?\nDirectly give me the correct choice, you can further explain it or not.\nA . {A}\nB . {B}\nC . {C}\nD . {D}\nYou may choose from ’A’, ’B’, ’C’, ’D’.\nAnswer : |
| BBH | Follow the given examples and answer the question.\n {_hint}\nQ : {{input}}\nA : Let’s think step by step. |
| DROP | You will be asked to read a passage and answer a question. Some examples of passages and Q&A are provided below.\n {drop_examples}\n \n ## Your Task\n ---\n {prompt}\nThink step by step, then write a line of the form "Answer: $ANSWER" at the end of your response. |
| MMLU | {_hint}\nQuestion : {{input}}\nA . {{A}}\nB . {{B}}\nC . {{C}}\nD . {{D}}\n \nFor simple problems:\nDirectly provide the answer with minimal explanation.\n \nFor complex problems:\nUse this step-by-step format:\n #### Step 1: [Concise description]\n [Brief explanation]\n #### Step 2: [Concise description]\n [Brief explanation]\n \nRegardless of the approach, always conclude with:\nThe answer is [the_answer_letter].\nwhere the [the_answer_letter] is one of A, B, C or D.\n \nLet ’s think step by step. |
| Model/Method | Math | Code | All |
| Phi-4 | 72.86 | 79.47 | 79.95 |
| InfiFusion | 73.23 | 82.43 | 81.44 |
| SFT-WRPO | 73.15 | 82.21 | 81.58 |
| InfiFPO | 73.59 | 83.15 | 82.19 |
| Model / Method | Math | Code | All |
| Qwen-2.5-Instruct | 72.18 | 82.62 | 80.97 |
| FuseChat | 75.96 | 83.50 | 83.22 |
| InfiFusion | 76.09 | 83.38 | 83.16 |
| SFT-WRPO | 76.42 | 84.29 | 83.46 |
| InfiFPO | 76.46 | 85.41 | 84.01 |
| Model / Method | Math | Code | All |
| Skywork-Reward-Llama-3.1-8B-v0.2 | |||
| Phi-4 | 72.86 | 79.47 | 79.95 |
| InfiFusion | 74.32 | 82.47 | 81.96 |
| SFT-WRPO | 74.28 | 83.44 | 81.93 |
| InfiFPO | 74.53 | 84.88 | 82.67 |
| ArmoRM-Llama3-8B-v0.1 | |||
| Model / Method | Math | Code | All |
| Phi-4 | 72.86 | 79.47 | 79.95 |
| FuseChat | 73.54 | 82.97 | 82.12 |
| - without sequence alignment | 72.30 | 79.16 | 79.43 |
| InfiFusion | 75.54 | 82.67 | 82.38 |
| - without sequence alignment | 73.47 | 79.98 | 80.11 |
| InfiFPO | 75.60 | 83.99 | 82.74 |
| Model / Method | 25k | 50k | 75k | 100k |
| Phi-4 | 79.95 | 79.95 | 79.95 | 79.95 |
| SFT-WRPO | 81.58 | 82.14 | 82.80 | 82.89 |
| InfiFPO | 82.55 | 82.99 | 83.33 | 83.56 |
| Model / Method | Math | Code | All |
| Qwen2.5-1.5B-Instruct | |||
| Base Model | 46.02 | 47.16 | 50.31 |
| InfiFusion | 49.59 | 50.49 | 53.11 |
| SFT-WRPO | 50.16 | 51.21 | 53.70 |
| InfiFPO | 50.70 | 52.75 | 54.61 |
| Qwen2.5-3B-Instruct | |||
| Model type | Logps (preferred) | Logps (dispreferred) |
| Pivot model | -0.4 | -0.7 |
| Source model 1 | -0.6 | -0.5 |
| Source model 2 | -0.3 | -0.8 |
| Model type | Logps (preferred) | Logps (dispreferred) | Selected |
| Pivot model | -0.4 | -0.7 | - |
| Source model 1 | -0.4 | -0.7 | - |
| Source model 2 | -0.3 | -0.8 | ✓ |
| OpenAi HumanEval - Task Type: Code Generation | |
| InfiFPO Behavior | Baseline Behavior |
| "prompt_1": "from typing import List\n\n\ndef remove_duplicates(numbers: List[int]) ->List[int]:\n """ From a list of integers, remove all elements that occur more than once.\n Keep order of elements left the same as in the input.\n >>>remove_duplicates([1, 2, 3, 2, 4])\n [1, 3, 4]\n """\n" | |
| "completion": "def remove_duplicates(numbers: List[int]) ->List[int]:\n """ From a list of integers, remove all elements that occur more than once.\n Keep order of elements left the same as in the input.\n >>>remove_duplicates([1, 2, 3, 2, 4])\n [1, 3, 4]\n """\n counts = {}\n for number in numbers:\n counts[number] = counts.get(number, 0) + 1\n \n result = []\n for number in numbers:\n if counts[number] == 1:\n result.append(number)\n \n return result\n","result": "passed","passed": true | "completion": "from typing import List\n\ndef remove_duplicates(numbers: List[int]) ->List[int]:\n """ From a list of integers, remove all elements that occur more than once.\n Keep order of elements left the same as in the input.\n >>>remove_duplicates([1, 2, 3, 2, 4])\n [1, 3, 4]\n """\n seen = set()\n duplicates = set()\n result = []\n\n for number in numbers:\n if number in duplicates:\n continue\n if number in seen:\n duplicates.add(number)\n else:\n seen.add(number)\n result.append(number)\n\n return result\n","result": "failed: ","passed": false |
| "prompt_2": "\nFIX = """\nAdd more test cases.\n"""\n\ndef vowels_count(s):\n """Write a function vowels_count which takes a string representing\n a word as input and returns the number of vowels in the string.\n Vowels in this case are ’a’, ’e’, ’i’, ’o’, ’u’. Here, ’y’ is also a\n vowel, but only when it is at the end of the given word.\n\n Example:\n >>>vowels_count("abcde")\n 2\n >>>vowels_count("ACEDY")\n 3\n """\n" | |
| "completion": "def vowels_count(s):\n """Write a function vowels_count which takes a string representing\n a word as input and returns the number of vowels in the string.\n Vowels in this case are ’a’, ’e’, ’i’, ’o’, ’u’. Here, ’y’ is also a\n vowel, but only when it is at the end of the given word.\n\n Example:\n >>>vowels_count("abcde")\n 2\n >>>vowels_count("ACEDY")\n 3\n """\n vowels = "aeiouAEIOU"\n count = 0\n for char in s:\n if char in vowels:\n count += 1\n if s[-1].lower() == ’y’:\n count += 1\n return count\n", "result": "passed", "passed": true | "completion": "def vowels_count(s):\n """Write a function vowels_count which takes a string representing\n a word as input and returns the number of vowels in the string.\n Vowels in this case are ’a’, ’e’, ’i’, ’o’, ’u’. Here, ’y’ is also a\n vowel, but only when it is at the end of the given word.\n\n Example:\n >>>vowels_count("abcde")\n 2\n >>>vowels_count("ACEDY")\n 3\n """\n vowels = "aeiouAEIOU"\n count = 0\n for i, char in enumerate(s):\n if char in vowels:\n count += 1\n elif char == ’y’ and i == len(s) - 1:\n count += 1\n return count\n\n# Additional test cases\nprint(vowels_count("hello")) # 2\nprint(vowels_count("sky")) # 1\nprint(vowels_count("rhythm")) # 0\nprint(vowels_count("fly")) # 1\nprint(vowels_count("boy")) # 2\nprint(vowels_count("try")) # 1\nprint(vowels_count("my")) # 1\nprint(vowels_count("y")) # 1\nprint(vowels_count("a")) # 1\nprint(vowels_count("e")) # 1\nprint(vowels_count("i")) # 1\nprint(vowels_count("o")) # 1\nprint(vowels_count("u")) # 1\n", "result": "failed: Test 5","passed": false, |
| Case | Problem Prompt | SFT Output | FPO Output | Gold | Comment |
| 0 | Problem: How many ways are there to divide a set of 8 elements into 5 non-empty ordered subsets? Please analyze and write your final answer after the phrase "The answer is": | SFT predicts 126000, by mistakenly recalling and applying permutations, leading to a significant overestimate. | InfiFPO correctly computes , applies , yielding . | 11760 | InfiFPO demonstrates recursive computation of Stirling numbers, while SFT simply recalls a wrong value, lacking procedural reasoning. |
| 1 | Problem: What is the value of ? Please analyze and write your final answer after the phrase "The answer is": | SFT predicts 0, oversimplifying based on oscillation intuition, neglecting the structure of the integral. | InfiFPO expands product of sines, applies Fourier integral properties, identifies non-zero singular contribution, yielding the correct result. | 1.0 | InfiFPO’s success stems from correct application of orthogonality and singularity analysis, while SFT lacks symbolic manipulation depth. |
| 2 | Problem: Given x = 0.157, what is the value of ? Please analyze and write your final answer after the phrase "The answer is": | Both SFT and InfiFPO predict 0.157, recognizing Euler’s reflection formula, correctly simplifying numerator and denominator. | Both predict 0.157. FPO’s derivation explicitly links product form to sine function identity. | 0.157 | Both models give correct answer, but InfiFPO provides a more explicit and pedagogical derivation path. |