Leveraging our novel merging approach, we can seamlessly integrate instruction, reasoning, and code models into a single, high-performing unified model in just one step.
merge method: cla-gm
precision: dtype: bfloat16
Context length: 262,144&1010000
[!TIP]
Temperature=0.7,TopP=0.8,TopK=20,MinP=0.
Objective: Merge 𝐾 fine-tuned models with identical tensor names and shapes into a single model whose parameters 𝜃⋆ lie at the robust center of the 𝐾 parameter sets.
For a given tensor name, each model provides a point 𝑥ᵢ ∈ ℝⁿ (flattened). We seek a robust center 𝜃⋆ ∈ ℝⁿ.
$$a = \frac{1}{K} \sum_{i=1}^{K} x_i$$
Efficient but sensitive to outliers.
$$m = \text{median}({x_i})$$
Robust but ignores vector magnitude coupling; computed elementwise across coordinates.
$$\theta^{(0)} = \frac{a + m}{2}$$
This blends efficiency and robustness without tuning, offering a strong seed for iterative robust estimators.
$$\theta^{\star} = \arg\min_{\theta \in \mathbb{R}^n} \sum_{i=1}^{K} |\theta - x_i|_2$$
This is the multivariate analogue of the median, robust to outliers in the Euclidean geometry of parameters.
Update Rule: Given current 𝜃(𝑡), define weights:
$$w_i^{(t)} = \frac{1}{\max(|\theta^{(t)} - x_i|_2, \varepsilon)}$$
where 𝜀 = eps(float32) prevents division by zero.
$$\theta^{(t+1)} = \frac{\sum_{i=1}^{K} w_i^{(t)} x_i}{\sum_{i=1}^{K} w_i^{(t)}}$$
Stop when the relative change is below 𝜀:
$$\frac{|\theta^{(t+1)} - \theta^{(t)}|_2}{\max(|\theta^{(t)}|_2, 1)} \leq \varepsilon$$
where 𝜀 = eps(float32) ≈ 1.19×10⁻⁷.
model-00007-of-00016.safetensors 3.7 GiBmodel-00009-of-00016.safetensors 3.7 GiBmodel-00011-of-00016.safetensors 3.7 GiBmodel-00005-of-00016.safetensors 3.7 GiBmodel-00006-of-00016.safetensors 3.7 GiBmodel-00010-of-00016.safetensors 3.7 GiBmodel-00014-of-00016.safetensors 3.7 GiBmodel-00015-of-00016.safetensors 3.7 GiBmodel-00013-of-00016.safetensors 3.7 GiBmodel-00004-of-00016.safetensors 3.7 GiBmodel-00002-of-00016.safetensors 3.7 GiBmodel-00001-of-00016.safetensors 3.7 GiBmodel-00008-of-00016.safetensors 3.7 GiBmodel-00003-of-00016.safetensors 3.7 GiBmodel-00012-of-00016.safetensors 3.7 GiBmodel-00016-of-00016.safetensors 1.0 GiB