Code provenance identified with 93% accuracy; LLMs show distinct security patterns
The authors claim they can recover whether a code snippet was written by a human or a language model with 93% accuracy and that the two sources differ in security patterns
Software arXiv 14 Jul 2026 Measurement Prototype evidence
Published as “Open-Source Intelligence for Code Provenance and the Security Patterns that Separate Human and Large-Language-Model Implementations of Common Programming Tasks”
Why it matters
Practitioners can use the classifiers to flag LLM-generated code and anticipate security-related divergences, but must be aware of language-specific attribution limits and incomplete repairs.
Summary
The authors show that provenance (human vs. model) can be recovered from code with 93% accuracy, far above a 78% baseline, and that a 7-way classifier can attribute code to a specific model with 48% accuracy. They also find that models can repair insecure code at a 77% success rate, but often only partially, removing the insecure pattern without adding a proper defense. The evidence comes from 528 real code samples across four languages, so the results are fairly robust but show language-specific limits.
What they found 3
- Provenance classifier achieves 93% accuracy versus a 78% baseline.
“recovers human versus model provenance with 93 percent accuracy against a 78 percent baseline”
- 7-way model attribution classifier reaches 48% accuracy.
“a 7-way classifier that attributes a sample to the specific model that wrote it at 48 percent”
- LLM repair of insecure code succeeds 77% of the time across 21 seeds and 12 weakness classes.
“a 77 percent repair rate across 21 seeds and 12 weakness classes”
Caveats 2
- A recurring partial-fix failure in which the model removes the insecure pattern without adding the correct defense.
- the provenance boundary is partly language-specific and does not transfer symmetrically between them
What’s new here 4
- First large-scale measurement of code provenance (human vs. LLM) using only open-source data.
- Cross-language analysis showing security pattern divergence holds across Python, JavaScript, Go, and Java.
- A reproducible pipeline that links task specifications to deterministic security/style detectors and attribution models.
- Empirical repair case study quantifying partial-fix failures of LLMs on insecure code.