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.
Model Highlights:
-
merge method:
cla-gm -
precision:
dtype: bfloat16 -
Context length:
262,144&1010000
Parameter Settings:
[!TIP]
Temperature=0.7,TopP=0.8,TopK=20,MinP=0.
Geometric Median with CLA Initialization
Problem Setting
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.
Per-Tensor Formulation
For a given tensor name, each model provides a point 𝑥ᵢ ∈ ℝⁿ (flattened). We seek a robust center 𝜃⋆ ∈ ℝⁿ.
Mean and Median
Arithmetic Mean:
$$a = \frac{1}{K} \sum_{i=1}^{K} x_i$$
Efficient but sensitive to outliers.
Elementwise Median:
$$m = \text{median}({x_i})$$
Robust but ignores vector magnitude coupling; computed elementwise across coordinates.
CLA Initialization
Centered Linear Average:
$$\theta^{(0)} = \frac{a + m}{2}$$
This blends efficiency and robustness without tuning, offering a strong seed for iterative robust estimators.
Geometric Median Objective
Objective Function:
$$\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.
Weiszfeld Algorithm
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.
Iteration Step:
$$\theta^{(t+1)} = \frac{\sum_{i=1}^{K} w_i^{(t)} x_i}{\sum_{i=1}^{K} w_i^{(t)}}$$
Convergence Criterion:
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⁻⁷.