Towards a Science of Causal Interpretability in Deep Learning for Software Engineering

📅 2025-05-21
📈 Citations: 0
Influential: 0
📄 PDF
🤖 AI Summary
Neural code models (NCMs) lack causal interpretability, hindering their use in intervention analysis and change impact assessment. Method: We propose DoCode—the first post-hoc causal explanation framework for code prediction—integrating structural causal modeling (SCM) with programming-language-aware feature representation. It employs average treatment effect (ATE) estimation, counterfactual inference, and trace-based attribution (COMET/TraceXplainer) to deliver code-level, falsifiable, low-confounding causal explanations. Results: Experiments show NCMs are highly sensitive to syntactic perturbations and can learn fine-grained programming concepts. DoCode significantly reduces spurious correlations, improves explanation fidelity and model debugging efficiency, and overcomes the limitations of conventional associative interpretation. It provides both theoretical foundations and practical tooling for the reliable deployment of deep learning models in software engineering.

Technology Category

Application Category

📝 Abstract
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.
Problem

Research questions and friction points this paper is trying to address.

Achieving causal interpretability in DL4SE for trust
Addressing NCMs' transparency gaps in input-output causality
Reducing spurious correlations in code predictions via causal inference
Innovation

Methods, ideas, or system contributions that make the work stand out.

DoCode uses causal inference for code predictions
SCMs and ATE estimate causal effects
Reduces spurious correlations via programming properties
🔎 Similar Papers
No similar papers found.