Conceptio › Archive › arXiv CS
arXiv CS open access

A Unified Model for Cross-Domain Clone Detection via Model Merging

2026 · arxiv_cs
arXiv CS · Papers · 2026
Open Source ↗Direct PDF ↓
software-architecturesoftware-engineeringtesting
Conceptio Open Archive

Analyze & explore related research in Conceptio

Connect this record directly into your research workflow or AI agent. Explore citations across open repositories, query full text, and export structured proof bundles.

arXiv:2608.04215v1 [cs.SE] 4 Aug 2026

A Unified Model for Cross-Domain Clone Detection via Model Merging Palash R. Roy✉

Banani Roy

Kevin A. Schneider

Chanchal K. Roy

University of Saskatchewan Computer Science Saskatoon, Canada palash.roy@usask.ca

University of Saskatchewan Computer Science Saskatoon, Canada banani.roy@usask.ca

University of Saskatchewan Computer Science Saskatoon, Canada kevin.schneider@usask.ca

University of Saskatchewan Computer Science Saskatoon, Canada chanchal.roy@usask.ca

Abstract

Keywords

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. In our evaluation, F1 drops exceed 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 systematically evaluate parameter merging with five task-vector methods (Task Arithmetic, TIES, DARE-TIES, WUDI, PCB), architecture merging via greedy layer stitching, and cross-tokenizer alignment. Our study spans four pretrained code models, three benchmarks, and twelve merging configurations. Same-base TIES merging creates effective cross-domain detectors, validated across two model families and three random seeds. It reaches 0.865 combined F1 on UniXcoder, 93% of multitask training 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. We therefore recommend TIES for the practical recipe. Cross-base merging yields only marginal and high-variance gains across all five methods. This indicates that task vector compatibility through a shared pre-trained base is the binding factor for effective merging in our setting. Merged encoder-based detectors also outperform zero-shot instruction-tuned code LLMs on GPTCloneBench (0.609 vs. 0.454 F1 for the strongest LLM baseline) at substantially lower per-pair inference cost. They also generalize up to 4× 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 code clone detectors.

Code Clone Detection, Model Merging, Task Arithmetic, CrossDomain Generalization, Empirical Software Engineering, Deep Learning for Code

CCS Concepts • Software and its engineering → Software maintenance tools; Software evolution; • Computing methodologies → Artificial intelligence; Learning settings.

This work is licensed under a Creative Commons Attribution 4.0 International License. ASE ’26, Munich, Germany © 2026 Copyright held by the owner/author(s). ACM ISBN 979-8-4007-2882-2/2026/10 https://doi.org/10.1145/3832783.3837415

ACM Reference Format: Palash R. Roy, Banani Roy, Kevin A. Schneider, and Chanchal K. Roy. 2026. A Unified Model for Cross-Domain Clone Detection via Model Merging. In Proceedings of the 41st IEEE/ACM International Conference on Automated Software Engineering (ASE ’26), October 12–16, 2026, Munich, Germany. ACM, New York, NY, USA, 13 pages. https://doi.org/10.1145/3832783.3837415

1

Introduction

Code clone detection is fundamental to software maintenance, quality assurance, and evolution [42, 43, 45]. The field has made remarkable progress over the past two decades, moving from token-based and tree-based matching [7, 27, 29], through learned representations [58, 59, 66], to pre-trained code models that achieve strong results on established benchmarks [16, 18, 19, 34]. This progress has come with an underappreciated cost. Each new detection capability, whether for cross-language clones [37, 41] or AI-generated semantic clones [2, 47], produces a new specialist model that works well in its own domain but fails outside it. Teams must therefore deploy and maintain multiple specialized models, each limited to a single clone type or language pair. The consequence is a growing out-of-distribution (OOD) generalization problem [21, 55]. UniXcoder [18] fine-tuned on BigCloneBench [50] achieves 0.940 F1 on same-language clones but collapses to 0.269 on CLCDSA [37] cross-language detection, a 71% drop. The reverse is equally severe. This is a well-documented limitation of fine-tuned models under distribution shift [21, 40], and recent work confirms similar degradation for clone detectors on unseen functionalities [30, 33] and highlights its implications for software engineering (SE) [8, 40]. What is notable is that, despite the practical urgency, no prior work has investigated how this cross-domain fragmentation can be addressed for clone detection without retraining. The obvious remedy of training a single model on all available data has its own limitations [54]. Multi-task learning requires simultaneous access to every training corpus, full retraining whenever a new domain appears, and careful loss balancing to avoid negative transfer [10]. These requirements are impractical in many SE settings where training data may be proprietary, distributed across teams, or simply too expensive to combine [64]. This raises a question. How can we unify existing specialist detectors into a single cross-domain model without retraining and without access to any training data at the merging step?

ASE ’26, October 12–16, 2026, Munich, Germany

Model merging [23, 63, 65] offers a principled path forward. These techniques combine trained models by operating directly on their checkpoints, requiring no training data, no gradient computation, and no retraining for the merging step itself. Merging completes in under five minutes on a single CPU in our experiments. Model merging has shown promise in NLP [63, 70] and computer vision [23, 60], but its applicability to software engineering tasks remains unexplored. The merging techniques themselves are established, yet no prior work has investigated their applicability to software engineering or identified the conditions under which they succeed or fail for code-related tasks. We present the first systematic empirical investigation of model merging for code clone detection, spanning parameter merging, architecture merging, and cross-tokenizer alignment across multiple model families. Our study evaluates parameter merging with five task-vector methods (Task Arithmetic [23], TIES [63], DARETIES [65], WUDI [9], and PCB [12]) and simple averaging [60], architecture merging via greedy layer stitching, and cross-tokenizer representation alignment. This spans four pre-trained code models, three benchmarks, and twelve merging configurations. Same-base TIES merging produces a cross-domain detector that achieves 0.890 ± 0.010 F1 on same-language clones and 0.839 ± 0.027 on crosslanguage clones simultaneously across three seeds, a 25% combined improvement over the best individually fine-tuned model. Same-base WUDI achieves the highest in-distribution combined F1 in our experiments (0.899 ± 0.025), but TIES generalizes better to unseen AI-generated clones, which informs our recommendation of TIES for the practical recipe. Cross-base merging yields only marginal, high-variance gains, which we trace to destructive interference between near-orthogonal task vectors. Merging also holds up against strong alternatives. Multi-task training on the combined data wins in-domain (0.927 vs. 0.865 combined F1) but collapses on unseen AI-generated clones (0.151 F1), where merging generalizes far better. This suggests joint training overfits the combined distribution while merging retains complementary specialist knowledge. Two zero-shot instruction-tuned code LLMs, Qwen2.5-Coder-7B-Instruct and DeepSeek-Coder-6.7BInstruct, also fall short of the merged detector, which runs orders of magnitude faster per pair. Finally, architecture-level layer stitching is interpretable: cross-language layers dominate early transformer positions and same-language layers dominate late ones. A learned cross-tokenizer alignment fails to bridge incompatible vocabularies, pointing to a tokenizer limitation that linear alignment cannot resolve. We validate these findings across two model families (UniXcoder and CodeBERT). RQ1. How well do individual code clone detectors generalize across detection domains? We quantify the cross-domain gap to establish the severity of the OOD problem. RQ2. What conditions determine successful parameter-level merging for cross-domain code clone detection? We compare same-base and cross-base merging across five task-vector methods and benchmark against multi-task training and two zero-shot LLM baselines. RQ3. What representations are captured by different layers across domains, and how can layer stitching exploit them? We explore whether layer-level selection captures domain-specific roles that uniform merging cannot.

Palash R. Roy, Banani Roy, Kevin A. Schneider, and Chanchal K. Roy

RQ4. Do merged models generalize to unseen clone types, such as LLM-generated semantic clones? We test zero-shot robustness on AI-generated semantic clones unseen during training. We make the following contributions. (1) We provide the first systematic empirical study of post-hoc model merging for cross-domain code clone detection, and identify shared-base task-vector compatibility as the binding factor for effective merging without any training data at the merging step. (2) We give geometric and statistical evidence for why cross-base merging fails and same-base merging succeeds, and show this pattern holds across all five task-vector methods we evaluate, establishing that the compatibility boundary is method-independent rather than an artifact of any single algorithm. (3) We show that architecture-level layer stitching reveals interpretable domain-specific patterns, and identify a tokenizer barrier that linear cross-tokenizer alignment cannot overcome. (4) We distill a practical, training-data-free recipe: fine-tune one shared base per domain and merge with TIES at the parameter level. We discuss its scope and limitations in Section 6. 2. Cross-domain evaluation

1. Domain Specific Fine tuning Same language expert (θ_SL)

BigCloneBench

Fine-tuned on same language Fine tuning

Pre-trained Encoder

Cross-language expert (θ_CL)

CLCDSA Benchmark

(θ_CL) tested on same-language data F1 drops>70%

(θ_SL) tested on cross-language data F1 drops>70%

Fine-tuned on cross language

3.Model Merging

Parameter Merging 4. Evaluation

1. Compute Task Vector 2. TIES trim + elect sign 3. Merged Models

1. BigCloneBench 2. CLCDSA 3. GPTCloneBench

Architecture Merging

(Zero Shot)

1. Build a layer pool 2. Greedy Search

No training on GPTCloneBench

3. Assemble the stitched model

Figure 1: Overview of our four-phase approach.

2

Background

Code Clones. Code clones are similar code fragments that arise through copy-paste, independent development, or automated generation [43]. The standard taxonomy [42, 43] ranges from exact copies (Type-1) through renamed (Type-2) and modified (Type-3) fragments to functionally equivalent but syntactically different code (Type-4). Two specialized forms of Type-4 clones are increasingly important. Cross-language clones are functionally equivalent implementations across different languages [37], and AI-generated semantic clones are code produced by large language models with distinct syntactic patterns [2, 3, 47]. Each requires its own detector and training data, creating the cross-domain fragmentation problem we address. Our focus is on generalization across these detection domains, which is distinct from Type-1 through Type-4 generalization within a single domain. Model Merging. Model merging combines multiple trained models into a single model without additional training [23]. Its key

A Unified Model for Cross-Domain Clone Detection via Model Merging

abstraction is the task vector, the difference between a fine-tuned model’s parameters and its pre-trained base. Task vectors encode domain-specific knowledge and can be arithmetically combined to transfer it across tasks [23]. Several methods refine naive taskvector addition. TIES [63] resolves sign conflicts through trimming and sign election, DARE [65] drops and rescales elements to reduce redundancy, WUDI [9] minimizes per-layer cross-task interference without training data, and PCB [12] balances parameter competition before rescaling. These methods succeed in NLP and computer vision, but their applicability to software engineering remains largely unexplored.

3

Approach

Figure 1 presents an overview of our approach. We investigate model merging for code clone detection through a four-phase pipeline: (1) domain-specific fine-tuning of specialist models, (2) cross-domain evaluation to quantify the generalization gap, (3) model merging through parameter-level and architecture-level strategies, and (4) evaluation on both in-domain and unseen benchmarks.

3.1

Domain-Specific Fine-Tuning

We formulate clone detection as a binary classification task over code pairs. Given a pair (𝑥 1, 𝑥 2 ), we concatenate the two code snippets as [CLS] 𝑥 1 [SEP] 𝑥 2 [SEP] and pass them through the encoder. The [CLS] representation is fed through a dropout layer and a linear classification head (768 → 2) trained using crossentropy loss. Given a pre-trained encoder 𝜃 base , we fine-tune on a target dataset D𝑘 to obtain a specialist checkpoint 𝜃 𝑘 optimized for a single detection domain. This yields 𝐾 specialist models. Each one achieves high performance on its respective domain but degrades severely on out-of-distribution inputs. Before merging, we evaluate each specialist on all benchmarks to quantify the cross-domain gap and identify complementary models.

3.2

Parameter-Level Merging

Parameter-level merging combines the weights of multiple specialist models into a single unified model through arithmetic operations on their parameters, without requiring any training data or gradient computation at the merging step. 3.2.1 Task Vectors. Given a fine-tuned model 𝜃 𝑘 and its corresponding pre-trained base 𝜃 base , the task vector [23] is defined as 𝛿𝑘 = 𝜃 𝑘 − 𝜃 base (1) The task vector 𝛿𝑘 encodes the knowledge gained during fine-tuning on domain 𝑘. A merged model is constructed by adding a weighted combination of task vectors back to the base model, 𝐾 ∑︁ 𝜃 merged = 𝜃 base + 𝜆𝑘 · 𝛿𝑘 (2) 𝑘=1

where 𝜆𝑘 are merging weights that control the relative contribution of each specialist. In our experiments, we set 𝜆𝑘 = 1/𝐾 for all specialists unless otherwise specified. 3.2.2 TIES Merging. Naively summing task vectors leads to interference when parameters from different specialists conflict in sign or magnitude. TIES (TrIm, Elect Sign, and Merge) [63] addresses

ASE ’26, October 12–16, 2026, Munich, Germany

this through three steps: (1) Trim: zero out task vector values below a percentile threshold, retaining only the most significant parameter changes. (2) Elect sign: for each parameter position, compute a weighted vote across all task vectors and elect the majority sign direction. (3) Merge: sum only the task vector values whose signs agree with the elected direction, discarding conflicting updates. The merged model becomes 𝜃 merged = 𝜃 base +

𝐾 ∑︁

𝜆𝑘 · TIES(𝛿𝑘 , {𝛿 𝑗 }𝐾𝑗=1 )

(3)

𝑘=1

3.2.3 DARE Dropping. DARE (Drop And REscale) [65] extends task vector merging by randomly dropping a fraction 𝑝 of each task vector’s elements and rescaling the surviving values by 1/(1 − 𝑝), 1 𝛿˜𝑘 = · (𝑚 ⊙ 𝛿𝑘 ), 𝑚𝑖 ∼ Bernoulli(1 − 𝑝) (4) 1−𝑝 where ⊙ denotes element-wise multiplication. DARE can be combined with TIES to form DARE-TIES, where dropping is applied before the trim-elect-merge steps. 3.2.4 WUDI Merging. WUDI [9] casts merging as a per-layer optimization rather than a heuristic conflict-resolution rule. For each linear layer, it searches for the merged task vector that minimizes cross-task interference, without training data or rescaling coeffi𝐾 is cients. The objective for a layer with task vectors {𝛿𝑘 }𝑘=1 LWUDI (𝛿) =

𝐾 ∑︁ ∥(𝛿 − 𝛿𝑘 ) 𝛿 ⊤ ∥ 2 𝑘

𝑘=1

∥𝛿𝑘 ∥ 2𝐹

𝐹

,

(5)

where ∥ · ∥ 𝐹 is the Frobenius norm, and the merged model is 𝜃 merged = 𝜃 base + arg min𝛿 LWUDI (𝛿). We initialize 𝛿 as the taskarithmetic sum and optimize with Adam (1×10−5 , 300 steps) per linear layer, applying WUDI to the encoder and classifier-head weight matrices and averaging non-linear parameters (layer normalization, embeddings, biases) as in TIES. 3.2.5 PCB Merging. PCB [12] is a training-free task-vector method that balances parameter competition within and across task vectors, dropping low-competition parameters before rescaling. We include it as a fifth method to test whether the same-base compatibility boundary holds beyond sign election (TIES) and interference minimization (WUDI). 3.2.6 Same-Base Hypothesis. We hypothesize that effective parameter merging requires all specialist models to share the same pretrained base 𝜃 base . When specialists are fine-tuned from different base models (e.g., CodeBERT vs. UniXcoder), their task vectors reside in different parameter spaces, and arithmetic combination may produce destructive interference rather than constructive merging. Whether the shared-base principle established in NLP and vision [9, 23, 63] holds for code clone detection, where models differ in pre-training objectives and tokenizers, remains an open empirical question. We validate this hypothesis across all five taskvector methods (Task Arithmetic, TIES, DARE-TIES, WUDI, and PCB) in Section 5.

3.3

Architecture-Level Merging

While parameter merging operates uniformly across all layers, different layers of a transformer may benefit from different specialists.

ASE ’26, October 12–16, 2026, Munich, Germany

Palash R. Roy, Banani Roy, Kevin A. Schneider, and Chanchal K. Roy

Table 1: Summary of evaluation benchmarks.

Architecture-level merging addresses this by selecting, for each layer position, which specialist’s layer to use in the final composite model. 3.3.1 Layer Pool Construction. Given 𝐾 specialist models each with 𝐿 transformer layers, we construct a layer pool P = {(𝑘, 𝑙) | 𝑘 ∈ [1, 𝐾], 𝑙 ∈ [0, 𝐿−1]} containing all candidate layers. For two specialists, this yields 2𝐿 candidate layers for 𝐿 positions. 3.3.2 Greedy Layer Selection. We employ a greedy search to construct the optimal inference path through the layer pool. Starting from the best-performing individual specialist as the initial model, we iterate over each layer position 𝑙 = 0, 1, . . . , 𝐿−1 and evaluate whether swapping in an alternative specialist’s layer improves a combined evaluation objective, F =

1 (F1SL + F1CL ) 2

(6)

We compute F on held-out validation sets for each domain. Greedy search requires only 𝐾 × 𝐿 evaluations (24 in our setting) compared to 𝐾 𝐿 for exhaustive enumeration, while producing strong results in practice. At each position, the swap that yields the highest F is retained. If no swap improves over the current configuration, the original layer is kept. This produces a composite model where each layer is drawn from whichever specialist contributes most to the combined objective at that position. 3.3.3 Tokenizer Constraint. Architecture-level merging requires that all candidate models share the same tokenizer. Different tokenizers produce different token ID sequences for the same source code, making the embedding layers incompatible. We investigate whether this constraint can be relaxed through representation alignment (Section 3.4).

3.4

Cross-Tokenizer Representation Alignment

To enable merging across models with different tokenizers, we explore learning a linear projection that maps one model’s hidden representations into the other’s space. Given a source model 𝜃 𝑆 (e.g., UniXcoder, vocabulary size 51,416) and a target model 𝜃𝑇 (e.g., CodeBERT, vocabulary size 50,265), we collect paired hidden states by feeding the same raw code samples through both models using their respective tokenizers. We use a separate subset of training data, disjoint from downstream evaluation, to avoid leakage. For each transformer layer 𝑙, we train a linear projection 𝑊𝑙 ∈ R𝑑 ×𝑑 that minimizes Lalign = ∥𝑊𝑙 · ℎ𝑆(𝑙 ) − ℎ𝑇(𝑙 ) ∥ 22 + 𝛼 · LCORAL

(7)

where ℎ𝑆(𝑙 ) and ℎ𝑇(𝑙 ) are the mean-pooled hidden states at layer 𝑙 from the source and target models respectively. We use mean pooling to obtain stable sequence-level representations across variable-length inputs. LCORAL is the Deep CORAL loss [49] that aligns the covariance structures of the two representation spaces. Once trained, the projection 𝑊𝑙 is inserted as a forward hook after layer 𝑙 whenever a source model layer is selected by the greedy search, transforming the output into the target model’s representation space before passing to the next layer.

4

Dataset

Domain

Train

Test

Lang.

BCB CLCDSA data GPTCloneBench

Same-lang Cross-lang AI-Clone

901,028 484,676 —

415,416 111,032 10,000

Java Java, Py Java

Experimental Setup

Datasets. Table 1 summarizes the three benchmarks used in our evaluation. BigCloneBench (BCB) [52] is the most widely used benchmark for same-language code clone detection. We use the CodeXGLUE split [34] in Java. The dataset exhibits class imbalance with approximately 14% positive clone pairs, which we address using weighted random sampling proportional to inverse class frequency. CLCDSA data [37] is a cross-language clone detection benchmark containing solutions in multiple programming languages to competitive programming problems from AtCoder and CodeJam. We use the Java↔Python subset throughout our experiments, in which each pair consists of one Java source file and one Python source file. We apply a problem-level split (70/15/15) to ensure no problem overlap between splits, and negative pairs are constructed by sampling Python solutions from different problems. The resulting subset is approximately balanced with 50% positive pairs by construction. GPTCloneBench [2] contains GPT-generated semantic clones built upon SemanticCloneBench [1]. We construct 10,000 balanced evaluation pairs by randomly sampling from the Java subset, using 5,000 true clones from intra-prompt pairs and 5,000 non-clones from cross-functionality pairs, with a fixed random seed for reproducibility. No model is trained on this benchmark. It serves exclusively for zero-shot generalization evaluation. Subject Models. We select three pre-trained code models based on the RoBERTa encoder architecture, each with 12 transformer layers and 768-dimensional hidden representations. CodeBERT [16] is pre-trained on code-natural language pairs in six programming languages using masked language modeling and replaced token detection. GraphCodeBERT [19] extends CodeBERT by incorporating data flow graphs during pre-training. Both share the same tokenizer with vocabulary size 50,265. UniXcoder [18] is a unified cross-modal model that uses AST-based pre-training objectives for code understanding and generation, with a distinct tokenizer of vocabulary size 51,416. We fine-tune CodeBERT and GraphCodeBERT on BigCloneBench, and fine-tune UniXcoder on both BigCloneBench and the CLCDSA Java↔Python subset, producing four specialist models (Table 2). We focus on UniXcoder for cross-language fine-tuning because it incorporates explicit cross-modal pretraining objectives [18], whereas CodeBERT and GraphCodeBERT use NL-PL pair pre-training. This design enables our central comparison between same-base merging (two UniXcoder variants) and cross-base merging (CodeBERT, GraphCodeBERT, and UniXcoder). Implementation Details. All specialist models are fine-tuned with identical hyperparameters. We use the AdamW optimizer with learning rate 2 × 10−5 , batch size 32, maximum sequence length 512, 10% linear warmup, and early stopping with patience of 3 epochs (up

A Unified Model for Cross-Domain Clone Detection via Model Merging

Table 2: Specialist models and their validation F1 scores. Model

Training Data

Valid. F1

CodeBERT GraphCodeBERT UniXcoder-BCB UniXcoder-CLCDSA

BCB BCB BCB CLCDSA data

0.895 0.905 0.931 0.940

to 10 epochs maximum). Training uses mixed precision (bfloat16) on NVIDIA A100 80GB PCIe GPUs. For the multi-task baseline, we finetune UniXcoder on the combined BCB and CLCDSA data training sets (1.38M pairs) using identical hyperparameters. For the CodeBERT validation experiment (Section 6), we fine-tune CodeBERT on CLCDSA data using the same settings. To assess robustness, all specialist models involved in same-base merging are trained across three random seeds (42, 2, 3). We report mean ± standard deviation for merged model performance. For parameter merging, we evaluate multiple configurations as detailed in Section 5. We use DARE-TIES (drop rate 𝑝 = 0.3), TIESonly (𝑝 = 0), and simple averaging (no trimming), with merging weights 𝜆𝑘 = 1/𝐾. For WUDI merging [9], we follow the official RoBERTa implementation with the Adam optimizer (learning rate 1 × 10−5 , 300 steps per linear layer) and the merged delta initialized as the task-arithmetic sum. Non-linear parameters (LayerNorm, embeddings, biases) use weighted averaging with 𝜆𝑘 = 1/𝐾. For PCB merging [12], we follow the official implementation with drop rate 0.1 and intra-balancing scale 1.0, applying PCB to the linear weight matrices and averaging non-linear parameters as above. For architecture merging, the greedy layer search evaluates each candidate swap on 1,000 held-out validation samples per dataset. For cross-tokenizer alignment, we train 12 linear projections (768 × 768) on 5,000 code samples from the BigCloneBench training set (disjoint from evaluation data) using MSE + CORAL loss (𝛼 = 0.1) for 20 epochs. All models are evaluated using identical procedures with the same test splits, the same classification threshold (argmax over logits), and the same metric computation pipeline. All model selection and merging decisions are performed on validation sets, and final performance is reported on held-out test sets throughout Section 5. LLM Baseline. To compare our merged encoder-based detector against representative instruction-tuned code LLMs, we evaluate two models, Qwen2.5-Coder-7B-Instruct [22] and DeepSeek-Coder6.7B-Instruct [20], in a zero-shot setting on GPTCloneBench using the official model releases without any task-specific fine-tuning. For each evaluation pair (𝑥 1, 𝑥 2 ), we apply the model’s chat template with a fixed system prompt (“You are an expert software engineer specializing in code clone detection.”) and a user prompt that presents the two snippets and asks the model to answer with a single word, “Yes” or “No”, indicating whether the snippets are semantic clones. Both models receive an identical prompt, decoding configuration, and evaluation set; only their respective instruction formats differ. We decode greedily (do_sample=False) with a maximum of 32 new tokens and parse the Yes/No verdict from the generated response. Outputs that do not conform to the requested one-word format (0% for Qwen, 13.6% for DeepSeek) are scored as non-clone. If the combined token length exceeds the context budget, we truncate the two snippets proportionally to their lengths (0

ASE ’26, October 12–16, 2026, Munich, Germany

Table 3: Cross-domain evaluation of specialist models. Bold = in-domain. Model

BCB F1

CLCDSA F1

F1comb

CodeBERT GraphCodeBERT UniXcoder-BCB UniXcoder-CLCDSA

0.894 0.891 0.940 0.259

0.464 0.495 0.269 0.924

0.679 0.693 0.605 0.592

of 10,000 pairs required truncation in our runs). Inference is dataparallel across NVIDIA A100 80GB PCIe GPUs in bfloat16, on the same 10,000 GPTCloneBench pairs and seed used throughout the paper. The full prompt template, per-pair predictions, and inference scripts are in the replication package (Section 9). Evaluation Metrics. We report F1 score, precision, and recall for binary clone detection on each benchmark’s full test set. To measure cross-domain effectiveness, we define the combined F1 as F1comb =

1 (F1SL + F1CL ) 2

(8)

where F1SL and F1CL are F1 scores on BigCloneBench and CLCDSA data test sets respectively. We use equal weighting in the absence of a domain-specific preference.

5

Results

RQ1. Cross-Domain Generalization Gap Table 3 presents the cross-domain evaluation results. All four specialist models achieve strong in-domain performance with F1 ≥ 0.891, confirming that fine-tuning produces effective domainspecific detectors. Cross-domain performance, however, degrades severely. UniXcoder-BCB achieves 0.940 F1 on BigCloneBench but only 0.269 on CLCDSA, a 71% drop. Conversely, UniXcoderCLCDSA achieves 0.924 on CLCDSA but collapses to 0.259 on BigCloneBench, a 72% drop. CodeBERT and GraphCodeBERT exhibit a similar pattern with 44–48% drops on CLCDSA. This degradation confirms the out-of-distribution challenge described in Section 1. Each model’s learned decision boundary is specific to its training distribution and does not transfer across clone detection domains. The best combined F1 among individual models is only 0.693 (GraphCodeBERT), indicating that no single specialist adequately covers both domains despite achieving up to 0.940 F1 on its home benchmark. Finding 1. Individual clone detectors suffer 44–72% F1 drops when evaluated outside their training domain, confirming the OOD generalization failure. No individual model achieves a combined F1 above 0.693. RQ2. Parameter-Level Merging Table 4 presents parameter merging results across ten configurations. Cross-base merging is consistently weaker and less stable than same-base merging. The best cross-base configurations, PCB (0.739 ± 0.060) and TIES-only (0.703), exceed the best individual model (0.693) only modestly and fall well short of every same-base merge, while weaker weightings collapse entirely (down to 0.260). The two three-seed methods, WUDI (0.656 ± 0.074) and PCB (0.739 ± 0.060), share an asymmetric, unstable profile: BCB F1 stays high as

ASE ’26, October 12–16, 2026, Munich, Germany

Palash R. Roy, Banani Roy, Kevin A. Schneider, and Chanchal K. Roy

Table 4: Parameter merging results. Three-seed mean ± std for same-base TIES/WUDI/PCB and cross-base WUDI/PCB. Configuration

Drop 𝑝

BCB F1

CLCDSA F1

F1comb

Cross-base

DARE-TIES (CB/GCB/UX, 𝜆=0.4/0.3/0.3) TIES-only (CB/GCB/UX, 𝜆=0.4/0.3/0.3) Equal weights (CB/GCB/UX, 𝜆=0.33 each) UniX-heavy (CB/GCB/UX, 𝜆=0.2/0.2/0.6) WUDI (UX-BCB + CB-CLCDSA, 𝜆=0.5/0.5) PCB (UX-BCB + CB-CLCDSA, 𝜆=0.5/0.5)

0.3 0.0 0.3 0.3 — —

0.864 0.841 0.502 0.241 .939±.001 .935±.004

0.332 0.566 0.017 0.619 .372±.148 .542±.122

0.598 0.703 0.260 0.430 .656±.074 .739±.060

Same-base

Simple averaging (UX+UX, 𝜆=0.5/0.5) TIES (UX+UX, 𝜆=0.5/0.5) PCB (UX+UX, 𝜆=0.5/0.5) WUDI (UX+UX, 𝜆=0.5/0.5)

0.0 0.0 — —

0.893 .890±.010 .910±.030 .935±.004

0.801 .839±.027 .854±.040 .863±.052

0.847 .865±.012 .882±.009 .899±.025

the UniXcoder-BCB specialist dominates its own parameter space, while CLCDSA F1 shows a lower mean and far higher variance (up to ±0.148) than its same-base counterpart. This limitation is not specific to TIES or DARE. It persists under WUDI’s interferenceminimization and PCB’s competition-balancing objectives, indicating the compatibility constraint is method-independent. Same-base merging is highly effective. When both specialists share the same pre-trained base (UniXcoder), even simple averaging achieves 0.847 combined F1, already surpassing all cross-base configurations. TIES further improves this to 0.865 ± 0.012 across three seeds and PCB to 0.882 ± 0.009. WUDI, which directly optimizes the merged task vector per linear layer to minimize cross-task interference, achieves the highest in-domain combined F1 at 0.899 ± 0.025, retaining 96–99% of each specialist’s in-domain performance without any training data at the merging step. The gap between TIES and simple averaging indicates that sign conflict resolution contributes meaningfully even when task vectors share the same base. WUDI’s further gain shows that direct interference-minimization extracts additional in-distribution signal compared to sign-election heuristics, with PCB falling between. However, WUDI’s OOD behavior differs from TIES (Section 5), which informs our practical recommendation. Section 6 analyzes the geometric properties of same-base and cross-base task vectors. Comparison with multi-task training. To assess whether the merging step can compete with training on all data simultaneously, we fine-tune UniXcoder on the combined BCB and CLCDSA data (1.38M pairs). The multi-task model achieves higher in-domain performance (combined 0.927), as expected. Same-base TIES achieves 93% of this and same-base WUDI 97%, without any training data at the merging step. However, the multi-task model underperforms substantially on GPTCloneBench (0.151 F1), while same-base TIESmerged models generalize far better (0.450–0.609 mean F1 across three seeds). Training on all domains simultaneously leads to overfitting the combined distribution, whereas merging retains independently optimized specialist knowledge. Finding 2. Same-base merging is method-independent and consistently outperforms cross-base merging across all five task-vector methods. Same-base TIES reaches 93% of multitask performance without any training data and generalizes 4× better to unseen GPT-generated clones.

Layer source selection UniXcoder-BCB

0

1

2

3

4

5

UniXcoder-CLCDSA

6

7

8

9

10 11

Combined F1 progression during greedy search Combined F1

Category

0.8

0.7

0.6 0

1

2

3

4

5

6

7

8

9

10 11

Layer index

Figure 2: Greedy layer selection for UniXcoder-BCB + UniXcoder-CLCDSA. RQ3. Architecture-Level Merging Table 5 compares architecture merging with parameter merging across three scenarios. The relative effectiveness depends strongly on model compatibility (samebase vs. cross-base). Table 5: Architecture merging compared to parameter merging. Configuration

BCB

CLCDSA

F1comb

Same-tokenizer, different base CB+GCB (param.) 0.841 CB+GCB (arch.) 0.856

0.566 0.620

0.703 0.738

Same-base UX+UX (arch.) UX+UX (param. TIES) UX+UX (param. WUDI)

0.842 0.900 0.935

0.743 0.841 0.881

0.793 0.871 0.908

Cross-tokenizer (with alignment) CB+GCB+UX (arch.) 0.856

0.620

0.738

Architecture merging outperforms parameter merging for cross-base models. When merging CodeBERT and GraphCodeBERT (same tokenizer, different bases), greedy layer stitching (0.738) outperforms cross-base TIES (0.703) by 5%. The greedy search identifies an interpretable pattern. CodeBERT layers are selected for

A Unified Model for Cross-Domain Clone Detection via Model Merging

early positions (layers 0–4, 7) while GraphCodeBERT layers are retained for later positions (layers 5–6, 8–11). This suggests that CodeBERT’s early layers capture stronger token-level representations, while GraphCodeBERT’s later layers leverage its data-flow pretraining for higher-level clone reasoning. For same-base models, parameter merging outperforms architecture merging. Same-base UniXcoder parameter merges (TIES at 0.871, WUDI at 0.908) substantially outperform same-base architecture merging (0.793). When task vectors are compatible, uniform parameter combination across all layers is more effective than layer-level selection, which forces an all-or-nothing choice at each layer position. Parameter merging instead allows smooth interpolation across all parameters, enabling more effective integration of complementary knowledge. Cross-tokenizer alignment does not improve architecture merging. Despite training linear projections with alignment loss below 0.005 for early layers (0–6), the greedy search never selected aligned UniXcoder layers over CodeBERT or GraphCodeBERT alternatives. Alignment loss increases sharply for later layers (0.090 for layer 10, 0.167 for layer 11), indicating that the representations diverge too substantially for linear projection to bridge. The tokenizer barrier may therefore reflect deeper differences in how models encode code semantics, not merely a vocabulary mismatch. Figure 2 visualizes the layer selection path for the same-base UniXcoder merge. Cross-language (CLCDSA) layers dominate early and middle positions (layers 0, 2–5, 7, 11), while same-language (BCB) layers are retained at positions 1, 6, 8–10. This pattern suggests that cross-language fine-tuning produces stronger low-level code representations that capture language-agnostic features, while same-language fine-tuning specializes later layers for within-language clone discrimination. The validation-set combined F1 increases steadily from 0.617 (single specialist baseline) to 0.815 during the greedy search, with the largest gains at layers 3–5 where cross-language layers are introduced. The final held-out test performance of the resulting composite model is 0.793 (Table 5). Finding 3. Architecture merging outperforms parameter merging for cross-base models (+5%) but underperforms for samebase models. Layer stitching reveals that cross-language layers dominate early positions while same-language layers dominate late positions. Linear cross-tokenizer alignment is insufficient. RQ4. Generalization to GPT-Generated Clones Table 6 reports zero-shot GPTCloneBench [2] F1 in its final column. All models were evaluated without any training or exposure to GPT-generated code. Despite the substantial domain shift from human-written to AI-generated clones, the same-base TIES merge and the architecture merge outperform every individual encoder specialist. The multi-task model trained on all available data achieves only 0.151 F1, substantially worse than all individual specialists and merged models, indicating severe overfitting to the combined training distribution. Two merges generalize markedly better than any individual encoder. The same-base TIES merge of two CodeBERT specialists reaches the highest GPTCloneBench F1 at 0.609 across three seeds, a 35.3% improvement over the best individual encoder (CodeBERT,

ASE ’26, October 12–16, 2026, Munich, Germany

0.450), and the architecture merge of CodeBERT and GraphCodeBERT reaches 0.528 (+17.3%). The same-base UniXcoder TIES merge is on par with the best encoder at 0.450. Comparison with zero-shot LLM baselines. We evaluate two instruction-tuned code LLMs on the same 10,000 GPTCloneBench pairs (Section 4). Qwen2.5-Coder-7B-Instruct achieves 0.454 F1 (precision 0.482, recall 0.429), comparable to the best individual encoder specialist but below the strongest merged detectors. DeepSeekCoder-6.7B-Instruct is markedly more conservative under the identical prompt, predicting clone for only 510 of 10,000 pairs and reaching 0.120 F1 (precision 0.647, recall 0.066). Both LLMs fall below the same-base TIES merge of two CodeBERT specialists (0.609), which outperforms Qwen by 0.155 and DeepSeek by 0.489 F1 absolute. The cost gap is also large. Qwen inference required 628.9 seconds wall-clock for 10,000 pairs on three A100 GPUs, equivalent to 0.189 seconds per pair on a single-GPU basis, and DeepSeek is comparable. Encoder-based detectors process the same pairs in the order of milliseconds per pair on a single GPU. For repository-scale or CIbased clone detection workflows, a merged encoder detector is both more accurate and orders of magnitude cheaper than a zero-shot code LLM. WUDI and PCB show different generalization profiles. While WUDI improves over TIES on in-distribution benchmarks (Table 4), it consistently underperforms TIES on the OOD GPTCloneBench across all three seeds for both base models (UX 0.248 ± 0.050, CB 0.412 ± 0.059, vs. TIES 0.450 and 0.609). PCB falls between the two on OOD as well (UX 0.361, CB 0.567), consistent with its intermediate in-distribution profile. WUDI’s per-layer interferenceminimization preserves each specialist’s decision surface precisely, which helps in-distribution but reduces robustness to AI-generated clones the specialists never saw; TIES’s softer sign-election generalizes better OOD. We therefore recommend same-base TIES rather than WUDI as the practical merging recipe (Section 1, contribution 4) when OOD robustness is a deployment concern. Table 6 and Table 7 consolidate all results across the three benchmarks. The geometric reasons behind the same-base advantage and the WUDI in-distribution / OOD trade-off are discussed in Section 6. Finding 4. Same-base TIES-merged and architecture-merged models generalize better to unseen GPT-generated clones than any individual encoder specialist, the multi-task baseline, and two zero-shot instruction-tuned code LLMs (up to +35.3% over the best individual encoder). WUDI, while stronger indistribution, underperforms on this OOD benchmark, with PCB intermediate, revealing an in-distribution / OOD trade-off within the same-base regime that informs our practical recommendation of TIES.

6

Discussion

Why Same-Base Merging Works. To explain why same-base merging succeeds while cross-base merging provides only marginal improvement and high variance, we analyze the geometric properties of the corresponding task vectors. We compute the cosine similarity and sign agreement between task vectors from same-base models (UniXcoder-BCB and UniXcoderCLCDSA) and cross-base models (UniXcoder-BCB and CodeBERTBCB).

ASE ’26, October 12–16, 2026, Munich, Germany

Palash R. Roy, Banani Roy, Kevin A. Schneider, and Chanchal K. Roy

Table 6: Complete results across all three benchmarks. Three-seed mean ± std for same-base TIES/WUDI/PCB and cross-base WUDI/PCB. Category

Method

BCB F1

CLCDSA F1

F1comb

GPT F1

Individual

CodeBERT-BCB GraphCodeBERT-BCB UniXcoder-BCB UniXcoder-CLCDSA

0.894 0.891 0.940 0.259

0.464 0.495 0.269 0.924

0.679 0.693 0.605 0.592

0.450 0.376 0.390 0.410

Multi-task

Combined training (UX)

0.933

0.922

0.927

0.151

LLM (zero-shot)

Qwen2.5-Coder-7B-Instruct DeepSeek-Coder-6.7B-Instruct

— —

— —

— —

0.454 0.120

Param. merge

Cross-base TIES Cross-base WUDI Cross-base PCB Same-base TIES (UX) Same-base TIES (CB) Same-base WUDI (UX) Same-base WUDI (CB) Same-base PCB (UX) Same-base PCB (CB)

0.841 .939±.001 .935±.004 .890±.010 .801±.018 .935±.004 .883±.003 .910±.030 .847±.015

0.566 .372±.148 .542±.122 .839±.027 .746±.012 .863±.052 .868±.023 .854±.040 .824±.035

0.703 .656±.074 .739±.060 .865±.012 .774±.014 .899±.025 .876±.012 .882±.009 .836±.014

— — .529±.091 .450±.042 .609±.049 .248±.050 .412±.059 .361±.018 .567±.003

Arch. merge

CB + GCB UX + UX

0.856 0.842

0.620 0.743

0.738 0.793

0.528 0.339

Table 7: Precision (P) and Recall (R) for key configurations. BCB

CLCDSA

GPT

Model

P

R

P

R

P

R

UniX-BCB UniX-CLCDSA Multi-task Same-base TIES Qwen2.5-Coder-7B DeepSeek-Coder-6.7B Arch. (CB+GCB)

.942 .155 .949 .905 — — .820

.937 .788 .919 .896 — — .895

.563 .949 .947 .871 — — .509

.177 .900 .898 .813 — — .793

.505 .483 .517 .516 .482 .647 .507

.318 .356 .089 .468 .429 .066 .551

Table 8: Task vector alignment analysis. Metric Cosine similarity Sign agreement

Same-Base

Cross-Base

0.032 59.5%

0.001 50.4%

Table 8 reveals a stark difference. Same-base task vectors exhibit substantially higher cosine similarity (0.032 vs. 0.001), indicating that fine-tuning from the same base produces parameter updates that, while task-specific, remain directionally aligned in parameter space. Cross-base task vectors are nearly orthogonal. Both cosine similarities are small in absolute terms, but the 32× relative difference is meaningful because TIES merging operates on perparameter sign agreement, not on global vector alignment. Even modest directional consistency enables productive sign election, as confirmed by the 59.5% vs. 50.4% sign agreement gap. The sign agreement is particularly relevant for TIES, which resolves parameter conflicts by electing the majority sign direction. At 59.5% agreement, same-base task vectors provide a consistent signal for sign election, allowing TIES to identify and retain productive

updates from both domains. At 50.4%, cross-base sign agreement is close to random, leaving TIES with no coherent signal to resolve conflicts. This directly explains the empirical gap observed in Section 5, where cross-base TIES merging (F1comb 0.703) barely improves over individual models, whereas same-base TIES merging achieves 0.865 ± 0.012 across three seeds. The geometric argument also explains the behavior of WUDI and PCB under the cross-base setting. WUDI’s per-layer objective minimizes the projection of each task vector’s residual onto its own subspace (Section 3.2.4). When task vectors reside in different parameter spaces, these subspaces themselves are not aligned, and the per-task projections that WUDI tries to preserve become inconsistent across tasks. Empirically, both cross-base WUDI and cross-base PCB underperform their same-base counterparts on combined F1 and show substantially wider CLCDSA variance across seeds (up to ±0.148, Table 4), despite PCB optimizing an unrelated competition-balancing objective. The compatibility requirement therefore does not depend on TIES-specific mechanisms such as sign election, nor on WUDI’s interference minimization. It arises from the more fundamental requirement that task vectors reside in a shared parameter space, and it applies to any task-vector merging method that operates under that assumption. The multi-task model’s failure on GPTCloneBench (0.151 F1) provides further insight. Multi-task training optimizes a single set of parameters to jointly minimize loss across both BCB and CLCDSA data, producing a decision boundary tightly fitted to the combined training distribution. When encountering GPT-generated clones, which exhibit substantially different syntactic patterns, this boundary fails entirely. Model merging instead combines two independently optimized specialists through arithmetic combination of their task vectors, preserving the representational diversity of

A Unified Model for Cross-Domain Clone Detection via Model Merging

ASE ’26, October 12–16, 2026, Munich, Germany

Table 9: Same-base merging validated on CodeBERT. Merge row is three-seed mean ± std.

(a) BigCloneBench (n=415,416)

(b) CLCDSA (n=111,032)

3431 1000

Model CB-BCB CB-CLCDSA CB TIES merge

BCB 0.894 0.000 .801±.018

CLCDSA 0.464 0.924 .746±.012

F1comb 0.679 0.462 .774±.014

GPT

10972 2919

0.450 0.000 .609±.049

250138

152088

2590

Clone Category

UX-BCB

UX-CL

TIES (UX)

TIES (CB)

Count

Type-1/2 (≥0.9) Strong T3 (0.7–0.9) Moderate T3 (0.5–0.7) Weak T3/T4 (<0.5)

1.000 1.000 0.994 0.937

0.948 0.547 0.639 0.788

1.000 1.000 1.000 0.895

1.000 1.000 1.000 0.900

193 53 155 56,419

Overall

0.937

0.788

0.896

0.900

56,820

each specialist rather than collapsing it into a single jointly optimized representation. This appears to provide greater robustness to distribution shifts beyond the training domains. Validation Across Model Families. To validate that the same-base principle generalizes beyond UniXcoder, we fine-tune CodeBERT on CLCDSA data and merge with CodeBERT-BCB using TIES under identical settings. Table 9 confirms that same-base merging works for a second model family. CodeBERT-CLCDSA exhibits complete cross-domain collapse on BCB (0.000 F1), more severe than UniXcoder-CLCDSA (0.259 F1). The merged model nevertheless recovers to 0.801 / 0.746 mean F1 across three seeds, a 14% combined improvement over the best individual CodeBERT (0.679). The merged CodeBERT also achieves 0.609 ± 0.049 F1 on GPTCloneBench, the highest zero-shot score across all models in our study. Prediction distributions reveal why the two CLCDSA specialists differ in cross-domain behavior. CodeBERT-CLCDSA assigns nearzero clone probability to all BCB pairs (mean 0.034), predicting every pair as non-clone with high confidence. UniXcoder-CLCDSA, by contrast, exhibits high uncertainty on BCB pairs (mean clone probability 0.603, std 0.245), over-predicting clones but capturing some true positives in the process. This difference likely reflects UniXcoder’s cross-modal AST-based pretraining, which produces more distributed representations that remain partially informative on out-of-domain inputs. Despite these contrasting failure modes, same-base TIES merging recovers cross-domain performance for both model families, confirming that the same-base principle is robust to the underlying model architecture. Clone-Type Sensitivity Analysis. To verify that merged models detect clones across all difficulty levels, not just easy syntactic clones, we analyze recall by clone similarity range on BigCloneBench. We use token-level Jaccard similarity as a proxy for clone type [52], binning positive pairs into four categories that approximate the standard clone taxonomy. Table 10 reveals two key findings. First, both merged models achieve perfect recall (1.000) on Type-1/2, Strong Type-3, and Moderate Type-3 clones, matching or exceeding the BCB specialist. Merging does not sacrifice detection of syntactically similar clones. Second, on the dominant and most challenging Weak Type-3/Type4 semantic clones, merged models achieve 0.895–0.900 recall. While

50451

40337

1410

839

1758

UniXcoder-BCB

Table 10: Recall by clone type (approximated via token similarity) on BigCloneBench.

4829

UniXcoder-CLCDSA

TIES Merge

Figure 3: Venn diagram of correct predictions per region. Purple regions are samples correctly classified only by the merged model. this is slightly below the BCB specialist (0.937), it represents a substantial improvement over the cross-language specialist (0.788), which struggles particularly on higher-similarity clones (0.547 recall on Strong Type-3). The merged model recovers this performance entirely, demonstrating that it integrates complementary detection capabilities across all clone types rather than specializing in only the dominant semantic category. Complementarity Analysis. To understand whether merging merely interpolates between specialists or captures genuinely complementary knowledge, we analyze per-sample prediction overlap between UniXcoder-BCB, UniXcoder-CLCDSA, and the same-base TIES merge on both test sets (Figure 3). The analysis reveals three key observations. First, the merged model correctly classifies 839 BCB samples and 1,758 CLCDSA samples that neither individual specialist could handle. These emergent predictions arise from the combination of complementary task vectors, not from either specialist alone. Second, Cohen’s Kappa between the two specialists is near zero (𝜅 = 0.038 on BCB, 𝜅 = 0.045 on CLCDSA), confirming that they learn fundamentally different decision boundaries. The TIES merge achieves high agreement with each specialist on its home domain (𝜅 = 0.915 with UniX-BCB on BCB, 𝜅 = 0.726 with UniX-CLCDSA on CLCDSA), demonstrating that merging successfully inherits both boundaries into a single model. Third, all differences between the merged model and individual specialists are statistically significant (McNemar’s test, 𝜒 2 ≥ 2,413, 𝑝 < 0.001 for all comparisons), confirming that the observed improvements are not attributable to chance. A simple ensemble (averaging softmax outputs) cannot produce these emergent predictions, since if both specialists predict incorrectly their average does as well. The 839 and 1,758 emergent samples therefore demonstrate that merging creates genuinely new decision boundaries rather than interpolating existing ones. Ensembles also incur 2× inference cost compared to the merged model, which has identical architecture and latency to a single specialist. Practical Merging Recipe. Our findings suggest a concrete recipe for SE teams seeking crossdomain clone detectors. The recipe assumes same-base specialists are already available and joint retraining is impractical; multi-task training remains stronger when all data is jointly accessible. (1) Select a base model. Choose a single pre-trained code model (e.g., UniXcoder) as the shared base for all domains. (2) Fine-tune per domain. Create one fine-tuned copy per target domain (e.g., one for same-language, one for cross-language).

ASE ’26, October 12–16, 2026, Munich, Germany

Standard fine-tuning suffices and no special training procedure is required. (3) Merge with TIES. Compute task vectors for each specialist and merge using TIES with equal weights (𝜆𝑘 = 1/𝐾) and a trim percentile of 20. This step requires no additional training data and completes in under 5 minutes on CPU. We recommend TIES over WUDI for this recipe because, although WUDI achieves higher in-distribution combined F1, TIES generalizes substantially better to out-of-distribution clone types such as AI-generated clones (Section 5). (4) Add new domains incrementally. When a new clone type emerges (e.g., AI-generated clones), fine-tune another copy of the same base model on the new domain and re-merge all specialists. No previous training data is needed. This recipe decouples domain specialization from model deployment, allowing each domain to be handled independently while integration is performed post hoc through merging. Generalizability Beyond Clone Detection. The same-base merging principle likely extends to other SE tasks where domain specialization creates OOD challenges, such as vulnerability detection across different vulnerability types or code summarization across programming languages. Because our crossbase WUDI and PCB results indicate the compatibility requirement is task-vector geometric rather than method-specific (Section 6), same-base merging should transfer to any task-vector method with compatible specialists. In practice, most organizations standardize on a single base model, making this constraint readily satisfiable.

7

Related Work

Single-Language Clone Detection. Code clone detection has been studied for over two decades [6, 11, 25, 38, 42, 43, 46, 51, 52]. Early methods used token sequences [29], abstract syntax trees [7, 27, 44], program dependency graphs [39], and structural features for Type-1 through Type-3 clones. Deep learning then introduced learned representations [56, 58, 59, 66], and a distinct line targets the harder Type-4 (semantic) clones, where fragments are functionally equivalent but syntactically different, using learned functional similarity [69] and semantic token or graph features [61], evaluated on semantic benchmarks such as SemanticCloneBench [1]. More recent work advances same-language detection through diverse code representations [57], token-based classifiers [15], and deep subtree interaction [62]. Pre-trained code models such as CodeBERT [16], GraphCodeBERT [19], and UniXcoder [18] achieve state-of-theart results on BigCloneBench [34, 52]. These methods improve accuracy within their own benchmarks but remain tied to a single language. We instead combine such strong single-domain detectors into a unified cross-domain model without retraining them. Cross-Language Clone Detection. For clones across languages, CLCDSA [37] uses syntactic features and API documentation, crosslanguage AST learning [41] operates over tree representations, and C4 [53] applies contrastive learning over parallel multilingual data. Li et al. [33] extend this to the zero-shot setting through contrastive learning and cycle consistency. Each of these targets one generalization direction and requires retraining with a modified objective. We instead unify specialist detectors across domains

Palash R. Roy, Banani Roy, Kevin A. Schneider, and Chanchal K. Roy

through post-hoc merging, with no retraining and no access to training data at the merging step. LLM-Based Clone Detection. A growing body of work studies LLMs for clone detection [4, 24, 26, 32, 67], generation [47], and analysis [3], including the construction of LLM-driven benchmarks [2] and detection via prompting [11]. Concurrent work by Kitsios et al. [30] confirmed that clone detectors suffer significant F1 drops on unseen functionalities and proposed contrastive learning as a mitigation, which reinforces the motivation for a post-hoc combination mechanism. These approaches either fine-tune LLMs for detection or prompt them at inference time, and neither asks whether existing specialist detectors can be unified without retraining. We take the complementary position that compact encoder-based specialists can be merged post-hoc, and Section 5 compares against two zero-shot code LLMs directly. Mixture-of-experts and routing-based methods offer another route to multi-task capability but require architectural modifications and joint training [14], placing them outside the post-hoc, training-data-free setting we address. To our knowledge, no prior work has unified cross-domain clone detectors through post-hoc model merging without access to training data, which is the gap our work fills. Model Merging. Task arithmetic [23] showed that the difference between fine-tuned and pre-trained parameters (the task vector) can be arithmetically combined to edit model behavior. TIES [63] resolves sign conflicts through trimming and majority-sign election. DARE [65] introduces random dropping with rescaling for homologous models. WUDI [9] casts task-vector merging as a perlayer optimization that minimizes cross-task interference without training data or rescaling coefficients, and reports state-of-the-art results among task-vector methods on NLP and vision benchmarks. PCB [12] balances parameter competition within and across task vectors to resolve interference without training data. Beyond taskvector methods, Fisher merging [35] uses Fisher information to weight parameter importance, and RegMean [28] formulates merging as a linear regression problem. Model soups [60] averages multiple fine-tuned checkpoints to improve robustness in computer vision. HM3 [70] proposed hierarchical multi-objective merging using reinforcement learning, and merging has been applied to instruction-tuned language models [65], multi-lingual NLP [36], and domain-specific image classifiers [23, 60]. These methods were developed and evaluated almost entirely on NLP and vision benchmarks, and none establishes whether the same task-vector compatibility holds for code models that differ in pre-training objectives and tokenizers. We close this gap by evaluating five of these taskvector methods, including the recent WUDI and PCB, directly on cross-domain code clone detection (Section 5), and by showing that the shared-base condition, rather than the choice of merging algorithm, is what determines success (Section 6). Multi-Task Learning and Ensembles. Multi-task learning (MTL) trains a single model on multiple objectives simultaneously, exploiting commonalities between related tasks [10, 68]. In software engineering, multi-task approaches have been applied to vulnerability detection with auxiliary objectives [13]. MTL requires joint access to all training data, full retraining when new tasks are added, and careful loss balancing [10]. Ensemble methods combine predictions at inference time [17] but incur costs scaling linearly with model count. Merging differs from both. Unlike MTL, it operates

A Unified Model for Cross-Domain Clone Detection via Model Merging

post-hoc on checkpoints without training data at the merging step, which suits settings where the original data is proprietary, distributed, or expensive to recombine. Unlike ensembles, it produces a single model with no inference overhead. These are not only conceptual differences. We compare merging directly against a multi-task model trained on all data and against inference-time ensembling, and find that merging retains complementary specialist knowledge that multi-task training overwrites, generalizing far better to unseen clone types, while matching a single specialist’s inference cost (Section 5, Section 6).

8

Threats to Validity

Internal validity. A valid concern is that our greedy layer search may find a suboptimal merge. To address this, we also evaluate global parameter merging, which does not rely on greedy selection, and observe the same same-base advantage. One might also ask whether the results are sensitive to random initialization. We mitigate this by testing every same-base configuration across three random seeds for TIES, WUDI, and PCB. All three methods consistently outperform individual models on in-distribution benchmarks for both UniXcoder and CodeBERT (Table 6), and although variance on GPTCloneBench is higher, every seed of every same-base TIES configuration exceeds the multi-task baseline. A further concern is that independently trained specialists may differ in learning rates, training epochs, batch sizes, preprocessing strategies, and random data orderings, whereas our specialists use matched configurations. In order to at least partially mitigate this threat, we fix these variables deliberately, so that the merging behavior we observe reflects task-vector compatibility rather than training-quality differences. As partial evidence that the recipe tolerates specialist-level variation, our two model families are trained independently and fail on out-of-domain inputs in contrasting ways, one with high prediction uncertainty and the other with confident misclassification, yet samebase merging recovers both (Section 6). Of course, further study with more heterogeneous specialists could help establish the limits of the same base recipe under mismatched training conditions. External validity. A natural question is whether our findings extend beyond RoBERTa-based encoder models, particularly to decoder-only LLMs. To address this empirically rather than by assertion, we report a direct comparison against two instructiontuned code LLMs, Qwen2.5-Coder-7B and DeepSeek-Coder-6.7B, in Section 5. A related risk is over-generalizing from that comparison. We therefore bound it to two models under zero-shot prompting and to the deployment regime we target, namely encoder-based detectors with deterministic predictions at low fixed per-pair cost, and we do not claim that no LLM configuration under few-shot or chain-of-thought prompting could outperform merged detectors. We also note that DeepSeek’s low score partly reflects a strong nonclone bias under the one-word prompt rather than an inability to reason about the snippets. It is also possible that our core finding is specific to a single model. We mitigate this by validating the samebase principle on a second model family with contrasting failure modes (Section 6), since the principle depends on task-vector geometry rather than model architecture or size. Finally, we evaluate only on Java and Java↔Python and acknowledge known concerns about BigCloneBench clone type labels [31], while noting that our

ASE ’26, October 12–16, 2026, Munich, Germany

focus is cross-domain generalization rather than clone-type-specific detection. Construct validity. One consideration is that our combined F1 weights both domains equally, which may not match practical priorities. We mitigate this by exposing the merging weights 𝜆𝑘 , which can be adjusted without retraining to emphasize either domain. Another risk is possible overlap between the training benchmarks (BCB and CLCDSA data), which could introduce data leakage and inflate performance. We address this by reasoning about the direction of the bias. Any overlap would disproportionately benefit the multi-task baseline, which trains jointly on both datasets, whereas our merging approach never accesses the underlying training data, so any leakage would bias results against our method and leave our improvements conservative rather than overstated. One might also question whether the GPTCloneBench evaluation, which relies on 10,000 randomly sampled Java pairs, captures the full diversity of GPT-generated clones. We mitigate this by evaluating across three independent random seeds and observing consistent improvements over all baselines in every run. A final open question is how broadly the in-distribution versus out-of-distribution trade-off across TIES, WUDI, and PCB generalizes.

9

Conclusion

We presented the first systematic empirical study of post-hoc model merging for cross-domain code clone detection. Across five task-vector methods, architecture-level layer stitching, and cross-tokenizer alignment on four code models and three benchmarks, one condition determines whether merging succeeds: specialists must share a pre-trained base. When they do, their task vectors align and combine into a single cross-domain detector that recovers most multi-task performance without training data and generalizes markedly better to unseen AI-generated clones. Different bases leave the vectors near-orthogonal and merging collapses into interference. Because this holds across every method we tested, it reflects task-vector geometry rather than any single algorithm, and yields a simple recipe: fine-tune one shared base per domain and merge with TIES. Several directions follow. The same-base principle should be tested on other SE tasks such as vulnerability detection, defect prediction, and code summarization, where classification-versus-generation architectures may expose method-dependent failure modes. The tokenizer barrier that blocked cross-family alignment invites nonlinear or learned projection approaches. And with sustainability an increasing concern in production deployment, merged detectors offer a low-carbon alternative to per-domain specialist stacks, with inference and storage savings scaling with the number of domains served.

Acknowledgements This research is supported in part by the Natural Sciences and Engineering Research Council of Canada (NSERC) Discovery Grants program, the Canada Foundation for Innovation’s John R. Evans Leaders Fund (CFI-JELF), and by the industry-stream NSERC CREATE in Software Analytics Research (SOAR). Data Availability. Our replication package is archived at [5]. A companion tool paper [48] describes our web-based interface, available at https://mergese.usask.ca.

ASE ’26, October 12–16, 2026, Munich, Germany

References [1] Farouq Al-Omari, Chanchal K. Roy, and Tonghao Chen. 2020. SemanticCloneBench: A Semantic Code Clone Benchmark using Crowd-Source Knowledge. In Proceedings of the IEEE 14th International Workshop on Software Clones (IWSC). IEEE, 57–63. doi:10.1109/IWSC50091.2020.9047643 [2] Ajmain Inqiad Alam, Palash Ranjan Roy, Farouq Al-Omari, Chanchal K. Roy, Banani Roy, and Kevin A. Schneider. 2023. GPTCloneBench: A comprehensive benchmark of semantic clones and cross-language clones using GPT-3 model and SemanticCloneBench. In Proceedings of the IEEE International Conference on Software Maintenance and Evolution (ICSME). IEEE, 1–13. doi:10.1109/ICSME58846. 2023.00013 [3] Ajmain Inqiad Alam, Palash Ranjan Roy, Farouq Al-Omari, Chanchal K. Roy, Banani Roy, and Kevin A. Schneider. 2025. Are Classical Clone Detectors Good Enough for the AI Era?. In Proceedings of the 41st IEEE International Conference on Software Maintenance and Evolution (ICSME). IEEE, 295–307. doi:10.1109/ ICSME64153.2025.00035 [4] Afnan A. Almatrafi, Fathy Elbouraey Eassa, and Sanaa Abdullah Sharaf. 2025. Code Clone Detection Techniques Based on Large Language Models. IEEE Access 13 (2025), 46136–46146. doi:10.1109/ACCESS.2025.3549780 [5] Author Anonymous. 2026. Replication Package: A Unified Model for CrossDomain Clone Detection via Model Merging. doi:10.5281/zenodo.21209512 [6] Lerina Aversano, Luigi Cerulo, and Massimiliano Di Penta. 2007. How Clones are Maintained: An Empirical Study. In Proceedings of the 11th European Conference on Software Maintenance and Reengineering, Software Evolution in Complex Software Intensive Systems (CSMR). IEEE Computer Society, 81–90. doi:10.1109/CSMR. 2007.26 [7] Ira D. Baxter, Andrew Yahin, Leonardo Mendonça de Moura, Marcelo Sant’Anna, and Lorraine Bier. 1998. Clone Detection Using Abstract Syntax Trees. In Proceedings of the International Conference on Software Maintenance (ICSM). IEEE Computer Society, 368–377. doi:10.1109/ICSM.1998.738528 [8] David Berend, Xiaofei Xie, Lei Ma, Lingjun Zhou, Yang Liu, Chi Xu, and Jianjun Zhao. 2020. Cats Are Not Fish: Deep Learning Testing Calls for Out-Of-Distribution Awareness. In Proceedings of the 35th IEEE/ACM International Conference on Automated Software Engineering (ASE). IEEE, 1041–1052. doi:10.1145/3324884.3416609 [9] Runxi Cheng, Feng Xiong, Yongxian Wei, Wanyun Zhu, and Chun Yuan. 2025. Whoever Started the interference Should End It: Guiding Data-Free Model Merging via Task Vectors. In Proceedings of the 42nd International Conference on Machine Learning (ICML) (Proceedings of Machine Learning Research, Vol. 267). PMLR / OpenReview.net, 10121–10143. https://proceedings.mlr.press/v267/cheng25h. html [10] Michael Crawshaw. 2020. Multi-Task Learning with Deep Neural Networks: A Survey. CoRR abs/2009.09796 (2020), 43 pages. doi:10.48550/arXiv.2009.09796 [11] Shihan Dou, Junjie Shan, Haoxiang Jia, Wenhao Deng, Zhiheng Xi, et al. 2023. Towards Understanding the Capability of Large Language Models on Code Clone Detection: A Survey. CoRR abs/2308.01191 (2023), 13 pages. doi:10.48550/ARXIV. 2308.01191 [12] Guodong Du, Junlin Lee, Jing Li, Runhua Jiang, Yifei Guo, et al. 2024. Parameter Competition Balancing for Model Merging. In Proceedings of the 37th Annual Conference on Neural Information Processing Systems (NeurIPS). 84746–84776. https://doi.org/10.52202/079017-2691 [13] Xiaohu Du, Ming Wen, Jiahao Zhu, Zifan Xie, et al. 2024. GeneralizationEnhanced Code Vulnerability Detection via Multi-Task Instruction Fine-Tuning. In Proceedings of the Findings of the Association for Computational Linguistics (ACL) (Findings of ACL, Vol. ACL 2024). Association for Computational Linguistics, 10507–10521. doi:10.18653/V1/2024.FINDINGS-ACL.625 [14] William Fedus, Barret Zoph, and Noam Shazeer. 2022. Switch Transformers: Scaling to Trillion Parameter Models with Simple and Efficient Sparsity. J. Mach. Learn. Res. 23 (2022), 120:1–120:39. https://jmlr.org/papers/v23/21-0998.html [15] Siyue Feng, Wenqi Suo, Yueming Wu, Deqing Zou, Yang Liu, and Hai Jin. 2024. Machine Learning is All You Need: A Simple Token-based Approach for Effective Code Clone Detection. In Proceedings of the 46th IEEE/ACM International Conference on Software Engineering (ICSE). ACM, 222:1–222:13. doi:10.1145/3597503. 3639114 [16] Zhangyin Feng, Daya Guo, Duyu Tang, Nan Duan, Xiaocheng Feng, Ming Gong, et al. 2020. CodeBERT: A Pre-Trained Model for Programming and Natural Languages. In Proceedings of the Findings of the Association for Computational Linguistics (ACL) (Findings of ACL, Vol. EMNLP). Association for Computational Linguistics, 1536–1547. doi:10.18653/v1/2020.findings-emnlp.139 [17] M. A. Ganaie, Minghui Hu, Ashwani Kumar Malik, Muhammad Tanveer, and Ponnuthurai N. Suganthan. 2022. Ensemble deep learning: A review. Eng. Appl. Artif. Intell. 115 (2022), 105151. doi:10.1016/J.ENGAPPAI.2022.105151 [18] Daya Guo, Shuai Lu, Nan Duan, Yanlin Wang, Ming Zhou, and Jian Yin. 2022. UniXcoder: Unified Cross-Modal Pre-training for Code Representation. In Proceedings of the 60th Annual Meeting of the Association for Computational Linguistics (ACL), Vol. 1: Long Papers. Association for Computational Linguistics, 7212–7225. doi:10.18653/V1/2022.ACL-LONG.499

Palash R. Roy, Banani Roy, Kevin A. Schneider, and Chanchal K. Roy

[19] Daya Guo, Shuo Ren, Shuai Lu, Zhangyin Feng, Duyu Tang, et al. 2021. GraphCodeBERT: Pre-training Code Representations with Data Flow. In Proceedings of the 9th International Conference on Learning Representations, ICLR. OpenReview.net, 18 pages. https://openreview.net/forum?id=jLoC4ez43PZ [20] Daya Guo, Qihao Zhu, Dejian Yang, Zhenda Xie, Kai Dong, et al. 2024. DeepSeekCoder: When the Large Language Model Meets Programming - The Rise of Code Intelligence. CoRR abs/2401.14196 (2024), 23 pages. doi:10.48550/ARXIV.2401. 14196 [21] Dan Hendrycks, Xiaoyuan Liu, Eric Wallace, Adam Dziedzic, Rishabh Krishnan, and Dawn Song. 2020. Pretrained Transformers Improve Out-of-Distribution Robustness. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics (ACL). Association for Computational Linguistics, 2744–2751. doi:10.18653/V1/2020.ACL-MAIN.244 [22] Binyuan Hui, Jian Yang, Zeyu Cui, Jiaxi Yang, Dayiheng Liu, Lei Zhang, et al. 2024. Qwen2.5-Coder Technical Report. CoRR abs/2409.12186 (2024), 32 pages. doi:10.48550/arXiv.2409.12186 [23] Gabriel Ilharco, Marco Túlio Ribeiro, Mitchell Wortsman, Ludwig Schmidt, Hannaneh Hajishirzi, and Ali Farhadi. 2023. Editing models with task arithmetic. In Proceedings of the 11th International Conference on Learning Representations. OpenReview.net, 31 pages. https://openreview.net/forum?id=6t0Kwf8-jrj [24] Ryutaro Inoue and Yoshiki Higo. 2024. Improving Accuracy of LLM-based Code Clone Detection U sing Functionally Equivalent Methods. In Proceedings of the 22nd IEEE/ACIS International Conference on Software Engineering Research, Management and Applications (SERA). IEEE, 24–27. doi:10.1109/SERA61261.2024. 10685589 [25] Hadhemi Jebnoun, Md. Saidur Rahman, Foutse Khomh, and Biruk Asmare Muse. 2022. Clones in deep learning code: what, where, and why? Empir. Softw. Eng. 27, 4 (2022), 84. doi:10.1007/S10664-021-10099-X [26] Bowen Jiang, Mitchell Ruffolo, Aaditya Kulkarni, Teia Canini, and Eman Abdullah AlOmar. 2026. A systematic mapping study on the research landscape of LLMbased code clone detection. Inf. Softw. Technol. 195 (2026), 108096. doi:10.1016/J. INFSOF.2026.108096 [27] Lingxiao Jiang, Ghassan Misherghi, Zhendong Su, and Stéphane Glondu. 2007. DECKARD: Scalable and Accurate Tree-Based Detection of Code Clones. In Proceedings of the 29th International Conference on Software Engineering (ICSE). IEEE Computer Society, 96–105. doi:10.1109/ICSE.2007.30 [28] Xisen Jin, Xiang Ren, Daniel Preotiuc-Pietro, and Pengxiang Cheng. 2023. Dataless Knowledge Fusion by Merging Weights of Language Models. In Proceedings of the 11th International Conference on Learning Representations (ICLR). OpenReview.net, 19 pages. doi:10.48550/arXiv.2212.09849 [29] Toshihiro Kamiya, Shinji Kusumoto, and Katsuro Inoue. 2002. CCFinder: A Multilinguistic Token-Based Code Clone Detection System for Large Scale Source Code. IEEE Trans. Software Eng. 28, 7 (2002), 654–670. doi:10.1109/TSE.2002. 1019480 [30] Konstantinos Kitsios, Francesco Sovrano, Earl T. Barr, and Alberto Bacchelli. 2025. Detecting Semantic Clones of Unseen Functionality. In Proceedings of the 40th IEEE/ACM International Conference on Automated Software Engineering (ASE). IEEE, 1312–1324. doi:10.1109/ASE63991.2025.00112 [31] Jens Krinke and Chaiyong Ragkhitwetsagul. 2022. BigCloneBench Considered Harmful for Machine Learning. In Proceedings of the 16th IEEE International Workshop on Software Clones (IWSC). IEEE, 1–7. doi:10.1109/IWSC55060.2022. 00008 [32] Chunguang Li, Jessada Konpang, Adisorn Sirikham, and Yan Wang. 2025. Nuanced Code Clone Detection Through LLM-Based Code Revision and AST Graph Modeling. IEEE Access 13 (2025), 191024–191036. doi:10.1109/ACCESS.2025. 3628856 [33] Jia Li, Chongyang Tao, Zhi Jin, Fang Liu, Jia Li, and Ge Li. 2023. ZC3 : Zero-Shot Cross-Language Code Clone Detection. In Proceedings of the 38th IEEE/ACM International Conference on Automated Software Engineering (ASE). IEEE, 875–887. doi:10.1109/ASE56229.2023.00210 [34] Shuai Lu, Daya Guo, Shuo Ren, Junjie Huang, Alexey Svyatkovskiy, Ambrosio Blanco, et al. 2021. CodeXGLUE: A Machine Learning Benchmark Dataset for Code Understanding and Generation. In Proceedings of the Neural Information Processing Systems Track on Datasets and Benchmarks 1. 16 pages. https://datasets-benchmarks-proceedings.neurips.cc/paper/2021/hash/ c16a5320fa475530d9583c34fd356ef5-Abstract-round1.html [35] Michael Matena and Colin Raffel. 2022. Merging Models with Fisher-Weighted Averaging. In Proceedings of the Advances in Neural Information Processing Systems 35: Annual Conference on Neural Information Processing Systems (NeurIPS). 14 pages. doi:10.48550/arXiv.2111.09832 [36] Mohammed Muqeeth, Haokun Liu, Yufan Liu, and Colin Raffel. 2024. Learning to Route Among Specialized Experts for Zero-Shot Generalization. In Proceedings of the 41st International Conference on Machine Learning (ICML) (Proceedings of Machine Learning Research, Vol. 235). PMLR / OpenReview.net, 36829–36846. https://proceedings.mlr.press/v235/muqeeth24a.html

A Unified Model for Cross-Domain Clone Detection via Model Merging

[37] Kawser Wazed Nafi, Tonny Shekha Kar, Banani Roy, Chanchal K. Roy, and Kevin A. Schneider. 2019. CLCDSA: Cross Language Code Clone Detection using Syntactical Features and API Documentation. In Proceedings of the 34th IEEE/ACM International Conference on Automated Software Engineering (ASE). IEEE, 1026– 1037. doi:10.1109/ASE.2019.00099 [38] Tasuku Nakagawa, Yoshiki Higo, and Shinji Kusumoto. 2021. NIL: large-scale detection of large-variance clones. In Proceedings of the 29th ACM Joint European Software Engineering Conference and Symposium on the Foundations of Software Engineering ESEC/FSE. ACM, 830–841. doi:10.1145/3468264.3468564 [39] Hoan Anh Nguyen, Tung Thanh Nguyen, Nam H. Pham, Jafar M. Al-Kofahi, and Tien N. Nguyen. 2009. Accurate and Efficient Structural Characteristic Feature Extraction for Clone Detection. In Proceedings of the Fundamental Approaches to Software Engineering, 12th International Conference (FASE) (Lecture Notes in Computer Science, Vol. 5503). Springer, 440–455. doi:10.1007/978-3-642-005930_31 [40] Van Nguyen, Xingliang Yuan, Tingmin Wu, Surya Nepal, Marthie Grobler, and Carsten Rudolph. 2024. Deep Learning-Based Out-of-distribution Source Code Data Identification: How Far Have We Gone? CoRR abs/2404.05964 (2024), 16 pages. doi:10.48550/ARXIV.2404.05964 [41] Daniel Perez and Shigeru Chiba. 2019. Cross-language clone detection by learning over abstract syntax trees. In Proceedings of the 16th International Conference on Mining Software Repositories (MSR). IEEE / ACM, 518–528. doi:10.1109/MSR.2019. 00078 [42] Dhavleesh Rattan, Rajesh Kumar Bhatia, and Maninder Singh. 2013. Software clone detection: A systematic review. Inf. Softw. Technol. 55, 7 (2013), 1165–1199. doi:10.1016/J.INFSOF.2013.01.008 [43] Chanchal Kumar Roy and James R Cordy. 2007. A survey on software clone detection research. Queen’s School of computing TR 541, 115 (2007), 64–68. https: //research.cs.queensu.ca/TechReports/Reports/2007-541.pdf [44] Chanchal Kumar Roy and James R. Cordy. 2008. NICAD: Accurate Detection of Near-Miss Intentional Clones Using Flexible Pretty-Printing and Code Normalization. In Proceedings of the 16th IEEE International Conference on Program Comprehension (ICPC). IEEE Computer Society, 172–181. doi:10.1109/ICPC.2008.41 [45] Palash Roy. 2025. Towards Just-In-Time, Inclusive Clone Refactoring. In Proceedings of the 41st IEEE International Conference on Software Maintenance and Evolution (ICSME). IEEE, 884–886. doi:10.1109/ICSME64153.2025.00099 [46] Palash Ranjan Roy. 2024. An Exploratory Study on the Roles of LLMs in Code Similarity Detection and Generation. Master’s thesis. https://harvest.usask.ca/ items/83c21d22-b256-4ff7-8c58-28bd6ecbdfc1 [47] Palash Ranjan Roy, Ajmain Inqiad Alam, Farouq Al-Omari, Banani Roy, Chanchal K. Roy, and Kevin A. Schneider. 2023. Unveiling the Potential of Large Language Models in Generating Semantic and Cross-Language Clones. In Proceedings of the 17th IEEE International Workshop on Software Clones (IWSC). IEEE, 22–28. doi:10.1109/IWSC60764.2023.00011 [48] Palash R. Roy, Banani Roy, Chanchal K. Roy, and Kevin Schneider. 2026. MergeSE: Post-Hoc Model Merging for Software Engineering Tasks Without Retraining. In Proceedings of the 41st IEEE/ACM International Conference on Automated Software Engineering (ASE). 4 pages. doi:10.1145/3832783.3834630 To Appear. [49] Baochen Sun and Kate Saenko. 2016. Deep CORAL: Correlation Alignment for Deep Domain Adaptation. In Proceedings of the European Conference on Computer Vision Workshops (ECCV Workshops) (Lecture Notes in Computer Science, Vol. 9915). 443–450. doi:10.1007/978-3-319-49409-8_35 [50] Jeffrey Svajlenko, Judith F. Islam, Iman Keivanloo, Chanchal Kumar Roy, and Mohammad Mamun Mia. 2014. Towards a Big Data Curated Benchmark of Interproject Code Clones. In Proceedings of the 30th IEEE International Conference on Software Maintenance and Evolution (ICSME). IEEE Computer Society, 476–480. doi:10.1109/ICSME.2014.77 [51] Jeffrey Svajlenko and Chanchal Kumar Roy. 2017. Fast and flexible largescale clone detection with CloneWorks. In Proceedings of the 39th International Conference on Software Engineering (ICSE). IEEE Computer Society, 27–30. doi:10.1109/ICSE-C.2017.3 [52] Jeffrey Svajlenko and Chanchal K. Roy. 2021. BigCloneBench. In Code Clone Analysis. Springer Singapore, 93–105. doi:10.1007/978-981-16-1927-4_7 [53] Chenning Tao, Qi Zhan, Xing Hu, and Xin Xia. 2022. C4: contrastive crosslanguage code clone detection. In Proceedings of the 30th IEEE/ACM International Conference on Program Comprehension (ICPC). ACM, 413–424. doi:10.1145/ 3524610.3527911 [54] Simon Vandenhende, Stamatios Georgoulis, Wouter Van Gansbeke, Marc Proesmans, Dengxin Dai, and Luc Van Gool. 2022. Multi-Task Learning for Dense Prediction Tasks: A Survey. IEEE Trans. Pattern Anal. Mach. Intell. 44, 7 (2022), 3614–3633. doi:10.1109/TPAMI.2021.3054719 [55] Jindong Wang, Cuiling Lan, Chang Liu, Yidong Ouyang, et al. 2023. Generalizing to Unseen Domains: A Survey on Domain Generalization. IEEE Trans. Knowl.

ASE ’26, October 12–16, 2026, Munich, Germany

Data Eng. 35, 8 (2023), 8052–8072. doi:10.1109/TKDE.2022.3178128 [56] Wenhan Wang, Ge Li, Bo Ma, Xin Xia, and Zhi Jin. 2020. Detecting Code Clones with Graph Neural Network and Flow-Augmented Abstract Syntax Tree. In Proceedings of the 27th IEEE International Conference on Software Analysis, Evolution and Reengineering (SANER). IEEE, 261–271. doi:10.1109/SANER48275.2020. 9054857 [57] Yuekun Wang, Yuhang Ye, Yueming Wu, Weiwei Zhang, Yinxing Xue, and Yang Liu. 2023. Comparison and Evaluation of Clone Detection Techniques with Different Code Representations. In Proceedings of the 45th IEEE/ACM International Conference on Software Engineering (ICSE). IEEE, 332–344. doi:10.1109/ICSE48619. 2023.00039 [58] Huihui Wei and Ming Li. 2017. Supervised Deep Features for Software Functional Clone Detection by Exploiting Lexical and Syntactical Information in Source Code. In Proceedings of the 26th International Joint Conference on Artificial Intelligence (ijcai). ijcai.org, 3034–3040. doi:10.24963/IJCAI.2017/423 [59] Martin White, Michele Tufano, Christopher Vendome, and Denys Poshyvanyk. 2016. Deep learning code fragments for code clone detection. In Proceedings of the 31st IEEE/ACM International Conference on Automated Software Engineering (ASE). ACM, 87–98. doi:10.1145/2970276.2970326 [60] Mitchell Wortsman, Gabriel Ilharco, Samir Yitzhak Gadre, Rebecca Roelofs, Raphael Gontijo Lopes, et al. 2022. Model soups: averaging weights of multiple fine-tuned models improves accuracy without increasing inference time. In Proceedings of the International Conference on Machine Learning (ICML) (Proceedings of Machine Learning Research, Vol. 162). PMLR, 23965–23998. https: //proceedings.mlr.press/v162/wortsman22a.html [61] Yueming Wu, Deqing Zou, Shihan Dou, Siru Yang, et al. 2020. SCDetector: Software Functional Clone Detection Based on Semantic Tokens Analysis. In Proceedings of the 35th IEEE/ACM International Conference on Automated Software Engineering (ASE). IEEE, 821–833. doi:10.1145/3324884.3416562 [62] Zhiwei Xu, Shaohua Qiang, Dinghong Song, Min Zhou, et al. 2024. DSFM: Enhancing Functional Code Clone Detection with Deep Subtree Interactions. In Proceedings of the 46th IEEE/ACM International Conference on Software Engineering (ICSE). ACM, 221:1–221:12. doi:10.1145/3597503.3639215 [63] Prateek Yadav, Derek Tam, Leshem Choshen, Colin A. Raffel, and Mohit Bansal. 2023. TIES-Merging: Resolving Interference When Merging Models. In Proceedings of the Advances in Neural Information Processing Systems 36: Annual Conference on Neural Information Processing Systems (NeurIPS). 23 pages. doi:10.52202/075280-0310 [64] Yanming Yang, Xing Hu, Zhipeng Gao, et al. 2024. Federated Learning for Software Engineering: A Case Study of Code Clone Detection and Defect Prediction. IEEE Trans. Software Eng. 50, 2 (2024), 296–321. doi:10.1109/TSE.2023.3347898 [65] Le Yu, Bowen Yu, Haiyang Yu, Fei Huang, and Yongbin Li. 2024. Language Models are Super Mario: Absorbing Abilities from Homologous Models as a Free Lunch. In Proceedings of the 41st International Conference on Machine Learning (ICML) (Proceedings of Machine Learning Research, Vol. 235). PMLR / OpenReview.net, 57755–57775. https://proceedings.mlr.press/v235/yu24p.html [66] Jian Zhang, Xu Wang, Hongyu Zhang, Hailong Sun, Kaixuan Wang, and Xudong Liu. 2019. A novel neural source code representation based on abstract syntax tree. In Proceedings of the 41st International Conference on Software Engineering (ICSE). IEEE / ACM, 783–794. doi:10.1109/ICSE.2019.00086 [67] Zixian Zhang and Takfarinas Saber. 2025. Exploring the Boundaries Between LLM Code Clone Detection and Code Similarity Assessment on Human and AI-Generated Code. Big Data Cogn. Comput. 9, 2 (2025), 41. doi:10.3390/ BDCC9020041 [68] Zhihan Zhang, Wenhao Yu, Mengxia Yu, Zhichun Guo, and Meng Jiang. 2023. A Survey of Multi-task Learning in Natural Language Processing: Regarding Task Relatedness and Training Methods. In Proceedings of the 17th Conference of the European Chapter of the Association for Computational Linguistics (EACL). Association for Computational Linguistics, 943–956. doi:10.18653/V1/2023.EACLMAIN.66 [69] Gang Zhao and Jeff Huang. 2018. DeepSim: deep learning code functional similarity. In Proceedings of the 2018 ACM Joint Meeting on European Software Engineering Conference and Symposium on the Foundations of Software Engineering (ESEC/FSE). ACM, 141–151. doi:10.1145/3236024.3236068 [70] Yu Zhou, Xingyu Wu, Jibin Wu, Liang Feng, and KC Tan. 2025. HM3: Hierarchical Multi-Objective Model Merging for Pretrained Models. In Proceedings of the Advances in Neural Information Processing Systems 38: Annual Conference on Neural Information Processing Systems (NeurIPS). 35 pages. doi:10.48550/arXiv. 2409.18893

Received 2026-03-26; accepted 2026-06-18

Related documents

Record · ID 429434 · SHA-256 2f352e13ced11936
Retrieved via Conceptio: every document is proof-bundled with source, license, and retrieval metadata.
Bring this data into your agent: Connect via MCP or API · 20 free credits to start · no card required
Read the Docs → · View CLI source on GitHub · Conceptio Open Knowledge Archive