TIES model merging unifies cross-domain clone detection, hitting 0.865 F1
F1 drops 70% across domains, but model merging fixes it without retraining
Code clone detection—finding similar code snippets across repositories, languages, and even AI-generated code—has traditionally been fragmented. Deep learning detectors excel in their training domain but suffer F1 drops exceeding 70% when faced with out-of-distribution clones. Training a single cross-domain detector is impractical because it requires simultaneous access to all training data. Researchers from the University of Saskatchewan (Palash R. Roy, Banani Roy, Kevin A. Schneider, and Chanchal K. Roy) have published a study at ASE 2026 investigating model merging—a post-hoc technique that combines trained checkpoints without accessing original data. They evaluated parameter merging with task-vector methods (including TIES), architecture merging via layer stitching, and cross-tokenizer alignment across four code models, three benchmarks, and twelve configurations.
Their results are compelling: same-base TIES merging creates effective cross-domain detectors, reaching 0.865 combined F1 on UniXcoder—93% of the performance of multi-task training, with zero training data at the merging step. While WUDI achieves slightly higher in-distribution F1 (0.899), TIES generalizes better to unseen AI-generated clones, making it the recommended approach. Merged detectors also outperform zero-shot code LLMs on GPTCloneBench at lower inference cost and generalize up to 4x better than multi-task training to novel AI-generated clones. Interestingly, cross-base merging yields only marginal, high-variance gains, indicating that task-vector compatibility through a shared pre-trained base is the binding factor. This work provides one of the first systematic empirical studies of model merging for software engineering, offering a practical recipe for building cross-domain clone detectors that don't degrade in the wild.
- TIES merging hits 0.865 combined F1 on UniXcoder, reaching 93% of multi-task performance without any training data at merge time.
- Merged detectors generalize up to 4x better than multi-task training to unseen AI-generated clones and beat zero-shot LLMs at lower inference cost.
- Cross-base merging yields only marginal gains, confirming a shared pre-trained base is the binding factor for effective parameter merging.
Why It Matters
Enables cross-domain code clone detection without retraining, saving compute and improving robustness for real-world, AI-generated code analysis.