WhyGen: Explaining ML-powered Code Generation by Referring to Training Examples
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 \textit{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 \textit{WhyGen} is able to precisely notify the users about possible recitations with a top-10 accuracy of 81.21%. The demo video can be found at https://youtu.be/HpWEZ5eL2Lk.
Fri 13 MayDisplayed time zone: Eastern Time (US & Canada) change
03:00 - 04:00 | Machine Learning with and for SEDEMO - Demonstrations at ICSE Demo room 1 Chair(s): Xiaoyuan Xie School of Computer Science, Wuhan University, China | ||
03:00 15mDemonstration | HUDD: A tool to debug DNNs for safety analysis DEMO - Demonstrations Hazem FAHMY University of Luxembourg, Fabrizio Pastore University of Luxembourg, Lionel Briand University of Luxembourg; University of Ottawa Pre-print Media Attached | ||
03:15 15mDemonstration | WhyGen: Explaining ML-powered Code Generation by Referring to Training Examples DEMO - Demonstrations DOI Pre-print Media Attached | ||
03:30 15mDemonstration | SEbox4DL: A Modular Software Engineering Toolbox for Deep Learning Models DEMO - Demonstrations Zhengyuan Wei City University of Hong Kong, Hong Kong, Haipeng Wang City University of Hong Kong, Zhen Yang City University of Hong Kong, China, Wing-Kwong Chan City University of Hong Kong, Hong Kong |