Merge fine-tuned SE models without retraining.
TIES / DARE-TIES / averaging on any HuggingFace encoder - for clone detection, vulnerability detection, defect prediction, code-smell, commit classification and more. One CLI, one web tool; no retraining, no labels. Built alongside our ASE submission.
$ mergese inspect microsoft/codebert-base \
microsoft/graphcodebert-base \
--base microsoft/codebert-base
✓ verdict: COMPATIBLE
cosine similarity: +0.7421
sign agreement: 73.4%
$ mergese merge m1 m2 m3 --base base \
--method dare-ties --drop-rate 0.3 \
--output ./merged
✓ merged in 11.3s (20% trimmed, 12.4% sign conflicts resolved)
Checkpoint library
Upload your model once here; every form below picks from this list. Public HuggingFace IDs (like microsoft/codebert-base) don't need uploading - just type them when needed.
1. Inspect compatibility
Verify two or more checkpoints share a tokenizer, architecture, and base. Compute pairwise task-vector cosine similarity and sign agreement.
2. Merge checkpoints
TIES / DARE-TIES / averaging on task vectors Δk = θk - θbase. Final model is written in HuggingFace format.
3. Evaluate
Run the merged model on a CSV benchmark and report accuracy / precision / recall / F1.
4. Export
Repackage the merged model as HuggingFace, ONNX, or TorchScript for downstream deployment.
Jobs
Live logs and final reports for every run on this server.
How it works
MergeSE turns post-hoc model merging - the technique behind our ASE 2026 submission - into a one-command CLI and a web UI.
SE tasks covered
Clone detection, vulnerability detection, defect / bug prediction, code-smell detection, commit classification, code-review acceptability, comment-code consistency, exception-type prediction, type inference, plus any custom binary or multi-class CSV.
Task vectors
For each fine-tuned model θk and a shared base θbase, we compute Δk = θk - θbase. These deltas isolate what fine-tuning learned and are the unit of merging.
TIES
Trim small |Δ| values (by percentile), elect a per-parameter majority sign, then keep only the sign-agreeing entries when averaging. Reduces destructive interference between tasks.
DARE-TIES
Randomly drop a fraction p of Δ entries and rescale by 1/(1-p), then apply TIES. Adds a sparsity prior, often improving merges of 3+ models.
PCB
Score every (task, parameter) pair by intra-balancing - how much it matters inside its own Δk - times inter-balancing - whether it pulls with or against the cross-task consensus. Keep only the top-scoring fraction and combine them score-weighted. Parameters that fight the consensus are dropped rather than averaged away.
Cross-task merging
Merging a clone detector with a vulnerability detector? Their classifier heads differ in shape. MergeSE auto-detects this and merges the encoder only - keeping the base's head - so you can re-attach a fresh head for the downstream task.
Pipeline
tasks → discover →
inspect → verify →
merge → HF checkpoint →
evaluate → F1 / macro-F1 →
export → HF / ONNX / TorchScript.
# Install
pip install -r requirements.txt
# CLI
python mergese.py inspect microsoft/codebert-base microsoft/graphcodebert-base --base microsoft/codebert-base
python mergese.py merge m1 m2 --base base --method dare-ties --output ./merged
python mergese.py evaluate ./merged --task clone_detection --test-file bcb_test.csv
python mergese.py export ./merged --format onnx --output ./merged.onnx
# Web (this UI)
python server/app.py # then open http://localhost:8765