paperbot · PL 论文追踪

全部论文 待读 收藏

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

基于模型合并的跨领域克隆检测统一模型
ASE Proceedings of the 41st IEEE/ACM International Conference on Automated Software Engineering2026匹配度 3/10 · 论文属于代码克隆检测与模型合并的交叉,虽涉及程序语言和代码模型,但不聚焦用户核心方向:面向 ML/Agentic 系统的静态分析、用 LLM/Agent 改进静态分析/形式化验证,以及浮点或贝叶斯程序分析。其核心是后处理式模型合并以构建跨领域克隆检测器,而非静态分析×LLM/Agent。引用 1 inbox
Palash R. Roy, Banani Roy, Kevin A. Schneider, Chanchal K. Roy
crossref: 2026-10-09

AI 速览

一句话:系统评估模型合并,发现同基座 TIES 无需训练数据即可构建跨领域代码克隆检测器,并给出实用配方。

代码克隆类型多样,现有深度学习检测器多为领域专家,跨域 F1 可降超 70%;部署多个专用模型不现实,训练单一跨域模型又需全部训练数据。本文研究仅基于已训练检查点的模型合并,系统评估五种任务向量合并、贪心层拼接架构合并和跨分词器对齐,覆盖四种代码模型、三个基准和十二种配置。同基座 TIES 合并无需训练数据即可构建跨域检测器,在 UniXcoder 上达 0.865 综合 F1,为多任务训练的 93%;WUDI 分布内最高 0.899,但 TIES 对未见 AI 生成克隆泛化更好。跨基座合并收益小且方差高;合并编码器在 GPTCloneBench 上优于零样本指令微调 LLM,推理成本更低,对 OOD 克隆的泛化可达多任务训练的 4 倍,显示域内性能与 OOD 鲁棒性的权衡。

问题
现有深度学习克隆检测器跨域泛化差,跨域 F1 下降可超 70%,但训练统一跨域模型需同时访问所有训练数据。
方法
论文系统评估仅依赖已训练检查点的模型合并技术,包括五种任务向量参数合并、贪心层拼接架构合并与跨分词器对齐,并在四种代码模型、三个基准和十二种配置上测试。
评估
同基座 TIES 合并无需训练数据即达到多任务训练的 93% 性能,并在未见 AI 生成克隆上泛化更好;合并编码器还优于零样本指令微调 LLM 且推理成本更低。
原文摘要(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. 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 pre-trained 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 multi-task 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.

链接与引用

DOI 原文 · arXiv ·

BibTeX
@inproceedings{paperbot12188,
  title = {A Unified Model for Cross-Domain Clone Detection via Model Merging},
  author = {Palash R. Roy and Banani Roy and Kevin A. Schneider and Chanchal K. Roy},
  booktitle = {ASE},
  year = {2026},
  doi = {10.1145/3832783.3837415}
}