DeepAI AI Chat
Log In Sign Up

WhyGen: Explaining ML-powered Code Generation by Referring to Training Examples

by   Weixiang Yan, et al.
Beijing University of Posts and Telecommunications

Deep learning has demonstrated great abilities in various code generation tasks. However, despite the great convenience for some developers, many are concerned that the code generators may recite or closely mimic copyrighted training data without user awareness, leading to legal and ethical concerns. To ease this problem, we introduce a tool, named WhyGen, to explain the generated code by referring to training examples. Specifically, we first introduce a data structure, named inference fingerprint, to represent the decision process of the model when generating a prediction. The fingerprints of all training examples are collected offline and saved to a database. When the model is used at runtime for code generation, the most relevant training examples can be retrieved by querying the fingerprint database. Our experiments have shown that WhyGen is able to precisely notify the users about possible recitations and highly similar imitations with a top-10 accuracy of 81.21 be found at


page 1

page 2

page 3

page 4


RelatIF: Identifying Explanatory Training Examples via Relative Influence

In this work, we focus on the use of influence functions to identify rel...

Who Wrote this Code? Watermarking for Code Generation

Large language models for code have recently shown remarkable performanc...

The "code” of Ethics:A Holistic Audit of AI Code Generators

AI-powered programming language generation (PLG) models have gained incr...

Demonstrating PAR4SEM - A Semantic Writing Aid with Adaptive Paraphrasing

In this paper, we present Par4Sem, a semantic writing aid tool based on ...

Jointly Learning from Decentralized (Federated) and Centralized Data to Mitigate Distribution Shift

With privacy as a motivation, Federated Learning (FL) is an increasingly...

Bootstrapping Transliteration with Constrained Discovery for Low-Resource Languages

Generating the English transliteration of a name written in a foreign sc...

Automated Generation of Connectionist Expert Systems for Problems Involving Noise and Redundancy

When creating an expert system, the most difficult and expensive task is...