The last decade has witnessed a rapid advance in machine learning models. While the black-box nature of these systems allows powerful predictions, it cannot be directly explained, posing a threat to the continuing democratization of machine learning technology. Tackling the challenge of model explainability, research has made significant progress in demystifying the image classification models. In the same spirit of these works, this paper studies code summarization models, particularly, given an input program for which a model makes a prediction, our goal is to reveal the key features that the model uses for predicting the label of the program. We realize our approach in HouYi, which we use to evaluate four prominent code summarization models: extreme summarizer, code2vec, code2seq, and sequence GNN. Results show that all models base their predictions on syntactic and lexical properties with little to none semantic implication. Based on this finding, we present a novel approach to explaining the predictions of code summarization models through the lens of training data. Our work opens up this exciting, new direction of studying what models have learned from source code.
翻译:过去十年中,机器学习模式取得了快速进步。 虽然这些系统的黑箱性质允许作出强有力的预测,但无法直接解释,对机器学习技术的持续民主化构成威胁。 应对模型解释的挑战,研究在解开图像分类模型的神秘性方面取得了显著进展。 本着同样的精神,本文研究代码总结模型,特别是考虑到一个模型能作出预测的投入程序,我们的目标是揭示模型用于预测程序标签的关键特征。 我们在霍伊发现了我们用来评估四个突出的代码总结模型的方法:极端摘要、代码2vec、代码2seq和序列GNN。 结果显示,所有模型的预测都以合成和词汇特性为基础,几乎没有任何语义影响。 基于这一发现,我们提出了一个新颖的方法,通过培训数据的透镜来解释代码总结模型的预测。我们的工作开启了研究模型从源代码中学到的东西的这个令人振奋人心的新方向。