Matrix-Driven Instant Review (MDIR)
- Matrix-Driven Instant Review (MDIR) is a methodology that infers explicit weight relationships between LLM parameters to identify plagiarism, weight reuse, or derivative model construction.
- It employs matrix-level operations such as orthogonal decomposition and permutation alignment along with large deviation theory to compute rigorous p-value estimates.
- MDIR achieves high sensitivity and specificity in detecting neural network weight correspondences while operating efficiently on commodity CPU hardware.
Matrix-Driven Instant Review (MDIR) is a methodology for detecting and reconstructing weight correspondences between LLM parameter sets to identify plagiarism, weight reuse, or derivative model construction. MDIR enables statistically robust, efficient detection of intentional or obfuscated reuse of neural network weights by leveraging matrix analysis and Large Deviation Theory, and delivers rigorous -value estimates of similarity. It operates directly on matrix weights without relying on forward inference, achieving both high sensitivity and specificity while reconstructing exact linear transformations (including permutations, orthogonal transforms, scalings, and noise) mapping one model’s weights to another. The method is designed to run within an hour on a commodity CPU-only PC for models with weight matrices of order (Zhang, 8 Aug 2025).
1. Conceptual Framework and Goals
MDIR addresses the detection of LLM plagiarism, specifically situations where model B’s parameters are derived—partially or fully—by reusing those of model A (). Scenarios of interest include direct copying, upcycling (subtle modifications to weights, e.g., continual pretraining, pruning, or permutations), and architectural adaptation. The main objectives are:
- To infer whether is related to by explicit weight relationships.
- To reconstruct the explicit linear mappings—permutations, orthogonal transforms, scalings, or additive noise—that best relate the two parameter sets.
- To provide rigorous statistical significance quantification (via -value estimation) underpinning each detection, minimizing false positives, especially in the presence of similar training data or architectural constraints.
- To obviate the need for full model inference or dataset access, contrasting with earlier approaches (Zhang, 8 Aug 2025).
2. Matrix-Analysis Methodology
The MDIR pipeline operates at the matrix level, systematically comparing major weight blocks within deep neural architectures:
- Embedding matrices: and .
- Attention layers: For each layer , matrices 0 (and 1 analogously).
- MLP weights: Gate, Up, and Down matrices, each 2.
Orthogonal (Polar) Decomposition
For any matrix 3 with SVD 4, the “orthogonal part” is defined as:
5
This orthogonal factor maximizes the trace inner product 6 over all 7 orthogonal (8).
Permutation Alignment
Given 9, the algorithm seeks the permutation 0 maximizing the Frobenius inner product:
1
This is equivalent to minimizing the Frobenius norm 2, assessing direct congruence modulo permutation. This process generalizes to any pair of square blocks, with corresponding similarity scores 3.
3. Statistical Significance via Large Deviation Theory
MDIR employs a rigorous Large Deviation Principle (LDP) for 4-value calculation, instrumental in distinguishing genuine structural matches from coincidental similarity due to data or initialization.
- Null Model: When 5 and 6 are unrelated, 7 is Haar-uniform on the orthogonal group 8. For a fixed permutation 9,
0
- Union Bound: Since the optimal permutation is selected over 1 options,
2
- Asymptotic Rate Function: For 3, 4, and 5 Haar in 6,
7
Hence,
8
- p-Value Estimator:
9
or, compactly for 0, 1,
2
This formalism ensures that only correspondences far beyond random coincidence result in low 3-values, providing a strong statistical basis for detection.
4. Detection and Reconstruction Pipeline
The MDIR algorithm is as follows:
- Matrix extraction: Retrieve target embedding matrices 4 and 5.
- Orthogonal alignment: Compute 6.
- Permutation search: Calculate optimal permutation 7 using the Hungarian algorithm (8 complexity).
- Statistical check: Compute 9, estimate 0 as above.
- Decision rule:
- If 1 (default 2), accept 3 as the global match and flag the pair as related.
- Otherwise, retain 4.
- Component-wise mapping:
- Attention layers: For each 5, compute inner transform for 6 (7) and analogously for 8.
- MLP blocks: Compute 9 (optionally aggregating Gate, Up, Down), with its own 0-value.
- Outputs: Flag (0/1), global transformation 1, per-block transforms 2, and MLP permutation 3.
The Hungarian method at 4 requires 5 operations, typically requiring 6 hour of CPU time, with moderate memory (73GB for several square matrices). SVD and polar decomposition steps are 8 (Zhang, 8 Aug 2025).
5. Empirical Validation and Comparative Assessment
Experimental Regimes
MDIR's efficacy is demonstrated across a spectrum of LLM modification scenarios:
| Level | Model Families Tested | Transformation Type |
|---|---|---|
| Level 1 | Qwen2.5-0.5B, Llama-3.1-8B | Fine-tuning |
| Level 2 | Qwen2-7B → Qwen2.5-7B | Heavy continual pretraining |
| Level 3 | Llama-3.1-8B → Llama-3.2-{1B,3B} | Pruning and retraining |
| Level 4 | RWKV variants | Architectural changes |
| Level 5 | Pangu-Pro-MoE vs Qwen2.5-14B | MoE upscaling, obfuscation |
Key Results
- True positives: All plagiarized pairs were detected with 9.
- False positives: None among unrelated pairs; all had 0.
- Ablation: MDIR only flags models with shared seed (true sharing), not those with overlapping data only.
- Comparison: Competing methods (REEF, CKA) showed false positives based on feature similarity, while MDIR maintained specificity.
- Visualization: Permutation matrices for true positives displayed near-perfect alignment in heatmaps (red/white).
- Efficiency: Full detection and reconstruction was achieved within the stated hardware/runtime constraints.
6. Limitations and Prospective Directions
Several assumptions and limitations are explicit:
- Polar decomposition is ill-posed for low-rank or reduced-precision matrices (e.g., fp16/bf16).
- In extreme 1-value regimes (2 to 3), numerical inaccuracies (up to 1%) can decrease 4 and inflate 5.
- For semi-orthogonal/pruned weight blocks (6), tight LDP bounds are not available, so 7 may be overestimated.
Potential extensions proposed include:
- Developing rigorous LDP bounds for partial isometries and Stiefel manifolds.
- Enhancing resistance to deliberate evasion strategies, such as noise injection and large learning rate retraining.
- Implementing GPU-accelerated or approximate matching algorithms (Hungarian) to efficiently scale to 8 (Zhang, 8 Aug 2025).
7. Context and Significance
MDIR addresses critical gaps in intellectual property verification for LLMs. Its ability to disentangle true weight reuse from feature similarity is distinguished by both methodological rigor and robust statistical interpretation. By reconstructing the precise weight correspondences and quantifying statistical significance, MDIR supports transparent auditing in an era of increasingly complex and obfuscated LLM derivations. The avoidance of model inference and limited resource requirements make the approach broadly accessible and practical for academic, industrial, and legal applications. The proposed areas for extension indicate a path toward further applicability and resilience of MDIR protocols for future large-scale neural models (Zhang, 8 Aug 2025).