用因果推理让代码模型的预测更可信,解释它为何这样判断。
Towards a Science of Causal Interpretability in Deep Learning for Software Engineering
- 基于结构因果模型,分析代码输入与输出的因果关系。
- 实验证明代码模型对语法变化敏感,且能学习编程概念。
- 适合关注AI可解释性与可信软件开发的研究者和工程师。
本论文致力于提升深度学习在软件工程(DL4SE)中的因果可解释性。尽管神经代码模型(NCMs)在自动化软件任务中表现优异,但其缺乏对输入与输出间因果关系的透明度,限制了对其能力的充分理解。为建立对NCMs的信任,需解释其代码预测的成因。关联性解释仅识别相关性,难以支持干预与变化分析。为此,论文提出DoCode,一种针对NCMs的后验因果可解释性方法。DoCode采用四步流程:构建结构因果模型(SCM)、确定因果效应量、使用平均处理效应(ATE)等指标估计因果效应,并进行反事实验证。该框架可扩展,示例表明其能通过编程语言特性减少虚假相关。在多种深度学习架构与可解释性场景下的代码生成案例研究显示,NCMs对代码语法变化敏感,能学习特定编程概念并降低混杂偏差。论文还分析了关联性解释的基础作用,利用COMET和TraceXplainer工具研究软件信息的因果性质,强调识别代码混杂因子的重要性,并提供实践指南,推动可信人工智能在软件工程中的应用。
原文摘要 · Abstract (English)
This dissertation addresses achieving causal interpretability in Deep Learning for Software Engineering (DL4SE). While Neural Code Models (NCMs) show strong performance in automating software tasks, their lack of transparency in causal relationships between inputs and outputs limits full understanding of their capabilities. To build trust in NCMs, researchers and practitioners must explain code predictions. Associational interpretability, which identifies correlations, is often insufficient for tasks requiring intervention and change analysis. To address this, the dissertation introduces DoCode, a novel post hoc interpretability method for NCMs. DoCode uses causal inference to provide programming language-oriented explanations of model predictions. It follows a four-step pipeline: modeling causal problems using Structural Causal Models (SCMs), identifying the causal estimand, estimating effects with metrics like Average Treatment Effect (ATE), and refuting effect estimates. Its framework is extensible, with an example that reduces spurious correlations by grounding explanations in programming language properties. A case study on deep code generation across interpretability scenarios and various deep learning architectures demonstrates DoCode's benefits. Results show NCMs' sensitivity to code syntax changes and their ability to learn certain programming concepts while minimizing confounding bias. The dissertation also examines associational interpretability as a foundation, analyzing software information's causal nature using tools like COMET and TraceXplainer for traceability. It highlights the need to identify code confounders and offers practical guidelines for applying causal interpretability to NCMs, contributing to more trustworthy AI in software engineering.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。