TriFusion-LLM: Prior-Guided Multimodal Fusion with LLM Arbitration for Fine-grained Code Clone Detection
1 st Mengdi Li, 2 nd Yuming Liu, 3 rd He Wang, 4 th Zifeng Xu, 5 th Yuqing Zhang* · 2026
Read TriFusion-LLM: Prior-Guided Multimodal Fusion with LLM Arbitration for Fine-grained Code Clone Detection by 1 st Mengdi Li, 2 nd Yuming Liu, 3 rd He Wang, 4 th Zifeng Xu, 5 th Yuqing Zhang* (2026) in the Tower of Babel, a free online library of public-domain works preserved in clean, searchable text. No sign-up. The full text is served as a plain-text file at a predictable URL, where text is present: https://antarctic-labs.com/tower-of-babel/arxiv-2603-15004.txt.
Introduction
Li and co-authors present a fusion framework for fine-grained code clone detection. It joins three signals: classic similarity scores, syntax tree structure, and CodeBERT embeddings. The goal is to sort clones into the seven types in BigCloneBench, not just flag clones as present or absent. The authors report a Macro-F1 rise from 0.695 to 0.875. A large language model reviews only the most unsure cases, about 0.2 percent, and adds further gains.
Catalog record
| CREATOR | 1 st Mengdi Li, 2 nd Yuming Liu, 3 rd He Wang, 4 th Zifeng Xu, 5 th Yuqing Zhang* |
|---|---|
| YEAR | 2026 |
| COLLECTION | PAPERS |
| FORMAT | TXT |
| FILE SIZE | 48799 |
| LICENSE | http://creativecommons.org/licenses/by-sa/4.0/ |
| RIGHTS | CC BY SA |
| SOURCE | arXiv |
Source: https://arxiv.org/abs/2603.15004
Browse the full library · About the Tower of Babel
Full text
The opening of the work, from the library's hosted text:
TriFusion-LLM: Prior-Guided Multimodal Fusion with LLM Arbitration for Fine-grained Code Clone Detection 1 st Mengdi Li, 2 nd Yuming Liu, 3 rd He Wang, 4 th Zifeng Xu, 5 th Yuqing Zhang* Abstract Code clone detection (CCD) supports software maintenance, refactoring, and security analysis. Although pre-trained models capture code semantics, most work reduces CCD to binary classification, overlooking the heterogeneity of clone types and the seven fine-grained categories in BigCloneBench. We present Full Model, a multimodal fusion framework that jointly integrates heuristic similarity priors from classical machine learning, structural signals from abstract syntax trees (ASTs), and deep semantic embeddings from CodeBERT into a single predictor. By fusing structural, statistical, and semantic representations, Full Model improves discrimination among fine-grained clone types while keeping inference cost practical. On the seven-class BigCloneBench benchmark, Full Model raises Macro-F1 from 0.695 to 0.875. Ablation studies show that using the primary model’s probability distribution as a prior to guide selective arbitration by a large language model (LLM) substantially outperforms blind reclassification; arbitrating only 0.2% of high-uncertainty samples yields an additional 0.3 absolute Macro-F1 gain. Overall, Full Model achieves an effective performance-cost trade-off for fine-grained CCD and offers a practical solution for large-scale industrial deployment. I Introduction Code Clone Detection (CCD), the core technology for identifying functionally equivalent or similar code fragments, is indispensable for diverse software engineering tasks, including software refactoring, bug propagation analysis, and security auditing [ 18 ] . Over the past two decades, the detection paradigm has evolved from efficient token-based matching (e.g., CCFinder [ 25 ] ) to syntax-based structural alignment via Abstract Syntax Trees (ASTs, e.g., Tamer [ 9 ] ), and has more recently converged toward Pre-trained Models (PTMs) [ 4 , 7 ] . This evolutionary trajectory is driving CCD from static pattern matching toward deep, dynamic logical analysis [ 27 , 14 ] . Despite the significant strides made by PTMs and their derivative multi-modal fusion frameworks (e.g., DSFM [ 26 ] and FCCA [ 10 ] ) in capturing sophisticated semantic features, contemporary literature frequently collapses CCD into a simplistic binary classification task. Such oversimplification renders models inadequate when navigating the fine-grained 7-class taxonomy defined by BigCloneBench (BCB), where decision boundaries between categories with nearly identical syntactic similarities remain notoriously blurred. This limitation originates from a ”capability gap” across two dimensions. First, pure neural fusion models are susceptible to ”Semantic Drift” [ 20 ] during the processing of complex clone pairs; high-level functional embeddings, lacking explicit grounding in programmatic physical facts, often fail to strictly align with the rigid quantitative similarity thresholds of BCB. Second, while recent efforts like Toma [ 3 ] demonstrate that lexical features and Machine Learning (ML) can serve as stable discriminative anchors, these methods exhibit significant cognitive blind spots when confronted with Type-4 semantic clones involving radical structural overhauls. When literal statistical evidence conflicts with deep semantic intuition at the decision margin, existing architectures lack an adaptive arbitration mechanism to resolve uncertainty and facilitate high-order logical rectification while maintaining retrieval efficiency. To bridge these gaps, we propose a multi-modal fusion framework that integrates ML-based heuristic priors, AST structural skeletons, and CodeBERT semantic embeddings. Our study is structured around two pivotal research questions: • RQ1:How effective is the proposed multi-modal fusion framework, and what is the contribution of each component to the overall performance? This question evaluates the framework’s global efficacy across the comprehensive 7-class taxonomy (Labels 0–6). By benchmarking against state-of-the-art models, we quantify how lexical, structural, and semantic features synergistically enhance performance metrics, providing a granular attribution analysis across the similarity gradients. • RQ2:How does the confidence-aware adaptive arbitration mechanism resolve discriminative conflicts? This question investigates the use of higher-order logical reasoning to reconcile conflicting feature signals. Based on a quantitative analysis of the primary model’s probability distributions and confidence intervals, we derive an adaptive triggering policy. Our evaluation focuses on the mechanism’s capacity to rectify ”gray-zone” samples while exploring the trade-off between detection fidelity and computational overhead. The primary contributions of this work are summarized as follows: The primary contributions of this work are summarized as follows: • A Multi-modal Fusion Paradigm: We architect a composite detection framework that synergizes lexical statistics, structural logic skeletons, and deep attentional semantics. This multi-dimensional integration effectively mitigates the ”semantic drift” prevalent in fine-grained clone discrimination. • Rigorous Empirical Evaluation: Extensive evaluations on the BigCloneBench (BCB) dataset demonstrate the framework’s state-of-the-art performance in 7-class classification. We further provide a comprehensive mechanism analysis dissecting the performance gains across diverse clone topologies. • Adaptive Cognitive Arbitration: We innovatively introduce an LLM-based arbitrator triggered by uncertainty quantification. By leveraging the primary model’s output probability distributions as contextual guidance to rectify low-confidence conflictual instances, this informed arbitration significantly outperforms baseline approaches that rely on blind, standalone LLM re-classification. • A Data-driven Triggering Strategy: Guided by validation set statistics, we formulate a quantitative, adaptive triggering criterion that achieves an optimal equilibrium between discriminative fidelity and computational inference overhead. • Open-source Implementation: To facilitate reproducibility and further research, the complete implementation and experimental scripts are publicly available at: https://github.com/LMD4790/TriFusion-LLM . II Related Work II-A Taxonomy and Benchmarking of Code Clones Formal taxonomies underpin clone detection evaluation. While Roy et al.’s four-tier scheme [ 18 ] is foundational, it lacks threshold clarity between Type-3 and Type-4. BigCloneBench (BCB) [ 20 , 21 ] resolves this through stratified similarity gradients (VST3, ST3, MT3, and WT3/T4), becoming the de facto standard for fine-grained discrimination. Despite these advancements, most research collapses clone detection into a simplistic binary task, masking nuanced structural variations. Investigating BCB’s fine-grained failure modes is therefore vital for identifying performance bottlenecks and steering the field toward precise, interpretable paradigms. Fig. 1 : Overall pipeline of the proposed multi-dimensional clone detection framework. Note: CALA=Confidence-aware Logic Arbitration. II-B Conventional and Augmented Code Clone Detection Extant research in code clone detection emphasizes the integration of lexical rules and structural constraints to foster interpretable identification. CodeGuard [ 6 ] standardizes identifiers and data types via hierarchical abstraction to bolster Type-2 detection, while CCDive [ 5 ] employs a transformation localization mechanism to sustain high precision under heavy code refactoring. Complementarily, CCStokener [ 25 ] constructs semantic tokens by fusing local structure with n-gram modeling, specifically targeting improved recall for Medium Type-3 (MT3) clones. To mitigate the inherent insensitivity of neural models to logic-preserving structural changes, alternative approaches utilize syntactic and control-flow properties as ”logical skeletons.” Tamer [ 9 ] introduces block-level Abstract Syntax Tree (AST) segmentation for subtree matching, whereas StoneDetector [ 19 ] encodes control-flow paths using Dominator Trees to ensure robustness against intricate syntactic variations. Notwithstanding these advancements in explicit structural grounding, such methodologies often struggle with Type-4 semantic clones—where functional equivalence persists despite radical structural divergence—due to their limited capacity for deep semantic intent modeling. Bridging the divide between rigid structural constraints and flexible semantic representations remains a pivotal challenge for advancing fine-grained clone classification. II-C Code Representation Learning and Semantic Analysis Pre-trained models (PTMs) have significantly advanced the capture of functional equivalence. While CodeBERT [ 4 ] pioneered bi-modal representation learning, subsequent frameworks like GraphCodeBERT [ 8 ] and UniXcoder [ 7 ] integrated data-flow and syntactic structures to sharpen sensitivity toward complex semantic variants. Conversely, Toma [ 3 ] demonstrated