当前位置: X-MOL 学术IEEE Trans. Softw. Eng. › 论文详情
Our official English website, www.x-mol.net, welcomes your feedback! (Note: you will need to create a separate account there.)
Toward a Theory of Causation for Interpreting Neural Code Models
IEEE Transactions on Software Engineering ( IF 7.4 ) Pub Date : 2024-03-21 , DOI: 10.1109/tse.2024.3379943
David N. Palacio 1 , Alejandro Velasco 1 , Nathan Cooper 1 , Alvaro Rodriguez 2 , Kevin Moran 3 , Denys Poshyvanyk 1
Affiliation  

Neural Language Models of Code, or Neural Code Models (NCMs), are rapidly progressing from research prototypes to commercial developer tools. As such, understanding the capabilities and limitations of such models is becoming critical. However, the abilities of these models are typically measured using automated metrics that often only reveal a portion of their real-world performance. While, in general, the performance of NCMs appears promising, currently much is unknown about how such models arrive at decisions. To this end, this paper introduces do${}_{\textbf{code}}$code , a post hoc interpretability method specific to NCMs that is capable of explaining model predictions. do${}_{\textbf{code}}$code is based upon causal inference to enable programming language-oriented explanations. While the theoretical underpinnings of do${}_{\textbf{code}}$code are extensible to exploring different model properties, we provide a concrete instantiation that aims to mitigate the impact of spurious correlations by grounding explanations of model behavior in properties of programming languages. To demonstrate the practical benefit of do${}_{\textbf{code}}$code , we illustrate the insights that our framework can provide by performing a case study on two popular deep learning architectures and ten NCMs. The results of this case study illustrate that our studied NCMs are sensitive to changes in code syntax. All our NCMs, except for the BERT-like model, statistically learn to predict tokens related to blocks of code ( e.g., brackets, parenthesis, semicolon) with less confounding bias as compared to other programming language constructs. These insights demonstrate the potential of do${}_{\textbf{code}}$code as a useful method to detect and facilitate the elimination of confounding bias in NCMs.

中文翻译:

走向解释神经代码模型的因果理论

代码的神经语言模型或神经代码模型 (NCM) 正在从研究原型快速发展为商业开发工具。因此,了解此类模型的功能和局限性变得至关重要。然而,这些模型的能力通常是使用自动化指标来衡量的,这些指标通常只能揭示其真实世界性能的一部分。虽然总体而言,NCM 的表现似乎很有希望,但目前对于此类模型如何做出决策还知之甚少。为此,本文介绍${}_{\textbf{代码}}$代码 ,一种特定于 NCM 的事后可解释性方法,能够解释模型预测。${}_{\textbf{代码}}$代码 基于因果推理来实现面向编程语言的解释。虽然理论基础${}_{\textbf{代码}}$代码 可扩展以探索不同的模型属性,我们提供了一个具体的实例化,旨在减轻通过将模型行为的解释基于编程语言的属性来消除虚假相关性。展示实际效益${}_{\textbf{代码}}$代码 中,我们通过对两种流行的深度学习架构和十个 NCM 进行案例研究来说明我们的框架可以提供的见解。本案例研究的结果表明,我们研究的 NCM 对代码语法的变化很敏感。除了类似 BERT 的模型之外,我们所有的 NCM 都通过统计方式学习预测与代码块相关的标记( 例如,方括号、圆括号、分号)与其他编程语言结构相比,具有更少的混淆偏差。这些见解表明了${}_{\textbf{代码}}$代码 作为检测和促进消除 NCM 中混杂偏差的有用方法。
更新日期:2024-03-21
down
wechat
bug