I built Fusion Check — a law that tells you, before merging, whether two fine-tuned LLMs are compatible. No data, no gradients, no GPU. Under a second.
The problem it solves: Blind "soup" (weight averaging) always merges — but when two models were trained on different tasks, the fusion dilutes both. The law gives you the necessary and sufficient condition on the task kernel (cosine of weight deltas + effective dimensionality) to know beforehand if the fusion preserves behavior.
The math (one line):
E[e²] = 2(1-α)²(1-cos²)/d_eff — threshold cos² ≥ 1 − δ²·d_eff/(2(1-α)²)
What it gives you:
- A decision: MERGE / NO_MERGE / PRIORITIZED / REFUSE / VERIFY
- The optimal mixing coefficient α* = √γ₁/(√γ₁+√γ₂) — closed form, verified symbolically and numerically
- Per-task retention prediction (calibrated: 13 pairs, LOOCV corr 0.81, MAE 0.072)
Proven three independent ways:
- Analytic derivation
- Formal verification with z3 (28 theorems)
- Empirical validation (147 combinations, max deviation 1.13%, zero violations)
Real result: Two weak, diverse estimators of the same task (0.762/0.756) → merged soup 0.822 (+6–7 points). Two orthogonal specialists? The law says NO_MERGE and prevents dilution.
Links:
- Repo: https://codeberg.org/josemiguel3125/fusion-check
- Paper (PDF): https://zenodo.org/records/21935115
- CLI:
pip install fusion-check→fusion-check verificar base/ m1/ m2/ --acc1 0.76 --acc2 0.83 - Demo: https://huggingface.co/spaces/josemiguel3125/fusion-check
- Package: https://pypi.org/project/fusion-check/
Honest limits:
- Small models (TinyStories-3M), 13 measured pairs, 9/13 correct decisions
- Out-of-calibration cosines fall back to the pure law with a low-confidence flag
- Nothing runs on servers — everything is local, open source (MIT), no patents
Author: Jose Miguel Madueño Ortega · MIT · free and open.
Top comments (0)