InfiGFusion: Graph-on-Logits Distillation via Efficient Gromov-Wasserstein for Model Fusion

ABSTRACT

Recent advances in large language models (LLMs) have intensified efforts to fuse heterogeneous open-source models into a unified system that inherits their complementary strengths. Existing logit-based fusion methods maintain inference efficiency but treat vocabulary dimensions independently, overlooking semantic dependencies encoded by cross-dimension interactions. These dependencies reflect how token types interact under a model's internal reasoning and are essential for aligning models with diverse generation behaviors. To explicitly model these dependencies, we propose InfiGFusion, the first structure-aware fusion framework with a novel Graph-on-Logits Distillation (GLD) loss. Specifically, we retain the top-k logits per output and aggregate their outer products across sequence positions to form a global co-activation graph, where nodes represent vocabulary channels and edges quantify their joint activations. To ensure scalability and efficiency, we design a sorting-based closed-form approximation that reduces the original O(n^4) cost of Gromov-Wasserstein distance to O(n log n), with provable approximation guarantees. Experiments across multiple fusion settings show that GLD consistently improves fusion quality and stability. InfiGFusion outperforms SOTA models and fusion baselines across 11 benchmarks spanning reasoning, coding, and mathematics. It shows particular strength in complex reasoning tasks, with +35.6 improvement on Multistep Arithmetic and +37.06 on Causal Judgement over SFT, demonstrating superior multi-step and relational inference.

Model FusionKnowledge DistillationGromov-Wasserstein DistanceLarge Language ModelsGraph Alignment
2025年5月21日
Yuanyi Wang, Zhaoyi Yan, Yiming Zhang, Qi Zhou, Yanggan Gu, Fei Wu, Hongxia Yang

Abstract

Recent advances in large language models (LLMs) have intensified efforts to fuse heterogeneous open-source models into a unified system that inherits their complementary strengths. Existing logit-based fusion methods maintain inference efficiency but treat vocabulary dimensions independently, overlooking semantic dependencies encoded by cross-dimension interactions. These dependencies reflect how token types interact under a model's internal reasoning and are essential for aligning models with diverse generation behaviors. To explicitly model these dependencies, we propose InfiGFusion, the first structure-aware fusion framework with a novel Graph-on-Logits Distillation (GLD) loss. Specifically, we retain the top-kk logits per output and aggregate their outer products across sequence positions to form a global co-activation graph, where nodes represent vocabulary channels and edges quantify their joint activations. To ensure scalability and efficiency, we design a sorting-based closed-form approximation that reduces the original O(n4)O(n^4) cost of Gromov-Wasserstein distance to O(nlogn)O(n \log n), with provable approximation guarantees. Experiments across multiple fusion settings show that GLD consistently improves fusion quality and stability. InfiGFusion outperforms SOTA models and fusion baselines across 11 benchmarks spanning reasoning, coding, and mathematics. It shows particular strength in complex reasoning tasks, with +35.6 improvement on Multistep Arithmetic and +37.06 on Causal Judgement over SFT, demonstrating superior multi-step and relational inference.

Introduction

Recent advances in LLMs have sparked growing interest in aggregating diverse model capabilities to build stronger, more general-purpose systems. Existing collective approaches span a broad design space. Prompt-based techniques dynamically chain or compose pretrained LLMs with tools or APIs to expand functional scope. Multi-agent systems employ multiple LLMs to collaborate or debate, often outperforming single-agent models on complex reasoning tasks. Model ensembling aggregates outputs from different models to boost accuracy and robustness, while Mixture-of-Experts (MoE) architectures improve scalability by activating specialized subnetworks. Meanwhile, parameter-level merging models aim to consolidate multiple fine-tuned checkpoints into a single model. Each of these paradigms explores a different trade-off between performance, efficiency, and compatibility.

Among fusion strategies, model fusion via logit distillation has emerged as a flexible and efficient paradigm. It enables a single pivot model to absorb knowledge from multiple source models—often with diverse domains, sizes, or architectures—without increasing inference cost. A representative cross-tokenizer approach is ULD, which introduces a universal logit-distillation loss for aligning models with different tokenizers. Unlike traditional distillation, which transfers intermediate features or outputs, these methods align only the output logits using token-level objectives such as KL divergence or Wasserstein distance. However, token-level methods inherently treat each vocabulary dimension independently, overlooking semantic dependencies—the co-activation patterns and relational structures among tokens that underlie a model's reasoning process. This limits their ability to align models with divergent generation behaviors, particularly for tasks requiring multi-step reasoning or fine-grained relational inference.

The following figure illustrates this limitation. While token-level losses enforce dimension similarity, they fail to capture the structured dependencies among tokens. InfiGFusion addresses this by modeling logits as graphs, aligning not just distributions but also the interactions that reflect a model's internal reasoning.

Token-level vs. Structure-aware Fusion

Figure 1: Token-level vs. Structure-aware Fusion. Given pivot and source logits of shape [L,3] (sequence length L, vocab size 3), token-level methods (left) align dimensions independently, ignoring token interactions. GLD (right) aggregates outer products into [3,3] co-activation graphs, capturing semantic dependencies via structure-aware graph alignment.

To address this challenge, we model semantic dependencies in the logit space using graph structures. Rather than treating token logits independently, we represent model outputs as feature-level graphs, where nodes correspond to token dimensions and edges capture their co-activation patterns across sequence positions. This representation reflects how a model internally organizes semantic relationships, beyond surface-level token probabilities, to support coherent reasoning and inference. Constructing such graphs from high-dimensional logits is nontrivial: vocabulary sizes are large, and most logits are near-zero, making full pairwise modeling inefficient and noisy. To mitigate this, we apply top-kk sparsification to retain salient dimensions, followed by inner-product similarity to define edge weights. This yields interpretable graphs that faithfully reflect model reasoning behaviors.

Building on this, we propose InfiGFusion, a semantic structure-aware fusion framework that distills knowledge from multiple source models by aligning their logit graphs. At its core is the Graph-on-Logits Distillation (GLD) loss, which captures semantic dependencies by aligning structure-level information between source and pivot models. Specifically, we employ the Gromov-Wasserstein (GW) distance to match graph structures. However, standard GW incurs O(n4)\mathcal{O}(n^4) complexity, making it impractical for large vocabularies. To address this, we design a closed-form approximation based on node aggregation and sorting-based matching, reducing the cost to O(nlogn)\mathcal{O}(n \log n). We further provide theoretical guarantees on the approximation error, ensuring alignment fidelity.

We validate InfiGFusion across diverse fusion scenarios, demonstrating consistent improvements over state-of-the-art methods. By explicitly modeling semantic dependencies through logit graph alignment, InfiGFusion excels in tasks involving multi-step reasoning, relational inference, and fine-grained alignment—scenarios where token-level objectives fall short. Extensive experiments on 11 benchmarks, including reasoning, mathematics, and coding, confirm its effectiveness in producing more capable fusion models.

Overall, our contributions can be summarized as follows:

  • InfiGFusion is the first structure-aware fusion framework that models semantic dependencies via feature-level logit graphs and aligns them via a novel Graph-on-Logits Distillation loss.
  • We propose a novel approximation to Gromov-Wasserstein distance, reducing complexity from O(n4)\mathcal{O}(n^4) to O(nlogn)\mathcal{O}(n \log n), with provable error bounds and rigorous theoretical analysis.
  • Experiments on 11 benchmarks show that InfiGFusion consistently outperforms baselines, with significant gains on complex reasoning tasks (+35.6 on Multistep Arithmetic, +37.06 on Causal Judgement), demonstrating superior multi-step and relational inference.

Collective LLM: To aggregate the capabilities of specialized LLMs, several strategies have been proposed. Prompt-based integration methods, such as Toolformer, ReAct, and HuggingGPT, guide LLMs to invoke tools or auxiliary models through natural language prompts. Multi-agent collaboration frameworks like ChatArena and AgentBench treat LLMs as interacting agents that debate or coordinate to improve reasoning. Model ensembling aggregates outputs via voting or reranking, but suffers from high inference cost. Mixture-of-Experts (MoE) models activate sparse expert subsets per query, offering scalability but introducing routing complexity. Parameter merging methods combine weights from fine-tuned models, but require architectural alignment. While these strategies explore different trade-offs between performance, efficiency, and flexibility, they generally assume the underlying models remain fixed. In contrast, we focus on knowledge fusion, where a pivot model learns from multiple sources during training.

Model Fusion via Knowledge Distillation: Traditional knowledge distillation (KD) transfers knowledge from a large teacher to a smaller student via features, logits, or output distributions, primarily for compression or acceleration. In contrast, model fusion via KD aims to integrate multiple source models—often with varying architectures, scales, and vocabularies—into a single target of similar size. Recent methods fuse multiple LLMs by aligning token distributions using KL divergence or Wasserstein distance. These approaches typically require vocabulary alignment and assume semantic compatibility at the token level. However, they overlook semantic dependencies among logit dimensions—i.e., how token probabilities interact under internal reasoning, which are crucial for preserving logical structure. Our work addresses this gap by introducing a structure-aware distillation objective that explicitly aligns semantic dependencies via graph alignment. Unlike prior methods, it avoids explicit vocabulary alignment by modeling logits as graphs, enabling robust, vocabulary-agnostic fusion across heterogeneous models while preserving reasoning structures.

Gromov-Wasserstein Distance: The Gromov-Wasserstein (GW) distance is a relational optimal transport metric for aligning distributions based on internal structural similarity. It has been widely used in graph comparison and structure-aware representation learning, especially when node correspondences are unknown. However, its standard formulation incurs O(n4)\mathcal{O}(n^4) complexity due to fourth-order interactions, rendering it impractical for large-scale logit graphs in LLMs. To mitigate this, prior works apply entropic regularization, Sinkhorn-based solvers, or low-rank projections. While effective for small graphs, these methods lack closed-form solutions and suffer from convergence instability, making them less suited for distillation over vocabulary-sized graphs (n>105n > 10^5). Our method takes a non-iterative, sorting-based approach: it compresses each similarity matrix into node-level features and aligns them via sorted-based matching, reducing complexity to O(nlogn)\mathcal{O}(n \log n). Unlike prior approximations, it yields a differentiable, training-friendly loss with a provable approximation bound. To our knowledge, this is the first closed-form, theoretically guaranteed GW approximation tailored for aligning logit graphs in LLM fusion.

Method

InfiGFusion fuses heterogeneous LLMs by distilling structured knowledge from multiple source models into a unified pivot model. Central to this process is the Graph-on-Logits Distillation (GLD) loss, which models logit vectors as feature-level graphs and aligns their structures across models.

To capture semantic dependencies, we adopt Gromov-Wasserstein distance for structure-level alignment between logit graphs. However, the standard GW incurs O(n4)\mathcal{O}(n^4) complexity, prohibitive for LLM-scale vocabularies (n>105n > 10^5). We propose a sorting-based approximation that reduces this to O(nlogn)\mathcal{O}(n \log n) by compressing graph structures into node-level features. Furthermore, we provide a provable error bound of n1n2+m1m2\frac{n - 1}{n^2} + \frac{m - 1}{m^2}, ensuring faithful and efficient graph alignment.

InfiGFusion framework

Figure 2: InfiGFusion framework. Given instruction-response pairs, source and pivot models produce logits, sparsified into feature-level graphs capturing semantic dependencies. We align graphs via an efficient Gromov-Wasserstein approximation (GLD), reducing complexity from O(n^4) to O(n log n). The overall objective combines structure-aware distillation (GLD) with token-level distillation (ULD) and supervised signals (SFT) for robust fusion.

Overview of InfiGFusion

InfiGFusion integrates knowledge from diverse source models {M1,,MS}\{M_1, \dots, M_S\} into a unified pivot model M0M_0, enhancing reasoning capabilities without increasing inference cost.

Given an instruction-response dataset D\mathcal{D}, M0M_0 is trained to align with both human supervision and source model behaviors via two complementary objectives: (i) Universal Logit Distillation (ULD): a coarse token-level alignment combining supervised fine-tuning (SFT) and a sorting-based Wasserstein-1 approximation; (ii) Graph-on-Logits Distillation (GLD): a structure-aware objective aligning relational dependencies in logit space. The overall loss is:

LInfiGFusion=λGLDs=1SLGLD,s+λULDs=1SLULD,s+λSFTLSFT,\mathcal{L}_{\text{InfiGFusion}} = \lambda_{\text{GLD}} \sum_{s=1}^{S} \mathcal{L}_{\text{GLD},s} + \lambda_{\text{ULD}} \sum_{s=1}^{S} \mathcal{L}_{\text{ULD},s} + \lambda_{\text{SFT}} \mathcal{L}_{\text{SFT}},

where ULD ensures distributional alignment and GLD captures fine-grained reasoning structures. For token-level ULD, we adopt the linear-time Wasserstein-1 approximation, which compare the logit distributions between pivot model tt and source models ss:

LULD,s=WD~(ft,fs)=i=1dft(i)fs(i),\mathcal{L}_{\text{ULD},s} = \widetilde{\text{WD}}(\mathbf{f}_t, \mathbf{f}_s) = \sum_{i=1}^{d'} \left| \mathbf{f}_t^{\downarrow}(i) - \mathbf{f}_s^{\downarrow}(i) \right|,

where f\mathbf{f}^{\downarrow} denotes sorting. This provides an efficient coarse alignment signal, complementing GLD's structural matching.

Dynamic Sparse Graph Construction

To capture structural dependencies among logit dimensions while avoiding the cost of full d×dd \times d modeling (dd is the vocabulary size for each model), we adopt a two-stage strategy: top-kk sparsification followed by dynamic graph construction.

Top-kk Logit Sparsification. Given a logit tensor ZRB×L×d\mathbf{Z} \in \mathbb{R}^{B \times L \times d}, we extract the top-kk logits for each position to obtain ZtopRB×L×d\mathbf{Z}^{\text{top}} \in \mathbb{R}^{B \times L \times d'}, with ddd' \ll d. We then unify the top-kk dimensions across tokens to obtain a consistent dd'-dimensional representation per sample.

Dynamic Graph Construction. To model the interdependencies among logit dimensions, graph construction can generally follow two paradigms: (i) token-wise similarity across the sequence, or (ii) feature-wise similarity among logit dimensions. The former focuses on token interactions, while the latter captures intrinsic correlations between semantic dimensions. In this work, we adopt the feature-wise approach, as it empirically yields better alignment performance and more effectively preserves structural information. Specifically, for each sample bb, we construct a graph Gh=(V,E)G_h = (V, E) over the reduced logits ZbRL×dZ_b \in \mathbb{R}^{L \times d'}, where each node corresponds to a selected logit dimension. The adjacency matrix CbRd×dC_b \in \mathbb{R}^{d' \times d'} is defined via dot-product similarity across the sequence:

Cb(i,j)=t=1Lzt(i)zt(j),Cb=ZbtopZbtop.C_b(i,j) = \sum_{t=1}^{L} z_t(i) \cdot z_t(j), \quad C_b = \mathbf{Z}_b^{\text{top}^\top} \cdot \mathbf{Z}_b^{\text{top}}.

This construction approximates cosine similarity after normalization and is applied to both pivot and source models at every training step, resulting in dynamic, data-dependent graphs that evolve with model predictions.

Efficient Approximation Algorithm

Directly applying Gromov-Wasserstein (GW) distance for structure-level alignment incurs O(n4)\mathcal{O}(n^4) complexity, which is infeasible for LLM-scale graphs. We propose an efficient approximation by summarizing graph structures into node-level features and aligning them via sorting-based matching, reducing complexity to O(nlogn)\mathcal{O}(n \log n). This method maintains alignment fidelity with a provable error bound of n1n2+m1m2\frac{n - 1}{n^2} + \frac{m - 1}{m^2}.

Given intra-graph similarity matrices Cs,CtRd×dC_s, C_t \in \mathbb{R}^{d' \times d'} from source and pivot models, the squared GW distance is defined as:

GW(C,D)=minγΠ(μs,μt)i,j,k,lC(i,j)D(k,l)2γikγjl.\text{GW}(C, D) = \min_{\gamma \in \Pi(\mu_s, \mu_t)} \sum_{i,j,k,l} |C(i,j) - D(k,l)|^2 \gamma_{ik} \gamma_{jl}.

Despite its expressiveness, the GW objective requires O(n2m2)\mathcal{O}(n^2 m^2) complexity due to its fourth-order tensor form, making it impractical for large logits (n,mn,m are the vocabulary sizes). To address this, we derive a closed-form approximation by compressing the graph structure into scalar features.

Graph Feature Compression. Our key insight is that the structure of each similarity matrix CRn×nC \in \mathbb{R}^{n \times n} and DRm×mD \in \mathbb{R}^{m \times m} can be summarized using scalar node-level features, where n,mn, m are vocabulary size. Specifically, we compute degree-style features:

fC(i)=1nj=1nC(i,j),fD(k)=1ml=1mD(k,l),f_C(i) = \frac{1}{n} \sum_{j=1}^{n} C(i, j), \quad f_D(k) = \frac{1}{m} \sum_{l=1}^{m} D(k, l),

which captures the overall importance or connectivity of each logit dimension in the graph. This reduces the original d×dd' \times d' structure to two vectors in Rd\mathbb{R}^{d'}.

Separable Relaxation. Substituting these features into the original objective yields a simplified, separable form:

GW~(C,D)=i,kfC(i)fD(k)2γik,\widetilde{\text{GW}}(C, D) = \sum_{i,k} |f_C(i) - f_D(k)|^2 \gamma_{ik},

where symmetry is assumed across γik\gamma_{ik} and γjl\gamma_{jl}. This relaxation significantly lowers computational cost. The error is theoretically bounded:

Proposition 1 (Approximation Error Bound). Let CRn×nC \in \mathbb{R}^{n \times n} and DRm×mD \in \mathbb{R}^{m \times m} be the similarity matrices derived from logit self-inner products and row-normalized such that jCij=1\sum_{j} C_{ij} = 1 and lDkl=1\sum_{l} D_{kl} = 1. Then the absolute error between the exact and approximated GW distances satisfies:

GW(C,D)GW~(C,D)n1n2+m1m2.|\text{GW}(C, D) - \widetilde{\text{GW}}(C, D)| \leq \frac{n - 1}{n^2} + \frac{m - 1}{m^2}.

In practice, the size of n,mn,m is more than 10510^5. This bound guarantees the error decays as O(1/n)\mathcal{O}(1/n), enabling scalable use in large-vocabulary settings.

Sorting-Based Matching. To avoid solving for the optimal transport plan γ\gamma explicitly, we take a direct strategy like ULD that adopts a deterministic transport strategy based on sorting. Let fC,fDf_C^{\downarrow}, f_D^{\downarrow} be the descending-sorted versions of fCf_C and fDf_D. We construct a matching that aligns the ii-th largest entry of fCf_C to the ii-th largest entry of fDf_D:

GW~(C,D)=i=1kfC(i)fD(i),k=min(ds,dt).\widetilde{\text{GW}}(C, D) = \sum_{i=1}^{k} \left| f_C^{\downarrow}(i) - f_D^{\downarrow}(i) \right|, \quad k = \min(d'_s, d'_t).

This effectively reduces the original optimization to an O(nlogn)\mathcal{O}(n \log n) sorting-based assignment.

Stability Analysis. Beyond efficiency, our approximation improves training stability. We compare the Lipschitz constants of common alignment losses:

Proposition 2 (Lipschitz Constants Comparison). We have the following relationship between the Lipschitz constants (LL) for the Gromov-Wasserstein, Wasserstein, and KL losses:

LGW=O(R3D)<LWD=O(D)<LKL=O(eRD),L_{\text{GW}} = \mathcal{O}\left(\frac{R^3}{D}\right) < L_{\text{WD}} = \mathcal{O}(\sqrt{D}) < L_{\text{KL}} = \mathcal{O}(e^{RD}),

for vocabulary size DD and logit range RR, which means the GW-guided training models have tighter generalization bounds.

The logit range RR is usually smaller than 120 for 14B LLMs. For example, with vocabulary size D=150,000D = 150,000, RR is observed in the range of [40,120][40, 120]. This suggests GW-based alignment yields the lowest sensitivity to perturbations, contributing to improved generalization and stable training.

Unified GLD Loss

To support multi-source fusion, we extend the GLD loss into a unified formulation. For each source model MsM_s, we compute a structure-aware alignment loss with respect to the pivot model M0M_0 and aggregate all source contributions:

LGLD=s=1SGW~(Cs,C0).\mathcal{L}_{\text{GLD}} = \sum_{s=1}^{S} \widetilde{\text{GW}}(C_s, C_0).

where CsC_s and C0C_0 denote the similarity matrices of the source and pivot graphs, respectively.

This unified objective enables efficient and scalable distillation from multiple source models, while preserving both semantic and relational structures across models.

Experiments

We evaluate InfiGFusion on large-scale LLM fusion, focusing on integrating models with diverse architectures and reasoning styles while maintaining inference efficiency. Our experiments verify that GLD enables faithful and effective fusion beyond token-level objectives. InfiGFusion outperforms state-of-the-art fusion methods and strong open-source baselines, with significant improvements in multi-step reasoning and relational inference.

Experimental Setup

Datasets. We construct a novel multi-task training dataset comprising 130k examples across general reasoning, mathematics, and coding. (i) The 52K general data are sourced from Infinity-Instruct. (ii) Our mathematical dataset comprises 39k pairs of math questions and corresponding answers. The questions are sourced from the NuminaMath_1.5 dataset, while the answers are distilled from the DeepSeek-R1-671B model. NuminaMath_1.5 represents the second iteration of the widely acclaimed NuminaMath dataset. It offers high-quality data for competition-level mathematical problems across various domains, including Algebra, Geometry, Combinatorics, Calculus, Inequalities, Logic and Puzzles, and Number Theory. (iii) In the code generation domain, we utilized the KodCode-V1-SFT-R1 dataset, which contains approximately 268k samples. Each sample was fed into our pivot model, which was prompted to generate 5 random responses per input. The generated outputs were then passed through a sandbox-based evaluation system. For each sample, if at least one of the five responses failed, the sample was flagged for further consideration. From these flagged samples, we filtered and selected 39k high-quality examples for further distillation.

TypesGeneralMathCode
DatasetInfinity-InstructNuminaMath-1.5KodCode-V1-SFT-R1
Original Size1.4M1.4M268k
Filtered Size52K39K39K

Models and Baselines. We fuse three source models: Qwen2.5-14B, Qwen2.5-Coder-14B, and Mistral-24B, into a Phi-4 pivot model. Fusion baselines include MiniLogit, InfiFusion, FuseLLM, and FuseChat.

Evaluation. We assess fusion performance on 11 benchmarks spanning reasoning (BBH, ARC-C, MMLU), mathematics (GSM8K, Math, TheoremQA), coding (MBPP, HumanEval), text reasoning (DROP, HellaSwag), and instruction following (IFEval).

Main Results

ModelsGSM8KMATHThQAMBPPHEvalBBHARCMMLUIFEvalDROPHSAvgSizeGPU Hour
Pivot Model
Phi-487.4180.0451.1270.883.5468.8493.985.6277.3488.6787.6279.5414B~1.0M
Source Models
Qwen2.5-Instruct91.1378.1647.2581.7083.5477.5992.2080.2285.0185.5688.2880.9714B~1.8M
Mistral-Small92.4269.8448.5068.8084.1581.5991.8681.6982.2586.5291.8479.9524B~1.6M
Qwen2.5-Coder89.1674.1838.8885.4090.9075.4089.4975.0874.7084.3479.8377.9414B~1.8M
SFT
Pivot-SFT89.9982.9654.5077.8687.8067.2393.5686.2177.7089.4487.7681.3614B120
Model Fusion via Distillation
MiniLogit89.8079.7846.3678.4985.4482.6892.1984.5879.3688.5688.2581.4314B220
FuseLLM90.2480.2553.5279.2884.0077.6292.0883.9278.5688.7487.8181.4614B225
FuseChat91.2177.5251.8881.8084.1583.3793.5684.2378.9089.2387.4282.1214B650
InfiFusion90.0780.9454.6279.6384.7280.9494.2485.8176.0289.2787.9182.2014B160
InfiGFusion90.4581.9255.3885.286.0085.6294.5885.2480.2289.6288.2283.8514B195

The table above summarizes the performance of InfiGFusion across eleven benchmarks, compared with the pivot model, source models, and representative model fusion methods.

Comparison with Pivot and Source Models. InfiGFusion consistently outperforms both the pivot model and source models in overall performance. Compared to the pivot model, it achieves a significant improvement (+2.53 avg), particularly on complex reasoning benchmarks such as BBH, ARC, and MMLU, where semantic richness and multi-step inference are crucial. For instance, InfiGFusion surpasses the pivot by +16.7 on BBH, demonstrating its ability to aggregate diverse reasoning styles beyond single-source capabilities. Compared to source models, InfiGFusion effectively integrates complementary strengths. While individual source models excel in isolated tasks (e.g., Mistral-Small on BBH, Qwen2.5-Coder on HEval), they struggle with generalization across domains. InfiGFusion surpasses these models with a more balanced performance, avoiding their trade-offs and consolidating knowledge into a unified pivot.

Comparison with Model Fusion Baselines. Against existing fusion methods (MiniLogit, FuseLLM, FuseChat), InfiGFusion exhibits superior fusion quality. Notably, while other distillation methods provide moderate improvements over the pivot, they often suffer from degraded performance in high-dependency tasks (e.g., logical reasoning, multi-condition alignment). InfiGFusion consistently delivers better results on structurally challenging tasks, indicating its advantage in preserving inter-token dependencies during fusion. Furthermore, compared to simpler fusion objectives, the structure-aware GLD loss of InfiGFusion yields better alignment without sacrificing robustness.

Efficiency and Resource Usage. In terms of computational cost, InfiGFusion maintains competitive efficiency. Despite introducing structure-aware alignment, its GPU hours remain modest (195 GPU hours), substantially lower than multi-step fusion pipelines like FuseChat (650 GPU hours). Model size remains identical to the pivot (14B), ensuring no additional inference overhead.

Complex Reasoning Performance

We evaluate InfiGFusion on 18 reasoning datasets spanning BBH and MMLU, covering multi-step logic, structural dependencies, and fine-grained semantic alignment, as shown in the following table. These tasks are known to challenge token-level fusion methods due to their complex reasoning path.

Reasoning ModelsQwen2.5-InstructMistralDeepSeek-R1-Distill-QwenPhi4Phi4 (SFT)InfiGFusion
Models Size14B24B14B14B14B14B
Abstract Algebra7365858286 (+4.0)88 (+6.0)
Marketing90.1792.3189.3292.7492.74 (+0.0)95.3 (+2.56)
International Law81.8281.8282.6491.7490.91 (-0.83)90.91 (-0.83)
Moral Scenarios71.9668.673.4175.7574.75 (-1.0)73.97 (-1.78)
Virology52.4149.454.2253.0153.61 (+0.6)54.22 (+1.21)
Formal Logic68.2566.6791.2777.7878.57 (+0.79)74.6 (-3.18)
Security Studies77.9678.7878.3777.1479.59 (+2.45)81.22 (+4.08)
logical_fallacies85.2884.6685.2886.587.73 (+1.23)87.73 (+1.23)
Ruin Names82.876.839.688.888.0 (-0.8)88.4 (-0.4)
Tracking 7 Objects80.496.480.894.490.0 (-4.4)96.8 (+2.4)
Tracking 5 Objects79.299.282.896.895.6 (-1.2)96.8 (+0.0)
Logical Deduction 397.698.883.298.496.4 (-2.0)97.6 (-0.8)
Logical Deduction 580.4828685.692.4 (+6.8)94 (+8.4)
Logical Deduction 768.862.883.288.488.8 (+0.4)89.2 (+0.8)
Colored Objects93.69087.696.496.8 (+0.4)96.4 (+0.0)
Multistep Arithmetic96.493.281.66462 (-2.0)99.6 (+35.6)
Dyck Languages35.637.29.611.213.2 (+2.0)40.0 (+28.8)
Causal Judgement43.8568.9845.3532.9935.83 (+2.84)70.05 (+37.06)
Avg. 18 Tasks75.5377.3773.2977.4377.94 (+0.51)84.16 (+6.73)

Improved Reasoning over SFT. Compared to Phi4-14B after supervised fine-tuning (SFT), InfiGFusion delivers consistent gains, boosting the average accuracy from 77.94% to 83.79%. Notable improvements are observed in tasks demanding complex relational reasoning: Multistep Arithmetic (+34.8%) and Causal Judgement (+34.39%). This demonstrates InfiGFusion's ability to enhance multi-hop inference and causal understanding by explicitly modeling semantic dependencies.

Structural Alignment Benefits. InfiGFusion excels in Tracking Shuffled Objects and Logical Deduction tasks, where aligning token relations is critical. For instance, it surpasses Phi4-14B SFT on Logical Deduction Five Objects (+1.6%) and Seven Objects (+0.4%), showcasing robust structure-level fusion beyond token alignment.

Preserving Pivot Strength. InfiGFusion maintains competitive performance in knowledge-centric tasks like International Law and Ruin Names, matching or slightly improving upon SFT baselines. This indicates that InfiGFusion not only integrates external model knowledge but also preserves the pivot model's original strengths. These results confirm that InfiGFusion's structure-aware fusion consistently enhances reasoning capabilities compared to token-level methods.

Ablation Study

Effect of Source Model Diversity. The following table evaluates the effect of fusing different source models. Individually, Qwen-Coder (Qc), Qwen-Instruct (Qi), and Mistral (M) each provide moderate gains, reflecting their domain-specific strengths. Notably, combinations such as Qi-M further amplify reasoning (+3.57), math (+3.06), and coding (+8.22) performance, demonstrating that complementary inductive biases from different models enhance the pivot model. InfiGFusion achieves the best results (+2.53 avg), confirming that our framework effectively consolidates diverse reasoning behaviors into a unified model.

ModelReasoningMathCodingAvg
Pivot: Phi481.4372.8677.1779.54
Qc84.39 (+2.96)74.18 (+1.32)86.1 (+8.63)83.20 (+3.66)
Qi86.03 (+4.60)74.08 (+1.22)84.89 (+7.72)83.52 (+3.98)
M84.50 (+3.07)75.77 (+2.91)85.8 (+8.63)83.62 (+4.08)
Qc-M84.89 (+3.46)74.18 (+1.32)86.09 (+8.92)83.54 (+4.00)
Qi-M85.00 (+3.57)75.92 (+3.06)85.39 (+8.22)83.72 (+4.18)
InfiGFusion87.06 (+5.63)74.74 (+1.88)85.6 (+8.43)83.85 (+2.53)

Effect of Loss Components. The following table analyzes our loss design. Removing ULD (w/o ULD) leads to a significant drop (-1.52 avg), particularly in reasoning (-1.8), indicating that coarse-grained token-level alignment is crucial for providing a reliable starting point. ULD narrows large distribution mismatches, effectively preparing the model for the finer-grained structural alignment performed by GLD. Excluding GLD (w/o GLD), on the other hand, yields a smaller overall decline (-0.69 avg), but reasoning performance still drops notably (-1.36). This highlights that while ULD handles first-order token matching, it lacks the capacity to capture higher-order semantic dependencies. When combined, ULD and GLD form a synergistic alignment mechanism: ULD aligns distributions coarsely and stabilizes optimization, while GLD refines alignment by enforcing consistency in the relational structure of logits. The empirical results validate this design, with the full loss achieving the best performance. All ablation studies are tested in the Top-k=10k=10 setting.

ComponentReasoningMathCodingAvg
GLD + ULD87.0674.7485.683.85
w/o ULD85.26 (-1.8)73.28 (-1.46)85.28 (-0.32)82.33 (-1.52)
w/o GLD85.70 (-1.36)75.21 (+0.47)85.18 (-0.42)83.16 (-0.69)

Effect of Top-kk

InfiGFusion sparsifies logits by retaining top-kk token dimensions before graph construction, selecting the most salient indices per sequence position. This inductive bias suppresses noisy activations and emphasizes meaningful token dependencies, serving as the foundation for graph-based semantic alignment. We evaluate Top-k{5,10,15,20,25,30}k \in \{5, 10, 15, 20, 25, 30\} and report the results below. Increasing kk from 5 to 10 brings notable gains across all tasks (Avg +0.54), as larger kk captures richer token interactions essential for semantic graph construction. However, further increasing kk beyond 10 yields diminishing returns and even slight degradations, particularly in reasoning (-0.49 from Top10 to Top30). This suggests that excessive low-confidence tokens introduce spurious edges, diluting graph discriminability. The observed trend aligns with the heavy-tailed nature of LLM logits, where only a small subset of token dimensions are informative. Overall, Top-10 achieves the best trade-off, balancing informative graph structure and computational efficiency.

Top-kReasoningMathCodingAvg
587.0374.3884.4282.08
1087.5575.9285.3982.62
1587.3775.4785.3582.49
2087.2275.0385.4882.41
2587.1274.5885.7182.20
3087.0674.7485.682.07

Case Study

To illustrate InfiGFusion's strengths beyond token-level alignment, we analyze representative cases, comparing outputs from a standard SFT-tuned model (Phi4) and our InfiGFusion model. The selected examples highlight InfiGFusion's superior reasoning in multi-step causality and relational inference.

Case study

Figure 3: Case study.

Case 1: Frank T. Shooting Incident. While both models predict "No," InfiGFusion performs a deeper step-by-step causality analysis. It explicitly identifies the causal chain's disruption—distinguishing between "intent," "misfire," and "accidental result"—showcasing robust multi-step causality disambiguation capabilities.

Case 2: Wallace's Dual Cause of Death. Unlike Phi4's surface-level judgment, InfiGFusion reasons through the latent causal structure, identifying "organized crime" as a distal cause. This reflects its strength in relational and indirect causality inference, where it effectively models complex event chains and upstream dependencies.

These cases demonstrate that InfiGFusion excels at: (i) Multi-step inference: Decomposing complex causal chains into interpretable reasoning steps. (ii) Relational causality reasoning: Capturing indirect and upstream causal factors often missed by SFT models. (iii) Fine-grained disambiguation: Distinguishing intent, action, and outcome with structured alignment of reasoning behaviors.

Analysis of the GW Approximation

In addition to the main results, we also conducted some experiments to analyze our proposed Gromov-Wasserstein approximation. It compares the quality of GW estimation in a simple simulated scenario. For example, by obtaining samples from two Gaussian distributions, and comparing the value of exact GW, sinkhorn-based approximation, and our proposed approximation. While our experiments demonstrate that the approximation is suitable as a training objective, it would be interesting to also understand its behavior as GW estimator.

Experiment setup: For each n{50,100,200,500,1000,1500,2000,2500,3000}n\in\{50,100,200,500,1000,1500,2000,2500,3000\}, we sample nn points from N(0,I)\mathcal{N}(0,I) and N(1,I)\mathcal{N}(1,I), build their n×nn\times n Euclidean distance matrices, and compute: (i) Exact GW and Sinkhorn GW via ot.gromov.gromov_wasserstein2(..., loss='square_loss'); (ii) Approx GW via our sorting-based closed-form. Each configuration is repeated 3×3\times to report mean±\pmstd. Approx RE quantifies the approximation accuracy relative to the exact GW: RE=GW^approxGWexactGWexact\mathrm{RE}=\frac{|\widehat{GW}_{\text{approx}}-GW_{\text{exact}}|}{GW_{\text{exact}}} (mean±\pmstd over 5 seeds). In this symmetric Gaussian setting, Exact and Sinkhorn GW coincide to our reported precision (even with ε=101\varepsilon=10^{-1}), evidencing the high accuracy of the Sinkhorn estimator here.

nnExact&&Sinkhorn GWApprox GWApprox RE (±std)Time Exact (s)Time Sink (s)Time Approx (s)
500.4815 ± 0.04520.1978 ± 0.02070.5888 ± 0.02420.0171 ± 0.02070.0027 ± 0.00050.0004 ± 0.0004
1000.3247 ± 0.02970.1261 ± 0.02170.6048 ± 0.09070.0072 ± 0.00080.0070 ± 0.00050.0001 ± 0.0000
2000.2033 ± 0.00880.0973 ± 0.01250.5230 ± 0.04260.1390 ± 0.03770.0983 ± 0.00330.0359 ± 0.0305
5000.1131 ± 0.00500.0587 ± 0.01430.4850 ± 0.11210.4405 ± 0.13370.4815 ± 0.09040.0607 ± 0.0353
10000.0764 ± 0.00110.0387 ± 0.01330.4921 ± 0.17852.3631 ± 0.49812.2456 ± 0.40850.1238 ± 0.0399
15000.0621 ± 0.00280.0308 ± 0.00160.5031 ± 0.039812.7151 ± 4.11829.1998 ± 2.19520.0982 ± 0.0015
20000.0496 ± 0.00280.0294 ± 0.00580.3995 ± 0.145320.1236 ± 5.025019.8941 ± 8.18270.0411 ± 0.0424
25000.0455 ± 0.00080.0305 ± 0.00750.3285 ± 0.171220.9198 ± 5.678230.1367 ± 3.10380.0026 ± 0.0014
30000.0404 ± 0.00020.0324 ± 0.01410.3941 ± 0.076752.8898 ± 9.273553.5049 ± 12.44340.2408 ± 0.2562

Results and analysis: Each setting is repeated 5 times with different seeds; we report mean±std. Across all sizes, Sinkhorn GW matches Exact GW to our reported precision (RE ≈ 0), hence we merge them into a single column in the table above. Our Approx GW exhibits decreasing relative error as nn grows (from ≈ 0.59 at n=50n=50 down to ≈ 0.39 at n=3000n=3000), consistent with the O(1/n)O(1/n) behavior. In terms of runtime, Exact/Sinkhorn scale poorly and rapidly become impractical beyond a few hundred points (already seconds at n=1000n=1000 and tens of seconds by n1500n\ge1500 on our machine), whereas Approx GW remains below ~0.3 s even at n=3000n=3000, demonstrating its O(nlogn)O(n\log n) scalability.

Conclusion

In this work, we propose InfiGFusion, a structure-aware fusion framework that explicitly models semantic dependencies among logits through a novel Graph-on-Logits Distillation (GLD) loss. By leveraging logit graph representations and an efficient Gromov-Wasserstein approximation, InfiGFusion enables the integration of heterogeneous LLMs without increasing inference cost. Extensive experiments on 11 benchmarks demonstrate that InfiGFusion consistently outperforms state-of-the-art fusion methods and baselines. In particular, it achieves notable gains in multi-step and relational reasoning tasks, such as +35.6 on Multistep Arithmetic and +37.06 on Causal Judgement over SFT models. It highlights the importance of structure-preserving alignment for effective model fusion in complex reasoning tasks, which is a promising direction for advancing collective LLM.

Limitations

While InfiGFusion demonstrates clear advantages in tasks involving multi-step reasoning, causal inference, and relational alignment, its performance shows limitations in scenarios dominated by literal token matching or factual recall. For tasks where the correct answer is encoded by a few dominant logit dimensions (e.g., factoid QA), the added structural alignment of GLD brings marginal benefits and may even introduce noise from irrelevant dependencies. Moreover, when source models present conflicting factual knowledge, InfiGFusion focuses on preserving relational consistency but lacks explicit mechanisms for factual conflict resolution, sometimes amplifying semantic ambiguities. These limitations reflect inherent trade-offs in structure-aware fusion and motivate future work on adaptive dependency modeling and source reliability estimation.

Our model is available at https://huggingface.co/InfiX-ai/InfiGFusion-14B.

BibTeX

@article{wang2025infigfusion,
  title={InfiGFusion: Graph-on-Logits Distillation via Efficient Gromov-Wasserstein for Model Fusion},
  author={Wang, Yuanyi and Yan, Zhaoyi and Zhang, Yiming and Zhou, Qi and Gu, Yanggan and Wu, Fei and Yang, Hongxia},
  journal={arXiv preprint arXiv:2505.13893},
  year={2025}
}