In the software engineering world, "code cloning"—copying and modifying snippets of code—is a well-studied phenomenon with established tools for detection. But as the AI ecosystem explodes, we are seeing a new kind of replication: Model Cloning. With over 2.3 million models on Hugging Face and fewer than 30% specifying clear licenses, the industry is facing a Wild West of intellectual property (IP) and security risks.
A new paper, "An In-Depth Study on Deep Learning Model Cloning," presented at ICML 2026, proposes a formal framework and a tool called MCDetector to identify and categorize these "cloned" models.
TL;DR
This paper introduces the first formal taxonomy for "deep learning model clones" and proposes MCDetector, a framework-agnostic tool that detects model similarity by combining structural topology fingerprints with parameter distribution analysis. It effectively identifies model lineage—even when models have been fine-tuned, merged, or slightly modified—providing a foundation for IP protection and security auditing.
What Problem Does This Paper Address?
Modern AI development rarely starts from scratch. Instead, engineers use a "reuse, transfer, and derivation" paradigm: taking a base model (like LLaMA or BERT) and fine-tuning it, distilling it, or merging it with others.
While efficient, this creates three major headaches:
- IP Conflicts: It is often impossible to tell if a "new" model is just a rebranded version of a proprietary one.
- Security Risks: If a base model has a backdoor or a critical flaw, that vulnerability propagates to every "clone" derived from it.
- Provenance Gaps: Without a way to measure similarity, we can't reliably trace the "family tree" of models in the open-source ecosystem.
Existing code-clone detection tools fail here because neural networks aren't just text; they are complex computation graphs where the "logic" is hidden in millions of floating-point weights.
Methods
The authors propose MCDetector, a white-box detection method that operates in three stages:
- Unified Representation (ONNX): To handle models built in different frameworks (PyTorch, TensorFlow, etc.), MCDetector converts them into ONNX (Open Neural Network Exchange) format. This abstracts the model into a heterogeneous directed acyclic graph (DAG).
- Structural Similarity ($S_{struct}$): The tool serializes the graph into a deterministic sequence of "operator-shape" tokens. It then uses SimHash to create a compact structural fingerprint. This allows for fast comparison of model architectures without the computational nightmare of exact graph matching.
- Weight Similarity ($S_{weight}$): This is the clever bit. Comparing weights directly is hard because neurons can be reordered without changing the model's output. MCDetector uses a metric called SDOCS (based on bidirectional maximum cosine similarity). Instead of checking if weight $A$ equals weight $B$, it looks at the distribution of weights, making it robust against permutations and minor fine-tuning.
Datasets
The researchers evaluated their approach using two primary sources:
- ModelCloneBench: A new synthetic benchmark created by the authors. it contains 208 model clones across three categories (Type-1, Type-2, and Type-3), involving transformations like random initialization, weight perturbation, and architectural tweaks (adding/removing layers).
- Real-World Open-Source Families: They collected representative models from Hugging Face, including the LLaMA 3.2, Qwen 2.5, Phi-4, and Gemma families, along with their various instruction-tuned and adapter-based derivatives.
Key Insights and Ideas
- The Taxonomy of Clones: The paper defines four types of clones, ranging from identical copies (Type-1) to models that share functionality but have entirely different structures (Type-4). This provides a much-needed vocabulary for AI policy and law.
- Structure vs. Weights: A key "aha moment" is that structural and weight similarities are complementary. Structural analysis identifies the "family" (e.g., "this is a LLaMA-style model"), while weight analysis identifies the "individual" (e.g., "this is a specific fine-tuned version of LLaMA").
- Permutation Invariance: By focusing on parameter distributions rather than raw values, the authors solved a major hurdle in model comparison: the fact that you can shuffle the internal "rows" of a neural network without changing what it does.
Key Results
- High Precision: On the synthetic benchmark, MCDetector achieved a 1.0000 F1-score for Type-1 and Type-2 clones.
- Type-3 Robustness: Even with structural modifications (Type-3), the tool maintained an F1-score of 0.9554.
- Real-World Retrieval: When tested on Hugging Face models, MCDetector achieved a Hit@3 of 1.00, meaning it successfully retrieved the documented "parent" model in the top three results for every query.
- Evolutionary Tracking: The tool successfully visualized how weight similarity decays as a model moves from "Direct Fine-tuning" to "Continuous Fine-tuning" and finally to "Model Merging" (which shows the lowest similarity).
Limitations and Future Work
- White-Box Only: MCDetector requires access to the model's weights and structure. It cannot detect clones of "black-box" models hidden behind APIs (like GPT-4).
- ONNX Dependency: The method relies on the ability to export a model to ONNX. If a model uses custom, non-standard operators that don't export well, detection might fail.
- Type-4 Clones: The paper explicitly leaves "behavioral clones" (different structure, same output) for future work, as these require expensive output-level or representation-level analysis.
- Architecture Scope: While tested on Transformers and CNNs, the authors note that more work is needed to validate the approach on multimodal or more exotic architectures.
Summary updated