Structural Entropy Minimization for Code Authorship and Provenance Analysis across Programming Paradigms
Structural Entropy Minimization for Code Authorship and Provenance Analysis across Programming Paradigms
Yükleniyor...
Özet
Context: The rapid adoption of large language models (LLMs) in software development has blurred the boundary between human-written and machine-generated code, creating critical challenges for authorship attribution, plagiarism detection, and software forensics. Existing approaches, predominantly based on token-level statistics or learned embeddings, are fragile under semantics-preserving transformations and fail to capture deeper structural regularities inherent to program organization. Objectives: This study aims to establish a paradigm-agnostic and interpretable framework for code authorship and provenance analysis by explicitly modeling structural organization, and to investigate whether LLM-generated code exhibits systematic structural regularities that can be reliably distinguished from human-authored programs. Methods: We propose a structural-entropy-guided, multi-relational framework in which each program is represented as a heterogeneous graph integrating six complementary views: abstract syntax, control flow, data dependence, stylistic patterns, complexity metrics, and semantic relations. The core mechanism minimizes a two-dimensional structural entropy objective to quantify global organizational regularity. An unsupervised inference scheme combines entropy-driven clustering with graph-theoretic centrality and stylistic priors, enabling authorship identification without labeled data. Results: Extensive experiments on a large-scale benchmark of 30,000 code samples spanning five programming paradigms and multiple state-of-the-art LLM families demonstrate that the proposed approach consistently outperforms representative baselines, achieving up to 95.8 F1 and 97.2 AUROC. The framework remains robust under semantics-preserving transformations such as refactoring and identifier renaming, and generalizes effectively to unseen paradigms and LLMs, indicating that structural entropy captures invariant signals beyond surface-level lexical features. Conclusion: The findings reveal that LLM-generated code exhibits measurable structural regularization patterns that can be effectively characterized through entropy minimization. By shifting the focus from token-level cues to global structural organization, the proposed framework provides a scalable, interpretable, and transformation-resilient solution for code provenance analysis in modern AI-assisted software ecosystems.
Açıklama
Bilim Dalları
Alıntı
WoS Q
Scopus Q
Cilt
201
Sayı
Başlangıç Sayfası
Bitiş Sayfası
Doaj Url
Yükleniyor...
