Detecting Artificial Intelligence Generated Computer Code
AssigneeNEC Laboratories America, Inc.
InventorsWei Cheng, Haifeng Chen, Xianjun Yang
Life of this patent
Estimating the term…
Abstract
Systems and methods for detecting artificial intelligence (AI) generated computer code. Lines of code can be masked from a candidate code to obtain perturbed codes. Missing code can be generated from the perturbed codes by employing an AI code generator model to obtain machine-filled codes. Probabilities of the candidate code probability and the machine-filled codes as AI-generated can be predicted by employing a surrogate model. The candidate code can be distinguished as AI-generated by comparing the probabilities against a detection threshold to obtain detection results.
Claims20
A computer-implemented method for detecting artificial intelligence (AI) generated computer code, comprising:
- masking one or more portions of a candidate code to obtain perturbed codes;
- generating missing code for the perturbed codes by employing an AI code generator model to obtain machine-filled codes;
- predicting probabilities of the candidate code and the machine-filled codes as AI-generated by employing a surrogate model;
- and
- distinguishing the candidate code as AI-generated by comparing the probabilities against a detection threshold to obtain detection results.
A system for detecting artificial intelligence (AI) generated computer code, comprising:
- a memory;
- and
- one or more processor devices in communication with the memory configured to:
- mask one or more portions of a candidate code to obtain perturbed codes;
- generate missing code from the perturbed codes by employing an AI code generator model to obtain machine-filled codes;
- predict probabilities of the candidate code and the machine-filled codes as AI-generated by employing a surrogate model;
- and
- distinguish the candidate code as AI-generated by comparing the probabilities against a detection threshold to obtain detection results.
A non-transitory computer program product comprising a computer-readable storage medium including program code for detecting artificial intelligence (AI) generated computer code, wherein the program code when executed on a computer causes the computer to perform:
- masking one or more portions of a candidate code to obtain perturbed codes;
- generating missing code from the perturbed codes by employing an AI code generator model to obtain machine-filled codes;
- predicting probabilities of the candidate code and the machine-filled codes as AI-generated by employing a surrogate model;
- and
- distinguishing the candidate code as AI-generated by comparing the probabilities against a detection threshold to obtain detection results.
Dependencies are inferred from the claim text.