A Unified Model for Cross-Domain Clone Detection via Model Merging
- URL: http://arxiv.org/abs/2608.04215v1
- Date: Tue, 04 Aug 2026 20:32:28 GMT
- Title: A Unified Model for Cross-Domain Clone Detection via Model Merging
- Abstract summary: Current deep learning detectors degrade significantly outside their training distribution.<n>We investigate model merging, a family of post-hoc techniques that operate solely on trained checkpoints.<n>Same-base TIES merging creates effective cross-domain detectors, validated across two model families and three random seeds.
- Score: 9.757638656919832
- License: http://creativecommons.org/licenses/by/4.0/
- Abstract: The growing diversity of code clone types, from syntactic copies to cross-language semantic clones to AI-generated duplicates, has created a fragmentation crisis in clone detection. Current deep learning detectors are domain specialists that degrade significantly outside their training distribution, with F1 drops exceeding 70% across domains. Deploying multiple specialized models is impractical, yet training a single cross-domain detector requires simultaneous access to all training data. To address this, we investigate model merging, a family of post-hoc techniques that operate solely on trained checkpoints. We evaluate parameter merging with five task-vector methods, architecture merging via greedy layer stitching, and cross-tokenizer alignment across four code models, three benchmarks, and twelve configurations. Same-base TIES merging creates effective cross-domain detectors, validated across two model families and three random seeds, reaching 0.865 combined F1 on UniXcoder, 93% of multi-task performance without any training data at the merging step. WUDI achieves the highest in-distribution combined F1 at 0.899, but TIES generalizes better to unseen AI-generated clones, making it our recommended method. Cross-base merging yields only marginal and high-variance gains across all five methods, indicating that task vector compatibility through a shared pre-trained base is the binding factor for effective merging. 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 unseen AI-generated clones, suggesting a trade-off between in-domain performance and OOD robustness. This work provides one of the first systematic empirical studies of model merging for software engineering and a practical recipe for building cross-domain clone detectors.
Related papers
- MergeSE: Post-Hoc Model Merging for Software Engineering Tasks Without Retraining [9.757638656919832]
We present textbfMergeSE, an open-source CLI and web tool for training-free model merging of HFace encoder checkpoints.<n> MergeSE supports SE classification more broadly through a built-in registry of nine task types.<n>It supports five merging algorithms, including TIES, DARE-TIES, Wudi, PCB, and averaging.
arXiv Detail & Related papers (2026-08-04T19:39:02Z) - ChipMATE: Multi-Agent Training via Reinforcement Learning for Enhanced RTL Generation [55.947962672433675]
ChipMATE is the first self-trained multi-agent framework for RTL generation.<n>Inspired by industrial practice, ChipMATE pairs a Verilog agent with a Python reference-model agent that mutually verify each other's outputs.<n>ChipMATE achieves 75.0% and 80.1% pass@1 on VerilogEval V2 with 4B and 9B base models.
arXiv Detail & Related papers (2026-05-13T01:04:21Z) - Coupling Models for One-Step Discrete Generation [50.37847093567075]
Coupling Models is a one-step discrete generative model that learns a direct coupling between discrete sequences and Gaussian latents.<n>It avoids complex continuous flows over the simplex and hand-specified data-to-noise couplings.<n>It reduces LM1B text-generation perplexity by 33% at its lowest-perplexity operating point.
arXiv Detail & Related papers (2026-05-08T03:40:39Z) - Beyond Perplexity: Character Distribution Signatures and the MDTA Benchmark for AI Text Detection [0.34998703934432673]
Training-free AI text detection methods primarily rely on model log-probabilities, achieving strong performance through approaches like Binoculars and DNA-DetectLLM.<n>We introduce an alternative detection signal based on character distribution signatures.<n>We provide theoretical foundations showing that AI models, trained on massive domain-balanced corpora, approximate global character patterns while humans exhibit domain-specialized distributions.
arXiv Detail & Related papers (2026-05-03T00:10:15Z) - CORE: Robust Out-of-Distribution Detection via Confidence and Orthogonal Residual Scoring [9.25889614321249]
Out-of-distribution (OOD) detection is essential for deploying deep learning models reliably, yet no single method performs consistently across architectures and datasets.<n>We propose CORE, which disentangles the two signals by scoring each subspace independently and combines them via normalized summation.<n> CORE achieves competitive or state-of-the-art performance across five architectures and five benchmark configurations.
arXiv Detail & Related papers (2026-03-18T21:23:54Z) - TriFusion-LLM: Prior-Guided Multimodal Fusion with LLM Arbitration for Fine-grained Code Clone Detection [15.824017693868045]
Full Model is a multimodal fusion framework for code clone detection.<n>It improves discrimination among fine-grained clone types while keeping inference cost practical.<n>Full Model achieves an effective performance-cost trade-off for fine-grained CCD.
arXiv Detail & Related papers (2026-03-16T09:08:07Z) - $V_1$: Unifying Generation and Self-Verification for Parallel Reasoners [69.66089681814013]
$V_$ is a framework that unifies generation and verification through efficient pairwise ranking.<n>$V_$-Infer improves Pass@1 by up to $10%$ over pointwise verification.<n>$V_$-PairRL achieves $7$--$9%$ test-time scaling gains over standard RL and pointwise joint training.
arXiv Detail & Related papers (2026-03-04T17:22:16Z) - ShortcutBreaker: Low-Rank Noisy Bottleneck with Global Perturbation Attention for Multi-Class Unsupervised Anomaly Detection [59.89803740308262]
ShortcutBreaker is a novel unified feature-reconstruction framework for MUAD tasks.<n>It features two key innovations to address the issue of shortcuts.<n>The proposed method achieves a remarkable image-level AUROC of 99.8%, 98.9%, 90.6%, and 87.8% on four datasets.
arXiv Detail & Related papers (2025-10-21T06:51:30Z) - DiffuCoder: Understanding and Improving Masked Diffusion Models for Code Generation [68.19756761027351]
Diffusion large language models (dLLMs) are compelling alternatives to autoregressive (AR) models.<n>We investigate their denoising processes and reinforcement learning methods.<n>Our work provides deeper insight into the machinery of dLLM generation and offers an effective, diffusion-native RL training framework.
arXiv Detail & Related papers (2025-06-25T17:35:47Z) - An Empirical Study of Multimodal Model Merging [148.48412442848795]
Model merging is a technique that fuses multiple models trained on different tasks to generate a multi-task solution.
We conduct our study for a novel goal where we can merge vision, language, and cross-modal transformers of a modality-specific architecture.
We propose two metrics that assess the distance between weights to be merged and can serve as an indicator of the merging outcomes.
arXiv Detail & Related papers (2023-04-28T15:43:21Z)
This list is automatically generated from the titles and abstracts of the papers in this site.
This site does not guarantee the quality of this site (including all information) and is not responsible for any consequences.